diff --git a/TrackingToolWeb/static/assets/index-B5O9aEJl.js b/TrackingToolWeb/static/assets/index-NzXShqcn.js similarity index 99% rename from TrackingToolWeb/static/assets/index-B5O9aEJl.js rename to TrackingToolWeb/static/assets/index-NzXShqcn.js index 3c90817..b3673a6 100644 --- a/TrackingToolWeb/static/assets/index-B5O9aEJl.js +++ b/TrackingToolWeb/static/assets/index-NzXShqcn.js @@ -77,4 +77,4 @@ Arguments: `+Array.prototype.slice.call(i).join("")+` newResult[${Y}] = ${k}.value; } - `)}T.write("payload.value = newResult;"),T.write("return payload;");const U=T.compile();return(j,k)=>U(b,j,k)};let u;const c=Bc,h=!bE.jitless,m=h&&lU.value,y=t.catchall;let g;e._zod.parse=(b,T)=>{g??(g=i.value);const x=b.value;return c(x)?h&&m&&T?.async===!1&&T.jitless!==!0?(u||(u=o(t.shape)),b=u(b,T),y?DE([],x,b,T,g,e):b):r(b,T):(b.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),b)}});function K1(e,t,r,i){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const o=e.filter(u=>!Zs(u));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Vi(c,i,Hi())))}),t)}const F8=ae("$ZodUnion",(e,t)=>{Gt.init(e,t),dt(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),dt(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),dt(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),dt(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${o.map(u=>mg(u.source)).join("|")})$`)}});const r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,u)=>{if(r)return i(o,u);let c=!1;const h=[];for(const p of t.options){const m=p._zod.run({value:o.value,issues:[]},u);if(m instanceof Promise)h.push(m),c=!0;else{if(m.issues.length===0)return m;h.push(m)}}return c?Promise.all(h).then(p=>K1(p,o,e,u)):K1(h,o,e,u)}}),Z8=ae("$ZodIntersection",(e,t)=>{Gt.init(e,t),e._zod.parse=(r,i)=>{const o=r.value,u=t.left._zod.run({value:o,issues:[]},i),c=t.right._zod.run({value:o,issues:[]},i);return u instanceof Promise||c instanceof Promise?Promise.all([u,c]).then(([p,m])=>Q1(r,p,m)):Q1(r,u,c)}});function qm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(wl(e)&&wl(t)){const r=Object.keys(t),i=Object.keys(e).filter(u=>r.indexOf(u)!==-1),o={...e,...t};for(const u of i){const c=qm(e[u],t[u]);if(!c.valid)return{valid:!1,mergeErrorPath:[u,...c.mergeErrorPath]};o[u]=c.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i{Gt.init(e,t);const r=sU(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(o=>uU.has(typeof o)).map(o=>typeof o=="string"?wf(o):o.toString()).join("|")})$`),e._zod.parse=(o,u)=>{const c=o.value;return i.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),G8=ae("$ZodTransform",(e,t)=>{Gt.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new vE(e.constructor.name);const o=t.transform(r.value,r);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new Ws;return r.value=o,r}});function J1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const q8=ae("$ZodOptional",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),dt(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${mg(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(u=>J1(u,r.value)):J1(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),I8=ae("$ZodNullable",(e,t)=>{Gt.init(e,t),dt(e._zod,"optin",()=>t.innerType._zod.optin),dt(e._zod,"optout",()=>t.innerType._zod.optout),dt(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${mg(r.source)}|null)$`):void 0}),dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),X8=ae("$ZodDefault",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(u=>e_(u,t)):e_(o,t)}});function e_(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const W8=ae("$ZodPrefault",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),K8=ae("$ZodNonOptional",(e,t)=>{Gt.init(e,t),dt(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(u=>t_(u,e)):t_(o,e)}});function t_(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Q8=ae("$ZodCatch",(e,t)=>{Gt.init(e,t),dt(e._zod,"optin",()=>t.innerType._zod.optin),dt(e._zod,"optout",()=>t.innerType._zod.optout),dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(u=>(r.value=u.value,u.issues.length&&(r.value=t.catchValue({...r,error:{issues:u.issues.map(c=>Vi(c,i,Hi()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(u=>Vi(u,i,Hi()))},input:r.value}),r.issues=[]),r)}}),J8=ae("$ZodPipe",(e,t)=>{Gt.init(e,t),dt(e._zod,"values",()=>t.in._zod.values),dt(e._zod,"optin",()=>t.in._zod.optin),dt(e._zod,"optout",()=>t.out._zod.optout),dt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){const u=t.out._zod.run(r,i);return u instanceof Promise?u.then(c=>lc(c,t.in,i)):lc(u,t.in,i)}const o=t.in._zod.run(r,i);return o instanceof Promise?o.then(u=>lc(u,t.out,i)):lc(o,t.out,i)}});function lc(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const eL=ae("$ZodReadonly",(e,t)=>{Gt.init(e,t),dt(e._zod,"propValues",()=>t.innerType._zod.propValues),dt(e._zod,"values",()=>t.innerType._zod.values),dt(e._zod,"optin",()=>t.innerType?._zod?.optin),dt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(n_):n_(o)}});function n_(e){return e.value=Object.freeze(e.value),e}const tL=ae("$ZodCustom",(e,t)=>{Zr.init(e,t),Gt.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,o=t.fn(i);if(o instanceof Promise)return o.then(u=>r_(u,r,i,e));r_(o,r,i,e)}});function r_(e,t,r,i){if(!e){const o={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(Sl(o))}}var a_;class nL{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const i=r[0];if(this._map.set(t,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const i={...this.get(r)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function rL(){return new nL}(a_=globalThis).__zod_globalRegistry??(a_.__zod_globalRegistry=rL());const uc=globalThis.__zod_globalRegistry;function aL(e,t){return new e({type:"string",...ke(t)})}function iL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(t)})}function i_(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(t)})}function sL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(t)})}function oL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(t)})}function lL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(t)})}function uL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(t)})}function cL(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(t)})}function fL(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(t)})}function dL(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(t)})}function hL(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(t)})}function mL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(t)})}function pL(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(t)})}function gL(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(t)})}function yL(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(t)})}function vL(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(t)})}function bL(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(t)})}function _L(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(t)})}function wL(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(t)})}function SL(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(t)})}function xL(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(t)})}function EL(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(t)})}function TL(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(t)})}function OL(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(t)})}function AL(e,t){return new e({type:"string",format:"date",check:"string_format",...ke(t)})}function CL(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(t)})}function DL(e,t){return new e({type:"string",format:"duration",check:"string_format",...ke(t)})}function ML(e){return new e({type:"unknown"})}function RL(e,t){return new e({type:"never",...ke(t)})}function ME(e,t){return new t8({check:"max_length",...ke(t),maximum:e})}function Fc(e,t){return new n8({check:"min_length",...ke(t),minimum:e})}function RE(e,t){return new r8({check:"length_equals",...ke(t),length:e})}function NL(e,t){return new a8({check:"string_format",format:"regex",...ke(t),pattern:e})}function kL(e){return new i8({check:"string_format",format:"lowercase",...ke(e)})}function zL(e){return new s8({check:"string_format",format:"uppercase",...ke(e)})}function jL(e,t){return new o8({check:"string_format",format:"includes",...ke(t),includes:e})}function UL(e,t){return new l8({check:"string_format",format:"starts_with",...ke(t),prefix:e})}function LL(e,t){return new u8({check:"string_format",format:"ends_with",...ke(t),suffix:e})}function uo(e){return new c8({check:"overwrite",tx:e})}function YL(e){return uo(t=>t.normalize(e))}function HL(){return uo(e=>e.trim())}function VL(){return uo(e=>e.toLowerCase())}function BL(){return uo(e=>e.toUpperCase())}function $L(){return uo(e=>oU(e))}function FL(e,t,r){return new e({type:"array",element:t,...ke(r)})}function ZL(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ke(r)})}function PL(e){const t=GL(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Sl(i,r.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(Sl(o))}},e(r.value,r)));return t}function GL(e,t){const r=new Zr({check:"custom",...ke(t)});return r._zod.check=e,r}function s_(e,t){try{var r=e()}catch(i){return t(i)}return r&&r.then?r.then(void 0,t):r}function qL(e,t){for(var r={};e.length;){var i=e[0],o=i.code,u=i.message,c=i.path.join(".");if(!r[c])if("unionErrors"in i){var h=i.unionErrors[0].errors[0];r[c]={message:h.message,type:h.code}}else r[c]={message:u,type:o};if("unionErrors"in i&&i.unionErrors.forEach(function(y){return y.errors.forEach(function(g){return e.push(g)})}),t){var p=r[c].types,m=p&&p[i.code];r[c]=ug(c,t,r,o,m?[].concat(m,i.message):i.message)}e.shift()}return r}function IL(e,t){for(var r={};e.length;){var i=e[0],o=i.code,u=i.message,c=i.path.join(".");if(!r[c])if(i.code==="invalid_union"&&i.errors.length>0){var h=i.errors[0][0];r[c]={message:h.message,type:h.code}}else r[c]={message:u,type:o};if(i.code==="invalid_union"&&i.errors.forEach(function(y){return y.forEach(function(g){return e.push(g)})}),t){var p=r[c].types,m=p&&p[i.code];r[c]=ug(c,t,r,o,m?[].concat(m,i.message):i.message)}e.shift()}return r}function XL(e,t,r){if(r===void 0&&(r={}),(function(i){return"_def"in i&&typeof i._def=="object"&&"typeName"in i._def})(e))return function(i,o,u){try{return Promise.resolve(s_(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](i,t)).then(function(c){return u.shouldUseNativeValidation&&Pm({},u),{errors:{},values:r.raw?Object.assign({},i):c}})},function(c){if((function(h){return Array.isArray(h?.issues)})(c))return{values:{},errors:P1(qL(c.errors,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw c}))}catch(c){return Promise.reject(c)}};if((function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,o,u){try{return Promise.resolve(s_(function(){return Promise.resolve((r.mode==="sync"?_U:wU)(e,i,t)).then(function(c){return u.shouldUseNativeValidation&&Pm({},u),{errors:{},values:r.raw?Object.assign({},i):c}})},function(c){if((function(h){return h instanceof gg})(c))return{values:{},errors:P1(IL(c.issues,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}const WL=ae("ZodISODateTime",(e,t)=>{E8.init(e,t),xt.init(e,t)});function KL(e){return OL(WL,e)}const QL=ae("ZodISODate",(e,t)=>{T8.init(e,t),xt.init(e,t)});function JL(e){return AL(QL,e)}const e9=ae("ZodISOTime",(e,t)=>{O8.init(e,t),xt.init(e,t)});function t9(e){return CL(e9,e)}const n9=ae("ZodISODuration",(e,t)=>{A8.init(e,t),xt.init(e,t)});function r9(e){return DL(n9,e)}const a9=(e,t)=>{gg.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>bU(e,r)},flatten:{value:r=>vU(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Gm,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Gm,2)}},isEmpty:{get(){return e.issues.length===0}}})},sr=ae("ZodError",a9,{Parent:Error}),i9=xf(sr),s9=Ef(sr),o9=Tf(sr),l9=Of(sr),u9=EU(sr),c9=TU(sr),f9=OU(sr),d9=AU(sr),h9=CU(sr),m9=DU(sr),p9=MU(sr),g9=RU(sr),Kt=ae("ZodType",(e,t)=>(Gt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Gi(t,{checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]})),e.clone=(r,i)=>li(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.parse=(r,i)=>i9(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>o9(e,r,i),e.parseAsync=async(r,i)=>s9(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>l9(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>u9(e,r,i),e.decode=(r,i)=>c9(e,r,i),e.encodeAsync=async(r,i)=>f9(e,r,i),e.decodeAsync=async(r,i)=>d9(e,r,i),e.safeEncode=(r,i)=>h9(e,r,i),e.safeDecode=(r,i)=>m9(e,r,i),e.safeEncodeAsync=async(r,i)=>p9(e,r,i),e.safeDecodeAsync=async(r,i)=>g9(e,r,i),e.refine=(r,i)=>e.check(oY(r,i)),e.superRefine=r=>e.check(lY(r)),e.overwrite=r=>e.check(uo(r)),e.optional=()=>u_(e),e.nullable=()=>c_(e),e.nullish=()=>u_(c_(e)),e.nonoptional=r=>eY(e,r),e.array=()=>H9(e),e.or=r=>F9([e,r]),e.and=r=>P9(e,r),e.transform=r=>f_(e,I9(r)),e.default=r=>K9(e,r),e.prefault=r=>J9(e,r),e.catch=r=>nY(e,r),e.pipe=r=>f_(e,r),e.readonly=()=>iY(e),e.describe=r=>{const i=e.clone();return uc.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){return uc.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return uc.get(e);const i=e.clone();return uc.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),NE=ae("_ZodString",(e,t)=>{yg.init(e,t),Kt.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(NL(...i)),e.includes=(...i)=>e.check(jL(...i)),e.startsWith=(...i)=>e.check(UL(...i)),e.endsWith=(...i)=>e.check(LL(...i)),e.min=(...i)=>e.check(Fc(...i)),e.max=(...i)=>e.check(ME(...i)),e.length=(...i)=>e.check(RE(...i)),e.nonempty=(...i)=>e.check(Fc(1,...i)),e.lowercase=i=>e.check(kL(i)),e.uppercase=i=>e.check(zL(i)),e.trim=()=>e.check(HL()),e.normalize=(...i)=>e.check(YL(...i)),e.toLowerCase=()=>e.check(VL()),e.toUpperCase=()=>e.check(BL()),e.slugify=()=>e.check($L())}),y9=ae("ZodString",(e,t)=>{yg.init(e,t),NE.init(e,t),e.email=r=>e.check(iL(v9,r)),e.url=r=>e.check(cL(b9,r)),e.jwt=r=>e.check(TL(z9,r)),e.emoji=r=>e.check(fL(_9,r)),e.guid=r=>e.check(i_(o_,r)),e.uuid=r=>e.check(sL(cc,r)),e.uuidv4=r=>e.check(oL(cc,r)),e.uuidv6=r=>e.check(lL(cc,r)),e.uuidv7=r=>e.check(uL(cc,r)),e.nanoid=r=>e.check(dL(w9,r)),e.guid=r=>e.check(i_(o_,r)),e.cuid=r=>e.check(hL(S9,r)),e.cuid2=r=>e.check(mL(x9,r)),e.ulid=r=>e.check(pL(E9,r)),e.base64=r=>e.check(SL(R9,r)),e.base64url=r=>e.check(xL(N9,r)),e.xid=r=>e.check(gL(T9,r)),e.ksuid=r=>e.check(yL(O9,r)),e.ipv4=r=>e.check(vL(A9,r)),e.ipv6=r=>e.check(bL(C9,r)),e.cidrv4=r=>e.check(_L(D9,r)),e.cidrv6=r=>e.check(wL(M9,r)),e.e164=r=>e.check(EL(k9,r)),e.datetime=r=>e.check(KL(r)),e.date=r=>e.check(JL(r)),e.time=r=>e.check(t9(r)),e.duration=r=>e.check(r9(r))});function pm(e){return aL(y9,e)}const xt=ae("ZodStringFormat",(e,t)=>{wt.init(e,t),NE.init(e,t)}),v9=ae("ZodEmail",(e,t)=>{p8.init(e,t),xt.init(e,t)}),o_=ae("ZodGUID",(e,t)=>{h8.init(e,t),xt.init(e,t)}),cc=ae("ZodUUID",(e,t)=>{m8.init(e,t),xt.init(e,t)}),b9=ae("ZodURL",(e,t)=>{g8.init(e,t),xt.init(e,t)}),_9=ae("ZodEmoji",(e,t)=>{y8.init(e,t),xt.init(e,t)}),w9=ae("ZodNanoID",(e,t)=>{v8.init(e,t),xt.init(e,t)}),S9=ae("ZodCUID",(e,t)=>{b8.init(e,t),xt.init(e,t)}),x9=ae("ZodCUID2",(e,t)=>{_8.init(e,t),xt.init(e,t)}),E9=ae("ZodULID",(e,t)=>{w8.init(e,t),xt.init(e,t)}),T9=ae("ZodXID",(e,t)=>{S8.init(e,t),xt.init(e,t)}),O9=ae("ZodKSUID",(e,t)=>{x8.init(e,t),xt.init(e,t)}),A9=ae("ZodIPv4",(e,t)=>{C8.init(e,t),xt.init(e,t)}),C9=ae("ZodIPv6",(e,t)=>{D8.init(e,t),xt.init(e,t)}),D9=ae("ZodCIDRv4",(e,t)=>{M8.init(e,t),xt.init(e,t)}),M9=ae("ZodCIDRv6",(e,t)=>{R8.init(e,t),xt.init(e,t)}),R9=ae("ZodBase64",(e,t)=>{N8.init(e,t),xt.init(e,t)}),N9=ae("ZodBase64URL",(e,t)=>{z8.init(e,t),xt.init(e,t)}),k9=ae("ZodE164",(e,t)=>{j8.init(e,t),xt.init(e,t)}),z9=ae("ZodJWT",(e,t)=>{L8.init(e,t),xt.init(e,t)}),j9=ae("ZodUnknown",(e,t)=>{Y8.init(e,t),Kt.init(e,t)});function l_(){return ML(j9)}const U9=ae("ZodNever",(e,t)=>{H8.init(e,t),Kt.init(e,t)});function L9(e){return RL(U9,e)}const Y9=ae("ZodArray",(e,t)=>{V8.init(e,t),Kt.init(e,t),e.element=t.element,e.min=(r,i)=>e.check(Fc(r,i)),e.nonempty=r=>e.check(Fc(1,r)),e.max=(r,i)=>e.check(ME(r,i)),e.length=(r,i)=>e.check(RE(r,i)),e.unwrap=()=>e.element});function H9(e,t){return FL(Y9,e,t)}const V9=ae("ZodObject",(e,t)=>{$8.init(e,t),Kt.init(e,t),dt(e,"shape",()=>t.shape),e.keyof=()=>G9(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:l_()}),e.loose=()=>e.clone({...e._zod.def,catchall:l_()}),e.strict=()=>e.clone({...e._zod.def,catchall:L9()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>hU(e,r),e.safeExtend=r=>mU(e,r),e.merge=r=>pU(e,r),e.pick=r=>fU(e,r),e.omit=r=>dU(e,r),e.partial=(...r)=>gU(kE,e,r[0]),e.required=(...r)=>yU(zE,e,r[0])});function B9(e,t){const r={type:"object",shape:e??{},...ke(t)};return new V9(r)}const $9=ae("ZodUnion",(e,t)=>{F8.init(e,t),Kt.init(e,t),e.options=t.options});function F9(e,t){return new $9({type:"union",options:e,...ke(t)})}const Z9=ae("ZodIntersection",(e,t)=>{Z8.init(e,t),Kt.init(e,t)});function P9(e,t){return new Z9({type:"intersection",left:e,right:t})}const Im=ae("ZodEnum",(e,t)=>{P8.init(e,t),Kt.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const u={};for(const c of i)if(r.has(c))u[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Im({...t,checks:[],...ke(o),entries:u})},e.exclude=(i,o)=>{const u={...t.entries};for(const c of i)if(r.has(c))delete u[c];else throw new Error(`Key ${c} not found in enum`);return new Im({...t,checks:[],...ke(o),entries:u})}});function G9(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Im({type:"enum",entries:r,...ke(t)})}const q9=ae("ZodTransform",(e,t)=>{G8.init(e,t),Kt.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new vE(e.constructor.name);r.addIssue=u=>{if(typeof u=="string")r.issues.push(Sl(u,r.value,t));else{const c=u;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=e),r.issues.push(Sl(c))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(u=>(r.value=u,r)):(r.value=o,r)}});function I9(e){return new q9({type:"transform",transform:e})}const kE=ae("ZodOptional",(e,t)=>{q8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function u_(e){return new kE({type:"optional",innerType:e})}const X9=ae("ZodNullable",(e,t)=>{I8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function c_(e){return new X9({type:"nullable",innerType:e})}const W9=ae("ZodDefault",(e,t)=>{X8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function K9(e,t){return new W9({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():wE(t)}})}const Q9=ae("ZodPrefault",(e,t)=>{W8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function J9(e,t){return new Q9({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():wE(t)}})}const zE=ae("ZodNonOptional",(e,t)=>{K8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function eY(e,t){return new zE({type:"nonoptional",innerType:e,...ke(t)})}const tY=ae("ZodCatch",(e,t)=>{Q8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function nY(e,t){return new tY({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const rY=ae("ZodPipe",(e,t)=>{J8.init(e,t),Kt.init(e,t),e.in=t.in,e.out=t.out});function f_(e,t){return new rY({type:"pipe",in:e,out:t})}const aY=ae("ZodReadonly",(e,t)=>{eL.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function iY(e){return new aY({type:"readonly",innerType:e})}const sY=ae("ZodCustom",(e,t)=>{tL.init(e,t),Kt.init(e,t)});function oY(e,t={}){return ZL(sY,e,t)}function lY(e){return PL(e)}var uY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cY=uY.reduce((e,t)=>{const r=kp(`Primitive.${t}`),i=_.forwardRef((o,u)=>{const{asChild:c,...h}=o,p=c?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(p,{...h,ref:u})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),fY="Label",jE=_.forwardRef((e,t)=>w.jsx(cY.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));jE.displayName=fY;var dY=jE;function hY(e){const t=Ve.c(8);let r,i;t[0]!==e?({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i):(r=t[1],i=t[2]);let o;t[3]!==r?(o=rt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",r),t[3]=r,t[4]=o):o=t[4];let u;return t[5]!==i||t[6]!==o?(u=w.jsx(dY,{"data-slot":"label",className:o,...i}),t[5]=i,t[6]=o,t[7]=u):u=t[7],u}const mY=V5,UE=_.createContext({}),gm=e=>{const t=Ve.c(9);let r;t[0]!==e?({...r}=e,t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r.name?(i={name:r.name},t[2]=r.name,t[3]=i):i=t[3];let o;t[4]!==r?(o=w.jsx(F5,{...r}),t[4]=r,t[5]=o):o=t[5];let u;return t[6]!==i||t[7]!==o?(u=w.jsx(UE.Provider,{value:i,children:o}),t[6]=i,t[7]=o,t[8]=u):u=t[8],u},vg=()=>{const e=Ve.c(13),t=_.useContext(UE),r=_.useContext(LE),{getFieldState:i}=_f();let o;e[0]!==t.name?(o={name:t.name},e[0]=t.name,e[1]=o):o=e[1];const u=fE(o);let c;e[2]!==t.name||e[3]!==u||e[4]!==i?(c=i(t.name,u),e[2]=t.name,e[3]=u,e[4]=i,e[5]=c):c=e[5];const h=c;if(!t)throw new Error("useFormField should be used within ");const{id:p}=r,m=`${p}-form-item`,y=`${p}-form-item-description`,g=`${p}-form-item-message`;let b;return e[6]!==t.name||e[7]!==h||e[8]!==p||e[9]!==m||e[10]!==y||e[11]!==g?(b={id:p,name:t.name,formItemId:m,formDescriptionId:y,formMessageId:g,...h},e[6]=t.name,e[7]=h,e[8]=p,e[9]=m,e[10]=y,e[11]=g,e[12]=b):b=e[12],b},LE=_.createContext({});function ym(e){const t=Ve.c(13);let r,i;t[0]!==e?({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i):(r=t[1],i=t[2]);const o=_.useId();let u;t[3]!==o?(u={id:o},t[3]=o,t[4]=u):u=t[4];let c;t[5]!==r?(c=rt("grid gap-2",r),t[5]=r,t[6]=c):c=t[6];let h;t[7]!==i||t[8]!==c?(h=w.jsx("div",{"data-slot":"form-item",className:c,...i}),t[7]=i,t[8]=c,t[9]=h):h=t[9];let p;return t[10]!==u||t[11]!==h?(p=w.jsx(LE.Provider,{value:u,children:h}),t[10]=u,t[11]=h,t[12]=p):p=t[12],p}function fc(e){const t=Ve.c(10);let r,i;t[0]!==e?({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i):(r=t[1],i=t[2]);const{error:o,formItemId:u}=vg(),c=!!o;let h;t[3]!==r?(h=rt("data-[error=true]:text-destructive",r),t[3]=r,t[4]=h):h=t[4];let p;return t[5]!==u||t[6]!==i||t[7]!==c||t[8]!==h?(p=w.jsx(hY,{"data-slot":"form-label","data-error":c,className:h,htmlFor:u,...i}),t[5]=u,t[6]=i,t[7]=c,t[8]=h,t[9]=p):p=t[9],p}function vm(e){const t=Ve.c(7);let r;t[0]!==e?({...r}=e,t[0]=e,t[1]=r):r=t[1];const{error:i,formItemId:o,formDescriptionId:u,formMessageId:c}=vg(),h=i?`${u} ${c}`:`${u}`,p=!!i;let m;return t[2]!==o||t[3]!==r||t[4]!==h||t[5]!==p?(m=w.jsx(zp,{"data-slot":"form-control",id:o,"aria-describedby":h,"aria-invalid":p,...r}),t[2]=o,t[3]=r,t[4]=h,t[5]=p,t[6]=m):m=t[6],m}function bm(e){const t=Ve.c(10);let r,i;t[0]!==e?({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i):(r=t[1],i=t[2]);const{error:o,formMessageId:u}=vg(),c=o?String(o?.message??""):i.children;if(!c)return null;let h;t[3]!==r?(h=rt("text-destructive text-sm",r),t[3]=r,t[4]=h):h=t[4];let p;return t[5]!==c||t[6]!==u||t[7]!==i||t[8]!==h?(p=w.jsx("p",{"data-slot":"form-message",id:u,className:h,...i,children:c}),t[5]=c,t[6]=u,t[7]=i,t[8]=h,t[9]=p):p=t[9],p}function _m(e){const t=Ve.c(10);let r,i,o;t[0]!==e?({className:r,type:o,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=o):(r=t[1],i=t[2],o=t[3]);let u;t[4]!==r?(u=rt("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",r),t[4]=r,t[5]=u):u=t[5];let c;return t[6]!==i||t[7]!==u||t[8]!==o?(c=w.jsx("input",{type:o,"data-slot":"input",className:u,...i}),t[6]=i,t[7]=u,t[8]=o,t[9]=c):c=t[9],c}const pY=B9({name:pm().min(1,"Tên là bắt buộc"),email:pm().email("Email không hợp lệ"),avatar:pm().optional()});function gY({user:e,onSave:t,children:r,trackingOpen:i}){const o=zk(),u=!!e,[c,h]=_.useState(!1),[p,m]=_.useState(!1),{captureRegisterImage:y,setCaptureRegisterImage:g}=ai(),b=aU({resolver:XL(pY),defaultValues:{name:"",email:"",avatar:""}});_.useEffect(()=>{e?b.reset({name:e.name,email:e.email,avatar:e.avatar??""}):b.reset({name:"",email:"",avatar:""})},[e,c,b]);const T=async()=>{await o({title:"Thông báo",message:"Bạn muốn hủy đăng ký. Mọi dữ liệu bạn nhập sẽ bị mất",confirmText:"Discard",cancelText:"Hủy",variant:"warning"})&&(h(!1),g(null))},x=async E=>{try{m(!0);const O={id:e?.id||Date.now().toString(),...E,avatar:E.avatar||null},{data:D}=await Qs.register({user:O,file:y});console.log({data:D}),t?.(O),h(!1),g(null),ma.success(D?.message||"Đăng ký thành công !")}catch(O){console.log({error:O}),ma.error(O?.message||"Internal Server Error")}finally{m(!1)}};return _.useEffect(()=>{i!==void 0&&h(i)},[i]),_.useEffect(()=>{if(y)return()=>{URL.revokeObjectURL(y)}},[y]),w.jsxs(Cp,{open:c,onOpenChange:E=>{if(!E){T();return}h(!0)},children:[w.jsx(nS,{children:r}),w.jsxs(Dp,{className:"sm:max-w-[425px]",children:[w.jsxs(Mp,{children:[w.jsx(Rp,{children:u?"Cập nhật thông tin":"Tạo người dùng mới"}),w.jsx(Np,{children:u?"Cập nhật thông tin người dùng của bạn":"Nhập thông tin để tạo người dùng mới"})]}),w.jsx(mY,{...b,children:w.jsxs("form",{onSubmit:b.handleSubmit(x),className:"space-y-4",children:[w.jsx(gm,{control:b.control,name:"name",render:({field:E})=>w.jsxs(ym,{children:[w.jsxs(fc,{children:["Tên ",w.jsx("span",{className:"text-red-600",children:"*"})]}),w.jsx(vm,{children:w.jsx(_m,{placeholder:"Nhập tên người dùng",...E})}),w.jsx(bm,{})]})}),w.jsx(gm,{control:b.control,name:"email",render:({field:E})=>w.jsxs(ym,{children:[w.jsxs(fc,{children:["Email ",w.jsx("span",{className:"text-red-600",children:"*"})]}),w.jsx(vm,{children:w.jsx(_m,{type:"email",placeholder:"Nhập email",...E})}),w.jsx(bm,{})]})}),w.jsx(gm,{control:b.control,name:"avatar",render:({field:E})=>w.jsxs(ym,{children:[w.jsx(fc,{children:"Avatar URL"}),w.jsx(vm,{children:w.jsx(_m,{placeholder:"https://example.com/avatar.jpg",...E})}),w.jsx(bm,{})]})}),w.jsx(fc,{children:"Ảnh từ camera"}),w.jsx("a",{target:"_blank",href:URL.createObjectURL(y),children:w.jsxs(hn,{size:"sm",variant:"outline",className:"w-full bg-transparent",type:"button",children:[w.jsx(ap,{className:"w-4 h-4 mr-2"}),"Xem ảnh"]})}),w.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[w.jsx(hn,{type:"button",variant:"outline",onClick:T,children:"Hủy"}),w.jsxs(hn,{type:"submit",children:[!p&&u?"Cập nhật":"Tạo mới",p&&w.jsx(mc,{className:"animate-spin"})]})]})]})})]})]})}function yY(){const e=Ve.c(9),{isAutoChecking:t,captureRegisterImage:r,isCountDown:i}=ai();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=w.jsx(MC,{className:"mr-2 size-4"}),e[0]=o):o=e[0];let u;e[1]!==t?(u=w.jsx(L5,{children:w.jsxs(hn,{onClick:vY,disabled:t,className:"w-full bg-green-600 hover:bg-green-700 text-white font-semibold",children:[o,"Tạo User Checking"]})}),e[1]=t,e[2]=u):u=e[2];let c;e[3]!==r||e[4]!==i?(c=r&&!i&&w.jsx(gY,{trackingOpen:!0}),e[3]=r,e[4]=i,e[5]=c):c=e[5];let h;return e[6]!==u||e[7]!==c?(h=w.jsxs(w.Fragment,{children:[u,c]}),e[6]=u,e[7]=c,e[8]=h):h=e[8],h}function vY(){}function bY({type:e,str:t}){const r=t||(e==="check in"?"Check-in successful":e==="check out"?"Check-out successful":"");if(!r)return;const i=new SpeechSynthesisUtterance(r);i.lang="en-US",i.rate=1,i.pitch=1,i.volume=1,speechSynthesis.speak(i)}function _Y(){const e=_.useRef(null),{canvasRef:t,videoRef:r}=ai(),{currentUser:i,setCurrentUser:o}=sE(),{isAutoChecking:u,setIsAutoChecking:c,setRefreshLog:h}=ai(),p=_.useRef(null),[m,y]=_.useState(!1),[g,b]=_.useState(!1),T=()=>{u?(p.current&&(clearInterval(p.current),p.current=null),c(!1)):(p.current=setInterval(()=>{E()},3e3),c(!0))},x=async()=>{if(!i){ma.warning("Vui lòng chọn user để tạo checkpoint");return}try{b(!0);const O=await Rm(r,t),{data:D}=await Qs.register({user:i,file:O});if(!D){ma.error(D?.message||"Error In Checkpoint: "+JSON.stringify(D));return}ma.success(D?.message||"Tạo checkpoint thành công")}catch(O){const D=O;ma.error(D.response?.data?.message||"Error In Checkpoint: "+JSON.stringify(D))}finally{b(!1)}},E=_.useCallback(async()=>{try{y(!0);const O=await Rm(r,t),{data:D}=await Qs.checkin({file:O});if(!D||!D?.data){ma.error(D?.message||"Error In Checking: "+JSON.stringify(D));return}D?.checking&&(o(D?.data||null),e.current=setTimeout(()=>{o(null),e.current=null},2e3));const U=D?.message||`Checking thành công lúc: ${tS(new Date().toLocaleString())}`;if(ma.success(U),!D?.status)return;bY({type:D?.status}),h(!0)}catch(O){const D=O;ma.error(D.response?.data?.message||"Error In Checking: "+JSON.stringify(D))}finally{y(!1)}},[t,o,r]);return _.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),_.useEffect(()=>{const O=D=>{if(D.code==="Space"){if(D.preventDefault(),!m)return;E()}};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O)}},[E,m]),w.jsxs("div",{className:"absolute bottom-10 px-4 right-0 left-0 grid grid-cols-3 gap-4",children:[w.jsxs(hn,{onClick:E,disabled:u,className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold",children:[!m&&w.jsxs(w.Fragment,{children:[w.jsx(ap,{className:"mr-2 size-4"}),"Điểm Danh Ngay"]}),m&&w.jsx(mc,{className:"size-4 animate-spin"})]}),w.jsxs(hn,{onClick:T,variant:u?"destructive":"outline",className:rt("w-full font-semibold",u&&"animate-pulse"),children:[!m&&u?w.jsxs(w.Fragment,{children:[w.jsx(xC,{className:"mr-2 size-4"}),"Dừng Tự Động"]}):w.jsxs(w.Fragment,{children:[w.jsx(bC,{className:"mr-2 size-4"}),"Tự Động Điểm Danh"]}),m&&w.jsx(mc,{className:"size-4 animate-spin"})]}),i&&w.jsxs(hn,{disabled:u,onClick:x,className:rt("w-full font-semibold"),children:[!g&&w.jsxs(w.Fragment,{children:[w.jsx(fC,{}),"Tạo Check Point"]}),g&&w.jsx(mc,{className:"size-4 animate-spin"})]}),!i&&w.jsx(yY,{})]})}function wY(){const[e,t]=_.useState(!0),[r,i]=_.useState(!0),{setCanvasRef:o,setVideoRef:u}=ai(),{isCountDown:c,setCaptureRegisterImage:h,setIsCountDown:p}=ai(),m=_.useRef(null),y=_.useRef(null),g=async()=>{try{const{data:b}=await dz.timekeepings(),x=(b?.data||[]).map(E=>({name:E?.user?.name,email:E?.user?.email,avatar:E?.user?.avatar}));await Promise.all(x.map(E=>Qs.registerSimple({user:E}))),console.log("Sync hoàn tất!")}catch(b){console.log("Sync error:",b)}};return _.useEffect(()=>((async()=>{try{const T=await navigator.mediaDevices.getUserMedia({video:{width:1280,height:720,facingMode:"user"}});m.current&&(m.current.srcObject=T)}catch(T){console.error("Không thể truy cập camera:",T)}})(),()=>{m.current?.srcObject&&(m.current?.srcObject).getTracks().forEach(x=>x.stop())}),[]),_.useEffect(()=>{g()},[]),_.useEffect(()=>{o(y),u(m)},[m,y]),w.jsx("div",{className:"min-h-screen bg-white",children:w.jsxs("div",{className:"flex h-screen",children:[w.jsx(i5,{isSidebarOpen:r}),w.jsx("div",{className:rt("flex-1 transition-all duration-300 ease-in-out",r&&"ml-96",e&&"mr-96"),children:w.jsx("div",{className:"h-full flex flex-col p-6",children:w.jsxs(MS,{className:"flex-1 overflow-hidden bg-black relative group",children:[w.jsx("video",{ref:m,autoPlay:!0,playsInline:!0,className:"w-full h-full object-cover"}),w.jsx("div",{className:"absolute inset-0 border-4 border-blue-500/30 pointer-events-none"}),c&&w.jsx(gz,{onCountdowned:async()=>{const b=await Rm(m,y);h(b),p(!1)}}),w.jsx(hn,{onClick:()=>i(!r),variant:"outline",size:"icon",className:"absolute top-1/2 -translate-y-1/2 left-4 bg-white/90 hover:bg-white shadow-lg",children:r?w.jsx(Ub,{className:"size-4"}):w.jsx(Lb,{className:"size-4"})}),w.jsx(hn,{onClick:()=>t(!e),variant:"outline",size:"icon",className:"absolute top-1/2 -translate-y-1/2 right-4 bg-white/90 hover:bg-white shadow-lg",children:e?w.jsx(Lb,{className:"size-4"}):w.jsx(Ub,{className:"size-4"})}),w.jsx(_Y,{})]})})}),w.jsx(u5,{isSidebarOpen:e}),w.jsx("canvas",{ref:y,className:"hidden"})]})})}var SY=(e,t,r,i,o,u,c,h)=>{let p=document.documentElement,m=["light","dark"];function y(T){(Array.isArray(e)?e:[e]).forEach(x=>{let E=x==="class",O=E&&u?o.map(D=>u[D]||D):o;E?(p.classList.remove(...O),p.classList.add(u&&u[T]?u[T]:T)):p.setAttribute(x,T)}),g(T)}function g(T){h&&m.includes(T)&&(p.style.colorScheme=T)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(i)y(i);else try{let T=localStorage.getItem(t)||r,x=c&&T==="system"?b():T;y(x)}catch{}},xY=_.createContext(void 0),EY={setTheme:e=>{},themes:[]},TY=()=>{var e;return(e=_.useContext(xY))!=null?e:EY};_.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:i,enableColorScheme:o,defaultTheme:u,value:c,themes:h,nonce:p,scriptProps:m})=>{let y=JSON.stringify([r,t,u,e,h,c,i,o]).slice(1,-1);return _.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${SY.toString()})(${y})`}})});const OY=e=>{const t=Ve.c(7);let r;t[0]!==e?({...r}=e,t[0]=e,t[1]=r):r=t[1];const{theme:i}=TY(),u=i===void 0?"system":i;let c,h;t[2]===Symbol.for("react.memo_cache_sentinel")?(c={success:w.jsx(sC,{className:"size-4"}),info:w.jsx(q_,{className:"size-4"}),warning:w.jsx(I_,{className:"size-4"}),error:w.jsx(yC,{className:"size-4"}),loading:w.jsx(mC,{className:"size-4 animate-spin"})},h={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},t[2]=c,t[3]=h):(c=t[2],h=t[3]);let p;return t[4]!==r||t[5]!==u?(p=w.jsx(U5,{theme:u,className:"toaster group",icons:c,style:h,...r}),t[4]=r,t[5]=u,t[6]=p):p=t[6],p};iO.createRoot(document.getElementById("root")).render(w.jsx(_.StrictMode,{children:w.jsxs(kk,{children:[w.jsx(wY,{}),w.jsx(OY,{richColors:!0,position:"top-right"})]})}))});export default AY(); + `)}T.write("payload.value = newResult;"),T.write("return payload;");const U=T.compile();return(j,k)=>U(b,j,k)};let u;const c=Bc,h=!bE.jitless,m=h&&lU.value,y=t.catchall;let g;e._zod.parse=(b,T)=>{g??(g=i.value);const x=b.value;return c(x)?h&&m&&T?.async===!1&&T.jitless!==!0?(u||(u=o(t.shape)),b=u(b,T),y?DE([],x,b,T,g,e):b):r(b,T):(b.issues.push({expected:"object",code:"invalid_type",input:x,inst:e}),b)}});function K1(e,t,r,i){for(const u of e)if(u.issues.length===0)return t.value=u.value,t;const o=e.filter(u=>!Zs(u));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(c=>Vi(c,i,Hi())))}),t)}const F8=ae("$ZodUnion",(e,t)=>{Gt.init(e,t),dt(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),dt(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),dt(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),dt(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${o.map(u=>mg(u.source)).join("|")})$`)}});const r=t.options.length===1,i=t.options[0]._zod.run;e._zod.parse=(o,u)=>{if(r)return i(o,u);let c=!1;const h=[];for(const p of t.options){const m=p._zod.run({value:o.value,issues:[]},u);if(m instanceof Promise)h.push(m),c=!0;else{if(m.issues.length===0)return m;h.push(m)}}return c?Promise.all(h).then(p=>K1(p,o,e,u)):K1(h,o,e,u)}}),Z8=ae("$ZodIntersection",(e,t)=>{Gt.init(e,t),e._zod.parse=(r,i)=>{const o=r.value,u=t.left._zod.run({value:o,issues:[]},i),c=t.right._zod.run({value:o,issues:[]},i);return u instanceof Promise||c instanceof Promise?Promise.all([u,c]).then(([p,m])=>Q1(r,p,m)):Q1(r,u,c)}});function qm(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(wl(e)&&wl(t)){const r=Object.keys(t),i=Object.keys(e).filter(u=>r.indexOf(u)!==-1),o={...e,...t};for(const u of i){const c=qm(e[u],t[u]);if(!c.valid)return{valid:!1,mergeErrorPath:[u,...c.mergeErrorPath]};o[u]=c.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let i=0;i{Gt.init(e,t);const r=sU(t.entries),i=new Set(r);e._zod.values=i,e._zod.pattern=new RegExp(`^(${r.filter(o=>uU.has(typeof o)).map(o=>typeof o=="string"?wf(o):o.toString()).join("|")})$`),e._zod.parse=(o,u)=>{const c=o.value;return i.has(c)||o.issues.push({code:"invalid_value",values:r,input:c,inst:e}),o}}),G8=ae("$ZodTransform",(e,t)=>{Gt.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new vE(e.constructor.name);const o=t.transform(r.value,r);if(i.async)return(o instanceof Promise?o:Promise.resolve(o)).then(c=>(r.value=c,r));if(o instanceof Promise)throw new Ws;return r.value=o,r}});function J1(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const q8=ae("$ZodOptional",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),dt(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${mg(r.source)})?$`):void 0}),e._zod.parse=(r,i)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(u=>J1(u,r.value)):J1(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,i)}}),I8=ae("$ZodNullable",(e,t)=>{Gt.init(e,t),dt(e._zod,"optin",()=>t.innerType._zod.optin),dt(e._zod,"optout",()=>t.innerType._zod.optout),dt(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${mg(r.source)}|null)$`):void 0}),dt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,i)=>r.value===null?r:t.innerType._zod.run(r,i)}),X8=ae("$ZodDefault",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(u=>e_(u,t)):e_(o,t)}});function e_(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const W8=ae("$ZodPrefault",(e,t)=>{Gt.init(e,t),e._zod.optin="optional",dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>(i.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,i))}),K8=ae("$ZodNonOptional",(e,t)=>{Gt.init(e,t),dt(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),e._zod.parse=(r,i)=>{const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(u=>t_(u,e)):t_(o,e)}});function t_(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Q8=ae("$ZodCatch",(e,t)=>{Gt.init(e,t),dt(e._zod,"optin",()=>t.innerType._zod.optin),dt(e._zod,"optout",()=>t.innerType._zod.optout),dt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(u=>(r.value=u.value,u.issues.length&&(r.value=t.catchValue({...r,error:{issues:u.issues.map(c=>Vi(c,i,Hi()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(u=>Vi(u,i,Hi()))},input:r.value}),r.issues=[]),r)}}),J8=ae("$ZodPipe",(e,t)=>{Gt.init(e,t),dt(e._zod,"values",()=>t.in._zod.values),dt(e._zod,"optin",()=>t.in._zod.optin),dt(e._zod,"optout",()=>t.out._zod.optout),dt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,i)=>{if(i.direction==="backward"){const u=t.out._zod.run(r,i);return u instanceof Promise?u.then(c=>lc(c,t.in,i)):lc(u,t.in,i)}const o=t.in._zod.run(r,i);return o instanceof Promise?o.then(u=>lc(u,t.out,i)):lc(o,t.out,i)}});function lc(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const eL=ae("$ZodReadonly",(e,t)=>{Gt.init(e,t),dt(e._zod,"propValues",()=>t.innerType._zod.propValues),dt(e._zod,"values",()=>t.innerType._zod.values),dt(e._zod,"optin",()=>t.innerType?._zod?.optin),dt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,i)=>{if(i.direction==="backward")return t.innerType._zod.run(r,i);const o=t.innerType._zod.run(r,i);return o instanceof Promise?o.then(n_):n_(o)}});function n_(e){return e.value=Object.freeze(e.value),e}const tL=ae("$ZodCustom",(e,t)=>{Zr.init(e,t),Gt.init(e,t),e._zod.parse=(r,i)=>r,e._zod.check=r=>{const i=r.value,o=t.fn(i);if(o instanceof Promise)return o.then(u=>r_(u,r,i,e));r_(o,r,i,e)}});function r_(e,t,r,i){if(!e){const o={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(o.params=i._zod.def.params),t.issues.push(Sl(o))}}var a_;class nL{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const i=r[0];if(this._map.set(t,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const i={...this.get(r)??{}};delete i.id;const o={...i,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function rL(){return new nL}(a_=globalThis).__zod_globalRegistry??(a_.__zod_globalRegistry=rL());const uc=globalThis.__zod_globalRegistry;function aL(e,t){return new e({type:"string",...ke(t)})}function iL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ke(t)})}function i_(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ke(t)})}function sL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ke(t)})}function oL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ke(t)})}function lL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ke(t)})}function uL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ke(t)})}function cL(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ke(t)})}function fL(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ke(t)})}function dL(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ke(t)})}function hL(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ke(t)})}function mL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ke(t)})}function pL(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ke(t)})}function gL(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ke(t)})}function yL(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ke(t)})}function vL(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ke(t)})}function bL(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ke(t)})}function _L(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ke(t)})}function wL(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ke(t)})}function SL(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ke(t)})}function xL(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ke(t)})}function EL(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ke(t)})}function TL(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ke(t)})}function OL(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ke(t)})}function AL(e,t){return new e({type:"string",format:"date",check:"string_format",...ke(t)})}function CL(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ke(t)})}function DL(e,t){return new e({type:"string",format:"duration",check:"string_format",...ke(t)})}function ML(e){return new e({type:"unknown"})}function RL(e,t){return new e({type:"never",...ke(t)})}function ME(e,t){return new t8({check:"max_length",...ke(t),maximum:e})}function Fc(e,t){return new n8({check:"min_length",...ke(t),minimum:e})}function RE(e,t){return new r8({check:"length_equals",...ke(t),length:e})}function NL(e,t){return new a8({check:"string_format",format:"regex",...ke(t),pattern:e})}function kL(e){return new i8({check:"string_format",format:"lowercase",...ke(e)})}function zL(e){return new s8({check:"string_format",format:"uppercase",...ke(e)})}function jL(e,t){return new o8({check:"string_format",format:"includes",...ke(t),includes:e})}function UL(e,t){return new l8({check:"string_format",format:"starts_with",...ke(t),prefix:e})}function LL(e,t){return new u8({check:"string_format",format:"ends_with",...ke(t),suffix:e})}function uo(e){return new c8({check:"overwrite",tx:e})}function YL(e){return uo(t=>t.normalize(e))}function HL(){return uo(e=>e.trim())}function VL(){return uo(e=>e.toLowerCase())}function BL(){return uo(e=>e.toUpperCase())}function $L(){return uo(e=>oU(e))}function FL(e,t,r){return new e({type:"array",element:t,...ke(r)})}function ZL(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ke(r)})}function PL(e){const t=GL(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Sl(i,r.value,t._zod.def));else{const o=i;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(Sl(o))}},e(r.value,r)));return t}function GL(e,t){const r=new Zr({check:"custom",...ke(t)});return r._zod.check=e,r}function s_(e,t){try{var r=e()}catch(i){return t(i)}return r&&r.then?r.then(void 0,t):r}function qL(e,t){for(var r={};e.length;){var i=e[0],o=i.code,u=i.message,c=i.path.join(".");if(!r[c])if("unionErrors"in i){var h=i.unionErrors[0].errors[0];r[c]={message:h.message,type:h.code}}else r[c]={message:u,type:o};if("unionErrors"in i&&i.unionErrors.forEach(function(y){return y.errors.forEach(function(g){return e.push(g)})}),t){var p=r[c].types,m=p&&p[i.code];r[c]=ug(c,t,r,o,m?[].concat(m,i.message):i.message)}e.shift()}return r}function IL(e,t){for(var r={};e.length;){var i=e[0],o=i.code,u=i.message,c=i.path.join(".");if(!r[c])if(i.code==="invalid_union"&&i.errors.length>0){var h=i.errors[0][0];r[c]={message:h.message,type:h.code}}else r[c]={message:u,type:o};if(i.code==="invalid_union"&&i.errors.forEach(function(y){return y.forEach(function(g){return e.push(g)})}),t){var p=r[c].types,m=p&&p[i.code];r[c]=ug(c,t,r,o,m?[].concat(m,i.message):i.message)}e.shift()}return r}function XL(e,t,r){if(r===void 0&&(r={}),(function(i){return"_def"in i&&typeof i._def=="object"&&"typeName"in i._def})(e))return function(i,o,u){try{return Promise.resolve(s_(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](i,t)).then(function(c){return u.shouldUseNativeValidation&&Pm({},u),{errors:{},values:r.raw?Object.assign({},i):c}})},function(c){if((function(h){return Array.isArray(h?.issues)})(c))return{values:{},errors:P1(qL(c.errors,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw c}))}catch(c){return Promise.reject(c)}};if((function(i){return"_zod"in i&&typeof i._zod=="object"})(e))return function(i,o,u){try{return Promise.resolve(s_(function(){return Promise.resolve((r.mode==="sync"?_U:wU)(e,i,t)).then(function(c){return u.shouldUseNativeValidation&&Pm({},u),{errors:{},values:r.raw?Object.assign({},i):c}})},function(c){if((function(h){return h instanceof gg})(c))return{values:{},errors:P1(IL(c.issues,!u.shouldUseNativeValidation&&u.criteriaMode==="all"),u)};throw c}))}catch(c){return Promise.reject(c)}};throw new Error("Invalid input: not a Zod schema")}const WL=ae("ZodISODateTime",(e,t)=>{E8.init(e,t),xt.init(e,t)});function KL(e){return OL(WL,e)}const QL=ae("ZodISODate",(e,t)=>{T8.init(e,t),xt.init(e,t)});function JL(e){return AL(QL,e)}const e9=ae("ZodISOTime",(e,t)=>{O8.init(e,t),xt.init(e,t)});function t9(e){return CL(e9,e)}const n9=ae("ZodISODuration",(e,t)=>{A8.init(e,t),xt.init(e,t)});function r9(e){return DL(n9,e)}const a9=(e,t)=>{gg.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>bU(e,r)},flatten:{value:r=>vU(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Gm,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Gm,2)}},isEmpty:{get(){return e.issues.length===0}}})},sr=ae("ZodError",a9,{Parent:Error}),i9=xf(sr),s9=Ef(sr),o9=Tf(sr),l9=Of(sr),u9=EU(sr),c9=TU(sr),f9=OU(sr),d9=AU(sr),h9=CU(sr),m9=DU(sr),p9=MU(sr),g9=RU(sr),Kt=ae("ZodType",(e,t)=>(Gt.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(Gi(t,{checks:[...t.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]})),e.clone=(r,i)=>li(e,r,i),e.brand=()=>e,e.register=((r,i)=>(r.add(e,i),e)),e.parse=(r,i)=>i9(e,r,i,{callee:e.parse}),e.safeParse=(r,i)=>o9(e,r,i),e.parseAsync=async(r,i)=>s9(e,r,i,{callee:e.parseAsync}),e.safeParseAsync=async(r,i)=>l9(e,r,i),e.spa=e.safeParseAsync,e.encode=(r,i)=>u9(e,r,i),e.decode=(r,i)=>c9(e,r,i),e.encodeAsync=async(r,i)=>f9(e,r,i),e.decodeAsync=async(r,i)=>d9(e,r,i),e.safeEncode=(r,i)=>h9(e,r,i),e.safeDecode=(r,i)=>m9(e,r,i),e.safeEncodeAsync=async(r,i)=>p9(e,r,i),e.safeDecodeAsync=async(r,i)=>g9(e,r,i),e.refine=(r,i)=>e.check(oY(r,i)),e.superRefine=r=>e.check(lY(r)),e.overwrite=r=>e.check(uo(r)),e.optional=()=>u_(e),e.nullable=()=>c_(e),e.nullish=()=>u_(c_(e)),e.nonoptional=r=>eY(e,r),e.array=()=>H9(e),e.or=r=>F9([e,r]),e.and=r=>P9(e,r),e.transform=r=>f_(e,I9(r)),e.default=r=>K9(e,r),e.prefault=r=>J9(e,r),e.catch=r=>nY(e,r),e.pipe=r=>f_(e,r),e.readonly=()=>iY(e),e.describe=r=>{const i=e.clone();return uc.add(i,{description:r}),i},Object.defineProperty(e,"description",{get(){return uc.get(e)?.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return uc.get(e);const i=e.clone();return uc.add(i,r[0]),i},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),NE=ae("_ZodString",(e,t)=>{yg.init(e,t),Kt.init(e,t);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...i)=>e.check(NL(...i)),e.includes=(...i)=>e.check(jL(...i)),e.startsWith=(...i)=>e.check(UL(...i)),e.endsWith=(...i)=>e.check(LL(...i)),e.min=(...i)=>e.check(Fc(...i)),e.max=(...i)=>e.check(ME(...i)),e.length=(...i)=>e.check(RE(...i)),e.nonempty=(...i)=>e.check(Fc(1,...i)),e.lowercase=i=>e.check(kL(i)),e.uppercase=i=>e.check(zL(i)),e.trim=()=>e.check(HL()),e.normalize=(...i)=>e.check(YL(...i)),e.toLowerCase=()=>e.check(VL()),e.toUpperCase=()=>e.check(BL()),e.slugify=()=>e.check($L())}),y9=ae("ZodString",(e,t)=>{yg.init(e,t),NE.init(e,t),e.email=r=>e.check(iL(v9,r)),e.url=r=>e.check(cL(b9,r)),e.jwt=r=>e.check(TL(z9,r)),e.emoji=r=>e.check(fL(_9,r)),e.guid=r=>e.check(i_(o_,r)),e.uuid=r=>e.check(sL(cc,r)),e.uuidv4=r=>e.check(oL(cc,r)),e.uuidv6=r=>e.check(lL(cc,r)),e.uuidv7=r=>e.check(uL(cc,r)),e.nanoid=r=>e.check(dL(w9,r)),e.guid=r=>e.check(i_(o_,r)),e.cuid=r=>e.check(hL(S9,r)),e.cuid2=r=>e.check(mL(x9,r)),e.ulid=r=>e.check(pL(E9,r)),e.base64=r=>e.check(SL(R9,r)),e.base64url=r=>e.check(xL(N9,r)),e.xid=r=>e.check(gL(T9,r)),e.ksuid=r=>e.check(yL(O9,r)),e.ipv4=r=>e.check(vL(A9,r)),e.ipv6=r=>e.check(bL(C9,r)),e.cidrv4=r=>e.check(_L(D9,r)),e.cidrv6=r=>e.check(wL(M9,r)),e.e164=r=>e.check(EL(k9,r)),e.datetime=r=>e.check(KL(r)),e.date=r=>e.check(JL(r)),e.time=r=>e.check(t9(r)),e.duration=r=>e.check(r9(r))});function pm(e){return aL(y9,e)}const xt=ae("ZodStringFormat",(e,t)=>{wt.init(e,t),NE.init(e,t)}),v9=ae("ZodEmail",(e,t)=>{p8.init(e,t),xt.init(e,t)}),o_=ae("ZodGUID",(e,t)=>{h8.init(e,t),xt.init(e,t)}),cc=ae("ZodUUID",(e,t)=>{m8.init(e,t),xt.init(e,t)}),b9=ae("ZodURL",(e,t)=>{g8.init(e,t),xt.init(e,t)}),_9=ae("ZodEmoji",(e,t)=>{y8.init(e,t),xt.init(e,t)}),w9=ae("ZodNanoID",(e,t)=>{v8.init(e,t),xt.init(e,t)}),S9=ae("ZodCUID",(e,t)=>{b8.init(e,t),xt.init(e,t)}),x9=ae("ZodCUID2",(e,t)=>{_8.init(e,t),xt.init(e,t)}),E9=ae("ZodULID",(e,t)=>{w8.init(e,t),xt.init(e,t)}),T9=ae("ZodXID",(e,t)=>{S8.init(e,t),xt.init(e,t)}),O9=ae("ZodKSUID",(e,t)=>{x8.init(e,t),xt.init(e,t)}),A9=ae("ZodIPv4",(e,t)=>{C8.init(e,t),xt.init(e,t)}),C9=ae("ZodIPv6",(e,t)=>{D8.init(e,t),xt.init(e,t)}),D9=ae("ZodCIDRv4",(e,t)=>{M8.init(e,t),xt.init(e,t)}),M9=ae("ZodCIDRv6",(e,t)=>{R8.init(e,t),xt.init(e,t)}),R9=ae("ZodBase64",(e,t)=>{N8.init(e,t),xt.init(e,t)}),N9=ae("ZodBase64URL",(e,t)=>{z8.init(e,t),xt.init(e,t)}),k9=ae("ZodE164",(e,t)=>{j8.init(e,t),xt.init(e,t)}),z9=ae("ZodJWT",(e,t)=>{L8.init(e,t),xt.init(e,t)}),j9=ae("ZodUnknown",(e,t)=>{Y8.init(e,t),Kt.init(e,t)});function l_(){return ML(j9)}const U9=ae("ZodNever",(e,t)=>{H8.init(e,t),Kt.init(e,t)});function L9(e){return RL(U9,e)}const Y9=ae("ZodArray",(e,t)=>{V8.init(e,t),Kt.init(e,t),e.element=t.element,e.min=(r,i)=>e.check(Fc(r,i)),e.nonempty=r=>e.check(Fc(1,r)),e.max=(r,i)=>e.check(ME(r,i)),e.length=(r,i)=>e.check(RE(r,i)),e.unwrap=()=>e.element});function H9(e,t){return FL(Y9,e,t)}const V9=ae("ZodObject",(e,t)=>{$8.init(e,t),Kt.init(e,t),dt(e,"shape",()=>t.shape),e.keyof=()=>G9(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:l_()}),e.loose=()=>e.clone({...e._zod.def,catchall:l_()}),e.strict=()=>e.clone({...e._zod.def,catchall:L9()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>hU(e,r),e.safeExtend=r=>mU(e,r),e.merge=r=>pU(e,r),e.pick=r=>fU(e,r),e.omit=r=>dU(e,r),e.partial=(...r)=>gU(kE,e,r[0]),e.required=(...r)=>yU(zE,e,r[0])});function B9(e,t){const r={type:"object",shape:e??{},...ke(t)};return new V9(r)}const $9=ae("ZodUnion",(e,t)=>{F8.init(e,t),Kt.init(e,t),e.options=t.options});function F9(e,t){return new $9({type:"union",options:e,...ke(t)})}const Z9=ae("ZodIntersection",(e,t)=>{Z8.init(e,t),Kt.init(e,t)});function P9(e,t){return new Z9({type:"intersection",left:e,right:t})}const Im=ae("ZodEnum",(e,t)=>{P8.init(e,t),Kt.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(i,o)=>{const u={};for(const c of i)if(r.has(c))u[c]=t.entries[c];else throw new Error(`Key ${c} not found in enum`);return new Im({...t,checks:[],...ke(o),entries:u})},e.exclude=(i,o)=>{const u={...t.entries};for(const c of i)if(r.has(c))delete u[c];else throw new Error(`Key ${c} not found in enum`);return new Im({...t,checks:[],...ke(o),entries:u})}});function G9(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(i=>[i,i])):e;return new Im({type:"enum",entries:r,...ke(t)})}const q9=ae("ZodTransform",(e,t)=>{G8.init(e,t),Kt.init(e,t),e._zod.parse=(r,i)=>{if(i.direction==="backward")throw new vE(e.constructor.name);r.addIssue=u=>{if(typeof u=="string")r.issues.push(Sl(u,r.value,t));else{const c=u;c.fatal&&(c.continue=!1),c.code??(c.code="custom"),c.input??(c.input=r.value),c.inst??(c.inst=e),r.issues.push(Sl(c))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(u=>(r.value=u,r)):(r.value=o,r)}});function I9(e){return new q9({type:"transform",transform:e})}const kE=ae("ZodOptional",(e,t)=>{q8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function u_(e){return new kE({type:"optional",innerType:e})}const X9=ae("ZodNullable",(e,t)=>{I8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function c_(e){return new X9({type:"nullable",innerType:e})}const W9=ae("ZodDefault",(e,t)=>{X8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function K9(e,t){return new W9({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():wE(t)}})}const Q9=ae("ZodPrefault",(e,t)=>{W8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function J9(e,t){return new Q9({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():wE(t)}})}const zE=ae("ZodNonOptional",(e,t)=>{K8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function eY(e,t){return new zE({type:"nonoptional",innerType:e,...ke(t)})}const tY=ae("ZodCatch",(e,t)=>{Q8.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function nY(e,t){return new tY({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const rY=ae("ZodPipe",(e,t)=>{J8.init(e,t),Kt.init(e,t),e.in=t.in,e.out=t.out});function f_(e,t){return new rY({type:"pipe",in:e,out:t})}const aY=ae("ZodReadonly",(e,t)=>{eL.init(e,t),Kt.init(e,t),e.unwrap=()=>e._zod.def.innerType});function iY(e){return new aY({type:"readonly",innerType:e})}const sY=ae("ZodCustom",(e,t)=>{tL.init(e,t),Kt.init(e,t)});function oY(e,t={}){return ZL(sY,e,t)}function lY(e){return PL(e)}var uY=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],cY=uY.reduce((e,t)=>{const r=kp(`Primitive.${t}`),i=_.forwardRef((o,u)=>{const{asChild:c,...h}=o,p=c?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),w.jsx(p,{...h,ref:u})});return i.displayName=`Primitive.${t}`,{...e,[t]:i}},{}),fY="Label",jE=_.forwardRef((e,t)=>w.jsx(cY.label,{...e,ref:t,onMouseDown:r=>{r.target.closest("button, input, select, textarea")||(e.onMouseDown?.(r),!r.defaultPrevented&&r.detail>1&&r.preventDefault())}}));jE.displayName=fY;var dY=jE;function hY(e){const t=Ve.c(8);let r,i;t[0]!==e?({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i):(r=t[1],i=t[2]);let o;t[3]!==r?(o=rt("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",r),t[3]=r,t[4]=o):o=t[4];let u;return t[5]!==i||t[6]!==o?(u=w.jsx(dY,{"data-slot":"label",className:o,...i}),t[5]=i,t[6]=o,t[7]=u):u=t[7],u}const mY=V5,UE=_.createContext({}),gm=e=>{const t=Ve.c(9);let r;t[0]!==e?({...r}=e,t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r.name?(i={name:r.name},t[2]=r.name,t[3]=i):i=t[3];let o;t[4]!==r?(o=w.jsx(F5,{...r}),t[4]=r,t[5]=o):o=t[5];let u;return t[6]!==i||t[7]!==o?(u=w.jsx(UE.Provider,{value:i,children:o}),t[6]=i,t[7]=o,t[8]=u):u=t[8],u},vg=()=>{const e=Ve.c(13),t=_.useContext(UE),r=_.useContext(LE),{getFieldState:i}=_f();let o;e[0]!==t.name?(o={name:t.name},e[0]=t.name,e[1]=o):o=e[1];const u=fE(o);let c;e[2]!==t.name||e[3]!==u||e[4]!==i?(c=i(t.name,u),e[2]=t.name,e[3]=u,e[4]=i,e[5]=c):c=e[5];const h=c;if(!t)throw new Error("useFormField should be used within ");const{id:p}=r,m=`${p}-form-item`,y=`${p}-form-item-description`,g=`${p}-form-item-message`;let b;return e[6]!==t.name||e[7]!==h||e[8]!==p||e[9]!==m||e[10]!==y||e[11]!==g?(b={id:p,name:t.name,formItemId:m,formDescriptionId:y,formMessageId:g,...h},e[6]=t.name,e[7]=h,e[8]=p,e[9]=m,e[10]=y,e[11]=g,e[12]=b):b=e[12],b},LE=_.createContext({});function ym(e){const t=Ve.c(13);let r,i;t[0]!==e?({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i):(r=t[1],i=t[2]);const o=_.useId();let u;t[3]!==o?(u={id:o},t[3]=o,t[4]=u):u=t[4];let c;t[5]!==r?(c=rt("grid gap-2",r),t[5]=r,t[6]=c):c=t[6];let h;t[7]!==i||t[8]!==c?(h=w.jsx("div",{"data-slot":"form-item",className:c,...i}),t[7]=i,t[8]=c,t[9]=h):h=t[9];let p;return t[10]!==u||t[11]!==h?(p=w.jsx(LE.Provider,{value:u,children:h}),t[10]=u,t[11]=h,t[12]=p):p=t[12],p}function fc(e){const t=Ve.c(10);let r,i;t[0]!==e?({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i):(r=t[1],i=t[2]);const{error:o,formItemId:u}=vg(),c=!!o;let h;t[3]!==r?(h=rt("data-[error=true]:text-destructive",r),t[3]=r,t[4]=h):h=t[4];let p;return t[5]!==u||t[6]!==i||t[7]!==c||t[8]!==h?(p=w.jsx(hY,{"data-slot":"form-label","data-error":c,className:h,htmlFor:u,...i}),t[5]=u,t[6]=i,t[7]=c,t[8]=h,t[9]=p):p=t[9],p}function vm(e){const t=Ve.c(7);let r;t[0]!==e?({...r}=e,t[0]=e,t[1]=r):r=t[1];const{error:i,formItemId:o,formDescriptionId:u,formMessageId:c}=vg(),h=i?`${u} ${c}`:`${u}`,p=!!i;let m;return t[2]!==o||t[3]!==r||t[4]!==h||t[5]!==p?(m=w.jsx(zp,{"data-slot":"form-control",id:o,"aria-describedby":h,"aria-invalid":p,...r}),t[2]=o,t[3]=r,t[4]=h,t[5]=p,t[6]=m):m=t[6],m}function bm(e){const t=Ve.c(10);let r,i;t[0]!==e?({className:r,...i}=e,t[0]=e,t[1]=r,t[2]=i):(r=t[1],i=t[2]);const{error:o,formMessageId:u}=vg(),c=o?String(o?.message??""):i.children;if(!c)return null;let h;t[3]!==r?(h=rt("text-destructive text-sm",r),t[3]=r,t[4]=h):h=t[4];let p;return t[5]!==c||t[6]!==u||t[7]!==i||t[8]!==h?(p=w.jsx("p",{"data-slot":"form-message",id:u,className:h,...i,children:c}),t[5]=c,t[6]=u,t[7]=i,t[8]=h,t[9]=p):p=t[9],p}function _m(e){const t=Ve.c(10);let r,i,o;t[0]!==e?({className:r,type:o,...i}=e,t[0]=e,t[1]=r,t[2]=i,t[3]=o):(r=t[1],i=t[2],o=t[3]);let u;t[4]!==r?(u=rt("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",r),t[4]=r,t[5]=u):u=t[5];let c;return t[6]!==i||t[7]!==u||t[8]!==o?(c=w.jsx("input",{type:o,"data-slot":"input",className:u,...i}),t[6]=i,t[7]=u,t[8]=o,t[9]=c):c=t[9],c}const pY=B9({name:pm().min(1,"Tên là bắt buộc"),email:pm().email("Email không hợp lệ"),avatar:pm().optional()});function gY({user:e,onSave:t,children:r,trackingOpen:i}){const o=zk(),u=!!e,[c,h]=_.useState(!1),[p,m]=_.useState(!1),{captureRegisterImage:y,setCaptureRegisterImage:g}=ai(),b=aU({resolver:XL(pY),defaultValues:{name:"",email:"",avatar:""}});_.useEffect(()=>{e?b.reset({name:e.name,email:e.email,avatar:e.avatar??""}):b.reset({name:"",email:"",avatar:""})},[e,c,b]);const T=async()=>{await o({title:"Thông báo",message:"Bạn muốn hủy đăng ký. Mọi dữ liệu bạn nhập sẽ bị mất",confirmText:"Discard",cancelText:"Hủy",variant:"warning"})&&(h(!1),g(null))},x=async E=>{try{m(!0);const O={id:e?.id||Date.now().toString(),...E,avatar:E.avatar||null},{data:D}=await Qs.register({user:O,file:y});console.log({data:D}),t?.(O),h(!1),g(null),ma.success(D?.message||"Đăng ký thành công !")}catch(O){console.log({error:O}),ma.error(O?.message||"Internal Server Error")}finally{m(!1)}};return _.useEffect(()=>{i!==void 0&&h(i)},[i]),_.useEffect(()=>{if(y)return()=>{URL.revokeObjectURL(y)}},[y]),w.jsxs(Cp,{open:c,onOpenChange:E=>{if(!E){T();return}h(!0)},children:[w.jsx(nS,{children:r}),w.jsxs(Dp,{className:"sm:max-w-[425px]",children:[w.jsxs(Mp,{children:[w.jsx(Rp,{children:u?"Cập nhật thông tin":"Tạo người dùng mới"}),w.jsx(Np,{children:u?"Cập nhật thông tin người dùng của bạn":"Nhập thông tin để tạo người dùng mới"})]}),w.jsx(mY,{...b,children:w.jsxs("form",{onSubmit:b.handleSubmit(x),className:"space-y-4",children:[w.jsx(gm,{control:b.control,name:"name",render:({field:E})=>w.jsxs(ym,{children:[w.jsxs(fc,{children:["Tên ",w.jsx("span",{className:"text-red-600",children:"*"})]}),w.jsx(vm,{children:w.jsx(_m,{placeholder:"Nhập tên người dùng",...E})}),w.jsx(bm,{})]})}),w.jsx(gm,{control:b.control,name:"email",render:({field:E})=>w.jsxs(ym,{children:[w.jsxs(fc,{children:["Email ",w.jsx("span",{className:"text-red-600",children:"*"})]}),w.jsx(vm,{children:w.jsx(_m,{type:"email",placeholder:"Nhập email",...E})}),w.jsx(bm,{})]})}),w.jsx(gm,{control:b.control,name:"avatar",render:({field:E})=>w.jsxs(ym,{children:[w.jsx(fc,{children:"Avatar URL"}),w.jsx(vm,{children:w.jsx(_m,{placeholder:"https://example.com/avatar.jpg",...E})}),w.jsx(bm,{})]})}),w.jsx(fc,{children:"Ảnh từ camera"}),w.jsx("a",{target:"_blank",href:URL.createObjectURL(y),children:w.jsxs(hn,{size:"sm",variant:"outline",className:"w-full bg-transparent",type:"button",children:[w.jsx(ap,{className:"w-4 h-4 mr-2"}),"Xem ảnh"]})}),w.jsxs("div",{className:"flex justify-end gap-2 pt-4",children:[w.jsx(hn,{type:"button",variant:"outline",onClick:T,children:"Hủy"}),w.jsxs(hn,{type:"submit",children:[!p&&u?"Cập nhật":"Tạo mới",p&&w.jsx(mc,{className:"animate-spin"})]})]})]})})]})]})}function yY(){const e=Ve.c(9),{isAutoChecking:t,captureRegisterImage:r,isCountDown:i}=ai();let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=w.jsx(MC,{className:"mr-2 size-4"}),e[0]=o):o=e[0];let u;e[1]!==t?(u=w.jsx(L5,{children:w.jsxs(hn,{onClick:vY,disabled:t,className:"w-full bg-green-600 hover:bg-green-700 text-white font-semibold",children:[o,"Tạo User Checking"]})}),e[1]=t,e[2]=u):u=e[2];let c;e[3]!==r||e[4]!==i?(c=r&&!i&&w.jsx(gY,{trackingOpen:!0}),e[3]=r,e[4]=i,e[5]=c):c=e[5];let h;return e[6]!==u||e[7]!==c?(h=w.jsxs(w.Fragment,{children:[u,c]}),e[6]=u,e[7]=c,e[8]=h):h=e[8],h}function vY(){}function bY({type:e,str:t}){const r=t||(e==="check in"?"Check-in successful":e==="check out"?"Check-out successful":"");if(!r)return;const i=new SpeechSynthesisUtterance(r);i.lang="en-US",i.rate=1,i.pitch=1,i.volume=1,speechSynthesis.speak(i)}function _Y(){const e=_.useRef(null),{canvasRef:t,videoRef:r}=ai(),{currentUser:i,setCurrentUser:o}=sE(),{isAutoChecking:u,setIsAutoChecking:c,setRefreshLog:h}=ai(),p=_.useRef(null),[m,y]=_.useState(!1),[g,b]=_.useState(!1),T=()=>{u?(p.current&&(clearInterval(p.current),p.current=null),c(!1)):(p.current=setInterval(()=>{E()},3e3),c(!0))},x=async()=>{if(!i){ma.warning("Vui lòng chọn user để tạo checkpoint");return}try{b(!0);const O=await Rm(r,t),{data:D}=await Qs.register({user:i,file:O});if(!D){ma.error(D?.message||"Error In Checkpoint: "+JSON.stringify(D));return}ma.success(D?.message||"Tạo checkpoint thành công")}catch(O){const D=O;ma.error(D.response?.data?.message||"Error In Checkpoint: "+JSON.stringify(D))}finally{b(!1)}},E=_.useCallback(async()=>{try{y(!0);const O=await Rm(r,t),{data:D}=await Qs.checkin({file:O});if(!D||!D?.data){ma.error(D?.message||"Error In Checking: "+JSON.stringify(D));return}D?.checking&&(o(D?.data||null),e.current=setTimeout(()=>{o(null),e.current=null},2e3));const U=D?.message||`Checking thành công lúc: ${tS(new Date().toLocaleString())}`;if(ma.success(U),!D?.status)return;bY({type:D?.status}),h(!0)}catch(O){const D=O,U=D.response?.data?.message||"Error In Checking: "+JSON.stringify(D);if(U.includes("No face detected"))return;ma.error(U)}finally{y(!1)}},[t,o,r]);return _.useEffect(()=>()=>{e.current&&clearTimeout(e.current)},[]),_.useEffect(()=>{const O=D=>{if(D.code==="Space"){if(D.preventDefault(),!m)return;E()}};return window.addEventListener("keydown",O),()=>{window.removeEventListener("keydown",O)}},[E,m]),w.jsxs("div",{className:"absolute bottom-10 px-4 right-0 left-0 grid grid-cols-3 gap-4",children:[w.jsxs(hn,{onClick:E,disabled:u,className:"w-full bg-blue-600 hover:bg-blue-700 text-white font-semibold",children:[!m&&w.jsxs(w.Fragment,{children:[w.jsx(ap,{className:"mr-2 size-4"}),"Điểm Danh Ngay"]}),m&&w.jsx(mc,{className:"size-4 animate-spin"})]}),w.jsxs(hn,{onClick:T,variant:u?"destructive":"outline",className:rt("w-full font-semibold",u&&"animate-pulse"),children:[!m&&u?w.jsxs(w.Fragment,{children:[w.jsx(xC,{className:"mr-2 size-4"}),"Dừng Tự Động"]}):w.jsxs(w.Fragment,{children:[w.jsx(bC,{className:"mr-2 size-4"}),"Tự Động Điểm Danh"]}),m&&w.jsx(mc,{className:"size-4 animate-spin"})]}),i&&w.jsxs(hn,{disabled:u,onClick:x,className:rt("w-full font-semibold"),children:[!g&&w.jsxs(w.Fragment,{children:[w.jsx(fC,{}),"Tạo Check Point"]}),g&&w.jsx(mc,{className:"size-4 animate-spin"})]}),!i&&w.jsx(yY,{})]})}function wY(){const[e,t]=_.useState(!0),[r,i]=_.useState(!1),{setCanvasRef:o,setVideoRef:u}=ai(),{isCountDown:c,setCaptureRegisterImage:h,setIsCountDown:p}=ai(),m=_.useRef(null),y=_.useRef(null),g=async()=>{try{const{data:b}=await dz.timekeepings(),x=(b?.data||[]).map(E=>({name:E?.user?.name,email:E?.user?.email,avatar:E?.user?.avatar}));await Promise.all(x.map(E=>Qs.registerSimple({user:E}))),console.log("Sync hoàn tất!")}catch(b){console.log("Sync error:",b)}};return _.useEffect(()=>((async()=>{try{const T=await navigator.mediaDevices.getUserMedia({video:{width:1280,height:720,facingMode:"user"}});m.current&&(m.current.srcObject=T)}catch(T){console.error("Không thể truy cập camera:",T)}})(),()=>{m.current?.srcObject&&(m.current?.srcObject).getTracks().forEach(x=>x.stop())}),[]),_.useEffect(()=>{g()},[]),_.useEffect(()=>{o(y),u(m)},[m,y]),w.jsx("div",{className:"min-h-screen bg-white",children:w.jsxs("div",{className:"flex h-screen",children:[w.jsx(i5,{isSidebarOpen:r}),w.jsx("div",{className:rt("flex-1 transition-all duration-300 ease-in-out",r&&"ml-96",e&&"mr-96"),children:w.jsx("div",{className:"h-full flex flex-col p-6",children:w.jsxs(MS,{className:"flex-1 overflow-hidden bg-black relative group",children:[w.jsx("video",{ref:m,autoPlay:!0,playsInline:!0,className:"w-full h-full object-cover"}),w.jsx("div",{className:"absolute inset-0 border-4 border-blue-500/30 pointer-events-none"}),c&&w.jsx(gz,{onCountdowned:async()=>{const b=await Rm(m,y);h(b),p(!1)}}),w.jsx(hn,{onClick:()=>i(!r),variant:"outline",size:"icon",className:"absolute top-1/2 -translate-y-1/2 left-4 bg-white/90 hover:bg-white shadow-lg",children:r?w.jsx(Ub,{className:"size-4"}):w.jsx(Lb,{className:"size-4"})}),w.jsx(hn,{onClick:()=>t(!e),variant:"outline",size:"icon",className:"absolute top-1/2 -translate-y-1/2 right-4 bg-white/90 hover:bg-white shadow-lg",children:e?w.jsx(Lb,{className:"size-4"}):w.jsx(Ub,{className:"size-4"})}),w.jsx(_Y,{})]})})}),w.jsx(u5,{isSidebarOpen:e}),w.jsx("canvas",{ref:y,className:"hidden"})]})})}var SY=(e,t,r,i,o,u,c,h)=>{let p=document.documentElement,m=["light","dark"];function y(T){(Array.isArray(e)?e:[e]).forEach(x=>{let E=x==="class",O=E&&u?o.map(D=>u[D]||D):o;E?(p.classList.remove(...O),p.classList.add(u&&u[T]?u[T]:T)):p.setAttribute(x,T)}),g(T)}function g(T){h&&m.includes(T)&&(p.style.colorScheme=T)}function b(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(i)y(i);else try{let T=localStorage.getItem(t)||r,x=c&&T==="system"?b():T;y(x)}catch{}},xY=_.createContext(void 0),EY={setTheme:e=>{},themes:[]},TY=()=>{var e;return(e=_.useContext(xY))!=null?e:EY};_.memo(({forcedTheme:e,storageKey:t,attribute:r,enableSystem:i,enableColorScheme:o,defaultTheme:u,value:c,themes:h,nonce:p,scriptProps:m})=>{let y=JSON.stringify([r,t,u,e,h,c,i,o]).slice(1,-1);return _.createElement("script",{...m,suppressHydrationWarning:!0,nonce:typeof window>"u"?p:"",dangerouslySetInnerHTML:{__html:`(${SY.toString()})(${y})`}})});const OY=e=>{const t=Ve.c(7);let r;t[0]!==e?({...r}=e,t[0]=e,t[1]=r):r=t[1];const{theme:i}=TY(),u=i===void 0?"system":i;let c,h;t[2]===Symbol.for("react.memo_cache_sentinel")?(c={success:w.jsx(sC,{className:"size-4"}),info:w.jsx(q_,{className:"size-4"}),warning:w.jsx(I_,{className:"size-4"}),error:w.jsx(yC,{className:"size-4"}),loading:w.jsx(mC,{className:"size-4 animate-spin"})},h={"--normal-bg":"var(--popover)","--normal-text":"var(--popover-foreground)","--normal-border":"var(--border)","--border-radius":"var(--radius)"},t[2]=c,t[3]=h):(c=t[2],h=t[3]);let p;return t[4]!==r||t[5]!==u?(p=w.jsx(U5,{theme:u,className:"toaster group",icons:c,style:h,...r}),t[4]=r,t[5]=u,t[6]=p):p=t[6],p};iO.createRoot(document.getElementById("root")).render(w.jsx(_.StrictMode,{children:w.jsxs(kk,{children:[w.jsx(wY,{}),w.jsx(OY,{richColors:!0,position:"top-right"})]})}))});export default AY(); diff --git a/TrackingToolWeb/static/index.html b/TrackingToolWeb/static/index.html index 9dc0a1b..8c51c0a 100644 --- a/TrackingToolWeb/static/index.html +++ b/TrackingToolWeb/static/index.html @@ -8,7 +8,7 @@