@camstack/addon-admin-ui 0.1.39 → 0.1.46

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-Cv6qLu_-.js → __mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs-CRKSbdgN.js} +1 -1
  2. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-CChEG9e0.js → __mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-BGPfTw3V.js} +1 -1
  3. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-C1BmHlGM.js → __mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs-jPpiOa0I.js} +1 -1
  4. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-Bxv_3KWz.js → __mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-DYNYuSL7.js} +1 -1
  5. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-DC63qZbr.js → __mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs-ij0ODm-n.js} +1 -1
  6. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-D2C49VyZ.js → __mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-C4Ko8zXp.js} +1 -1
  7. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-D3WbXy3O.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs-Cf5gSqc_.js} +1 -1
  8. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-Csg6EbPB.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-CYaX3FDr.js} +1 -1
  9. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-CUc0oFNo.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs-rHwdrynu.js} +1 -1
  10. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-vh0hhA5d.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-DRDS6j-Y.js} +1 -1
  11. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs-CpGtTxci.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs-cUuqcEcL.js} +2 -2
  12. package/dist/assets/{__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs_commonjs-proxy-RUDPE9aM.js → __mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs_commonjs-proxy-CzMP41OH.js} +1 -1
  13. package/dist/assets/{_virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-TUicghXo.js → _virtual_mf-localSharedImportMap___mfe_internal__admin_ui_host-DNAkeUTZ.js} +1 -1
  14. package/dist/assets/{devices-GLp7me2a.js → devices-DaqavVOg.js} +1 -1
  15. package/dist/assets/{hostInit-94fVe_XD.js → hostInit-ByQycOVJ.js} +1 -1
  16. package/dist/assets/index-B6kubsZI.js +151 -0
  17. package/dist/assets/index-BI1a6Whs.js +1 -0
  18. package/dist/assets/index-BVNg3Krt.js +1185 -0
  19. package/dist/assets/{index-TiJwCuZx.js → index-BbwPCEeT.js} +1 -1
  20. package/dist/assets/{index-D6khiudP.js → index-BpC2rqYA.js} +1 -1
  21. package/dist/assets/index-CukoHCyD.js +1 -0
  22. package/dist/assets/{index-JJ5NLHxC.js → index-Cyva9RmE.js} +1 -1
  23. package/dist/assets/index-DLnW8nGB.css +1 -0
  24. package/dist/assets/index-DNydUTOB.js +1 -0
  25. package/dist/assets/{index-CwF7Dxf8.js → index-DVLRgczW.js} +1 -1
  26. package/dist/assets/index-PXbclFuZ.js +87 -0
  27. package/dist/assets/index-QqQmcu5i.js +1 -0
  28. package/dist/assets/method-access-map-DjDdPRYC.js +1 -0
  29. package/dist/assets/{remoteEntry-JLETvOnh.js → remoteEntry-iRKuVHUX.js} +1 -1
  30. package/dist/assets/{schemas-BEt-CulV.js → schemas-BdJePqbR.js} +5 -5
  31. package/dist/assets/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-DM77_4pA.js → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__admin_ui_host__remoteEntry-_hash_-QVZxTxLo.js} +2 -2
  32. package/dist/index.html +152 -9
  33. package/dist/mf-entry-bootstrap-0.js +2 -2
  34. package/dist/server/addon.js +435 -52
  35. package/dist/server/addon.js.map +1 -1
  36. package/dist/sw.js +1 -1
  37. package/package.json +1 -1
  38. package/dist/assets/index-BM6aK9lG.js +0 -1150
  39. package/dist/assets/index-ByRJWRUP.js +0 -1
  40. package/dist/assets/index-COoei6lw.css +0 -1
  41. package/dist/assets/index-CtHpLu0L.js +0 -1
  42. package/dist/assets/index-DNY_otk4.js +0 -151
  43. package/dist/assets/index-DQFO9ZU6.js +0 -1
  44. package/dist/assets/index-WrAHDGEr.js +0 -87
  45. package/dist/assets/index-b0D9qthW.js +0 -1
  46. package/dist/assets/method-access-map-DLEhlu0x.js +0 -1
  47. package/dist/registerSW.js +0 -1
@@ -1,151 +0,0 @@
1
- import{b as CO,g as OO}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs-C_6K4VBY.js";import{r as wm}from"./__mfe_internal__admin_ui_host__loadShare__react__loadShare__.mjs_commonjs-proxy-D2C49VyZ.js";import{r as Sm}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.mjs_commonjs-proxy-DrLZNXOX.js";import{r as IO}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom__loadShare__.mjs_commonjs-proxy-Csg6EbPB.js";import{r as EO}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_2_dom_mf_1_client__loadShare__.mjs_commonjs-proxy-vh0hhA5d.js";import{r as MO}from"./__mfe_internal__admin_ui_host__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-CChEG9e0.js";import{r as DO}from"./__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_client__loadShare__.mjs_commonjs-proxy-WD2WouMQ.js";import{r as AO}from"./__mfe_internal__admin_ui_host__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.mjs_commonjs-proxy-Bxv_3KWz.js";import{r as zO}from"./__mfe_internal__admin_ui_host__loadShare__react_mf_2_konva__loadShare__.mjs_commonjs-proxy-RUDPE9aM.js";import{r as TO}from"./__mfe_internal__admin_ui_host__loadShare__konva__loadShare__.mjs_commonjs-proxy-Bqeq2Zwj.js";import{r as RO}from"./index-D6khiudP.js";import{s as ZO}from"./index-JJ5NLHxC.js";function LO(t,m){for(var N=0;N<m.length;N++){const I=m[N];if(typeof I!="string"&&!Array.isArray(I)){for(const _ in I)if(_!=="default"&&!(_ in t)){const S=Object.getOwnPropertyDescriptor(I,_);S&&Object.defineProperty(t,_,S.get?S:{enumerable:!0,get:()=>I[_]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}var Ul={},Bl={},mm;function UO(){return mm||(mm=1,(function(t){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Gm();let m=wm,N=Sm;var I={frigate:"#3b82f6",scrypted:"#a855f7",reolink:"#06b6d4",homeAssistant:"#22d3ee",rtsp:"#78716c"},_={primary:"#f59e42",primaryForeground:"#0c0a09",background:"#0c0a09",backgroundElevated:"#1c1917",surface:"#1c1917",surfaceHover:"#292524",border:"#292524",borderSubtle:"#1c1917",foreground:"#fafaf9",foregroundMuted:"#a8a29e",foregroundSubtle:"#78716c",foregroundDisabled:"#57534e",success:"#4ade80",warning:"#fbbf24",danger:"#f87171",info:"#60a5fa",provider:I},S={primary:"#e67e22",primaryForeground:"#ffffff",background:"#fafaf9",backgroundElevated:"#ffffff",surface:"#f5f5f4",surfaceHover:"#e7e5e4",border:"#d6d3d1",borderSubtle:"#e7e5e4",foreground:"#1c1917",foregroundMuted:"#57534e",foregroundSubtle:"#78716c",foregroundDisabled:"#a8a29e",success:"#16a34a",warning:"#d97706",danger:"#dc2626",info:"#2563eb",provider:I},z={colors:{dark:_,light:S},spacing:{xs:2,sm:4,md:8,lg:12,xl:16,"2xl":24,"3xl":32},radius:{sm:4,md:6,lg:8,xl:12},typography:{fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif',sizes:{xs:{fontSize:10,lineHeight:14},sm:{fontSize:11,lineHeight:16},base:{fontSize:12,lineHeight:18},lg:{fontSize:13,lineHeight:18},xl:{fontSize:14,lineHeight:20},"2xl":{fontSize:16,lineHeight:22},"3xl":{fontSize:20,lineHeight:28}},weights:{regular:400,medium:500,semibold:600,bold:700}},table:{rowHeight:28,headerHeight:24,cellPaddingX:8,cellPaddingY:6},sidebar:{width:176,itemHeight:28,iconSize:14}};function U(ye,ze){const Me={...ye};for(const Ye in ze){const vt=ze[Ye],Nt=ye[Ye];vt!==void 0&&typeof vt=="object"&&vt!==null&&!Array.isArray(vt)&&typeof Nt=="object"&&Nt!==null?Me[Ye]=U(Nt,vt):vt!==void 0&&(Me[Ye]=vt)}return Me}function c(ye){return ye?U(structuredClone(z),ye):structuredClone(z)}function s(ye){return ye.replace(/[A-Z]/g,ze=>`-${ze.toLowerCase()}`)}function u(ye){return`--color-${s(ye)}`}function p(ye){const ze=[];for(const[Me,Ye]of Object.entries(ye))Me!=="provider"&&ze.push(` ${u(Me)}: ${Ye};`);return ze.join(`
2
- `)}function n(ye){const ze=[];for(const[Me,Ye]of Object.entries(ye))ze.push(` --color-provider-${s(Me)}: ${Ye};`);return ze.join(`
3
- `)}function r(ye){const ze=[];for(const[Me,Ye]of Object.entries(ye))ze.push(` --spacing-${Me}: ${Ye}px;`);return ze.join(`
4
- `)}function x(ye){const ze=[];for(const[Me,Ye]of Object.entries(ye))ze.push(` --radius-${Me}: ${Ye}px;`);return ze.join(`
5
- `)}function D(ye){const ze=p(ye.colors.dark),Me=p(ye.colors.light);return`@theme {
6
- ${n(ye.colors.dark.provider)}
7
- ${r(ye.spacing)}
8
- ${x(ye.radius)}
9
- }
10
-
11
- .dark {
12
- ${ze}
13
- }
14
-
15
- .light {
16
- ${Me}
17
- }
18
-
19
- @media (prefers-color-scheme: dark) {
20
- :root {
21
- ${ze.replace(/^ {2}/gm," ")}
22
- }
23
- }
24
-
25
- @media (prefers-color-scheme: light) {
26
- :root {
27
- ${Me.replace(/^ {2}/gm," ")}
28
- }
29
- }
30
- `}var ee=(0,m.createContext)(null),Y=["dark","light","system"];function ne(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function ue(ye,ze){if(typeof window>"u")return ze;const Me=localStorage.getItem(ye);return Me==="dark"||Me==="light"||Me==="system"?Me:ze}function ge(ye){return ye==="system"?ne():ye}function ie({children:ye,defaultMode:ze="system",storageKey:Me="camstack-theme-mode"}){const[Ye,vt]=(0,m.useState)(()=>ue(Me,ze)),[Nt,Mt]=(0,m.useState)(()=>ge(Ye)),Dt=(0,m.useCallback)(xt=>{vt(xt),Mt(ge(xt)),typeof window<"u"&&localStorage.setItem(Me,xt)},[Me]),zt=(0,m.useCallback)(()=>{Dt(Y[(Y.indexOf(Ye)+1)%Y.length]??"dark")},[Ye,Dt]);(0,m.useEffect)(()=>{if(typeof document>"u")return;const xt=document.documentElement;xt.classList.remove("dark","light"),xt.classList.add(Nt)},[Ye,Nt]),(0,m.useEffect)(()=>{if(typeof window>"u"||Ye!=="system")return;const xt=window.matchMedia("(prefers-color-scheme: dark)"),Ut=()=>{Mt(ne())};return xt.addEventListener("change",Ut),()=>xt.removeEventListener("change",Ut)},[Ye]);const Zt=(0,m.useMemo)(()=>({mode:Ye,resolvedMode:Nt,setMode:Dt,toggleMode:zt}),[Ye,Nt,Dt,zt]);return(0,N.jsx)(ee.Provider,{value:Zt,children:ye})}function be(){const ye=(0,m.useContext)(ee);if(!ye)throw new Error("useThemeMode must be used within a ThemeProvider");return ye}t.ThemeProvider=ie,t.ThemeProvider$1=ie,t.createTheme=c,t.createTheme$1=c,t.darkColors=_,t.darkColors$1=_,t.defaultTheme=z,t.defaultTheme$1=z,t.lightColors=S,t.lightColors$1=S,t.themeToCss=D,t.themeToCss$1=D,t.useThemeMode=be,t.useThemeMode$1=be})(Bl)),Bl}const BO=CO(ZO);var hr={},Ht={},Pt={},Yr={};(function(t){var m;Object.defineProperty(t,"__esModule",{value:!0}),t.globalConfig=t.$ZodEncodeError=t.$ZodAsyncError=t.$brand=t.NEVER=void 0,t.$constructor=N,t.config=S,t.NEVER=Object.freeze({status:"aborted"});function N(z,U,c){function s(r,x){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:x,constr:n,traits:new Set},enumerable:!1}),r._zod.traits.has(z))return;r._zod.traits.add(z),U(r,x);const D=n.prototype,ee=Object.keys(D);for(let Y=0;Y<ee.length;Y++){const ne=ee[Y];ne in r||(r[ne]=D[ne].bind(r))}}const u=c?.Parent??Object;class p extends u{}Object.defineProperty(p,"name",{value:z});function n(r){var x;const D=c?.Parent?new p:this;s(D,r),(x=D._zod).deferred??(x.deferred=[]);for(const ee of D._zod.deferred)ee();return D}return Object.defineProperty(n,"init",{value:s}),Object.defineProperty(n,Symbol.hasInstance,{value:r=>c?.Parent&&r instanceof c.Parent?!0:r?._zod?.traits?.has(z)}),Object.defineProperty(n,"name",{value:z}),n}t.$brand=Symbol("zod_brand");class I extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}t.$ZodAsyncError=I;class _ extends Error{constructor(U){super(`Encountered unidirectional transform during encode: ${U}`),this.name="ZodEncodeError"}}t.$ZodEncodeError=_,(m=globalThis).__zod_globalConfig??(m.__zod_globalConfig={}),t.globalConfig=globalThis.__zod_globalConfig;function S(z){return z&&Object.assign(t.globalConfig,z),t.globalConfig}})(Yr);var Pr={},Et={},oe={};Object.defineProperty(oe,"__esModule",{value:!0});oe.Class=oe.BIGINT_FORMAT_RANGES=oe.NUMBER_FORMAT_RANGES=oe.primitiveTypes=oe.propertyKeyTypes=oe.getParsedType=oe.allowsEval=oe.captureStackTrace=void 0;oe.assertEqual=GO;oe.assertNotEqual=VO;oe.assertIs=QO;oe.assertNever=WO;oe.assert=qO;oe.getEnumValues=HO;oe.joinValues=JO;oe.jsonStringifyReplacer=KO;oe.cached=jm;oe.nullish=XO;oe.cleanRegex=YO;oe.floatSafeRemainder=eI;oe.defineLazy=tI;oe.objectClone=rI;oe.assignProp=Zr;oe.mergeDefs=Or;oe.cloneDef=nI;oe.getElementAtPath=iI;oe.promiseAllObject=aI;oe.randomString=oI;oe.esc=sI;oe.slugify=lI;oe.isObject=Fl;oe.isPlainObject=Ho;oe.shallowClone=cI;oe.numKeys=uI;oe.escapeRegex=fI;oe.clone=Lr;oe.normalizeParams=mI;oe.createTransparentProxy=gI;oe.stringifyPrimitive=$m;oe.optionalKeys=pI;oe.pick=hI;oe.omit=vI;oe.extend=bI;oe.safeExtend=yI;oe.merge=xI;oe.partial=_I;oe.required=wI;oe.aborted=SI;oe.explicitlyAborted=jI;oe.prefixIssues=$I;oe.unwrapMessage=Hi;oe.finalizeIssue=kI;oe.getSizableOrigin=PI;oe.getLengthableOrigin=NI;oe.parsedType=CI;oe.issue=OI;oe.cleanEnum=II;oe.base64ToUint8Array=km;oe.uint8ArrayToBase64=Pm;oe.base64urlToUint8Array=EI;oe.uint8ArrayToBase64url=MI;oe.hexToUint8Array=DI;oe.uint8ArrayToHex=AI;const FO=Yr;function GO(t){return t}function VO(t){return t}function QO(t){}function WO(t){throw new Error("Unexpected value in exhaustive check")}function qO(t){}function HO(t){const m=Object.values(t).filter(I=>typeof I=="number");return Object.entries(t).filter(([I,_])=>m.indexOf(+I)===-1).map(([I,_])=>_)}function JO(t,m="|"){return t.map(N=>$m(N)).join(m)}function KO(t,m){return typeof m=="bigint"?m.toString():m}function jm(t){return{get value(){{const m=t();return Object.defineProperty(this,"value",{value:m}),m}}}}function XO(t){return t==null}function YO(t){const m=t.startsWith("^")?1:0,N=t.endsWith("$")?t.length-1:t.length;return t.slice(m,N)}function eI(t,m){const N=t/m,I=Math.round(N),_=Number.EPSILON*Math.max(Math.abs(N),1);return Math.abs(N-I)<_?0:N-I}const gm=Symbol("evaluating");function tI(t,m,N){let I;Object.defineProperty(t,m,{get(){if(I!==gm)return I===void 0&&(I=gm,I=N()),I},set(_){Object.defineProperty(t,m,{value:_})},configurable:!0})}function rI(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function Zr(t,m,N){Object.defineProperty(t,m,{value:N,writable:!0,enumerable:!0,configurable:!0})}function Or(...t){const m={};for(const N of t){const I=Object.getOwnPropertyDescriptors(N);Object.assign(m,I)}return Object.defineProperties({},m)}function nI(t){return Or(t._zod.def)}function iI(t,m){return m?m.reduce((N,I)=>N?.[I],t):t}function aI(t){const m=Object.keys(t),N=m.map(I=>t[I]);return Promise.all(N).then(I=>{const _={};for(let S=0;S<m.length;S++)_[m[S]]=I[S];return _})}function oI(t=10){const m="abcdefghijklmnopqrstuvwxyz";let N="";for(let I=0;I<t;I++)N+=m[Math.floor(Math.random()*m.length)];return N}function sI(t){return JSON.stringify(t)}function lI(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}oe.captureStackTrace="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function Fl(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}oe.allowsEval=jm(()=>{if(FO.globalConfig.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Ho(t){if(Fl(t)===!1)return!1;const m=t.constructor;if(m===void 0||typeof m!="function")return!0;const N=m.prototype;return!(Fl(N)===!1||Object.prototype.hasOwnProperty.call(N,"isPrototypeOf")===!1)}function cI(t){return Ho(t)?{...t}:Array.isArray(t)?[...t]:t instanceof Map?new Map(t):t instanceof Set?new Set(t):t}function uI(t){let m=0;for(const N in t)Object.prototype.hasOwnProperty.call(t,N)&&m++;return m}const dI=t=>{const m=typeof t;switch(m){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${m}`)}};oe.getParsedType=dI;oe.propertyKeyTypes=new Set(["string","number","symbol"]);oe.primitiveTypes=new Set(["string","number","bigint","boolean","symbol","undefined"]);function fI(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Lr(t,m,N){const I=new t._zod.constr(m??t._zod.def);return(!m||N?.parent)&&(I._zod.parent=t),I}function mI(t){const m=t;if(!m)return{};if(typeof m=="string")return{error:()=>m};if(m?.message!==void 0){if(m?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");m.error=m.message}return delete m.message,typeof m.error=="string"?{...m,error:()=>m.error}:m}function gI(t){let m;return new Proxy({},{get(N,I,_){return m??(m=t()),Reflect.get(m,I,_)},set(N,I,_,S){return m??(m=t()),Reflect.set(m,I,_,S)},has(N,I){return m??(m=t()),Reflect.has(m,I)},deleteProperty(N,I){return m??(m=t()),Reflect.deleteProperty(m,I)},ownKeys(N){return m??(m=t()),Reflect.ownKeys(m)},getOwnPropertyDescriptor(N,I){return m??(m=t()),Reflect.getOwnPropertyDescriptor(m,I)},defineProperty(N,I,_){return m??(m=t()),Reflect.defineProperty(m,I,_)}})}function $m(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function pI(t){return Object.keys(t).filter(m=>t[m]._zod.optin==="optional"&&t[m]._zod.optout==="optional")}oe.NUMBER_FORMAT_RANGES={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};oe.BIGINT_FORMAT_RANGES={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function hI(t,m){const N=t._zod.def,I=N.checks;if(I&&I.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const S=Or(t._zod.def,{get shape(){const z={};for(const U in m){if(!(U in N.shape))throw new Error(`Unrecognized key: "${U}"`);m[U]&&(z[U]=N.shape[U])}return Zr(this,"shape",z),z},checks:[]});return Lr(t,S)}function vI(t,m){const N=t._zod.def,I=N.checks;if(I&&I.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const S=Or(t._zod.def,{get shape(){const z={...t._zod.def.shape};for(const U in m){if(!(U in N.shape))throw new Error(`Unrecognized key: "${U}"`);m[U]&&delete z[U]}return Zr(this,"shape",z),z},checks:[]});return Lr(t,S)}function bI(t,m){if(!Ho(m))throw new Error("Invalid input to extend: expected a plain object");const N=t._zod.def.checks;if(N&&N.length>0){const S=t._zod.def.shape;for(const z in m)if(Object.getOwnPropertyDescriptor(S,z)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const _=Or(t._zod.def,{get shape(){const S={...t._zod.def.shape,...m};return Zr(this,"shape",S),S}});return Lr(t,_)}function yI(t,m){if(!Ho(m))throw new Error("Invalid input to safeExtend: expected a plain object");const N=Or(t._zod.def,{get shape(){const I={...t._zod.def.shape,...m};return Zr(this,"shape",I),I}});return Lr(t,N)}function xI(t,m){if(t._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const N=Or(t._zod.def,{get shape(){const I={...t._zod.def.shape,...m._zod.def.shape};return Zr(this,"shape",I),I},get catchall(){return m._zod.def.catchall},checks:m._zod.def.checks??[]});return Lr(t,N)}function _I(t,m,N){const _=m._zod.def.checks;if(_&&_.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const z=Or(m._zod.def,{get shape(){const U=m._zod.def.shape,c={...U};if(N)for(const s in N){if(!(s in U))throw new Error(`Unrecognized key: "${s}"`);N[s]&&(c[s]=t?new t({type:"optional",innerType:U[s]}):U[s])}else for(const s in U)c[s]=t?new t({type:"optional",innerType:U[s]}):U[s];return Zr(this,"shape",c),c},checks:[]});return Lr(m,z)}function wI(t,m,N){const I=Or(m._zod.def,{get shape(){const _=m._zod.def.shape,S={..._};if(N)for(const z in N){if(!(z in S))throw new Error(`Unrecognized key: "${z}"`);N[z]&&(S[z]=new t({type:"nonoptional",innerType:_[z]}))}else for(const z in _)S[z]=new t({type:"nonoptional",innerType:_[z]});return Zr(this,"shape",S),S}});return Lr(m,I)}function SI(t,m=0){if(t.aborted===!0)return!0;for(let N=m;N<t.issues.length;N++)if(t.issues[N]?.continue!==!0)return!0;return!1}function jI(t,m=0){if(t.aborted===!0)return!0;for(let N=m;N<t.issues.length;N++)if(t.issues[N]?.continue===!1)return!0;return!1}function $I(t,m){return m.map(N=>{var I;return(I=N).path??(I.path=[]),N.path.unshift(t),N})}function Hi(t){return typeof t=="string"?t:t?.message}function kI(t,m,N){const I=t.message?t.message:Hi(t.inst?._zod.def?.error?.(t))??Hi(m?.error?.(t))??Hi(N.customError?.(t))??Hi(N.localeError?.(t))??"Invalid input",{inst:_,continue:S,input:z,...U}=t;return U.path??(U.path=[]),U.message=I,m?.reportInput&&(U.input=z),U}function PI(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function NI(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function CI(t){const m=typeof t;switch(m){case"number":return Number.isNaN(t)?"nan":"number";case"object":{if(t===null)return"null";if(Array.isArray(t))return"array";const N=t;if(N&&Object.getPrototypeOf(N)!==Object.prototype&&"constructor"in N&&N.constructor)return N.constructor.name}}return m}function OI(...t){const[m,N,I]=t;return typeof m=="string"?{message:m,code:"custom",input:N,inst:I}:{...m}}function II(t){return Object.entries(t).filter(([m,N])=>Number.isNaN(Number.parseInt(m,10))).map(m=>m[1])}function km(t){const m=atob(t),N=new Uint8Array(m.length);for(let I=0;I<m.length;I++)N[I]=m.charCodeAt(I);return N}function Pm(t){let m="";for(let N=0;N<t.length;N++)m+=String.fromCharCode(t[N]);return btoa(m)}function EI(t){const m=t.replace(/-/g,"+").replace(/_/g,"/"),N="=".repeat((4-m.length%4)%4);return km(m+N)}function MI(t){return Pm(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function DI(t){const m=t.replace(/^0x/,"");if(m.length%2!==0)throw new Error("Invalid hex string length");const N=new Uint8Array(m.length/2);for(let I=0;I<m.length;I+=2)N[I/2]=Number.parseInt(m.slice(I,I+2),16);return N}function AI(t){return Array.from(t).map(m=>m.toString(16).padStart(2,"0")).join("")}class zI{constructor(...m){}}oe.Class=zI;var TI=Et&&Et.__createBinding||(Object.create?(function(t,m,N,I){I===void 0&&(I=N);var _=Object.getOwnPropertyDescriptor(m,N);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[N]}}),Object.defineProperty(t,I,_)}):(function(t,m,N,I){I===void 0&&(I=N),t[I]=m[N]})),RI=Et&&Et.__setModuleDefault||(Object.create?(function(t,m){Object.defineProperty(t,"default",{enumerable:!0,value:m})}):function(t,m){t.default=m}),ZI=Et&&Et.__importStar||function(t){if(t&&t.__esModule)return t;var m={};if(t!=null)for(var N in t)N!=="default"&&Object.prototype.hasOwnProperty.call(t,N)&&TI(m,t,N);return RI(m,t),m};Object.defineProperty(Et,"__esModule",{value:!0});Et.$ZodRealError=Et.$ZodError=void 0;Et.flattenError=UI;Et.formatError=BI;Et.treeifyError=FI;Et.toDotPath=Om;Et.prettifyError=GI;const Nm=Yr,LI=ZI(oe),Cm=(t,m)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:m,enumerable:!1}),t.message=JSON.stringify(m,LI.jsonStringifyReplacer,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})};Et.$ZodError=(0,Nm.$constructor)("$ZodError",Cm);Et.$ZodRealError=(0,Nm.$constructor)("$ZodError",Cm,{Parent:Error});function UI(t,m=N=>N.message){const N={},I=[];for(const _ of t.issues)_.path.length>0?(N[_.path[0]]=N[_.path[0]]||[],N[_.path[0]].push(m(_))):I.push(m(_));return{formErrors:I,fieldErrors:N}}function BI(t,m=N=>N.message){const N={_errors:[]},I=(_,S=[])=>{for(const z of _.issues)if(z.code==="invalid_union"&&z.errors.length)z.errors.map(U=>I({issues:U},[...S,...z.path]));else if(z.code==="invalid_key")I({issues:z.issues},[...S,...z.path]);else if(z.code==="invalid_element")I({issues:z.issues},[...S,...z.path]);else{const U=[...S,...z.path];if(U.length===0)N._errors.push(m(z));else{let c=N,s=0;for(;s<U.length;){const u=U[s];s===U.length-1?(c[u]=c[u]||{_errors:[]},c[u]._errors.push(m(z))):c[u]=c[u]||{_errors:[]},c=c[u],s++}}}};return I(t),N}function FI(t,m=N=>N.message){const N={errors:[]},I=(_,S=[])=>{var z,U;for(const c of _.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map(s=>I({issues:s},[...S,...c.path]));else if(c.code==="invalid_key")I({issues:c.issues},[...S,...c.path]);else if(c.code==="invalid_element")I({issues:c.issues},[...S,...c.path]);else{const s=[...S,...c.path];if(s.length===0){N.errors.push(m(c));continue}let u=N,p=0;for(;p<s.length;){const n=s[p],r=p===s.length-1;typeof n=="string"?(u.properties??(u.properties={}),(z=u.properties)[n]??(z[n]={errors:[]}),u=u.properties[n]):(u.items??(u.items=[]),(U=u.items)[n]??(U[n]={errors:[]}),u=u.items[n]),r&&u.errors.push(m(c)),p++}}};return I(t),N}function Om(t){const m=[],N=t.map(I=>typeof I=="object"?I.key:I);for(const I of N)typeof I=="number"?m.push(`[${I}]`):typeof I=="symbol"?m.push(`[${JSON.stringify(String(I))}]`):/[^\w$]/.test(I)?m.push(`[${JSON.stringify(I)}]`):(m.length&&m.push("."),m.push(I));return m.join("")}function GI(t){const m=[],N=[...t.issues].sort((I,_)=>(I.path??[]).length-(_.path??[]).length);for(const I of N)m.push(`✖ ${I.message}`),I.path?.length&&m.push(` → at ${Om(I.path)}`);return m.join(`
31
- `)}(function(t){var m=Pr&&Pr.__createBinding||(Object.create?(function(ue,ge,ie,be){be===void 0&&(be=ie);var ye=Object.getOwnPropertyDescriptor(ge,ie);(!ye||("get"in ye?!ge.__esModule:ye.writable||ye.configurable))&&(ye={enumerable:!0,get:function(){return ge[ie]}}),Object.defineProperty(ue,be,ye)}):(function(ue,ge,ie,be){be===void 0&&(be=ie),ue[be]=ge[ie]})),N=Pr&&Pr.__setModuleDefault||(Object.create?(function(ue,ge){Object.defineProperty(ue,"default",{enumerable:!0,value:ge})}):function(ue,ge){ue.default=ge}),I=Pr&&Pr.__importStar||function(ue){if(ue&&ue.__esModule)return ue;var ge={};if(ue!=null)for(var ie in ue)ie!=="default"&&Object.prototype.hasOwnProperty.call(ue,ie)&&m(ge,ue,ie);return N(ge,ue),ge};Object.defineProperty(t,"__esModule",{value:!0}),t.safeDecodeAsync=t._safeDecodeAsync=t.safeEncodeAsync=t._safeEncodeAsync=t.safeDecode=t._safeDecode=t.safeEncode=t._safeEncode=t.decodeAsync=t._decodeAsync=t.encodeAsync=t._encodeAsync=t.decode=t._decode=t.encode=t._encode=t.safeParseAsync=t._safeParseAsync=t.safeParse=t._safeParse=t.parseAsync=t._parseAsync=t.parse=t._parse=void 0;const _=I(Yr),S=I(Et),z=I(oe),U=ue=>(ge,ie,be,ye)=>{const ze=be?{...be,async:!1}:{async:!1},Me=ge._zod.run({value:ie,issues:[]},ze);if(Me instanceof Promise)throw new _.$ZodAsyncError;if(Me.issues.length){const Ye=new(ye?.Err??ue)(Me.issues.map(vt=>z.finalizeIssue(vt,ze,_.config())));throw z.captureStackTrace(Ye,ye?.callee),Ye}return Me.value};t._parse=U,t.parse=(0,t._parse)(S.$ZodRealError);const c=ue=>async(ge,ie,be,ye)=>{const ze=be?{...be,async:!0}:{async:!0};let Me=ge._zod.run({value:ie,issues:[]},ze);if(Me instanceof Promise&&(Me=await Me),Me.issues.length){const Ye=new(ye?.Err??ue)(Me.issues.map(vt=>z.finalizeIssue(vt,ze,_.config())));throw z.captureStackTrace(Ye,ye?.callee),Ye}return Me.value};t._parseAsync=c,t.parseAsync=(0,t._parseAsync)(S.$ZodRealError);const s=ue=>(ge,ie,be)=>{const ye=be?{...be,async:!1}:{async:!1},ze=ge._zod.run({value:ie,issues:[]},ye);if(ze instanceof Promise)throw new _.$ZodAsyncError;return ze.issues.length?{success:!1,error:new(ue??S.$ZodError)(ze.issues.map(Me=>z.finalizeIssue(Me,ye,_.config())))}:{success:!0,data:ze.value}};t._safeParse=s,t.safeParse=(0,t._safeParse)(S.$ZodRealError);const u=ue=>async(ge,ie,be)=>{const ye=be?{...be,async:!0}:{async:!0};let ze=ge._zod.run({value:ie,issues:[]},ye);return ze instanceof Promise&&(ze=await ze),ze.issues.length?{success:!1,error:new ue(ze.issues.map(Me=>z.finalizeIssue(Me,ye,_.config())))}:{success:!0,data:ze.value}};t._safeParseAsync=u,t.safeParseAsync=(0,t._safeParseAsync)(S.$ZodRealError);const p=ue=>(ge,ie,be)=>{const ye=be?{...be,direction:"backward"}:{direction:"backward"};return(0,t._parse)(ue)(ge,ie,ye)};t._encode=p,t.encode=(0,t._encode)(S.$ZodRealError);const n=ue=>(ge,ie,be)=>(0,t._parse)(ue)(ge,ie,be);t._decode=n,t.decode=(0,t._decode)(S.$ZodRealError);const r=ue=>async(ge,ie,be)=>{const ye=be?{...be,direction:"backward"}:{direction:"backward"};return(0,t._parseAsync)(ue)(ge,ie,ye)};t._encodeAsync=r,t.encodeAsync=(0,t._encodeAsync)(S.$ZodRealError);const x=ue=>async(ge,ie,be)=>(0,t._parseAsync)(ue)(ge,ie,be);t._decodeAsync=x,t.decodeAsync=(0,t._decodeAsync)(S.$ZodRealError);const D=ue=>(ge,ie,be)=>{const ye=be?{...be,direction:"backward"}:{direction:"backward"};return(0,t._safeParse)(ue)(ge,ie,ye)};t._safeEncode=D,t.safeEncode=(0,t._safeEncode)(S.$ZodRealError);const ee=ue=>(ge,ie,be)=>(0,t._safeParse)(ue)(ge,ie,be);t._safeDecode=ee,t.safeDecode=(0,t._safeDecode)(S.$ZodRealError);const Y=ue=>async(ge,ie,be)=>{const ye=be?{...be,direction:"backward"}:{direction:"backward"};return(0,t._safeParseAsync)(ue)(ge,ie,ye)};t._safeEncodeAsync=Y,t.safeEncodeAsync=(0,t._safeEncodeAsync)(S.$ZodRealError);const ne=ue=>async(ge,ie,be)=>(0,t._safeParseAsync)(ue)(ge,ie,be);t._safeDecodeAsync=ne,t.safeDecodeAsync=(0,t._safeDecodeAsync)(S.$ZodRealError)})(Pr);var Nr={},vr={},br={};(function(t){var m=br&&br.__createBinding||(Object.create?(function(ne,ue,ge,ie){ie===void 0&&(ie=ge);var be=Object.getOwnPropertyDescriptor(ue,ge);(!be||("get"in be?!ue.__esModule:be.writable||be.configurable))&&(be={enumerable:!0,get:function(){return ue[ge]}}),Object.defineProperty(ne,ie,be)}):(function(ne,ue,ge,ie){ie===void 0&&(ie=ge),ne[ie]=ue[ge]})),N=br&&br.__setModuleDefault||(Object.create?(function(ne,ue){Object.defineProperty(ne,"default",{enumerable:!0,value:ue})}):function(ne,ue){ne.default=ue}),I=br&&br.__importStar||function(ne){if(ne&&ne.__esModule)return ne;var ue={};if(ne!=null)for(var ge in ne)ge!=="default"&&Object.prototype.hasOwnProperty.call(ne,ge)&&m(ue,ne,ge);return N(ue,ne),ue};Object.defineProperty(t,"__esModule",{value:!0}),t.sha256_base64url=t.sha256_base64=t.sha256_hex=t.sha1_base64url=t.sha1_base64=t.sha1_hex=t.md5_base64url=t.md5_base64=t.md5_hex=t.hex=t.uppercase=t.lowercase=t.undefined=t.null=t.boolean=t.number=t.integer=t.bigint=t.string=t.date=t.e164=t.httpProtocol=t.domain=t.hostname=t.base64url=t.base64=t.cidrv6=t.cidrv4=t.mac=t.ipv6=t.ipv4=t.browserEmail=t.idnEmail=t.unicodeEmail=t.rfc5322Email=t.html5Email=t.email=t.uuid7=t.uuid6=t.uuid4=t.uuid=t.guid=t.extendedDuration=t.duration=t.nanoid=t.ksuid=t.xid=t.ulid=t.cuid2=t.cuid=void 0,t.sha512_base64url=t.sha512_base64=t.sha512_hex=t.sha384_base64url=t.sha384_base64=t.sha384_hex=void 0,t.emoji=U,t.time=p,t.datetime=n;const _=I(oe);t.cuid=/^[cC][0-9a-z]{6,}$/,t.cuid2=/^[0-9a-z]+$/,t.ulid=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,t.xid=/^[0-9a-vA-V]{20}$/,t.ksuid=/^[A-Za-z0-9]{27}$/,t.nanoid=/^[a-zA-Z0-9_-]{21}$/,t.duration=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,t.extendedDuration=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,t.guid=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;const S=ne=>ne?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${ne}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;t.uuid=S,t.uuid4=(0,t.uuid)(4),t.uuid6=(0,t.uuid)(6),t.uuid7=(0,t.uuid)(7),t.email=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,t.html5Email=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,t.rfc5322Email=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,t.unicodeEmail=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,t.idnEmail=t.unicodeEmail,t.browserEmail=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;const z="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function U(){return new RegExp(z,"u")}t.ipv4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,t.ipv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;const c=ne=>{const ue=_.escapeRegex(ne??":");return new RegExp(`^(?:[0-9A-F]{2}${ue}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${ue}){5}[0-9a-f]{2}$`)};t.mac=c,t.cidrv4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,t.cidrv6=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,t.base64=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,t.base64url=/^[A-Za-z0-9_-]*$/,t.hostname=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,t.domain=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,t.httpProtocol=/^https?$/,t.e164=/^\+[1-9]\d{6,14}$/;const s="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";t.date=new RegExp(`^${s}$`);function u(ne){const ue="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof ne.precision=="number"?ne.precision===-1?`${ue}`:ne.precision===0?`${ue}:[0-5]\\d`:`${ue}:[0-5]\\d\\.\\d{${ne.precision}}`:`${ue}(?::[0-5]\\d(?:\\.\\d+)?)?`}function p(ne){return new RegExp(`^${u(ne)}$`)}function n(ne){const ue=u({precision:ne.precision}),ge=["Z"];ne.local&&ge.push(""),ne.offset&&ge.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const ie=`${ue}(?:${ge.join("|")})`;return new RegExp(`^${s}T(?:${ie})$`)}const r=ne=>{const ue=ne?`[\\s\\S]{${ne?.minimum??0},${ne?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${ue}$`)};t.string=r,t.bigint=/^-?\d+n?$/,t.integer=/^-?\d+$/,t.number=/^-?\d+(?:\.\d+)?$/,t.boolean=/^(?:true|false)$/i;const x=/^null$/i;t.null=x;const D=/^undefined$/i;t.undefined=D,t.lowercase=/^[^A-Z]*$/,t.uppercase=/^[^a-z]*$/,t.hex=/^[0-9a-fA-F]*$/;function ee(ne,ue){return new RegExp(`^[A-Za-z0-9+/]{${ne}}${ue}$`)}function Y(ne){return new RegExp(`^[A-Za-z0-9_-]{${ne}}$`)}t.md5_hex=/^[0-9a-fA-F]{32}$/,t.md5_base64=ee(22,"=="),t.md5_base64url=Y(22),t.sha1_hex=/^[0-9a-fA-F]{40}$/,t.sha1_base64=ee(27,"="),t.sha1_base64url=Y(27),t.sha256_hex=/^[0-9a-fA-F]{64}$/,t.sha256_base64=ee(43,"="),t.sha256_base64url=Y(43),t.sha384_hex=/^[0-9a-fA-F]{96}$/,t.sha384_base64=ee(64,""),t.sha384_base64url=Y(64),t.sha512_hex=/^[0-9a-fA-F]{128}$/,t.sha512_base64=ee(86,"=="),t.sha512_base64url=Y(86)})(br);(function(t){var m=vr&&vr.__createBinding||(Object.create?(function(s,u,p,n){n===void 0&&(n=p);var r=Object.getOwnPropertyDescriptor(u,p);(!r||("get"in r?!u.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return u[p]}}),Object.defineProperty(s,n,r)}):(function(s,u,p,n){n===void 0&&(n=p),s[n]=u[p]})),N=vr&&vr.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),I=vr&&vr.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var p in s)p!=="default"&&Object.prototype.hasOwnProperty.call(s,p)&&m(u,s,p);return N(u,s),u};Object.defineProperty(t,"__esModule",{value:!0}),t.$ZodCheckOverwrite=t.$ZodCheckMimeType=t.$ZodCheckProperty=t.$ZodCheckEndsWith=t.$ZodCheckStartsWith=t.$ZodCheckIncludes=t.$ZodCheckUpperCase=t.$ZodCheckLowerCase=t.$ZodCheckRegex=t.$ZodCheckStringFormat=t.$ZodCheckLengthEquals=t.$ZodCheckMinLength=t.$ZodCheckMaxLength=t.$ZodCheckSizeEquals=t.$ZodCheckMinSize=t.$ZodCheckMaxSize=t.$ZodCheckBigIntFormat=t.$ZodCheckNumberFormat=t.$ZodCheckMultipleOf=t.$ZodCheckGreaterThan=t.$ZodCheckLessThan=t.$ZodCheck=void 0;const _=I(Yr),S=I(br),z=I(oe);t.$ZodCheck=_.$constructor("$ZodCheck",(s,u)=>{var p;s._zod??(s._zod={}),s._zod.def=u,(p=s._zod).onattach??(p.onattach=[])});const U={number:"number",bigint:"bigint",object:"date"};t.$ZodCheckLessThan=_.$constructor("$ZodCheckLessThan",(s,u)=>{t.$ZodCheck.init(s,u);const p=U[typeof u.value];s._zod.onattach.push(n=>{const r=n._zod.bag,x=(u.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;u.value<x&&(u.inclusive?r.maximum=u.value:r.exclusiveMaximum=u.value)}),s._zod.check=n=>{(u.inclusive?n.value<=u.value:n.value<u.value)||n.issues.push({origin:p,code:"too_big",maximum:typeof u.value=="object"?u.value.getTime():u.value,input:n.value,inclusive:u.inclusive,inst:s,continue:!u.abort})}}),t.$ZodCheckGreaterThan=_.$constructor("$ZodCheckGreaterThan",(s,u)=>{t.$ZodCheck.init(s,u);const p=U[typeof u.value];s._zod.onattach.push(n=>{const r=n._zod.bag,x=(u.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;u.value>x&&(u.inclusive?r.minimum=u.value:r.exclusiveMinimum=u.value)}),s._zod.check=n=>{(u.inclusive?n.value>=u.value:n.value>u.value)||n.issues.push({origin:p,code:"too_small",minimum:typeof u.value=="object"?u.value.getTime():u.value,input:n.value,inclusive:u.inclusive,inst:s,continue:!u.abort})}}),t.$ZodCheckMultipleOf=_.$constructor("$ZodCheckMultipleOf",(s,u)=>{t.$ZodCheck.init(s,u),s._zod.onattach.push(p=>{var n;(n=p._zod.bag).multipleOf??(n.multipleOf=u.value)}),s._zod.check=p=>{if(typeof p.value!=typeof u.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof p.value=="bigint"?p.value%u.value===BigInt(0):z.floatSafeRemainder(p.value,u.value)===0)||p.issues.push({origin:typeof p.value,code:"not_multiple_of",divisor:u.value,input:p.value,inst:s,continue:!u.abort})}}),t.$ZodCheckNumberFormat=_.$constructor("$ZodCheckNumberFormat",(s,u)=>{t.$ZodCheck.init(s,u),u.format=u.format||"float64";const p=u.format?.includes("int"),n=p?"int":"number",[r,x]=z.NUMBER_FORMAT_RANGES[u.format];s._zod.onattach.push(D=>{const ee=D._zod.bag;ee.format=u.format,ee.minimum=r,ee.maximum=x,p&&(ee.pattern=S.integer)}),s._zod.check=D=>{const ee=D.value;if(p){if(!Number.isInteger(ee)){D.issues.push({expected:n,format:u.format,code:"invalid_type",continue:!1,input:ee,inst:s});return}if(!Number.isSafeInteger(ee)){ee>0?D.issues.push({input:ee,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:s,origin:n,inclusive:!0,continue:!u.abort}):D.issues.push({input:ee,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:s,origin:n,inclusive:!0,continue:!u.abort});return}}ee<r&&D.issues.push({origin:"number",input:ee,code:"too_small",minimum:r,inclusive:!0,inst:s,continue:!u.abort}),ee>x&&D.issues.push({origin:"number",input:ee,code:"too_big",maximum:x,inclusive:!0,inst:s,continue:!u.abort})}}),t.$ZodCheckBigIntFormat=_.$constructor("$ZodCheckBigIntFormat",(s,u)=>{t.$ZodCheck.init(s,u);const[p,n]=z.BIGINT_FORMAT_RANGES[u.format];s._zod.onattach.push(r=>{const x=r._zod.bag;x.format=u.format,x.minimum=p,x.maximum=n}),s._zod.check=r=>{const x=r.value;x<p&&r.issues.push({origin:"bigint",input:x,code:"too_small",minimum:p,inclusive:!0,inst:s,continue:!u.abort}),x>n&&r.issues.push({origin:"bigint",input:x,code:"too_big",maximum:n,inclusive:!0,inst:s,continue:!u.abort})}}),t.$ZodCheckMaxSize=_.$constructor("$ZodCheckMaxSize",(s,u)=>{var p;t.$ZodCheck.init(s,u),(p=s._zod.def).when??(p.when=n=>{const r=n.value;return!z.nullish(r)&&r.size!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;u.maximum<r&&(n._zod.bag.maximum=u.maximum)}),s._zod.check=n=>{const r=n.value;r.size<=u.maximum||n.issues.push({origin:z.getSizableOrigin(r),code:"too_big",maximum:u.maximum,inclusive:!0,input:r,inst:s,continue:!u.abort})}}),t.$ZodCheckMinSize=_.$constructor("$ZodCheckMinSize",(s,u)=>{var p;t.$ZodCheck.init(s,u),(p=s._zod.def).when??(p.when=n=>{const r=n.value;return!z.nullish(r)&&r.size!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;u.minimum>r&&(n._zod.bag.minimum=u.minimum)}),s._zod.check=n=>{const r=n.value;r.size>=u.minimum||n.issues.push({origin:z.getSizableOrigin(r),code:"too_small",minimum:u.minimum,inclusive:!0,input:r,inst:s,continue:!u.abort})}}),t.$ZodCheckSizeEquals=_.$constructor("$ZodCheckSizeEquals",(s,u)=>{var p;t.$ZodCheck.init(s,u),(p=s._zod.def).when??(p.when=n=>{const r=n.value;return!z.nullish(r)&&r.size!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag;r.minimum=u.size,r.maximum=u.size,r.size=u.size}),s._zod.check=n=>{const r=n.value,x=r.size;if(x===u.size)return;const D=x>u.size;n.issues.push({origin:z.getSizableOrigin(r),...D?{code:"too_big",maximum:u.size}:{code:"too_small",minimum:u.size},inclusive:!0,exact:!0,input:n.value,inst:s,continue:!u.abort})}}),t.$ZodCheckMaxLength=_.$constructor("$ZodCheckMaxLength",(s,u)=>{var p;t.$ZodCheck.init(s,u),(p=s._zod.def).when??(p.when=n=>{const r=n.value;return!z.nullish(r)&&r.length!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag.maximum??Number.POSITIVE_INFINITY;u.maximum<r&&(n._zod.bag.maximum=u.maximum)}),s._zod.check=n=>{const r=n.value;if(r.length<=u.maximum)return;const D=z.getLengthableOrigin(r);n.issues.push({origin:D,code:"too_big",maximum:u.maximum,inclusive:!0,input:r,inst:s,continue:!u.abort})}}),t.$ZodCheckMinLength=_.$constructor("$ZodCheckMinLength",(s,u)=>{var p;t.$ZodCheck.init(s,u),(p=s._zod.def).when??(p.when=n=>{const r=n.value;return!z.nullish(r)&&r.length!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;u.minimum>r&&(n._zod.bag.minimum=u.minimum)}),s._zod.check=n=>{const r=n.value;if(r.length>=u.minimum)return;const D=z.getLengthableOrigin(r);n.issues.push({origin:D,code:"too_small",minimum:u.minimum,inclusive:!0,input:r,inst:s,continue:!u.abort})}}),t.$ZodCheckLengthEquals=_.$constructor("$ZodCheckLengthEquals",(s,u)=>{var p;t.$ZodCheck.init(s,u),(p=s._zod.def).when??(p.when=n=>{const r=n.value;return!z.nullish(r)&&r.length!==void 0}),s._zod.onattach.push(n=>{const r=n._zod.bag;r.minimum=u.length,r.maximum=u.length,r.length=u.length}),s._zod.check=n=>{const r=n.value,x=r.length;if(x===u.length)return;const D=z.getLengthableOrigin(r),ee=x>u.length;n.issues.push({origin:D,...ee?{code:"too_big",maximum:u.length}:{code:"too_small",minimum:u.length},inclusive:!0,exact:!0,input:n.value,inst:s,continue:!u.abort})}}),t.$ZodCheckStringFormat=_.$constructor("$ZodCheckStringFormat",(s,u)=>{var p,n;t.$ZodCheck.init(s,u),s._zod.onattach.push(r=>{const x=r._zod.bag;x.format=u.format,u.pattern&&(x.patterns??(x.patterns=new Set),x.patterns.add(u.pattern))}),u.pattern?(p=s._zod).check??(p.check=r=>{u.pattern.lastIndex=0,!u.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:u.format,input:r.value,...u.pattern?{pattern:u.pattern.toString()}:{},inst:s,continue:!u.abort})}):(n=s._zod).check??(n.check=()=>{})}),t.$ZodCheckRegex=_.$constructor("$ZodCheckRegex",(s,u)=>{t.$ZodCheckStringFormat.init(s,u),s._zod.check=p=>{u.pattern.lastIndex=0,!u.pattern.test(p.value)&&p.issues.push({origin:"string",code:"invalid_format",format:"regex",input:p.value,pattern:u.pattern.toString(),inst:s,continue:!u.abort})}}),t.$ZodCheckLowerCase=_.$constructor("$ZodCheckLowerCase",(s,u)=>{u.pattern??(u.pattern=S.lowercase),t.$ZodCheckStringFormat.init(s,u)}),t.$ZodCheckUpperCase=_.$constructor("$ZodCheckUpperCase",(s,u)=>{u.pattern??(u.pattern=S.uppercase),t.$ZodCheckStringFormat.init(s,u)}),t.$ZodCheckIncludes=_.$constructor("$ZodCheckIncludes",(s,u)=>{t.$ZodCheck.init(s,u);const p=z.escapeRegex(u.includes),n=new RegExp(typeof u.position=="number"?`^.{${u.position}}${p}`:p);u.pattern=n,s._zod.onattach.push(r=>{const x=r._zod.bag;x.patterns??(x.patterns=new Set),x.patterns.add(n)}),s._zod.check=r=>{r.value.includes(u.includes,u.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:u.includes,input:r.value,inst:s,continue:!u.abort})}}),t.$ZodCheckStartsWith=_.$constructor("$ZodCheckStartsWith",(s,u)=>{t.$ZodCheck.init(s,u);const p=new RegExp(`^${z.escapeRegex(u.prefix)}.*`);u.pattern??(u.pattern=p),s._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(p)}),s._zod.check=n=>{n.value.startsWith(u.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:u.prefix,input:n.value,inst:s,continue:!u.abort})}}),t.$ZodCheckEndsWith=_.$constructor("$ZodCheckEndsWith",(s,u)=>{t.$ZodCheck.init(s,u);const p=new RegExp(`.*${z.escapeRegex(u.suffix)}$`);u.pattern??(u.pattern=p),s._zod.onattach.push(n=>{const r=n._zod.bag;r.patterns??(r.patterns=new Set),r.patterns.add(p)}),s._zod.check=n=>{n.value.endsWith(u.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:u.suffix,input:n.value,inst:s,continue:!u.abort})}});function c(s,u,p){s.issues.length&&u.issues.push(...z.prefixIssues(p,s.issues))}t.$ZodCheckProperty=_.$constructor("$ZodCheckProperty",(s,u)=>{t.$ZodCheck.init(s,u),s._zod.check=p=>{const n=u.schema._zod.run({value:p.value[u.property],issues:[]},{});if(n instanceof Promise)return n.then(r=>c(r,p,u.property));c(n,p,u.property)}}),t.$ZodCheckMimeType=_.$constructor("$ZodCheckMimeType",(s,u)=>{t.$ZodCheck.init(s,u);const p=new Set(u.mime);s._zod.onattach.push(n=>{n._zod.bag.mime=u.mime}),s._zod.check=n=>{p.has(n.value.type)||n.issues.push({code:"invalid_value",values:u.mime,input:n.value.type,inst:s,continue:!u.abort})}}),t.$ZodCheckOverwrite=_.$constructor("$ZodCheckOverwrite",(s,u)=>{t.$ZodCheck.init(s,u),s._zod.check=p=>{p.value=u.tx(p.value)}})})(vr);var Ki={};Object.defineProperty(Ki,"__esModule",{value:!0});Ki.Doc=void 0;class VI{constructor(m=[]){this.content=[],this.indent=0,this&&(this.args=m)}indented(m){this.indent+=1,m(this),this.indent-=1}write(m){if(typeof m=="function"){m(this,{execution:"sync"}),m(this,{execution:"async"});return}const I=m.split(`
32
- `).filter(z=>z),_=Math.min(...I.map(z=>z.length-z.trimStart().length)),S=I.map(z=>z.slice(_)).map(z=>" ".repeat(this.indent*2)+z);for(const z of S)this.content.push(z)}compile(){const m=Function,N=this?.args,_=[...(this?.content??[""]).map(S=>` ${S}`)];return new m(...N,_.join(`
33
- `))}}Ki.Doc=VI;var Xi={};Object.defineProperty(Xi,"__esModule",{value:!0});Xi.version=void 0;Xi.version={major:4,minor:4,patch:3};(function(t){var m=Nr&&Nr.__createBinding||(Object.create?(function($,C,M,L){L===void 0&&(L=M);var F=Object.getOwnPropertyDescriptor(C,M);(!F||("get"in F?!C.__esModule:F.writable||F.configurable))&&(F={enumerable:!0,get:function(){return C[M]}}),Object.defineProperty($,L,F)}):(function($,C,M,L){L===void 0&&(L=M),$[L]=C[M]})),N=Nr&&Nr.__setModuleDefault||(Object.create?(function($,C){Object.defineProperty($,"default",{enumerable:!0,value:C})}):function($,C){$.default=C}),I=Nr&&Nr.__importStar||function($){if($&&$.__esModule)return $;var C={};if($!=null)for(var M in $)M!=="default"&&Object.prototype.hasOwnProperty.call($,M)&&m(C,$,M);return N(C,$),C};Object.defineProperty(t,"__esModule",{value:!0}),t.$ZodTuple=t.$ZodIntersection=t.$ZodDiscriminatedUnion=t.$ZodXor=t.$ZodUnion=t.$ZodObjectJIT=t.$ZodObject=t.$ZodArray=t.$ZodDate=t.$ZodVoid=t.$ZodNever=t.$ZodUnknown=t.$ZodAny=t.$ZodNull=t.$ZodUndefined=t.$ZodSymbol=t.$ZodBigIntFormat=t.$ZodBigInt=t.$ZodBoolean=t.$ZodNumberFormat=t.$ZodNumber=t.$ZodCustomStringFormat=t.$ZodJWT=t.$ZodE164=t.$ZodBase64URL=t.$ZodBase64=t.$ZodCIDRv6=t.$ZodCIDRv4=t.$ZodMAC=t.$ZodIPv6=t.$ZodIPv4=t.$ZodISODuration=t.$ZodISOTime=t.$ZodISODate=t.$ZodISODateTime=t.$ZodKSUID=t.$ZodXID=t.$ZodULID=t.$ZodCUID2=t.$ZodCUID=t.$ZodNanoID=t.$ZodEmoji=t.$ZodURL=t.$ZodEmail=t.$ZodUUID=t.$ZodGUID=t.$ZodStringFormat=t.$ZodString=t.clone=t.$ZodType=void 0,t.$ZodCustom=t.$ZodLazy=t.$ZodPromise=t.$ZodFunction=t.$ZodTemplateLiteral=t.$ZodReadonly=t.$ZodPreprocess=t.$ZodCodec=t.$ZodPipe=t.$ZodNaN=t.$ZodCatch=t.$ZodSuccess=t.$ZodNonOptional=t.$ZodPrefault=t.$ZodDefault=t.$ZodNullable=t.$ZodExactOptional=t.$ZodOptional=t.$ZodTransform=t.$ZodFile=t.$ZodLiteral=t.$ZodEnum=t.$ZodSet=t.$ZodMap=t.$ZodRecord=void 0,t.isValidBase64=n,t.isValidBase64URL=r,t.isValidJWT=x;const _=I(vr),S=I(Yr),z=Ki,U=Pr,c=I(br),s=I(oe),u=Xi;t.$ZodType=S.$constructor("$ZodType",($,C)=>{var M;$??($={}),$._zod.def=C,$._zod.bag=$._zod.bag||{},$._zod.version=u.version;const L=[...$._zod.def.checks??[]];$._zod.traits.has("$ZodCheck")&&L.unshift($);for(const F of L)for(const W of F._zod.onattach)W($);if(L.length===0)(M=$._zod).deferred??(M.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{const F=(re,fe,q)=>{let Q=s.aborted(re),se;for(const de of fe){if(de._zod.def.when){if(s.explicitlyAborted(re)||!de._zod.def.when(re))continue}else if(Q)continue;const K=re.issues.length,ce=de._zod.check(re);if(ce instanceof Promise&&q?.async===!1)throw new S.$ZodAsyncError;if(se||ce instanceof Promise)se=(se??Promise.resolve()).then(async()=>{await ce,re.issues.length!==K&&(Q||(Q=s.aborted(re,K)))});else{if(re.issues.length===K)continue;Q||(Q=s.aborted(re,K))}}return se?se.then(()=>re):re},W=(re,fe,q)=>{if(s.aborted(re))return re.aborted=!0,re;const Q=F(fe,L,q);if(Q instanceof Promise){if(q.async===!1)throw new S.$ZodAsyncError;return Q.then(se=>$._zod.parse(se,q))}return $._zod.parse(Q,q)};$._zod.run=(re,fe)=>{if(fe.skipChecks)return $._zod.parse(re,fe);if(fe.direction==="backward"){const Q=$._zod.parse({value:re.value,issues:[]},{...fe,skipChecks:!0});return Q instanceof Promise?Q.then(se=>W(se,re,fe)):W(Q,re,fe)}const q=$._zod.parse(re,fe);if(q instanceof Promise){if(fe.async===!1)throw new S.$ZodAsyncError;return q.then(Q=>F(Q,L,fe))}return F(q,L,fe)}}s.defineLazy($,"~standard",()=>({validate:F=>{try{const W=(0,U.safeParse)($,F);return W.success?{value:W.data}:{issues:W.error?.issues}}catch{return(0,U.safeParseAsync)($,F).then(re=>re.success?{value:re.data}:{issues:re.error?.issues})}},vendor:"zod",version:1}))});var p=oe;Object.defineProperty(t,"clone",{enumerable:!0,get:function(){return p.clone}}),t.$ZodString=S.$constructor("$ZodString",($,C)=>{t.$ZodType.init($,C),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??c.string($._zod.bag),$._zod.parse=(M,L)=>{if(C.coerce)try{M.value=String(M.value)}catch{}return typeof M.value=="string"||M.issues.push({expected:"string",code:"invalid_type",input:M.value,inst:$}),M}}),t.$ZodStringFormat=S.$constructor("$ZodStringFormat",($,C)=>{_.$ZodCheckStringFormat.init($,C),t.$ZodString.init($,C)}),t.$ZodGUID=S.$constructor("$ZodGUID",($,C)=>{C.pattern??(C.pattern=c.guid),t.$ZodStringFormat.init($,C)}),t.$ZodUUID=S.$constructor("$ZodUUID",($,C)=>{if(C.version){const L={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[C.version];if(L===void 0)throw new Error(`Invalid UUID version: "${C.version}"`);C.pattern??(C.pattern=c.uuid(L))}else C.pattern??(C.pattern=c.uuid());t.$ZodStringFormat.init($,C)}),t.$ZodEmail=S.$constructor("$ZodEmail",($,C)=>{C.pattern??(C.pattern=c.email),t.$ZodStringFormat.init($,C)}),t.$ZodURL=S.$constructor("$ZodURL",($,C)=>{t.$ZodStringFormat.init($,C),$._zod.check=M=>{try{const L=M.value.trim();if(!C.normalize&&C.protocol?.source===c.httpProtocol.source&&!/^https?:\/\//i.test(L)){M.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:M.value,inst:$,continue:!C.abort});return}const F=new URL(L);C.hostname&&(C.hostname.lastIndex=0,C.hostname.test(F.hostname)||M.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:C.hostname.source,input:M.value,inst:$,continue:!C.abort})),C.protocol&&(C.protocol.lastIndex=0,C.protocol.test(F.protocol.endsWith(":")?F.protocol.slice(0,-1):F.protocol)||M.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:C.protocol.source,input:M.value,inst:$,continue:!C.abort})),C.normalize?M.value=F.href:M.value=L;return}catch{M.issues.push({code:"invalid_format",format:"url",input:M.value,inst:$,continue:!C.abort})}}}),t.$ZodEmoji=S.$constructor("$ZodEmoji",($,C)=>{C.pattern??(C.pattern=c.emoji()),t.$ZodStringFormat.init($,C)}),t.$ZodNanoID=S.$constructor("$ZodNanoID",($,C)=>{C.pattern??(C.pattern=c.nanoid),t.$ZodStringFormat.init($,C)}),t.$ZodCUID=S.$constructor("$ZodCUID",($,C)=>{C.pattern??(C.pattern=c.cuid),t.$ZodStringFormat.init($,C)}),t.$ZodCUID2=S.$constructor("$ZodCUID2",($,C)=>{C.pattern??(C.pattern=c.cuid2),t.$ZodStringFormat.init($,C)}),t.$ZodULID=S.$constructor("$ZodULID",($,C)=>{C.pattern??(C.pattern=c.ulid),t.$ZodStringFormat.init($,C)}),t.$ZodXID=S.$constructor("$ZodXID",($,C)=>{C.pattern??(C.pattern=c.xid),t.$ZodStringFormat.init($,C)}),t.$ZodKSUID=S.$constructor("$ZodKSUID",($,C)=>{C.pattern??(C.pattern=c.ksuid),t.$ZodStringFormat.init($,C)}),t.$ZodISODateTime=S.$constructor("$ZodISODateTime",($,C)=>{C.pattern??(C.pattern=c.datetime(C)),t.$ZodStringFormat.init($,C)}),t.$ZodISODate=S.$constructor("$ZodISODate",($,C)=>{C.pattern??(C.pattern=c.date),t.$ZodStringFormat.init($,C)}),t.$ZodISOTime=S.$constructor("$ZodISOTime",($,C)=>{C.pattern??(C.pattern=c.time(C)),t.$ZodStringFormat.init($,C)}),t.$ZodISODuration=S.$constructor("$ZodISODuration",($,C)=>{C.pattern??(C.pattern=c.duration),t.$ZodStringFormat.init($,C)}),t.$ZodIPv4=S.$constructor("$ZodIPv4",($,C)=>{C.pattern??(C.pattern=c.ipv4),t.$ZodStringFormat.init($,C),$._zod.bag.format="ipv4"}),t.$ZodIPv6=S.$constructor("$ZodIPv6",($,C)=>{C.pattern??(C.pattern=c.ipv6),t.$ZodStringFormat.init($,C),$._zod.bag.format="ipv6",$._zod.check=M=>{try{new URL(`http://[${M.value}]`)}catch{M.issues.push({code:"invalid_format",format:"ipv6",input:M.value,inst:$,continue:!C.abort})}}}),t.$ZodMAC=S.$constructor("$ZodMAC",($,C)=>{C.pattern??(C.pattern=c.mac(C.delimiter)),t.$ZodStringFormat.init($,C),$._zod.bag.format="mac"}),t.$ZodCIDRv4=S.$constructor("$ZodCIDRv4",($,C)=>{C.pattern??(C.pattern=c.cidrv4),t.$ZodStringFormat.init($,C)}),t.$ZodCIDRv6=S.$constructor("$ZodCIDRv6",($,C)=>{C.pattern??(C.pattern=c.cidrv6),t.$ZodStringFormat.init($,C),$._zod.check=M=>{const L=M.value.split("/");try{if(L.length!==2)throw new Error;const[F,W]=L;if(!W)throw new Error;const re=Number(W);if(`${re}`!==W)throw new Error;if(re<0||re>128)throw new Error;new URL(`http://[${F}]`)}catch{M.issues.push({code:"invalid_format",format:"cidrv6",input:M.value,inst:$,continue:!C.abort})}}});function n($){if($==="")return!0;if(/\s/.test($)||$.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}t.$ZodBase64=S.$constructor("$ZodBase64",($,C)=>{C.pattern??(C.pattern=c.base64),t.$ZodStringFormat.init($,C),$._zod.bag.contentEncoding="base64",$._zod.check=M=>{n(M.value)||M.issues.push({code:"invalid_format",format:"base64",input:M.value,inst:$,continue:!C.abort})}});function r($){if(!c.base64url.test($))return!1;const C=$.replace(/[-_]/g,L=>L==="-"?"+":"/"),M=C.padEnd(Math.ceil(C.length/4)*4,"=");return n(M)}t.$ZodBase64URL=S.$constructor("$ZodBase64URL",($,C)=>{C.pattern??(C.pattern=c.base64url),t.$ZodStringFormat.init($,C),$._zod.bag.contentEncoding="base64url",$._zod.check=M=>{r(M.value)||M.issues.push({code:"invalid_format",format:"base64url",input:M.value,inst:$,continue:!C.abort})}}),t.$ZodE164=S.$constructor("$ZodE164",($,C)=>{C.pattern??(C.pattern=c.e164),t.$ZodStringFormat.init($,C)});function x($,C=null){try{const M=$.split(".");if(M.length!==3)return!1;const[L]=M;if(!L)return!1;const F=JSON.parse(atob(L));return!("typ"in F&&F?.typ!=="JWT"||!F.alg||C&&(!("alg"in F)||F.alg!==C))}catch{return!1}}t.$ZodJWT=S.$constructor("$ZodJWT",($,C)=>{t.$ZodStringFormat.init($,C),$._zod.check=M=>{x(M.value,C.alg)||M.issues.push({code:"invalid_format",format:"jwt",input:M.value,inst:$,continue:!C.abort})}}),t.$ZodCustomStringFormat=S.$constructor("$ZodCustomStringFormat",($,C)=>{t.$ZodStringFormat.init($,C),$._zod.check=M=>{C.fn(M.value)||M.issues.push({code:"invalid_format",format:C.format,input:M.value,inst:$,continue:!C.abort})}}),t.$ZodNumber=S.$constructor("$ZodNumber",($,C)=>{t.$ZodType.init($,C),$._zod.pattern=$._zod.bag.pattern??c.number,$._zod.parse=(M,L)=>{if(C.coerce)try{M.value=Number(M.value)}catch{}const F=M.value;if(typeof F=="number"&&!Number.isNaN(F)&&Number.isFinite(F))return M;const W=typeof F=="number"?Number.isNaN(F)?"NaN":Number.isFinite(F)?void 0:"Infinity":void 0;return M.issues.push({expected:"number",code:"invalid_type",input:F,inst:$,...W?{received:W}:{}}),M}}),t.$ZodNumberFormat=S.$constructor("$ZodNumberFormat",($,C)=>{_.$ZodCheckNumberFormat.init($,C),t.$ZodNumber.init($,C)}),t.$ZodBoolean=S.$constructor("$ZodBoolean",($,C)=>{t.$ZodType.init($,C),$._zod.pattern=c.boolean,$._zod.parse=(M,L)=>{if(C.coerce)try{M.value=!!M.value}catch{}const F=M.value;return typeof F=="boolean"||M.issues.push({expected:"boolean",code:"invalid_type",input:F,inst:$}),M}}),t.$ZodBigInt=S.$constructor("$ZodBigInt",($,C)=>{t.$ZodType.init($,C),$._zod.pattern=c.bigint,$._zod.parse=(M,L)=>{if(C.coerce)try{M.value=BigInt(M.value)}catch{}return typeof M.value=="bigint"||M.issues.push({expected:"bigint",code:"invalid_type",input:M.value,inst:$}),M}}),t.$ZodBigIntFormat=S.$constructor("$ZodBigIntFormat",($,C)=>{_.$ZodCheckBigIntFormat.init($,C),t.$ZodBigInt.init($,C)}),t.$ZodSymbol=S.$constructor("$ZodSymbol",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>{const F=M.value;return typeof F=="symbol"||M.issues.push({expected:"symbol",code:"invalid_type",input:F,inst:$}),M}}),t.$ZodUndefined=S.$constructor("$ZodUndefined",($,C)=>{t.$ZodType.init($,C),$._zod.pattern=c.undefined,$._zod.values=new Set([void 0]),$._zod.parse=(M,L)=>{const F=M.value;return typeof F>"u"||M.issues.push({expected:"undefined",code:"invalid_type",input:F,inst:$}),M}}),t.$ZodNull=S.$constructor("$ZodNull",($,C)=>{t.$ZodType.init($,C),$._zod.pattern=c.null,$._zod.values=new Set([null]),$._zod.parse=(M,L)=>{const F=M.value;return F===null||M.issues.push({expected:"null",code:"invalid_type",input:F,inst:$}),M}}),t.$ZodAny=S.$constructor("$ZodAny",($,C)=>{t.$ZodType.init($,C),$._zod.parse=M=>M}),t.$ZodUnknown=S.$constructor("$ZodUnknown",($,C)=>{t.$ZodType.init($,C),$._zod.parse=M=>M}),t.$ZodNever=S.$constructor("$ZodNever",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>(M.issues.push({expected:"never",code:"invalid_type",input:M.value,inst:$}),M)}),t.$ZodVoid=S.$constructor("$ZodVoid",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>{const F=M.value;return typeof F>"u"||M.issues.push({expected:"void",code:"invalid_type",input:F,inst:$}),M}}),t.$ZodDate=S.$constructor("$ZodDate",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>{if(C.coerce)try{M.value=new Date(M.value)}catch{}const F=M.value,W=F instanceof Date;return W&&!Number.isNaN(F.getTime())||M.issues.push({expected:"date",code:"invalid_type",input:F,...W?{received:"Invalid Date"}:{},inst:$}),M}});function D($,C,M){$.issues.length&&C.issues.push(...s.prefixIssues(M,$.issues)),C.value[M]=$.value}t.$ZodArray=S.$constructor("$ZodArray",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>{const F=M.value;if(!Array.isArray(F))return M.issues.push({expected:"array",code:"invalid_type",input:F,inst:$}),M;M.value=Array(F.length);const W=[];for(let re=0;re<F.length;re++){const fe=F[re],q=C.element._zod.run({value:fe,issues:[]},L);q instanceof Promise?W.push(q.then(Q=>D(Q,M,re))):D(q,M,re)}return W.length?Promise.all(W).then(()=>M):M}});function ee($,C,M,L,F,W){const re=M in L;if($.issues.length){if(F&&W&&!re)return;C.issues.push(...s.prefixIssues(M,$.issues))}if(!re&&!F){$.issues.length||C.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[M]});return}$.value===void 0?re&&(C.value[M]=void 0):C.value[M]=$.value}function Y($){const C=Object.keys($.shape);for(const L of C)if(!$.shape?.[L]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${L}": expected a Zod schema`);const M=s.optionalKeys($.shape);return{...$,keys:C,keySet:new Set(C),numKeys:C.length,optionalKeys:new Set(M)}}function ne($,C,M,L,F,W){const re=[],fe=F.keySet,q=F.catchall._zod,Q=q.def.type,se=q.optin==="optional",de=q.optout==="optional";for(const K in C){if(K==="__proto__"||fe.has(K))continue;if(Q==="never"){re.push(K);continue}const ce=q.run({value:C[K],issues:[]},L);ce instanceof Promise?$.push(ce.then(xe=>ee(xe,M,K,C,se,de))):ee(ce,M,K,C,se,de)}return re.length&&M.issues.push({code:"unrecognized_keys",keys:re,input:C,inst:W}),$.length?Promise.all($).then(()=>M):M}t.$ZodObject=S.$constructor("$ZodObject",($,C)=>{if(t.$ZodType.init($,C),!Object.getOwnPropertyDescriptor(C,"shape")?.get){const fe=C.shape;Object.defineProperty(C,"shape",{get:()=>{const q={...fe};return Object.defineProperty(C,"shape",{value:q}),q}})}const L=s.cached(()=>Y(C));s.defineLazy($._zod,"propValues",()=>{const fe=C.shape,q={};for(const Q in fe){const se=fe[Q]._zod;if(se.values){q[Q]??(q[Q]=new Set);for(const de of se.values)q[Q].add(de)}}return q});const F=s.isObject,W=C.catchall;let re;$._zod.parse=(fe,q)=>{re??(re=L.value);const Q=fe.value;if(!F(Q))return fe.issues.push({expected:"object",code:"invalid_type",input:Q,inst:$}),fe;fe.value={};const se=[],de=re.shape;for(const K of re.keys){const ce=de[K],xe=ce._zod.optin==="optional",et=ce._zod.optout==="optional",Ge=ce._zod.run({value:Q[K],issues:[]},q);Ge instanceof Promise?se.push(Ge.then(Je=>ee(Je,fe,K,Q,xe,et))):ee(Ge,fe,K,Q,xe,et)}return W?ne(se,Q,fe,q,L.value,$):se.length?Promise.all(se).then(()=>fe):fe}}),t.$ZodObjectJIT=S.$constructor("$ZodObjectJIT",($,C)=>{t.$ZodObject.init($,C);const M=$._zod.parse,L=s.cached(()=>Y(C)),F=K=>{const ce=new z.Doc(["shape","payload","ctx"]),xe=L.value,et=gt=>{const it=s.esc(gt);return`shape[${it}]._zod.run({ value: input[${it}], issues: [] }, ctx)`};ce.write("const input = payload.value;");const Ge=Object.create(null);let Je=0;for(const gt of xe.keys)Ge[gt]=`key_${Je++}`;ce.write("const newResult = {};");for(const gt of xe.keys){const it=Ge[gt],ft=s.esc(gt),bt=K[gt],Ur=bt?._zod?.optin==="optional",yr=bt?._zod?.optout==="optional";ce.write(`const ${it} = ${et(gt)};`),Ur&&yr?ce.write(`
34
- if (${it}.issues.length) {
35
- if (${ft} in input) {
36
- payload.issues = payload.issues.concat(${it}.issues.map(iss => ({
37
- ...iss,
38
- path: iss.path ? [${ft}, ...iss.path] : [${ft}]
39
- })));
40
- }
41
- }
42
-
43
- if (${it}.value === undefined) {
44
- if (${ft} in input) {
45
- newResult[${ft}] = undefined;
46
- }
47
- } else {
48
- newResult[${ft}] = ${it}.value;
49
- }
50
-
51
- `):Ur?ce.write(`
52
- if (${it}.issues.length) {
53
- payload.issues = payload.issues.concat(${it}.issues.map(iss => ({
54
- ...iss,
55
- path: iss.path ? [${ft}, ...iss.path] : [${ft}]
56
- })));
57
- }
58
-
59
- if (${it}.value === undefined) {
60
- if (${ft} in input) {
61
- newResult[${ft}] = undefined;
62
- }
63
- } else {
64
- newResult[${ft}] = ${it}.value;
65
- }
66
-
67
- `):ce.write(`
68
- const ${it}_present = ${ft} in input;
69
- if (${it}.issues.length) {
70
- payload.issues = payload.issues.concat(${it}.issues.map(iss => ({
71
- ...iss,
72
- path: iss.path ? [${ft}, ...iss.path] : [${ft}]
73
- })));
74
- }
75
- if (!${it}_present && !${it}.issues.length) {
76
- payload.issues.push({
77
- code: "invalid_type",
78
- expected: "nonoptional",
79
- input: undefined,
80
- path: [${ft}]
81
- });
82
- }
83
-
84
- if (${it}_present) {
85
- if (${it}.value === undefined) {
86
- newResult[${ft}] = undefined;
87
- } else {
88
- newResult[${ft}] = ${it}.value;
89
- }
90
- }
91
-
92
- `)}ce.write("payload.value = newResult;"),ce.write("return payload;");const tt=ce.compile();return(gt,it)=>tt(K,gt,it)};let W;const re=s.isObject,fe=!S.globalConfig.jitless,q=s.allowsEval,Q=fe&&q.value,se=C.catchall;let de;$._zod.parse=(K,ce)=>{de??(de=L.value);const xe=K.value;return re(xe)?fe&&Q&&ce?.async===!1&&ce.jitless!==!0?(W||(W=F(C.shape)),K=W(K,ce),se?ne([],xe,K,ce,de,$):K):M(K,ce):(K.issues.push({expected:"object",code:"invalid_type",input:xe,inst:$}),K)}});function ue($,C,M,L){for(const W of $)if(W.issues.length===0)return C.value=W.value,C;const F=$.filter(W=>!s.aborted(W));return F.length===1?(C.value=F[0].value,F[0]):(C.issues.push({code:"invalid_union",input:C.value,inst:M,errors:$.map(W=>W.issues.map(re=>s.finalizeIssue(re,L,S.config())))}),C)}t.$ZodUnion=S.$constructor("$ZodUnion",($,C)=>{t.$ZodType.init($,C),s.defineLazy($._zod,"optin",()=>C.options.some(L=>L._zod.optin==="optional")?"optional":void 0),s.defineLazy($._zod,"optout",()=>C.options.some(L=>L._zod.optout==="optional")?"optional":void 0),s.defineLazy($._zod,"values",()=>{if(C.options.every(L=>L._zod.values))return new Set(C.options.flatMap(L=>Array.from(L._zod.values)))}),s.defineLazy($._zod,"pattern",()=>{if(C.options.every(L=>L._zod.pattern)){const L=C.options.map(F=>F._zod.pattern);return new RegExp(`^(${L.map(F=>s.cleanRegex(F.source)).join("|")})$`)}});const M=C.options.length===1?C.options[0]._zod.run:null;$._zod.parse=(L,F)=>{if(M)return M(L,F);let W=!1;const re=[];for(const fe of C.options){const q=fe._zod.run({value:L.value,issues:[]},F);if(q instanceof Promise)re.push(q),W=!0;else{if(q.issues.length===0)return q;re.push(q)}}return W?Promise.all(re).then(fe=>ue(fe,L,$,F)):ue(re,L,$,F)}});function ge($,C,M,L){const F=$.filter(W=>W.issues.length===0);return F.length===1?(C.value=F[0].value,C):(F.length===0?C.issues.push({code:"invalid_union",input:C.value,inst:M,errors:$.map(W=>W.issues.map(re=>s.finalizeIssue(re,L,S.config())))}):C.issues.push({code:"invalid_union",input:C.value,inst:M,errors:[],inclusive:!1}),C)}t.$ZodXor=S.$constructor("$ZodXor",($,C)=>{t.$ZodUnion.init($,C),C.inclusive=!1;const M=C.options.length===1?C.options[0]._zod.run:null;$._zod.parse=(L,F)=>{if(M)return M(L,F);let W=!1;const re=[];for(const fe of C.options){const q=fe._zod.run({value:L.value,issues:[]},F);q instanceof Promise?(re.push(q),W=!0):re.push(q)}return W?Promise.all(re).then(fe=>ge(fe,L,$,F)):ge(re,L,$,F)}}),t.$ZodDiscriminatedUnion=S.$constructor("$ZodDiscriminatedUnion",($,C)=>{C.inclusive=!1,t.$ZodUnion.init($,C);const M=$._zod.parse;s.defineLazy($._zod,"propValues",()=>{const F={};for(const W of C.options){const re=W._zod.propValues;if(!re||Object.keys(re).length===0)throw new Error(`Invalid discriminated union option at index "${C.options.indexOf(W)}"`);for(const[fe,q]of Object.entries(re)){F[fe]||(F[fe]=new Set);for(const Q of q)F[fe].add(Q)}}return F});const L=s.cached(()=>{const F=C.options,W=new Map;for(const re of F){const fe=re._zod.propValues?.[C.discriminator];if(!fe||fe.size===0)throw new Error(`Invalid discriminated union option at index "${C.options.indexOf(re)}"`);for(const q of fe){if(W.has(q))throw new Error(`Duplicate discriminator value "${String(q)}"`);W.set(q,re)}}return W});$._zod.parse=(F,W)=>{const re=F.value;if(!s.isObject(re))return F.issues.push({code:"invalid_type",expected:"object",input:re,inst:$}),F;const fe=L.value.get(re?.[C.discriminator]);return fe?fe._zod.run(F,W):C.unionFallback||W.direction==="backward"?M(F,W):(F.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:C.discriminator,options:Array.from(L.value.keys()),input:re,path:[C.discriminator],inst:$}),F)}}),t.$ZodIntersection=S.$constructor("$ZodIntersection",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>{const F=M.value,W=C.left._zod.run({value:F,issues:[]},L),re=C.right._zod.run({value:F,issues:[]},L);return W instanceof Promise||re instanceof Promise?Promise.all([W,re]).then(([q,Q])=>be(M,q,Q)):be(M,W,re)}});function ie($,C){if($===C)return{valid:!0,data:$};if($ instanceof Date&&C instanceof Date&&+$==+C)return{valid:!0,data:$};if(s.isPlainObject($)&&s.isPlainObject(C)){const M=Object.keys(C),L=Object.keys($).filter(W=>M.indexOf(W)!==-1),F={...$,...C};for(const W of L){const re=ie($[W],C[W]);if(!re.valid)return{valid:!1,mergeErrorPath:[W,...re.mergeErrorPath]};F[W]=re.data}return{valid:!0,data:F}}if(Array.isArray($)&&Array.isArray(C)){if($.length!==C.length)return{valid:!1,mergeErrorPath:[]};const M=[];for(let L=0;L<$.length;L++){const F=$[L],W=C[L],re=ie(F,W);if(!re.valid)return{valid:!1,mergeErrorPath:[L,...re.mergeErrorPath]};M.push(re.data)}return{valid:!0,data:M}}return{valid:!1,mergeErrorPath:[]}}function be($,C,M){const L=new Map;let F;for(const fe of C.issues)if(fe.code==="unrecognized_keys"){F??(F=fe);for(const q of fe.keys)L.has(q)||L.set(q,{}),L.get(q).l=!0}else $.issues.push(fe);for(const fe of M.issues)if(fe.code==="unrecognized_keys")for(const q of fe.keys)L.has(q)||L.set(q,{}),L.get(q).r=!0;else $.issues.push(fe);const W=[...L].filter(([,fe])=>fe.l&&fe.r).map(([fe])=>fe);if(W.length&&F&&$.issues.push({...F,keys:W}),s.aborted($))return $;const re=ie(C.value,M.value);if(!re.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(re.mergeErrorPath)}`);return $.value=re.data,$}t.$ZodTuple=S.$constructor("$ZodTuple",($,C)=>{t.$ZodType.init($,C);const M=C.items;$._zod.parse=(L,F)=>{const W=L.value;if(!Array.isArray(W))return L.issues.push({input:W,inst:$,expected:"tuple",code:"invalid_type"}),L;L.value=[];const re=[],fe=ye(M,"optin"),q=ye(M,"optout");if(!C.rest){if(W.length<fe)return L.issues.push({code:"too_small",minimum:fe,inclusive:!0,input:W,inst:$,origin:"array"}),L;W.length>M.length&&L.issues.push({code:"too_big",maximum:M.length,inclusive:!0,input:W,inst:$,origin:"array"})}const Q=new Array(M.length);for(let se=0;se<M.length;se++){const de=M[se]._zod.run({value:W[se],issues:[]},F);de instanceof Promise?re.push(de.then(K=>{Q[se]=K})):Q[se]=de}if(C.rest){let se=M.length-1;const de=W.slice(M.length);for(const K of de){se++;const ce=C.rest._zod.run({value:K,issues:[]},F);ce instanceof Promise?re.push(ce.then(xe=>ze(xe,L,se))):ze(ce,L,se)}}return re.length?Promise.all(re).then(()=>Me(Q,L,M,W,q)):Me(Q,L,M,W,q)}});function ye($,C){for(let M=$.length-1;M>=0;M--)if($[M]._zod[C]!=="optional")return M+1;return 0}function ze($,C,M){$.issues.length&&C.issues.push(...s.prefixIssues(M,$.issues)),C.value[M]=$.value}function Me($,C,M,L,F){for(let W=0;W<M.length;W++){const re=$[W],fe=W<L.length;if(re.issues.length){if(!fe&&W>=F){C.value.length=W;break}C.issues.push(...s.prefixIssues(W,re.issues))}C.value[W]=re.value}for(let W=C.value.length-1;W>=L.length&&(M[W]._zod.optout==="optional"&&C.value[W]===void 0);W--)C.value.length=W;return C}t.$ZodRecord=S.$constructor("$ZodRecord",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>{const F=M.value;if(!s.isPlainObject(F))return M.issues.push({expected:"record",code:"invalid_type",input:F,inst:$}),M;const W=[],re=C.keyType._zod.values;if(re){M.value={};const fe=new Set;for(const Q of re)if(typeof Q=="string"||typeof Q=="number"||typeof Q=="symbol"){fe.add(typeof Q=="number"?Q.toString():Q);const se=C.keyType._zod.run({value:Q,issues:[]},L);if(se instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(se.issues.length){M.issues.push({code:"invalid_key",origin:"record",issues:se.issues.map(ce=>s.finalizeIssue(ce,L,S.config())),input:Q,path:[Q],inst:$});continue}const de=se.value,K=C.valueType._zod.run({value:F[Q],issues:[]},L);K instanceof Promise?W.push(K.then(ce=>{ce.issues.length&&M.issues.push(...s.prefixIssues(Q,ce.issues)),M.value[de]=ce.value})):(K.issues.length&&M.issues.push(...s.prefixIssues(Q,K.issues)),M.value[de]=K.value)}let q;for(const Q in F)fe.has(Q)||(q=q??[],q.push(Q));q&&q.length>0&&M.issues.push({code:"unrecognized_keys",input:F,inst:$,keys:q})}else{M.value={};for(const fe of Reflect.ownKeys(F)){if(fe==="__proto__"||!Object.prototype.propertyIsEnumerable.call(F,fe))continue;let q=C.keyType._zod.run({value:fe,issues:[]},L);if(q instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof fe=="string"&&c.number.test(fe)&&q.issues.length){const de=C.keyType._zod.run({value:Number(fe),issues:[]},L);if(de instanceof Promise)throw new Error("Async schemas not supported in object keys currently");de.issues.length===0&&(q=de)}if(q.issues.length){C.mode==="loose"?M.value[fe]=F[fe]:M.issues.push({code:"invalid_key",origin:"record",issues:q.issues.map(de=>s.finalizeIssue(de,L,S.config())),input:fe,path:[fe],inst:$});continue}const se=C.valueType._zod.run({value:F[fe],issues:[]},L);se instanceof Promise?W.push(se.then(de=>{de.issues.length&&M.issues.push(...s.prefixIssues(fe,de.issues)),M.value[q.value]=de.value})):(se.issues.length&&M.issues.push(...s.prefixIssues(fe,se.issues)),M.value[q.value]=se.value)}}return W.length?Promise.all(W).then(()=>M):M}}),t.$ZodMap=S.$constructor("$ZodMap",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>{const F=M.value;if(!(F instanceof Map))return M.issues.push({expected:"map",code:"invalid_type",input:F,inst:$}),M;const W=[];M.value=new Map;for(const[re,fe]of F){const q=C.keyType._zod.run({value:re,issues:[]},L),Q=C.valueType._zod.run({value:fe,issues:[]},L);q instanceof Promise||Q instanceof Promise?W.push(Promise.all([q,Q]).then(([se,de])=>{Ye(se,de,M,re,F,$,L)})):Ye(q,Q,M,re,F,$,L)}return W.length?Promise.all(W).then(()=>M):M}});function Ye($,C,M,L,F,W,re){$.issues.length&&(s.propertyKeyTypes.has(typeof L)?M.issues.push(...s.prefixIssues(L,$.issues)):M.issues.push({code:"invalid_key",origin:"map",input:F,inst:W,issues:$.issues.map(fe=>s.finalizeIssue(fe,re,S.config()))})),C.issues.length&&(s.propertyKeyTypes.has(typeof L)?M.issues.push(...s.prefixIssues(L,C.issues)):M.issues.push({origin:"map",code:"invalid_element",input:F,inst:W,key:L,issues:C.issues.map(fe=>s.finalizeIssue(fe,re,S.config()))})),M.value.set($.value,C.value)}t.$ZodSet=S.$constructor("$ZodSet",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>{const F=M.value;if(!(F instanceof Set))return M.issues.push({input:F,inst:$,expected:"set",code:"invalid_type"}),M;const W=[];M.value=new Set;for(const re of F){const fe=C.valueType._zod.run({value:re,issues:[]},L);fe instanceof Promise?W.push(fe.then(q=>vt(q,M))):vt(fe,M)}return W.length?Promise.all(W).then(()=>M):M}});function vt($,C){$.issues.length&&C.issues.push(...$.issues),C.value.add($.value)}t.$ZodEnum=S.$constructor("$ZodEnum",($,C)=>{t.$ZodType.init($,C);const M=s.getEnumValues(C.entries),L=new Set(M);$._zod.values=L,$._zod.pattern=new RegExp(`^(${M.filter(F=>s.propertyKeyTypes.has(typeof F)).map(F=>typeof F=="string"?s.escapeRegex(F):F.toString()).join("|")})$`),$._zod.parse=(F,W)=>{const re=F.value;return L.has(re)||F.issues.push({code:"invalid_value",values:M,input:re,inst:$}),F}}),t.$ZodLiteral=S.$constructor("$ZodLiteral",($,C)=>{if(t.$ZodType.init($,C),C.values.length===0)throw new Error("Cannot create literal schema with no valid values");const M=new Set(C.values);$._zod.values=M,$._zod.pattern=new RegExp(`^(${C.values.map(L=>typeof L=="string"?s.escapeRegex(L):L?s.escapeRegex(L.toString()):String(L)).join("|")})$`),$._zod.parse=(L,F)=>{const W=L.value;return M.has(W)||L.issues.push({code:"invalid_value",values:C.values,input:W,inst:$}),L}}),t.$ZodFile=S.$constructor("$ZodFile",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>{const F=M.value;return F instanceof File||M.issues.push({expected:"file",code:"invalid_type",input:F,inst:$}),M}}),t.$ZodTransform=S.$constructor("$ZodTransform",($,C)=>{t.$ZodType.init($,C),$._zod.optin="optional",$._zod.parse=(M,L)=>{if(L.direction==="backward")throw new S.$ZodEncodeError($.constructor.name);const F=C.transform(M.value,M);if(L.async)return(F instanceof Promise?F:Promise.resolve(F)).then(re=>(M.value=re,M.fallback=!0,M));if(F instanceof Promise)throw new S.$ZodAsyncError;return M.value=F,M.fallback=!0,M}});function Nt($,C){return C===void 0&&($.issues.length||$.fallback)?{issues:[],value:void 0}:$}t.$ZodOptional=S.$constructor("$ZodOptional",($,C)=>{t.$ZodType.init($,C),$._zod.optin="optional",$._zod.optout="optional",s.defineLazy($._zod,"values",()=>C.innerType._zod.values?new Set([...C.innerType._zod.values,void 0]):void 0),s.defineLazy($._zod,"pattern",()=>{const M=C.innerType._zod.pattern;return M?new RegExp(`^(${s.cleanRegex(M.source)})?$`):void 0}),$._zod.parse=(M,L)=>{if(C.innerType._zod.optin==="optional"){const F=M.value,W=C.innerType._zod.run(M,L);return W instanceof Promise?W.then(re=>Nt(re,F)):Nt(W,F)}return M.value===void 0?M:C.innerType._zod.run(M,L)}}),t.$ZodExactOptional=S.$constructor("$ZodExactOptional",($,C)=>{t.$ZodOptional.init($,C),s.defineLazy($._zod,"values",()=>C.innerType._zod.values),s.defineLazy($._zod,"pattern",()=>C.innerType._zod.pattern),$._zod.parse=(M,L)=>C.innerType._zod.run(M,L)}),t.$ZodNullable=S.$constructor("$ZodNullable",($,C)=>{t.$ZodType.init($,C),s.defineLazy($._zod,"optin",()=>C.innerType._zod.optin),s.defineLazy($._zod,"optout",()=>C.innerType._zod.optout),s.defineLazy($._zod,"pattern",()=>{const M=C.innerType._zod.pattern;return M?new RegExp(`^(${s.cleanRegex(M.source)}|null)$`):void 0}),s.defineLazy($._zod,"values",()=>C.innerType._zod.values?new Set([...C.innerType._zod.values,null]):void 0),$._zod.parse=(M,L)=>M.value===null?M:C.innerType._zod.run(M,L)}),t.$ZodDefault=S.$constructor("$ZodDefault",($,C)=>{t.$ZodType.init($,C),$._zod.optin="optional",s.defineLazy($._zod,"values",()=>C.innerType._zod.values),$._zod.parse=(M,L)=>{if(L.direction==="backward")return C.innerType._zod.run(M,L);if(M.value===void 0)return M.value=C.defaultValue,M;const F=C.innerType._zod.run(M,L);return F instanceof Promise?F.then(W=>Mt(W,C)):Mt(F,C)}});function Mt($,C){return $.value===void 0&&($.value=C.defaultValue),$}t.$ZodPrefault=S.$constructor("$ZodPrefault",($,C)=>{t.$ZodType.init($,C),$._zod.optin="optional",s.defineLazy($._zod,"values",()=>C.innerType._zod.values),$._zod.parse=(M,L)=>(L.direction==="backward"||M.value===void 0&&(M.value=C.defaultValue),C.innerType._zod.run(M,L))}),t.$ZodNonOptional=S.$constructor("$ZodNonOptional",($,C)=>{t.$ZodType.init($,C),s.defineLazy($._zod,"values",()=>{const M=C.innerType._zod.values;return M?new Set([...M].filter(L=>L!==void 0)):void 0}),$._zod.parse=(M,L)=>{const F=C.innerType._zod.run(M,L);return F instanceof Promise?F.then(W=>Dt(W,$)):Dt(F,$)}});function Dt($,C){return!$.issues.length&&$.value===void 0&&$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:C}),$}t.$ZodSuccess=S.$constructor("$ZodSuccess",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>{if(L.direction==="backward")throw new S.$ZodEncodeError("ZodSuccess");const F=C.innerType._zod.run(M,L);return F instanceof Promise?F.then(W=>(M.value=W.issues.length===0,M)):(M.value=F.issues.length===0,M)}}),t.$ZodCatch=S.$constructor("$ZodCatch",($,C)=>{t.$ZodType.init($,C),$._zod.optin="optional",s.defineLazy($._zod,"optout",()=>C.innerType._zod.optout),s.defineLazy($._zod,"values",()=>C.innerType._zod.values),$._zod.parse=(M,L)=>{if(L.direction==="backward")return C.innerType._zod.run(M,L);const F=C.innerType._zod.run(M,L);return F instanceof Promise?F.then(W=>(M.value=W.value,W.issues.length&&(M.value=C.catchValue({...M,error:{issues:W.issues.map(re=>s.finalizeIssue(re,L,S.config()))},input:M.value}),M.issues=[],M.fallback=!0),M)):(M.value=F.value,F.issues.length&&(M.value=C.catchValue({...M,error:{issues:F.issues.map(W=>s.finalizeIssue(W,L,S.config()))},input:M.value}),M.issues=[],M.fallback=!0),M)}}),t.$ZodNaN=S.$constructor("$ZodNaN",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>((typeof M.value!="number"||!Number.isNaN(M.value))&&M.issues.push({input:M.value,inst:$,expected:"nan",code:"invalid_type"}),M)}),t.$ZodPipe=S.$constructor("$ZodPipe",($,C)=>{t.$ZodType.init($,C),s.defineLazy($._zod,"values",()=>C.in._zod.values),s.defineLazy($._zod,"optin",()=>C.in._zod.optin),s.defineLazy($._zod,"optout",()=>C.out._zod.optout),s.defineLazy($._zod,"propValues",()=>C.in._zod.propValues),$._zod.parse=(M,L)=>{if(L.direction==="backward"){const W=C.out._zod.run(M,L);return W instanceof Promise?W.then(re=>zt(re,C.in,L)):zt(W,C.in,L)}const F=C.in._zod.run(M,L);return F instanceof Promise?F.then(W=>zt(W,C.out,L)):zt(F,C.out,L)}});function zt($,C,M){return $.issues.length?($.aborted=!0,$):C._zod.run({value:$.value,issues:$.issues,fallback:$.fallback},M)}t.$ZodCodec=S.$constructor("$ZodCodec",($,C)=>{t.$ZodType.init($,C),s.defineLazy($._zod,"values",()=>C.in._zod.values),s.defineLazy($._zod,"optin",()=>C.in._zod.optin),s.defineLazy($._zod,"optout",()=>C.out._zod.optout),s.defineLazy($._zod,"propValues",()=>C.in._zod.propValues),$._zod.parse=(M,L)=>{if((L.direction||"forward")==="forward"){const W=C.in._zod.run(M,L);return W instanceof Promise?W.then(re=>Zt(re,C,L)):Zt(W,C,L)}else{const W=C.out._zod.run(M,L);return W instanceof Promise?W.then(re=>Zt(re,C,L)):Zt(W,C,L)}}});function Zt($,C,M){if($.issues.length)return $.aborted=!0,$;if((M.direction||"forward")==="forward"){const F=C.transform($.value,$);return F instanceof Promise?F.then(W=>xt($,W,C.out,M)):xt($,F,C.out,M)}else{const F=C.reverseTransform($.value,$);return F instanceof Promise?F.then(W=>xt($,W,C.in,M)):xt($,F,C.in,M)}}function xt($,C,M,L){return $.issues.length?($.aborted=!0,$):M._zod.run({value:C,issues:$.issues},L)}t.$ZodPreprocess=S.$constructor("$ZodPreprocess",($,C)=>{t.$ZodPipe.init($,C)}),t.$ZodReadonly=S.$constructor("$ZodReadonly",($,C)=>{t.$ZodType.init($,C),s.defineLazy($._zod,"propValues",()=>C.innerType._zod.propValues),s.defineLazy($._zod,"values",()=>C.innerType._zod.values),s.defineLazy($._zod,"optin",()=>C.innerType?._zod?.optin),s.defineLazy($._zod,"optout",()=>C.innerType?._zod?.optout),$._zod.parse=(M,L)=>{if(L.direction==="backward")return C.innerType._zod.run(M,L);const F=C.innerType._zod.run(M,L);return F instanceof Promise?F.then(Ut):Ut(F)}});function Ut($){return $.value=Object.freeze($.value),$}t.$ZodTemplateLiteral=S.$constructor("$ZodTemplateLiteral",($,C)=>{t.$ZodType.init($,C);const M=[];for(const L of C.parts)if(typeof L=="object"&&L!==null){if(!L._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...L._zod.traits].shift()}`);const F=L._zod.pattern instanceof RegExp?L._zod.pattern.source:L._zod.pattern;if(!F)throw new Error(`Invalid template literal part: ${L._zod.traits}`);const W=F.startsWith("^")?1:0,re=F.endsWith("$")?F.length-1:F.length;M.push(F.slice(W,re))}else if(L===null||s.primitiveTypes.has(typeof L))M.push(s.escapeRegex(`${L}`));else throw new Error(`Invalid template literal part: ${L}`);$._zod.pattern=new RegExp(`^${M.join("")}$`),$._zod.parse=(L,F)=>typeof L.value!="string"?(L.issues.push({input:L.value,inst:$,expected:"string",code:"invalid_type"}),L):($._zod.pattern.lastIndex=0,$._zod.pattern.test(L.value)||L.issues.push({input:L.value,inst:$,code:"invalid_format",format:C.format??"template_literal",pattern:$._zod.pattern.source}),L)}),t.$ZodFunction=S.$constructor("$ZodFunction",($,C)=>(t.$ZodType.init($,C),$._def=C,$._zod.def=C,$.implement=M=>{if(typeof M!="function")throw new Error("implement() must be called with a function");return function(...L){const F=$._def.input?(0,U.parse)($._def.input,L):L,W=Reflect.apply(M,this,F);return $._def.output?(0,U.parse)($._def.output,W):W}},$.implementAsync=M=>{if(typeof M!="function")throw new Error("implementAsync() must be called with a function");return async function(...L){const F=$._def.input?await(0,U.parseAsync)($._def.input,L):L,W=await Reflect.apply(M,this,F);return $._def.output?await(0,U.parseAsync)($._def.output,W):W}},$._zod.parse=(M,L)=>typeof M.value!="function"?(M.issues.push({code:"invalid_type",expected:"function",input:M.value,inst:$}),M):($._def.output&&$._def.output._zod.def.type==="promise"?M.value=$.implementAsync(M.value):M.value=$.implement(M.value),M),$.input=(...M)=>{const L=$.constructor;return Array.isArray(M[0])?new L({type:"function",input:new t.$ZodTuple({type:"tuple",items:M[0],rest:M[1]}),output:$._def.output}):new L({type:"function",input:M[0],output:$._def.output})},$.output=M=>{const L=$.constructor;return new L({type:"function",input:$._def.input,output:M})},$)),t.$ZodPromise=S.$constructor("$ZodPromise",($,C)=>{t.$ZodType.init($,C),$._zod.parse=(M,L)=>Promise.resolve(M.value).then(F=>C.innerType._zod.run({value:F,issues:[]},L))}),t.$ZodLazy=S.$constructor("$ZodLazy",($,C)=>{t.$ZodType.init($,C),s.defineLazy($._zod,"innerType",()=>{const M=C;return M._cachedInner||(M._cachedInner=C.getter()),M._cachedInner}),s.defineLazy($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),s.defineLazy($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),s.defineLazy($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),s.defineLazy($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(M,L)=>$._zod.innerType._zod.run(M,L)}),t.$ZodCustom=S.$constructor("$ZodCustom",($,C)=>{_.$ZodCheck.init($,C),t.$ZodType.init($,C),$._zod.parse=(M,L)=>M,$._zod.check=M=>{const L=M.value,F=C.fn(L);if(F instanceof Promise)return F.then(W=>ur(W,M,L,$));ur(F,M,L,$)}});function ur($,C,M,L){if(!$){const F={code:"custom",input:M,inst:L,path:[...L._zod.def.path??[]],continue:!L._zod.def.abort};L._zod.def.params&&(F.params=L._zod.def.params),C.issues.push(s.issue(F))}}})(Nr);var Ji={},Wa={exports:{}},kn=Wa.exports;(function(t,m){var N=kn&&kn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=kn&&kn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=kn&&kn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function s(n){return c[n]??null}const u={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},p={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${n.expected}، ولكن تم إدخال ${D}`:`مدخلات غير مقبولة: يفترض إدخال ${r}، ولكن تم إدخال ${D}`}case"invalid_value":return n.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${S.stringifyPrimitive(n.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${r} ${n.maximum.toString()} ${x.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${r} ${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${r} ${n.minimum.toString()} ${x.unit}`:`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${r} ${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`:r.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${r.suffix}"`:r.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${r.includes}"`:r.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${r.pattern}`:`${u[r.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${S.joinValues(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function U(){return{localeError:z()}}t.exports=m.default})(Wa,Wa.exports);var QI=Wa.exports,qa={exports:{}},Pn=qa.exports;(function(t,m){var N=Pn&&Pn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Pn&&Pn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Pn&&Pn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function s(n){return c[n]??null}const u={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},p={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Yanlış dəyər: gözlənilən instanceof ${n.expected}, daxil olan ${D}`:`Yanlış dəyər: gözlənilən ${r}, daxil olan ${D}`}case"invalid_value":return n.values.length===1?`Yanlış dəyər: gözlənilən ${S.stringifyPrimitive(n.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${r}${n.maximum.toString()} ${x.unit??"element"}`:`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Çox kiçik: gözlənilən ${n.origin} ${r}${n.minimum.toString()} ${x.unit}`:`Çox kiçik: gözlənilən ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Yanlış mətn: "${r.prefix}" ilə başlamalıdır`:r.format==="ends_with"?`Yanlış mətn: "${r.suffix}" ilə bitməlidir`:r.format==="includes"?`Yanlış mətn: "${r.includes}" daxil olmalıdır`:r.format==="regex"?`Yanlış mətn: ${r.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${u[r.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function U(){return{localeError:z()}}t.exports=m.default})(qa,qa.exports);var WI=qa.exports,Ha={exports:{}},Nn=Ha.exports;(function(t,m){var N=Nn&&Nn.__createBinding||(Object.create?(function(s,u,p,n){n===void 0&&(n=p);var r=Object.getOwnPropertyDescriptor(u,p);(!r||("get"in r?!u.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return u[p]}}),Object.defineProperty(s,n,r)}):(function(s,u,p,n){n===void 0&&(n=p),s[n]=u[p]})),I=Nn&&Nn.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),_=Nn&&Nn.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var p in s)p!=="default"&&Object.prototype.hasOwnProperty.call(s,p)&&N(u,s,p);return I(u,s),u};Object.defineProperty(m,"__esModule",{value:!0}),m.default=c;const S=_(oe);function z(s,u,p,n){const r=Math.abs(s),x=r%10,D=r%100;return D>=11&&D<=19?n:x===1?u:x>=2&&x<=4?p:n}const U=()=>{const s={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function u(r){return s[r]??null}const p={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},n={nan:"NaN",number:"лік",array:"масіў"};return r=>{switch(r.code){case"invalid_type":{const x=n[r.expected]??r.expected,D=S.parsedType(r.input),ee=n[D]??D;return/^[A-Z]/.test(r.expected)?`Няправільны ўвод: чакаўся instanceof ${r.expected}, атрымана ${ee}`:`Няправільны ўвод: чакаўся ${x}, атрымана ${ee}`}case"invalid_value":return r.values.length===1?`Няправільны ўвод: чакалася ${S.stringifyPrimitive(r.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${S.joinValues(r.values,"|")}`;case"too_big":{const x=r.inclusive?"<=":"<",D=u(r.origin);if(D){const ee=Number(r.maximum),Y=z(ee,D.unit.one,D.unit.few,D.unit.many);return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна ${D.verb} ${x}${r.maximum.toString()} ${Y}`}return`Занадта вялікі: чакалася, што ${r.origin??"значэнне"} павінна быць ${x}${r.maximum.toString()}`}case"too_small":{const x=r.inclusive?">=":">",D=u(r.origin);if(D){const ee=Number(r.minimum),Y=z(ee,D.unit.one,D.unit.few,D.unit.many);return`Занадта малы: чакалася, што ${r.origin} павінна ${D.verb} ${x}${r.minimum.toString()} ${Y}`}return`Занадта малы: чакалася, што ${r.origin} павінна быць ${x}${r.minimum.toString()}`}case"invalid_format":{const x=r;return x.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${x.prefix}"`:x.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${x.suffix}"`:x.format==="includes"?`Няправільны радок: павінен змяшчаць "${x.includes}"`:x.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${x.pattern}`:`Няправільны ${p[x.format]??r.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${r.keys.length>1?"ключы":"ключ"}: ${S.joinValues(r.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${r.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${r.origin}`;default:return"Няправільны ўвод"}}};function c(){return{localeError:U()}}t.exports=m.default})(Ha,Ha.exports);var qI=Ha.exports,Ja={exports:{}},Cn=Ja.exports;(function(t,m){var N=Cn&&Cn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Cn&&Cn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Cn&&Cn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function s(n){return c[n]??null}const u={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},p={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Невалиден вход: очакван instanceof ${n.expected}, получен ${D}`:`Невалиден вход: очакван ${r}, получен ${D}`}case"invalid_value":return n.values.length===1?`Невалиден вход: очакван ${S.stringifyPrimitive(n.values[0])}`:`Невалидна опция: очаквано едно от ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Твърде голямо: очаква се ${n.origin??"стойност"} да съдържа ${r}${n.maximum.toString()} ${x.unit??"елемента"}`:`Твърде голямо: очаква се ${n.origin??"стойност"} да бъде ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Твърде малко: очаква се ${n.origin} да съдържа ${r}${n.minimum.toString()} ${x.unit}`:`Твърде малко: очаква се ${n.origin} да бъде ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;if(r.format==="starts_with")return`Невалиден низ: трябва да започва с "${r.prefix}"`;if(r.format==="ends_with")return`Невалиден низ: трябва да завършва с "${r.suffix}"`;if(r.format==="includes")return`Невалиден низ: трябва да включва "${r.includes}"`;if(r.format==="regex")return`Невалиден низ: трябва да съвпада с ${r.pattern}`;let x="Невалиден";return r.format==="emoji"&&(x="Невалидно"),r.format==="datetime"&&(x="Невалидно"),r.format==="date"&&(x="Невалидна"),r.format==="time"&&(x="Невалидно"),r.format==="duration"&&(x="Невалидна"),`${x} ${u[r.format]??n.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${n.divisor}`;case"unrecognized_keys":return`Неразпознат${n.keys.length>1?"и":""} ключ${n.keys.length>1?"ове":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${n.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${n.origin}`;default:return"Невалиден вход"}}};function U(){return{localeError:z()}}t.exports=m.default})(Ja,Ja.exports);var HI=Ja.exports,Ka={exports:{}},On=Ka.exports;(function(t,m){var N=On&&On.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=On&&On.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=On&&On.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function s(n){return c[n]??null}const u={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},p={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Tipus invàlid: s'esperava instanceof ${n.expected}, s'ha rebut ${D}`:`Tipus invàlid: s'esperava ${r}, s'ha rebut ${D}`}case"invalid_value":return n.values.length===1?`Valor invàlid: s'esperava ${S.stringifyPrimitive(n.values[0])}`:`Opció invàlida: s'esperava una de ${S.joinValues(n.values," o ")}`;case"too_big":{const r=n.inclusive?"com a màxim":"menys de",x=s(n.origin);return x?`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${r} ${n.maximum.toString()} ${x.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${r} ${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?"com a mínim":"més de",x=s(n.origin);return x?`Massa petit: s'esperava que ${n.origin} contingués ${r} ${n.minimum.toString()} ${x.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${r} ${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Format invàlid: ha de començar amb "${r.prefix}"`:r.format==="ends_with"?`Format invàlid: ha d'acabar amb "${r.suffix}"`:r.format==="includes"?`Format invàlid: ha d'incloure "${r.includes}"`:r.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${r.pattern}`:`Format invàlid per a ${u[r.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function U(){return{localeError:z()}}t.exports=m.default})(Ka,Ka.exports);var JI=Ka.exports,Xa={exports:{}},In=Xa.exports;(function(t,m){var N=In&&In.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=In&&In.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=In&&In.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function s(n){return c[n]??null}const u={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},p={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Neplatný vstup: očekáváno instanceof ${n.expected}, obdrženo ${D}`:`Neplatný vstup: očekáváno ${r}, obdrženo ${D}`}case"invalid_value":return n.values.length===1?`Neplatný vstup: očekáváno ${S.stringifyPrimitive(n.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${r}${n.maximum.toString()} ${x.unit??"prvků"}`:`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${r}${n.minimum.toString()} ${x.unit??"prvků"}`:`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Neplatný řetězec: musí začínat na "${r.prefix}"`:r.format==="ends_with"?`Neplatný řetězec: musí končit na "${r.suffix}"`:r.format==="includes"?`Neplatný řetězec: musí obsahovat "${r.includes}"`:r.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${r.pattern}`:`Neplatný formát ${u[r.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function U(){return{localeError:z()}}t.exports=m.default})(Xa,Xa.exports);var KI=Xa.exports,Ya={exports:{}},En=Ya.exports;(function(t,m){var N=En&&En.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=En&&En.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=En&&En.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function s(n){return c[n]??null}const u={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},p={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${D}`:`Ugyldigt input: forventede ${r}, fik ${D}`}case"invalid_value":return n.values.length===1?`Ugyldig værdi: forventede ${S.stringifyPrimitive(n.values[0])}`:`Ugyldigt valg: forventede en af følgende ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin),D=p[n.origin]??n.origin;return x?`For stor: forventede ${D??"value"} ${x.verb} ${r} ${n.maximum.toString()} ${x.unit??"elementer"}`:`For stor: forventede ${D??"value"} havde ${r} ${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin),D=p[n.origin]??n.origin;return x?`For lille: forventede ${D} ${x.verb} ${r} ${n.minimum.toString()} ${x.unit}`:`For lille: forventede ${D} havde ${r} ${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ugyldig streng: skal starte med "${r.prefix}"`:r.format==="ends_with"?`Ugyldig streng: skal ende med "${r.suffix}"`:r.format==="includes"?`Ugyldig streng: skal indeholde "${r.includes}"`:r.format==="regex"?`Ugyldig streng: skal matche mønsteret ${r.pattern}`:`Ugyldig ${u[r.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${n.origin}`;default:return"Ugyldigt input"}}};function U(){return{localeError:z()}}t.exports=m.default})(Ya,Ya.exports);var XI=Ya.exports,eo={exports:{}},Mn=eo.exports;(function(t,m){var N=Mn&&Mn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Mn&&Mn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Mn&&Mn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function s(n){return c[n]??null}const u={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},p={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Ungültige Eingabe: erwartet instanceof ${n.expected}, erhalten ${D}`:`Ungültige Eingabe: erwartet ${r}, erhalten ${D}`}case"invalid_value":return n.values.length===1?`Ungültige Eingabe: erwartet ${S.stringifyPrimitive(n.values[0])}`:`Ungültige Option: erwartet eine von ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Zu groß: erwartet, dass ${n.origin??"Wert"} ${r}${n.maximum.toString()} ${x.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${n.origin??"Wert"} ${r}${n.maximum.toString()} ist`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Zu klein: erwartet, dass ${n.origin} ${r}${n.minimum.toString()} ${x.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${r}${n.minimum.toString()} ist`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ungültiger String: muss mit "${r.prefix}" beginnen`:r.format==="ends_with"?`Ungültiger String: muss mit "${r.suffix}" enden`:r.format==="includes"?`Ungültiger String: muss "${r.includes}" enthalten`:r.format==="regex"?`Ungültiger String: muss dem Muster ${r.pattern} entsprechen`:`Ungültig: ${u[r.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function U(){return{localeError:z()}}t.exports=m.default})(eo,eo.exports);var YI=eo.exports,to={exports:{}},Dn=to.exports;(function(t,m){var N=Dn&&Dn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Dn&&Dn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Dn&&Dn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"χαρακτήρες",verb:"να έχει"},file:{unit:"bytes",verb:"να έχει"},array:{unit:"στοιχεία",verb:"να έχει"},set:{unit:"στοιχεία",verb:"να έχει"},map:{unit:"καταχωρήσεις",verb:"να έχει"}};function s(n){return c[n]??null}const u={regex:"είσοδος",email:"διεύθυνση email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ημερομηνία και ώρα",date:"ISO ημερομηνία",time:"ISO ώρα",duration:"ISO διάρκεια",ipv4:"διεύθυνση IPv4",ipv6:"διεύθυνση IPv6",mac:"διεύθυνση MAC",cidrv4:"εύρος IPv4",cidrv6:"εύρος IPv6",base64:"συμβολοσειρά κωδικοποιημένη σε base64",base64url:"συμβολοσειρά κωδικοποιημένη σε base64url",json_string:"συμβολοσειρά JSON",e164:"αριθμός E.164",jwt:"JWT",template_literal:"είσοδος"},p={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return typeof n.expected=="string"&&/^[A-Z]/.test(n.expected)?`Μη έγκυρη είσοδος: αναμενόταν instanceof ${n.expected}, λήφθηκε ${D}`:`Μη έγκυρη είσοδος: αναμενόταν ${r}, λήφθηκε ${D}`}case"invalid_value":return n.values.length===1?`Μη έγκυρη είσοδος: αναμενόταν ${S.stringifyPrimitive(n.values[0])}`:`Μη έγκυρη επιλογή: αναμενόταν ένα από ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Πολύ μεγάλο: αναμενόταν ${n.origin??"τιμή"} να έχει ${r}${n.maximum.toString()} ${x.unit??"στοιχεία"}`:`Πολύ μεγάλο: αναμενόταν ${n.origin??"τιμή"} να είναι ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Πολύ μικρό: αναμενόταν ${n.origin} να έχει ${r}${n.minimum.toString()} ${x.unit}`:`Πολύ μικρό: αναμενόταν ${n.origin} να είναι ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να ξεκινά με "${r.prefix}"`:r.format==="ends_with"?`Μη έγκυρη συμβολοσειρά: πρέπει να τελειώνει με "${r.suffix}"`:r.format==="includes"?`Μη έγκυρη συμβολοσειρά: πρέπει να περιέχει "${r.includes}"`:r.format==="regex"?`Μη έγκυρη συμβολοσειρά: πρέπει να ταιριάζει με το μοτίβο ${r.pattern}`:`Μη έγκυρο: ${u[r.format]??n.format}`}case"not_multiple_of":return`Μη έγκυρος αριθμός: πρέπει να είναι πολλαπλάσιο του ${n.divisor}`;case"unrecognized_keys":return`Άγνωστ${n.keys.length>1?"α":"ο"} κλειδ${n.keys.length>1?"ιά":"ί"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Μη έγκυρο κλειδί στο ${n.origin}`;case"invalid_union":return"Μη έγκυρη είσοδος";case"invalid_element":return`Μη έγκυρη τιμή στο ${n.origin}`;default:return"Μη έγκυρη είσοδος"}}};function U(){return{localeError:z()}}t.exports=m.default})(to,to.exports);var eE=to.exports,ro={exports:{}},An=ro.exports;(function(t,m){var N=An&&An.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=An&&An.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=An&&An.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function s(n){return c[n]??null}const u={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},p={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return`Invalid input: expected ${r}, received ${D}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${S.stringifyPrimitive(n.values[0])}`:`Invalid option: expected one of ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Too big: expected ${n.origin??"value"} to have ${r}${n.maximum.toString()} ${x.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Too small: expected ${n.origin} to have ${r}${n.minimum.toString()} ${x.unit}`:`Too small: expected ${n.origin} to be ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Invalid string: must start with "${r.prefix}"`:r.format==="ends_with"?`Invalid string: must end with "${r.suffix}"`:r.format==="includes"?`Invalid string: must include "${r.includes}"`:r.format==="regex"?`Invalid string: must match pattern ${r.pattern}`:`Invalid ${u[r.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return n.options&&Array.isArray(n.options)&&n.options.length>0?`Invalid discriminator value. Expected ${n.options.map(x=>`'${x}'`).join(" | ")}`:"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function U(){return{localeError:z()}}t.exports=m.default})(ro,ro.exports);var Im=ro.exports,no={exports:{}},zn=no.exports;(function(t,m){var N=zn&&zn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=zn&&zn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=zn&&zn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function s(n){return c[n]??null}const u={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},p={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendiĝis instanceof ${n.expected}, riceviĝis ${D}`:`Nevalida enigo: atendiĝis ${r}, riceviĝis ${D}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendiĝis ${S.stringifyPrimitive(n.values[0])}`:`Nevalida opcio: atendiĝis unu el ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${r}${n.maximum.toString()} ${x.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Tro malgranda: atendiĝis ke ${n.origin} havu ${r}${n.minimum.toString()} ${x.unit}`:`Tro malgranda: atendiĝis ke ${n.origin} estu ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${r.prefix}"`:r.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${r.suffix}"`:r.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${r.includes}"`:r.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${r.pattern}`:`Nevalida ${u[r.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} ŝlosilo${n.keys.length>1?"j":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function U(){return{localeError:z()}}t.exports=m.default})(no,no.exports);var tE=no.exports,io={exports:{}},Tn=io.exports;(function(t,m){var N=Tn&&Tn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Tn&&Tn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Tn&&Tn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function s(n){return c[n]??null}const u={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},p={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Entrada inválida: se esperaba instanceof ${n.expected}, recibido ${D}`:`Entrada inválida: se esperaba ${r}, recibido ${D}`}case"invalid_value":return n.values.length===1?`Entrada inválida: se esperaba ${S.stringifyPrimitive(n.values[0])}`:`Opción inválida: se esperaba una de ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin),D=p[n.origin]??n.origin;return x?`Demasiado grande: se esperaba que ${D??"valor"} tuviera ${r}${n.maximum.toString()} ${x.unit??"elementos"}`:`Demasiado grande: se esperaba que ${D??"valor"} fuera ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin),D=p[n.origin]??n.origin;return x?`Demasiado pequeño: se esperaba que ${D} tuviera ${r}${n.minimum.toString()} ${x.unit}`:`Demasiado pequeño: se esperaba que ${D} fuera ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Cadena inválida: debe comenzar con "${r.prefix}"`:r.format==="ends_with"?`Cadena inválida: debe terminar en "${r.suffix}"`:r.format==="includes"?`Cadena inválida: debe incluir "${r.includes}"`:r.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${r.pattern}`:`Inválido ${u[r.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${p[n.origin]??n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${p[n.origin]??n.origin}`;default:return"Entrada inválida"}}};function U(){return{localeError:z()}}t.exports=m.default})(io,io.exports);var rE=io.exports,ao={exports:{}},Rn=ao.exports;(function(t,m){var N=Rn&&Rn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Rn&&Rn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Rn&&Rn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function s(n){return c[n]??null}const u={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},p={nan:"NaN",number:"عدد",array:"آرایه"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`ورودی نامعتبر: می‌بایست instanceof ${n.expected} می‌بود، ${D} دریافت شد`:`ورودی نامعتبر: می‌بایست ${r} می‌بود، ${D} دریافت شد`}case"invalid_value":return n.values.length===1?`ورودی نامعتبر: می‌بایست ${S.stringifyPrimitive(n.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${S.joinValues(n.values,"|")} می‌بود`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`خیلی بزرگ: ${n.origin??"مقدار"} باید ${r}${n.maximum.toString()} ${x.unit??"عنصر"} باشد`:`خیلی بزرگ: ${n.origin??"مقدار"} باید ${r}${n.maximum.toString()} باشد`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`خیلی کوچک: ${n.origin} باید ${r}${n.minimum.toString()} ${x.unit} باشد`:`خیلی کوچک: ${n.origin} باید ${r}${n.minimum.toString()} باشد`}case"invalid_format":{const r=n;return r.format==="starts_with"?`رشته نامعتبر: باید با "${r.prefix}" شروع شود`:r.format==="ends_with"?`رشته نامعتبر: باید با "${r.suffix}" تمام شود`:r.format==="includes"?`رشته نامعتبر: باید شامل "${r.includes}" باشد`:r.format==="regex"?`رشته نامعتبر: باید با الگوی ${r.pattern} مطابقت داشته باشد`:`${u[r.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function U(){return{localeError:z()}}t.exports=m.default})(ao,ao.exports);var nE=ao.exports,oo={exports:{}},Zn=oo.exports;(function(t,m){var N=Zn&&Zn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Zn&&Zn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Zn&&Zn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function s(n){return c[n]??null}const u={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},p={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${D}`:`Virheellinen tyyppi: odotettiin ${r}, oli ${D}`}case"invalid_value":return n.values.length===1?`Virheellinen syöte: täytyy olla ${S.stringifyPrimitive(n.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Liian suuri: ${x.subject} täytyy olla ${r}${n.maximum.toString()} ${x.unit}`.trim():`Liian suuri: arvon täytyy olla ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Liian pieni: ${x.subject} täytyy olla ${r}${n.minimum.toString()} ${x.unit}`.trim():`Liian pieni: arvon täytyy olla ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${r.prefix}"`:r.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${r.suffix}"`:r.format==="includes"?`Virheellinen syöte: täytyy sisältää "${r.includes}"`:r.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${r.pattern}`:`Virheellinen ${u[r.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function U(){return{localeError:z()}}t.exports=m.default})(oo,oo.exports);var iE=oo.exports,so={exports:{}},Ln=so.exports;(function(t,m){var N=Ln&&Ln.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Ln&&Ln.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Ln&&Ln.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function s(n){return c[n]??null}const u={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},p={string:"chaîne",number:"nombre",int:"entier",boolean:"booléen",bigint:"grand entier",symbol:"symbole",undefined:"indéfini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Entrée invalide : instanceof ${n.expected} attendu, ${D} reçu`:`Entrée invalide : ${r} attendu, ${D} reçu`}case"invalid_value":return n.values.length===1?`Entrée invalide : ${S.stringifyPrimitive(n.values[0])} attendu`:`Option invalide : une valeur parmi ${S.joinValues(n.values,"|")} attendue`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Trop grand : ${p[n.origin]??"valeur"} doit ${x.verb} ${r}${n.maximum.toString()} ${x.unit??"élément(s)"}`:`Trop grand : ${p[n.origin]??"valeur"} doit être ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Trop petit : ${p[n.origin]??"valeur"} doit ${x.verb} ${r}${n.minimum.toString()} ${x.unit}`:`Trop petit : ${p[n.origin]??"valeur"} doit être ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Chaîne invalide : doit commencer par "${r.prefix}"`:r.format==="ends_with"?`Chaîne invalide : doit se terminer par "${r.suffix}"`:r.format==="includes"?`Chaîne invalide : doit inclure "${r.includes}"`:r.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${r.pattern}`:`${u[r.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function U(){return{localeError:z()}}t.exports=m.default})(so,so.exports);var aE=so.exports,lo={exports:{}},Un=lo.exports;(function(t,m){var N=Un&&Un.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Un&&Un.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Un&&Un.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function s(n){return c[n]??null}const u={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},p={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Entrée invalide : attendu instanceof ${n.expected}, reçu ${D}`:`Entrée invalide : attendu ${r}, reçu ${D}`}case"invalid_value":return n.values.length===1?`Entrée invalide : attendu ${S.stringifyPrimitive(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"≤":"<",x=s(n.origin);return x?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${r}${n.maximum.toString()} ${x.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?"≥":">",x=s(n.origin);return x?`Trop petit : attendu que ${n.origin} ait ${r}${n.minimum.toString()} ${x.unit}`:`Trop petit : attendu que ${n.origin} soit ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Chaîne invalide : doit commencer par "${r.prefix}"`:r.format==="ends_with"?`Chaîne invalide : doit se terminer par "${r.suffix}"`:r.format==="includes"?`Chaîne invalide : doit inclure "${r.includes}"`:r.format==="regex"?`Chaîne invalide : doit correspondre au motif ${r.pattern}`:`${u[r.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function U(){return{localeError:z()}}t.exports=m.default})(lo,lo.exports);var oE=lo.exports,co={exports:{}},Bn=co.exports;(function(t,m){var N=Bn&&Bn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Bn&&Bn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Bn&&Bn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},s={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},u=Y=>Y?c[Y]:void 0,p=Y=>{const ne=u(Y);return ne?ne.label:Y??c.unknown.label},n=Y=>`ה${p(Y)}`,r=Y=>(u(Y)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות",x=Y=>Y?s[Y]??null:null,D={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},ee={nan:"NaN"};return Y=>{switch(Y.code){case"invalid_type":{const ne=Y.expected,ue=ee[ne??""]??p(ne),ge=S.parsedType(Y.input),ie=ee[ge]??c[ge]?.label??ge;return/^[A-Z]/.test(Y.expected)?`קלט לא תקין: צריך להיות instanceof ${Y.expected}, התקבל ${ie}`:`קלט לא תקין: צריך להיות ${ue}, התקבל ${ie}`}case"invalid_value":{if(Y.values.length===1)return`ערך לא תקין: הערך חייב להיות ${S.stringifyPrimitive(Y.values[0])}`;const ne=Y.values.map(ie=>S.stringifyPrimitive(ie));if(Y.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${ne[0]} או ${ne[1]}`;const ue=ne[ne.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${ne.slice(0,-1).join(", ")} או ${ue}`}case"too_big":{const ne=x(Y.origin),ue=n(Y.origin??"value");if(Y.origin==="string")return`${ne?.longLabel??"ארוך"} מדי: ${ue} צריכה להכיל ${Y.maximum.toString()} ${ne?.unit??""} ${Y.inclusive?"או פחות":"לכל היותר"}`.trim();if(Y.origin==="number"){const be=Y.inclusive?`קטן או שווה ל-${Y.maximum}`:`קטן מ-${Y.maximum}`;return`גדול מדי: ${ue} צריך להיות ${be}`}if(Y.origin==="array"||Y.origin==="set"){const be=Y.origin==="set"?"צריכה":"צריך",ye=Y.inclusive?`${Y.maximum} ${ne?.unit??""} או פחות`:`פחות מ-${Y.maximum} ${ne?.unit??""}`;return`גדול מדי: ${ue} ${be} להכיל ${ye}`.trim()}const ge=Y.inclusive?"<=":"<",ie=r(Y.origin??"value");return ne?.unit?`${ne.longLabel} מדי: ${ue} ${ie} ${ge}${Y.maximum.toString()} ${ne.unit}`:`${ne?.longLabel??"גדול"} מדי: ${ue} ${ie} ${ge}${Y.maximum.toString()}`}case"too_small":{const ne=x(Y.origin),ue=n(Y.origin??"value");if(Y.origin==="string")return`${ne?.shortLabel??"קצר"} מדי: ${ue} צריכה להכיל ${Y.minimum.toString()} ${ne?.unit??""} ${Y.inclusive?"או יותר":"לפחות"}`.trim();if(Y.origin==="number"){const be=Y.inclusive?`גדול או שווה ל-${Y.minimum}`:`גדול מ-${Y.minimum}`;return`קטן מדי: ${ue} צריך להיות ${be}`}if(Y.origin==="array"||Y.origin==="set"){const be=Y.origin==="set"?"צריכה":"צריך";if(Y.minimum===1&&Y.inclusive){const ze=(Y.origin==="set","לפחות פריט אחד");return`קטן מדי: ${ue} ${be} להכיל ${ze}`}const ye=Y.inclusive?`${Y.minimum} ${ne?.unit??""} או יותר`:`יותר מ-${Y.minimum} ${ne?.unit??""}`;return`קטן מדי: ${ue} ${be} להכיל ${ye}`.trim()}const ge=Y.inclusive?">=":">",ie=r(Y.origin??"value");return ne?.unit?`${ne.shortLabel} מדי: ${ue} ${ie} ${ge}${Y.minimum.toString()} ${ne.unit}`:`${ne?.shortLabel??"קטן"} מדי: ${ue} ${ie} ${ge}${Y.minimum.toString()}`}case"invalid_format":{const ne=Y;if(ne.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${ne.prefix}"`;if(ne.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${ne.suffix}"`;if(ne.format==="includes")return`המחרוזת חייבת לכלול "${ne.includes}"`;if(ne.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${ne.pattern}`;const ue=D[ne.format],ge=ue?.label??ne.format,be=(ue?.gender??"m")==="f"?"תקינה":"תקין";return`${ge} לא ${be}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${Y.divisor}`;case"unrecognized_keys":return`מפתח${Y.keys.length>1?"ות":""} לא מזוה${Y.keys.length>1?"ים":"ה"}: ${S.joinValues(Y.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n(Y.origin??"array")}`;default:return"קלט לא תקין"}}};function U(){return{localeError:z()}}t.exports=m.default})(co,co.exports);var sE=co.exports,uo={exports:{}},Fn=uo.exports;(function(t,m){var N=Fn&&Fn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Fn&&Fn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Fn&&Fn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function s(n){return c[n]??null}const u={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},p={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Neispravan unos: očekuje se instanceof ${n.expected}, a primljeno je ${D}`:`Neispravan unos: očekuje se ${r}, a primljeno je ${D}`}case"invalid_value":return n.values.length===1?`Neispravna vrijednost: očekivano ${S.stringifyPrimitive(n.values[0])}`:`Neispravna opcija: očekivano jedno od ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin),D=p[n.origin]??n.origin;return x?`Preveliko: očekivano da ${D??"vrijednost"} ima ${r}${n.maximum.toString()} ${x.unit??"elemenata"}`:`Preveliko: očekivano da ${D??"vrijednost"} bude ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin),D=p[n.origin]??n.origin;return x?`Premalo: očekivano da ${D} ima ${r}${n.minimum.toString()} ${x.unit}`:`Premalo: očekivano da ${D} bude ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Neispravan tekst: mora započinjati s "${r.prefix}"`:r.format==="ends_with"?`Neispravan tekst: mora završavati s "${r.suffix}"`:r.format==="includes"?`Neispravan tekst: mora sadržavati "${r.includes}"`:r.format==="regex"?`Neispravan tekst: mora odgovarati uzorku ${r.pattern}`:`Neispravna ${u[r.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti višekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i ključevi":" ključ"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Neispravan ključ u ${p[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${p[n.origin]??n.origin}`;default:return"Neispravan unos"}}};function U(){return{localeError:z()}}t.exports=m.default})(uo,uo.exports);var lE=uo.exports,fo={exports:{}},Gn=fo.exports;(function(t,m){var N=Gn&&Gn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Gn&&Gn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Gn&&Gn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function s(n){return c[n]??null}const u={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},p={nan:"NaN",number:"szám",array:"tömb"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Érvénytelen bemenet: a várt érték instanceof ${n.expected}, a kapott érték ${D}`:`Érvénytelen bemenet: a várt érték ${r}, a kapott érték ${D}`}case"invalid_value":return n.values.length===1?`Érvénytelen bemenet: a várt érték ${S.stringifyPrimitive(n.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${r}${n.maximum.toString()} ${x.unit??"elem"}`:`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${r}${n.minimum.toString()} ${x.unit}`:`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Érvénytelen string: "${r.prefix}" értékkel kell kezdődnie`:r.format==="ends_with"?`Érvénytelen string: "${r.suffix}" értékkel kell végződnie`:r.format==="includes"?`Érvénytelen string: "${r.includes}" értéket kell tartalmaznia`:r.format==="regex"?`Érvénytelen string: ${r.pattern} mintának kell megfelelnie`:`Érvénytelen ${u[r.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function U(){return{localeError:z()}}t.exports=m.default})(fo,fo.exports);var cE=fo.exports,mo={exports:{}},Vn=mo.exports;(function(t,m){var N=Vn&&Vn.__createBinding||(Object.create?(function(u,p,n,r){r===void 0&&(r=n);var x=Object.getOwnPropertyDescriptor(p,n);(!x||("get"in x?!p.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return p[n]}}),Object.defineProperty(u,r,x)}):(function(u,p,n,r){r===void 0&&(r=n),u[r]=p[n]})),I=Vn&&Vn.__setModuleDefault||(Object.create?(function(u,p){Object.defineProperty(u,"default",{enumerable:!0,value:p})}):function(u,p){u.default=p}),_=Vn&&Vn.__importStar||function(u){if(u&&u.__esModule)return u;var p={};if(u!=null)for(var n in u)n!=="default"&&Object.prototype.hasOwnProperty.call(u,n)&&N(p,u,n);return I(p,u),p};Object.defineProperty(m,"__esModule",{value:!0}),m.default=s;const S=_(oe);function z(u,p,n){return Math.abs(u)===1?p:n}function U(u){if(!u)return"";const p=["ա","ե","ը","ի","ո","ու","օ"],n=u[u.length-1];return u+(p.includes(n)?"ն":"ը")}const c=()=>{const u={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function p(x){return u[x]??null}const n={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},r={nan:"NaN",number:"թիվ",array:"զանգված"};return x=>{switch(x.code){case"invalid_type":{const D=r[x.expected]??x.expected,ee=S.parsedType(x.input),Y=r[ee]??ee;return/^[A-Z]/.test(x.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${x.expected}, ստացվել է ${Y}`:`Սխալ մուտքագրում․ սպասվում էր ${D}, ստացվել է ${Y}`}case"invalid_value":return x.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${S.stringifyPrimitive(x.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${S.joinValues(x.values,"|")}`;case"too_big":{const D=x.inclusive?"<=":"<",ee=p(x.origin);if(ee){const Y=Number(x.maximum),ne=z(Y,ee.unit.one,ee.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${U(x.origin??"արժեք")} կունենա ${D}${x.maximum.toString()} ${ne}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${U(x.origin??"արժեք")} լինի ${D}${x.maximum.toString()}`}case"too_small":{const D=x.inclusive?">=":">",ee=p(x.origin);if(ee){const Y=Number(x.minimum),ne=z(Y,ee.unit.one,ee.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${U(x.origin)} կունենա ${D}${x.minimum.toString()} ${ne}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${U(x.origin)} լինի ${D}${x.minimum.toString()}`}case"invalid_format":{const D=x;return D.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${D.prefix}"-ով`:D.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${D.suffix}"-ով`:D.format==="includes"?`Սխալ տող․ պետք է պարունակի "${D.includes}"`:D.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${D.pattern} ձևաչափին`:`Սխալ ${n[D.format]??x.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${x.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${x.keys.length>1?"ներ":""}. ${S.joinValues(x.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${U(x.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${U(x.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function s(){return{localeError:c()}}t.exports=m.default})(mo,mo.exports);var uE=mo.exports,go={exports:{}},Qn=go.exports;(function(t,m){var N=Qn&&Qn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Qn&&Qn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Qn&&Qn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function s(n){return c[n]??null}const u={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},p={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${D}`:`Input tidak valid: diharapkan ${r}, diterima ${D}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${S.stringifyPrimitive(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${r}${n.maximum.toString()} ${x.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Terlalu kecil: diharapkan ${n.origin} memiliki ${r}${n.minimum.toString()} ${x.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`String tidak valid: harus dimulai dengan "${r.prefix}"`:r.format==="ends_with"?`String tidak valid: harus berakhir dengan "${r.suffix}"`:r.format==="includes"?`String tidak valid: harus menyertakan "${r.includes}"`:r.format==="regex"?`String tidak valid: harus sesuai pola ${r.pattern}`:`${u[r.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function U(){return{localeError:z()}}t.exports=m.default})(go,go.exports);var dE=go.exports,po={exports:{}},Wn=po.exports;(function(t,m){var N=Wn&&Wn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Wn&&Wn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Wn&&Wn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function s(n){return c[n]??null}const u={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},p={nan:"NaN",number:"númer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Rangt gildi: Þú slóst inn ${D} þar sem á að vera instanceof ${n.expected}`:`Rangt gildi: Þú slóst inn ${D} þar sem á að vera ${r}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert ráð fyrir ${S.stringifyPrimitive(n.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} hafi ${r}${n.maximum.toString()} ${x.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} sé ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Of lítið: gert er ráð fyrir að ${n.origin} hafi ${r}${n.minimum.toString()} ${x.unit}`:`Of lítið: gert er ráð fyrir að ${n.origin} sé ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ógildur strengur: verður að byrja á "${r.prefix}"`:r.format==="ends_with"?`Ógildur strengur: verður að enda á "${r.suffix}"`:r.format==="includes"?`Ógildur strengur: verður að innihalda "${r.includes}"`:r.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${r.pattern}`:`Rangt ${u[r.format]??n.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`Óþekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${n.origin}`;default:return"Rangt gildi"}}};function U(){return{localeError:z()}}t.exports=m.default})(po,po.exports);var fE=po.exports,ho={exports:{}},qn=ho.exports;(function(t,m){var N=qn&&qn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=qn&&qn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=qn&&qn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function s(n){return c[n]??null}const u={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},p={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${D}`:`Input non valido: atteso ${r}, ricevuto ${D}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${S.stringifyPrimitive(n.values[0])}`:`Opzione non valida: atteso uno tra ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Troppo grande: ${n.origin??"valore"} deve avere ${r}${n.maximum.toString()} ${x.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Troppo piccolo: ${n.origin} deve avere ${r}${n.minimum.toString()} ${x.unit}`:`Troppo piccolo: ${n.origin} deve essere ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Stringa non valida: deve iniziare con "${r.prefix}"`:r.format==="ends_with"?`Stringa non valida: deve terminare con "${r.suffix}"`:r.format==="includes"?`Stringa non valida: deve includere "${r.includes}"`:r.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${r.pattern}`:`Input non valido: ${u[r.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function U(){return{localeError:z()}}t.exports=m.default})(ho,ho.exports);var mE=ho.exports,vo={exports:{}},Hn=vo.exports;(function(t,m){var N=Hn&&Hn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Hn&&Hn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Hn&&Hn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function s(n){return c[n]??null}const u={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},p={nan:"NaN",number:"数値",array:"配列"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`無効な入力: instanceof ${n.expected}が期待されましたが、${D}が入力されました`:`無効な入力: ${r}が期待されましたが、${D}が入力されました`}case"invalid_value":return n.values.length===1?`無効な入力: ${S.stringifyPrimitive(n.values[0])}が期待されました`:`無効な選択: ${S.joinValues(n.values,"、")}のいずれかである必要があります`;case"too_big":{const r=n.inclusive?"以下である":"より小さい",x=s(n.origin);return x?`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${x.unit??"要素"}${r}必要があります`:`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${r}必要があります`}case"too_small":{const r=n.inclusive?"以上である":"より大きい",x=s(n.origin);return x?`小さすぎる値: ${n.origin}は${n.minimum.toString()}${x.unit}${r}必要があります`:`小さすぎる値: ${n.origin}は${n.minimum.toString()}${r}必要があります`}case"invalid_format":{const r=n;return r.format==="starts_with"?`無効な文字列: "${r.prefix}"で始まる必要があります`:r.format==="ends_with"?`無効な文字列: "${r.suffix}"で終わる必要があります`:r.format==="includes"?`無効な文字列: "${r.includes}"を含む必要があります`:r.format==="regex"?`無効な文字列: パターン${r.pattern}に一致する必要があります`:`無効な${u[r.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${S.joinValues(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function U(){return{localeError:z()}}t.exports=m.default})(vo,vo.exports);var gE=vo.exports,bo={exports:{}},Jn=bo.exports;(function(t,m){var N=Jn&&Jn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Jn&&Jn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Jn&&Jn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function s(n){return c[n]??null}const u={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული ველი",base64url:"base64url-კოდირებული ველი",json_string:"JSON ველი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},p={nan:"NaN",number:"რიცხვი",string:"ველი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${n.expected}, მიღებული ${D}`:`არასწორი შეყვანა: მოსალოდნელი ${r}, მიღებული ${D}`}case"invalid_value":return n.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${S.stringifyPrimitive(n.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${S.joinValues(n.values,"|")}-დან`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} ${x.verb} ${r}${n.maximum.toString()} ${x.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} იყოს ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`ზედმეტად პატარა: მოსალოდნელი ${n.origin} ${x.verb} ${r}${n.minimum.toString()} ${x.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${n.origin} იყოს ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`არასწორი ველი: უნდა იწყებოდეს "${r.prefix}"-ით`:r.format==="ends_with"?`არასწორი ველი: უნდა მთავრდებოდეს "${r.suffix}"-ით`:r.format==="includes"?`არასწორი ველი: უნდა შეიცავდეს "${r.includes}"-ს`:r.format==="regex"?`არასწორი ველი: უნდა შეესაბამებოდეს შაბლონს ${r.pattern}`:`არასწორი ${u[r.format]??n.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${n.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${n.keys.length>1?"ები":"ი"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${n.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${n.origin}-ში`;default:return"არასწორი შეყვანა"}}};function U(){return{localeError:z()}}t.exports=m.default})(bo,bo.exports);var pE=bo.exports,yo={exports:{}},xo={exports:{}},Kn=xo.exports;(function(t,m){var N=Kn&&Kn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Kn&&Kn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Kn&&Kn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function s(n){return c[n]??null}const u={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},p={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${n.expected} ប៉ុន្តែទទួលបាន ${D}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${r} ប៉ុន្តែទទួលបាន ${D}`}case"invalid_value":return n.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${S.stringifyPrimitive(n.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${r} ${n.maximum.toString()} ${x.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${r} ${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`តូចពេក៖ ត្រូវការ ${n.origin} ${r} ${n.minimum.toString()} ${x.unit}`:`តូចពេក៖ ត្រូវការ ${n.origin} ${r} ${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${r.prefix}"`:r.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${r.suffix}"`:r.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${r.includes}"`:r.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${r.pattern}`:`មិនត្រឹមត្រូវ៖ ${u[r.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function U(){return{localeError:z()}}t.exports=m.default})(xo,xo.exports);var Em=xo.exports,pm=yo.exports;(function(t,m){var N=pm&&pm.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(m,"__esModule",{value:!0}),m.default=_;const I=N(Em);function _(){return(0,I.default)()}t.exports=m.default})(yo,yo.exports);var hE=yo.exports,_o={exports:{}},Xn=_o.exports;(function(t,m){var N=Xn&&Xn.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=Xn&&Xn.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=Xn&&Xn.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function s(n){return c[n]??null}const u={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},p={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`잘못된 입력: 예상 타입은 instanceof ${n.expected}, 받은 타입은 ${D}입니다`:`잘못된 입력: 예상 타입은 ${r}, 받은 타입은 ${D}입니다`}case"invalid_value":return n.values.length===1?`잘못된 입력: 값은 ${S.stringifyPrimitive(n.values[0])} 이어야 합니다`:`잘못된 옵션: ${S.joinValues(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{const r=n.inclusive?"이하":"미만",x=r==="미만"?"이어야 합니다":"여야 합니다",D=s(n.origin),ee=D?.unit??"요소";return D?`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${ee} ${r}${x}`:`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${r}${x}`}case"too_small":{const r=n.inclusive?"이상":"초과",x=r==="이상"?"이어야 합니다":"여야 합니다",D=s(n.origin),ee=D?.unit??"요소";return D?`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${ee} ${r}${x}`:`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${r}${x}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`잘못된 문자열: "${r.prefix}"(으)로 시작해야 합니다`:r.format==="ends_with"?`잘못된 문자열: "${r.suffix}"(으)로 끝나야 합니다`:r.format==="includes"?`잘못된 문자열: "${r.includes}"을(를) 포함해야 합니다`:r.format==="regex"?`잘못된 문자열: 정규식 ${r.pattern} 패턴과 일치해야 합니다`:`잘못된 ${u[r.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function U(){return{localeError:z()}}t.exports=m.default})(_o,_o.exports);var vE=_o.exports,wo={exports:{}},Yn=wo.exports;(function(t,m){var N=Yn&&Yn.__createBinding||(Object.create?(function(u,p,n,r){r===void 0&&(r=n);var x=Object.getOwnPropertyDescriptor(p,n);(!x||("get"in x?!p.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return p[n]}}),Object.defineProperty(u,r,x)}):(function(u,p,n,r){r===void 0&&(r=n),u[r]=p[n]})),I=Yn&&Yn.__setModuleDefault||(Object.create?(function(u,p){Object.defineProperty(u,"default",{enumerable:!0,value:p})}):function(u,p){u.default=p}),_=Yn&&Yn.__importStar||function(u){if(u&&u.__esModule)return u;var p={};if(u!=null)for(var n in u)n!=="default"&&Object.prototype.hasOwnProperty.call(u,n)&&N(p,u,n);return I(p,u),p};Object.defineProperty(m,"__esModule",{value:!0}),m.default=s;const S=_(oe),z=u=>u.charAt(0).toUpperCase()+u.slice(1);function U(u){const p=Math.abs(u),n=p%10,r=p%100;return r>=11&&r<=19||n===0?"many":n===1?"one":"few"}const c=()=>{const u={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function p(x,D,ee,Y){const ne=u[x]??null;return ne===null?ne:{unit:ne.unit[D],verb:ne.verb[Y][ee?"inclusive":"notInclusive"]}}const n={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},r={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return x=>{switch(x.code){case"invalid_type":{const D=r[x.expected]??x.expected,ee=S.parsedType(x.input),Y=r[ee]??ee;return/^[A-Z]/.test(x.expected)?`Gautas tipas ${Y}, o tikėtasi - instanceof ${x.expected}`:`Gautas tipas ${Y}, o tikėtasi - ${D}`}case"invalid_value":return x.values.length===1?`Privalo būti ${S.stringifyPrimitive(x.values[0])}`:`Privalo būti vienas iš ${S.joinValues(x.values,"|")} pasirinkimų`;case"too_big":{const D=r[x.origin]??x.origin,ee=p(x.origin,U(Number(x.maximum)),x.inclusive??!1,"smaller");if(ee?.verb)return`${z(D??x.origin??"reikšmė")} ${ee.verb} ${x.maximum.toString()} ${ee.unit??"elementų"}`;const Y=x.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${z(D??x.origin??"reikšmė")} turi būti ${Y} ${x.maximum.toString()} ${ee?.unit}`}case"too_small":{const D=r[x.origin]??x.origin,ee=p(x.origin,U(Number(x.minimum)),x.inclusive??!1,"bigger");if(ee?.verb)return`${z(D??x.origin??"reikšmė")} ${ee.verb} ${x.minimum.toString()} ${ee.unit??"elementų"}`;const Y=x.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${z(D??x.origin??"reikšmė")} turi būti ${Y} ${x.minimum.toString()} ${ee?.unit}`}case"invalid_format":{const D=x;return D.format==="starts_with"?`Eilutė privalo prasidėti "${D.prefix}"`:D.format==="ends_with"?`Eilutė privalo pasibaigti "${D.suffix}"`:D.format==="includes"?`Eilutė privalo įtraukti "${D.includes}"`:D.format==="regex"?`Eilutė privalo atitikti ${D.pattern}`:`Neteisingas ${n[D.format]??x.format}`}case"not_multiple_of":return`Skaičius privalo būti ${x.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${x.keys.length>1?"i":"as"} rakt${x.keys.length>1?"ai":"as"}: ${S.joinValues(x.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{const D=r[x.origin]??x.origin;return`${z(D??x.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function s(){return{localeError:c()}}t.exports=m.default})(wo,wo.exports);var bE=wo.exports,So={exports:{}},ei=So.exports;(function(t,m){var N=ei&&ei.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=ei&&ei.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=ei&&ei.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function s(n){return c[n]??null}const u={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},p={nan:"NaN",number:"број",array:"низа"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Грешен внес: се очекува instanceof ${n.expected}, примено ${D}`:`Грешен внес: се очекува ${r}, примено ${D}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${S.stringifyPrimitive(n.values[0])}`:`Грешана опција: се очекува една ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${r}${n.maximum.toString()} ${x.unit??"елементи"}`:`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Премногу мал: се очекува ${n.origin} да има ${r}${n.minimum.toString()} ${x.unit}`:`Премногу мал: се очекува ${n.origin} да биде ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Неважечка низа: мора да започнува со "${r.prefix}"`:r.format==="ends_with"?`Неважечка низа: мора да завршува со "${r.suffix}"`:r.format==="includes"?`Неважечка низа: мора да вклучува "${r.includes}"`:r.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${r.pattern}`:`Invalid ${u[r.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function U(){return{localeError:z()}}t.exports=m.default})(So,So.exports);var yE=So.exports,jo={exports:{}},ti=jo.exports;(function(t,m){var N=ti&&ti.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=ti&&ti.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=ti&&ti.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function s(n){return c[n]??null}const u={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},p={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${D}`:`Input tidak sah: dijangka ${r}, diterima ${D}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${S.stringifyPrimitive(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Terlalu besar: dijangka ${n.origin??"nilai"} ${x.verb} ${r}${n.maximum.toString()} ${x.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Terlalu kecil: dijangka ${n.origin} ${x.verb} ${r}${n.minimum.toString()} ${x.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`String tidak sah: mesti bermula dengan "${r.prefix}"`:r.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${r.suffix}"`:r.format==="includes"?`String tidak sah: mesti mengandungi "${r.includes}"`:r.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${r.pattern}`:`${u[r.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function U(){return{localeError:z()}}t.exports=m.default})(jo,jo.exports);var xE=jo.exports,$o={exports:{}},ri=$o.exports;(function(t,m){var N=ri&&ri.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=ri&&ri.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=ri&&ri.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function s(n){return c[n]??null}const u={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},p={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${D}`:`Ongeldige invoer: verwacht ${r}, ontving ${D}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${S.stringifyPrimitive(n.values[0])}`:`Ongeldige optie: verwacht één van ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin),D=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return x?`Te ${D}: verwacht dat ${n.origin??"waarde"} ${r}${n.maximum.toString()} ${x.unit??"elementen"} ${x.verb}`:`Te ${D}: verwacht dat ${n.origin??"waarde"} ${r}${n.maximum.toString()} is`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin),D=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return x?`Te ${D}: verwacht dat ${n.origin} ${r}${n.minimum.toString()} ${x.unit} ${x.verb}`:`Te ${D}: verwacht dat ${n.origin} ${r}${n.minimum.toString()} is`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ongeldige tekst: moet met "${r.prefix}" beginnen`:r.format==="ends_with"?`Ongeldige tekst: moet op "${r.suffix}" eindigen`:r.format==="includes"?`Ongeldige tekst: moet "${r.includes}" bevatten`:r.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${r.pattern}`:`Ongeldig: ${u[r.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function U(){return{localeError:z()}}t.exports=m.default})($o,$o.exports);var _E=$o.exports,ko={exports:{}},ni=ko.exports;(function(t,m){var N=ni&&ni.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=ni&&ni.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=ni&&ni.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function s(n){return c[n]??null}const u={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},p={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${D}`:`Ugyldig input: forventet ${r}, fikk ${D}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${S.stringifyPrimitive(n.values[0])}`:`Ugyldig valg: forventet en av ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`For stor(t): forventet ${n.origin??"value"} til å ha ${r}${n.maximum.toString()} ${x.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til å ha ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`For lite(n): forventet ${n.origin} til å ha ${r}${n.minimum.toString()} ${x.unit}`:`For lite(n): forventet ${n.origin} til å ha ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ugyldig streng: må starte med "${r.prefix}"`:r.format==="ends_with"?`Ugyldig streng: må ende med "${r.suffix}"`:r.format==="includes"?`Ugyldig streng: må inneholde "${r.includes}"`:r.format==="regex"?`Ugyldig streng: må matche mønsteret ${r.pattern}`:`Ugyldig ${u[r.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function U(){return{localeError:z()}}t.exports=m.default})(ko,ko.exports);var wE=ko.exports,Po={exports:{}},ii=Po.exports;(function(t,m){var N=ii&&ii.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=ii&&ii.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=ii&&ii.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function s(n){return c[n]??null}const u={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},p={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Fâsit giren: umulan instanceof ${n.expected}, alınan ${D}`:`Fâsit giren: umulan ${r}, alınan ${D}`}case"invalid_value":return n.values.length===1?`Fâsit giren: umulan ${S.stringifyPrimitive(n.values[0])}`:`Fâsit tercih: mûteberler ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Fazla büyük: ${n.origin??"value"}, ${r}${n.maximum.toString()} ${x.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${n.origin??"value"}, ${r}${n.maximum.toString()} olmalıydı.`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Fazla küçük: ${n.origin}, ${r}${n.minimum.toString()} ${x.unit} sahip olmalıydı.`:`Fazla küçük: ${n.origin}, ${r}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Fâsit metin: "${r.prefix}" ile başlamalı.`:r.format==="ends_with"?`Fâsit metin: "${r.suffix}" ile bitmeli.`:r.format==="includes"?`Fâsit metin: "${r.includes}" ihtivâ etmeli.`:r.format==="regex"?`Fâsit metin: ${r.pattern} nakşına uymalı.`:`Fâsit ${u[r.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function U(){return{localeError:z()}}t.exports=m.default})(Po,Po.exports);var SE=Po.exports,No={exports:{}},ai=No.exports;(function(t,m){var N=ai&&ai.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=ai&&ai.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=ai&&ai.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function s(n){return c[n]??null}const u={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},p={nan:"NaN",number:"عدد",array:"ارې"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`ناسم ورودي: باید instanceof ${n.expected} وای, مګر ${D} ترلاسه شو`:`ناسم ورودي: باید ${r} وای, مګر ${D} ترلاسه شو`}case"invalid_value":return n.values.length===1?`ناسم ورودي: باید ${S.stringifyPrimitive(n.values[0])} وای`:`ناسم انتخاب: باید یو له ${S.joinValues(n.values,"|")} څخه وای`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`ډیر لوی: ${n.origin??"ارزښت"} باید ${r}${n.maximum.toString()} ${x.unit??"عنصرونه"} ولري`:`ډیر لوی: ${n.origin??"ارزښت"} باید ${r}${n.maximum.toString()} وي`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`ډیر کوچنی: ${n.origin} باید ${r}${n.minimum.toString()} ${x.unit} ولري`:`ډیر کوچنی: ${n.origin} باید ${r}${n.minimum.toString()} وي`}case"invalid_format":{const r=n;return r.format==="starts_with"?`ناسم متن: باید د "${r.prefix}" سره پیل شي`:r.format==="ends_with"?`ناسم متن: باید د "${r.suffix}" سره پای ته ورسيږي`:r.format==="includes"?`ناسم متن: باید "${r.includes}" ولري`:r.format==="regex"?`ناسم متن: باید د ${r.pattern} سره مطابقت ولري`:`${u[r.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function U(){return{localeError:z()}}t.exports=m.default})(No,No.exports);var jE=No.exports,Co={exports:{}},oi=Co.exports;(function(t,m){var N=oi&&oi.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=oi&&oi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=oi&&oi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function s(n){return c[n]??null}const u={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},p={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${n.expected}, otrzymano ${D}`:`Nieprawidłowe dane wejściowe: oczekiwano ${r}, otrzymano ${D}`}case"invalid_value":return n.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${S.stringifyPrimitive(n.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${r}${n.maximum.toString()} ${x.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${r}${n.minimum.toString()} ${x.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${r.prefix}"`:r.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${r.suffix}"`:r.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${r.includes}"`:r.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${r.pattern}`:`Nieprawidłow(y/a/e) ${u[r.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function U(){return{localeError:z()}}t.exports=m.default})(Co,Co.exports);var $E=Co.exports,Oo={exports:{}},si=Oo.exports;(function(t,m){var N=si&&si.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=si&&si.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=si&&si.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function s(n){return c[n]??null}const u={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},p={nan:"NaN",number:"número",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Tipo inválido: esperado instanceof ${n.expected}, recebido ${D}`:`Tipo inválido: esperado ${r}, recebido ${D}`}case"invalid_value":return n.values.length===1?`Entrada inválida: esperado ${S.stringifyPrimitive(n.values[0])}`:`Opção inválida: esperada uma das ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${r}${n.maximum.toString()} ${x.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Muito pequeno: esperado que ${n.origin} tivesse ${r}${n.minimum.toString()} ${x.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Texto inválido: deve começar com "${r.prefix}"`:r.format==="ends_with"?`Texto inválido: deve terminar com "${r.suffix}"`:r.format==="includes"?`Texto inválido: deve incluir "${r.includes}"`:r.format==="regex"?`Texto inválido: deve corresponder ao padrão ${r.pattern}`:`${u[r.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function U(){return{localeError:z()}}t.exports=m.default})(Oo,Oo.exports);var kE=Oo.exports,Io={exports:{}},li=Io.exports;(function(t,m){var N=li&&li.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=li&&li.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=li&&li.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"caractere",verb:"să aibă"},file:{unit:"octeți",verb:"să aibă"},array:{unit:"elemente",verb:"să aibă"},set:{unit:"elemente",verb:"să aibă"},map:{unit:"intrări",verb:"să aibă"}};function s(n){return c[n]??null}const u={regex:"intrare",email:"adresă de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dată și oră ISO",date:"dată ISO",time:"oră ISO",duration:"durată ISO",ipv4:"adresă IPv4",ipv6:"adresă IPv6",mac:"adresă MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"șir codat base64",base64url:"șir codat base64url",json_string:"șir JSON",e164:"număr E.164",jwt:"JWT",template_literal:"intrare"},p={nan:"NaN",string:"șir",number:"număr",boolean:"boolean",function:"funcție",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"număr mare",void:"void",never:"never",map:"hartă",set:"set"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return`Intrare invalidă: așteptat ${r}, primit ${D}`}case"invalid_value":return n.values.length===1?`Intrare invalidă: așteptat ${S.stringifyPrimitive(n.values[0])}`:`Opțiune invalidă: așteptat una dintre ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Prea mare: așteptat ca ${n.origin??"valoarea"} ${x.verb} ${r}${n.maximum.toString()} ${x.unit??"elemente"}`:`Prea mare: așteptat ca ${n.origin??"valoarea"} să fie ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Prea mic: așteptat ca ${n.origin} ${x.verb} ${r}${n.minimum.toString()} ${x.unit}`:`Prea mic: așteptat ca ${n.origin} să fie ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Șir invalid: trebuie să înceapă cu "${r.prefix}"`:r.format==="ends_with"?`Șir invalid: trebuie să se termine cu "${r.suffix}"`:r.format==="includes"?`Șir invalid: trebuie să includă "${r.includes}"`:r.format==="regex"?`Șir invalid: trebuie să se potrivească cu modelul ${r.pattern}`:`Format invalid: ${u[r.format]??n.format}`}case"not_multiple_of":return`Număr invalid: trebuie să fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Cheie invalidă în ${n.origin}`;case"invalid_union":return"Intrare invalidă";case"invalid_element":return`Valoare invalidă în ${n.origin}`;default:return"Intrare invalidă"}}};function U(){return{localeError:z()}}t.exports=m.default})(Io,Io.exports);var PE=Io.exports,Eo={exports:{}},ci=Eo.exports;(function(t,m){var N=ci&&ci.__createBinding||(Object.create?(function(s,u,p,n){n===void 0&&(n=p);var r=Object.getOwnPropertyDescriptor(u,p);(!r||("get"in r?!u.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return u[p]}}),Object.defineProperty(s,n,r)}):(function(s,u,p,n){n===void 0&&(n=p),s[n]=u[p]})),I=ci&&ci.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),_=ci&&ci.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var p in s)p!=="default"&&Object.prototype.hasOwnProperty.call(s,p)&&N(u,s,p);return I(u,s),u};Object.defineProperty(m,"__esModule",{value:!0}),m.default=c;const S=_(oe);function z(s,u,p,n){const r=Math.abs(s),x=r%10,D=r%100;return D>=11&&D<=19?n:x===1?u:x>=2&&x<=4?p:n}const U=()=>{const s={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function u(r){return s[r]??null}const p={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},n={nan:"NaN",number:"число",array:"массив"};return r=>{switch(r.code){case"invalid_type":{const x=n[r.expected]??r.expected,D=S.parsedType(r.input),ee=n[D]??D;return/^[A-Z]/.test(r.expected)?`Неверный ввод: ожидалось instanceof ${r.expected}, получено ${ee}`:`Неверный ввод: ожидалось ${x}, получено ${ee}`}case"invalid_value":return r.values.length===1?`Неверный ввод: ожидалось ${S.stringifyPrimitive(r.values[0])}`:`Неверный вариант: ожидалось одно из ${S.joinValues(r.values,"|")}`;case"too_big":{const x=r.inclusive?"<=":"<",D=u(r.origin);if(D){const ee=Number(r.maximum),Y=z(ee,D.unit.one,D.unit.few,D.unit.many);return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет иметь ${x}${r.maximum.toString()} ${Y}`}return`Слишком большое значение: ожидалось, что ${r.origin??"значение"} будет ${x}${r.maximum.toString()}`}case"too_small":{const x=r.inclusive?">=":">",D=u(r.origin);if(D){const ee=Number(r.minimum),Y=z(ee,D.unit.one,D.unit.few,D.unit.many);return`Слишком маленькое значение: ожидалось, что ${r.origin} будет иметь ${x}${r.minimum.toString()} ${Y}`}return`Слишком маленькое значение: ожидалось, что ${r.origin} будет ${x}${r.minimum.toString()}`}case"invalid_format":{const x=r;return x.format==="starts_with"?`Неверная строка: должна начинаться с "${x.prefix}"`:x.format==="ends_with"?`Неверная строка: должна заканчиваться на "${x.suffix}"`:x.format==="includes"?`Неверная строка: должна содержать "${x.includes}"`:x.format==="regex"?`Неверная строка: должна соответствовать шаблону ${x.pattern}`:`Неверный ${p[x.format]??r.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${r.divisor}`;case"unrecognized_keys":return`Нераспознанн${r.keys.length>1?"ые":"ый"} ключ${r.keys.length>1?"и":""}: ${S.joinValues(r.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${r.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${r.origin}`;default:return"Неверные входные данные"}}};function c(){return{localeError:U()}}t.exports=m.default})(Eo,Eo.exports);var NE=Eo.exports,Mo={exports:{}},ui=Mo.exports;(function(t,m){var N=ui&&ui.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=ui&&ui.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=ui&&ui.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function s(n){return c[n]??null}const u={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},p={nan:"NaN",number:"število",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pričakovano instanceof ${n.expected}, prejeto ${D}`:`Neveljaven vnos: pričakovano ${r}, prejeto ${D}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pričakovano ${S.stringifyPrimitive(n.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${r}${n.maximum.toString()} ${x.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Premajhno: pričakovano, da bo ${n.origin} imelo ${r}${n.minimum.toString()} ${x.unit}`:`Premajhno: pričakovano, da bo ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Neveljaven niz: mora se začeti z "${r.prefix}"`:r.format==="ends_with"?`Neveljaven niz: mora se končati z "${r.suffix}"`:r.format==="includes"?`Neveljaven niz: mora vsebovati "${r.includes}"`:r.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${r.pattern}`:`Neveljaven ${u[r.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function U(){return{localeError:z()}}t.exports=m.default})(Mo,Mo.exports);var CE=Mo.exports,Do={exports:{}},di=Do.exports;(function(t,m){var N=di&&di.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=di&&di.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=di&&di.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function s(n){return c[n]??null}const u={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},p={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: förväntat instanceof ${n.expected}, fick ${D}`:`Ogiltig inmatning: förväntat ${r}, fick ${D}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: förväntat ${S.stringifyPrimitive(n.values[0])}`:`Ogiltigt val: förväntade en av ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`För stor(t): förväntade ${n.origin??"värdet"} att ha ${r}${n.maximum.toString()} ${x.unit??"element"}`:`För stor(t): förväntat ${n.origin??"värdet"} att ha ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`För lite(t): förväntade ${n.origin??"värdet"} att ha ${r}${n.minimum.toString()} ${x.unit}`:`För lite(t): förväntade ${n.origin??"värdet"} att ha ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ogiltig sträng: måste börja med "${r.prefix}"`:r.format==="ends_with"?`Ogiltig sträng: måste sluta med "${r.suffix}"`:r.format==="includes"?`Ogiltig sträng: måste innehålla "${r.includes}"`:r.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${r.pattern}"`:`Ogiltig(t) ${u[r.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function U(){return{localeError:z()}}t.exports=m.default})(Do,Do.exports);var OE=Do.exports,Ao={exports:{}},fi=Ao.exports;(function(t,m){var N=fi&&fi.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=fi&&fi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=fi&&fi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function s(n){return c[n]??null}const u={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},p={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${n.expected}, பெறப்பட்டது ${D}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${r}, பெறப்பட்டது ${D}`}case"invalid_value":return n.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${S.stringifyPrimitive(n.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${S.joinValues(n.values,"|")} இல் ஒன்று`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${r}${n.maximum.toString()} ${x.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${r}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${r}${n.minimum.toString()} ${x.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${r}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{const r=n;return r.format==="starts_with"?`தவறான சரம்: "${r.prefix}" இல் தொடங்க வேண்டும்`:r.format==="ends_with"?`தவறான சரம்: "${r.suffix}" இல் முடிவடைய வேண்டும்`:r.format==="includes"?`தவறான சரம்: "${r.includes}" ஐ உள்ளடக்க வேண்டும்`:r.format==="regex"?`தவறான சரம்: ${r.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${u[r.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function U(){return{localeError:z()}}t.exports=m.default})(Ao,Ao.exports);var IE=Ao.exports,zo={exports:{}},mi=zo.exports;(function(t,m){var N=mi&&mi.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=mi&&mi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=mi&&mi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function s(n){return c[n]??null}const u={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},p={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${n.expected} แต่ได้รับ ${D}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${r} แต่ได้รับ ${D}`}case"invalid_value":return n.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${S.stringifyPrimitive(n.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"ไม่เกิน":"น้อยกว่า",x=s(n.origin);return x?`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${r} ${n.maximum.toString()} ${x.unit??"รายการ"}`:`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${r} ${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?"อย่างน้อย":"มากกว่า",x=s(n.origin);return x?`น้อยกว่ากำหนด: ${n.origin} ควรมี${r} ${n.minimum.toString()} ${x.unit}`:`น้อยกว่ากำหนด: ${n.origin} ควรมี${r} ${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${r.prefix}"`:r.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${r.suffix}"`:r.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${r.includes}" อยู่ในข้อความ`:r.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${r.pattern}`:`รูปแบบไม่ถูกต้อง: ${u[r.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function U(){return{localeError:z()}}t.exports=m.default})(zo,zo.exports);var EE=zo.exports,To={exports:{}},gi=To.exports;(function(t,m){var N=gi&&gi.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=gi&&gi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=gi&&gi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function s(n){return c[n]??null}const u={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},p={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Geçersiz değer: beklenen instanceof ${n.expected}, alınan ${D}`:`Geçersiz değer: beklenen ${r}, alınan ${D}`}case"invalid_value":return n.values.length===1?`Geçersiz değer: beklenen ${S.stringifyPrimitive(n.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Çok büyük: beklenen ${n.origin??"değer"} ${r}${n.maximum.toString()} ${x.unit??"öğe"}`:`Çok büyük: beklenen ${n.origin??"değer"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Çok küçük: beklenen ${n.origin} ${r}${n.minimum.toString()} ${x.unit}`:`Çok küçük: beklenen ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Geçersiz metin: "${r.prefix}" ile başlamalı`:r.format==="ends_with"?`Geçersiz metin: "${r.suffix}" ile bitmeli`:r.format==="includes"?`Geçersiz metin: "${r.includes}" içermeli`:r.format==="regex"?`Geçersiz metin: ${r.pattern} desenine uymalı`:`Geçersiz ${u[r.format]??n.format}`}case"not_multiple_of":return`Geçersiz sayı: ${n.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${n.keys.length>1?"lar":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${n.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function U(){return{localeError:z()}}t.exports=m.default})(To,To.exports);var ME=To.exports,Ro={exports:{}},Zo={exports:{}},pi=Zo.exports;(function(t,m){var N=pi&&pi.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=pi&&pi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=pi&&pi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function s(n){return c[n]??null}const u={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},p={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Неправильні вхідні дані: очікується instanceof ${n.expected}, отримано ${D}`:`Неправильні вхідні дані: очікується ${r}, отримано ${D}`}case"invalid_value":return n.values.length===1?`Неправильні вхідні дані: очікується ${S.stringifyPrimitive(n.values[0])}`:`Неправильна опція: очікується одне з ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Занадто велике: очікується, що ${n.origin??"значення"} ${x.verb} ${r}${n.maximum.toString()} ${x.unit??"елементів"}`:`Занадто велике: очікується, що ${n.origin??"значення"} буде ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Занадто мале: очікується, що ${n.origin} ${x.verb} ${r}${n.minimum.toString()} ${x.unit}`:`Занадто мале: очікується, що ${n.origin} буде ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Неправильний рядок: повинен починатися з "${r.prefix}"`:r.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${r.suffix}"`:r.format==="includes"?`Неправильний рядок: повинен містити "${r.includes}"`:r.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${r.pattern}`:`Неправильний ${u[r.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function U(){return{localeError:z()}}t.exports=m.default})(Zo,Zo.exports);var Mm=Zo.exports,hm=Ro.exports;(function(t,m){var N=hm&&hm.__importDefault||function(S){return S&&S.__esModule?S:{default:S}};Object.defineProperty(m,"__esModule",{value:!0}),m.default=_;const I=N(Mm);function _(){return(0,I.default)()}t.exports=m.default})(Ro,Ro.exports);var DE=Ro.exports,Lo={exports:{}},hi=Lo.exports;(function(t,m){var N=hi&&hi.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=hi&&hi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=hi&&hi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function s(n){return c[n]??null}const u={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},p={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`غلط ان پٹ: instanceof ${n.expected} متوقع تھا، ${D} موصول ہوا`:`غلط ان پٹ: ${r} متوقع تھا، ${D} موصول ہوا`}case"invalid_value":return n.values.length===1?`غلط ان پٹ: ${S.stringifyPrimitive(n.values[0])} متوقع تھا`:`غلط آپشن: ${S.joinValues(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`بہت بڑا: ${n.origin??"ویلیو"} کے ${r}${n.maximum.toString()} ${x.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${n.origin??"ویلیو"} کا ${r}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`بہت چھوٹا: ${n.origin} کے ${r}${n.minimum.toString()} ${x.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${n.origin} کا ${r}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{const r=n;return r.format==="starts_with"?`غلط سٹرنگ: "${r.prefix}" سے شروع ہونا چاہیے`:r.format==="ends_with"?`غلط سٹرنگ: "${r.suffix}" پر ختم ہونا چاہیے`:r.format==="includes"?`غلط سٹرنگ: "${r.includes}" شامل ہونا چاہیے`:r.format==="regex"?`غلط سٹرنگ: پیٹرن ${r.pattern} سے میچ ہونا چاہیے`:`غلط ${u[r.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${S.joinValues(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function U(){return{localeError:z()}}t.exports=m.default})(Lo,Lo.exports);var AE=Lo.exports,Uo={exports:{}},vi=Uo.exports;(function(t,m){var N=vi&&vi.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=vi&&vi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=vi&&vi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"},map:{unit:"yozuv",verb:"bo‘lishi kerak"}};function s(n){return c[n]??null}const u={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},p={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${D}`:`Noto‘g‘ri kirish: kutilgan ${r}, qabul qilingan ${D}`}case"invalid_value":return n.values.length===1?`Noto‘g‘ri kirish: kutilgan ${S.stringifyPrimitive(n.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Juda katta: kutilgan ${n.origin??"qiymat"} ${r}${n.maximum.toString()} ${x.unit} ${x.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Juda kichik: kutilgan ${n.origin} ${r}${n.minimum.toString()} ${x.unit} ${x.verb}`:`Juda kichik: kutilgan ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Noto‘g‘ri satr: "${r.prefix}" bilan boshlanishi kerak`:r.format==="ends_with"?`Noto‘g‘ri satr: "${r.suffix}" bilan tugashi kerak`:r.format==="includes"?`Noto‘g‘ri satr: "${r.includes}" ni o‘z ichiga olishi kerak`:r.format==="regex"?`Noto‘g‘ri satr: ${r.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${u[r.format]??n.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${n.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${n.keys.length>1?"lar":""}: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${n.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function U(){return{localeError:z()}}t.exports=m.default})(Uo,Uo.exports);var zE=Uo.exports,Bo={exports:{}},bi=Bo.exports;(function(t,m){var N=bi&&bi.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=bi&&bi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=bi&&bi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function s(n){return c[n]??null}const u={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},p={nan:"NaN",number:"số",array:"mảng"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${n.expected}, nhận được ${D}`:`Đầu vào không hợp lệ: mong đợi ${r}, nhận được ${D}`}case"invalid_value":return n.values.length===1?`Đầu vào không hợp lệ: mong đợi ${S.stringifyPrimitive(n.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Quá lớn: mong đợi ${n.origin??"giá trị"} ${x.verb} ${r}${n.maximum.toString()} ${x.unit??"phần tử"}`:`Quá lớn: mong đợi ${n.origin??"giá trị"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Quá nhỏ: mong đợi ${n.origin} ${x.verb} ${r}${n.minimum.toString()} ${x.unit}`:`Quá nhỏ: mong đợi ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${r.prefix}"`:r.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${r.suffix}"`:r.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${r.includes}"`:r.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${r.pattern}`:`${u[r.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function U(){return{localeError:z()}}t.exports=m.default})(Bo,Bo.exports);var TE=Bo.exports,Fo={exports:{}},yi=Fo.exports;(function(t,m){var N=yi&&yi.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=yi&&yi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=yi&&yi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function s(n){return c[n]??null}const u={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},p={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`无效输入:期望 instanceof ${n.expected},实际接收 ${D}`:`无效输入:期望 ${r},实际接收 ${D}`}case"invalid_value":return n.values.length===1?`无效输入:期望 ${S.stringifyPrimitive(n.values[0])}`:`无效选项:期望以下之一 ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`数值过大:期望 ${n.origin??"值"} ${r}${n.maximum.toString()} ${x.unit??"个元素"}`:`数值过大:期望 ${n.origin??"值"} ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`数值过小:期望 ${n.origin} ${r}${n.minimum.toString()} ${x.unit}`:`数值过小:期望 ${n.origin} ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`无效字符串:必须以 "${r.prefix}" 开头`:r.format==="ends_with"?`无效字符串:必须以 "${r.suffix}" 结尾`:r.format==="includes"?`无效字符串:必须包含 "${r.includes}"`:r.format==="regex"?`无效字符串:必须满足正则表达式 ${r.pattern}`:`无效${u[r.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function U(){return{localeError:z()}}t.exports=m.default})(Fo,Fo.exports);var RE=Fo.exports,Go={exports:{}},xi=Go.exports;(function(t,m){var N=xi&&xi.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=xi&&xi.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=xi&&xi.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function s(n){return c[n]??null}const u={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},p={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`無效的輸入值:預期為 instanceof ${n.expected},但收到 ${D}`:`無效的輸入值:預期為 ${r},但收到 ${D}`}case"invalid_value":return n.values.length===1?`無效的輸入值:預期為 ${S.stringifyPrimitive(n.values[0])}`:`無效的選項:預期為以下其中之一 ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`數值過大:預期 ${n.origin??"值"} 應為 ${r}${n.maximum.toString()} ${x.unit??"個元素"}`:`數值過大:預期 ${n.origin??"值"} 應為 ${r}${n.maximum.toString()}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`數值過小:預期 ${n.origin} 應為 ${r}${n.minimum.toString()} ${x.unit}`:`數值過小:預期 ${n.origin} 應為 ${r}${n.minimum.toString()}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`無效的字串:必須以 "${r.prefix}" 開頭`:r.format==="ends_with"?`無效的字串:必須以 "${r.suffix}" 結尾`:r.format==="includes"?`無效的字串:必須包含 "${r.includes}"`:r.format==="regex"?`無效的字串:必須符合格式 ${r.pattern}`:`無效的 ${u[r.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${S.joinValues(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function U(){return{localeError:z()}}t.exports=m.default})(Go,Go.exports);var ZE=Go.exports,Vo={exports:{}},_i=Vo.exports;(function(t,m){var N=_i&&_i.__createBinding||(Object.create?(function(c,s,u,p){p===void 0&&(p=u);var n=Object.getOwnPropertyDescriptor(s,u);(!n||("get"in n?!s.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return s[u]}}),Object.defineProperty(c,p,n)}):(function(c,s,u,p){p===void 0&&(p=u),c[p]=s[u]})),I=_i&&_i.__setModuleDefault||(Object.create?(function(c,s){Object.defineProperty(c,"default",{enumerable:!0,value:s})}):function(c,s){c.default=s}),_=_i&&_i.__importStar||function(c){if(c&&c.__esModule)return c;var s={};if(c!=null)for(var u in c)u!=="default"&&Object.prototype.hasOwnProperty.call(c,u)&&N(s,c,u);return I(s,c),s};Object.defineProperty(m,"__esModule",{value:!0}),m.default=U;const S=_(oe),z=()=>{const c={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function s(n){return c[n]??null}const u={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},p={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return n=>{switch(n.code){case"invalid_type":{const r=p[n.expected]??n.expected,x=S.parsedType(n.input),D=p[x]??x;return/^[A-Z]/.test(n.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${n.expected}, àmọ̀ a rí ${D}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${r}, àmọ̀ a rí ${D}`}case"invalid_value":return n.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${S.stringifyPrimitive(n.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${S.joinValues(n.values,"|")}`;case"too_big":{const r=n.inclusive?"<=":"<",x=s(n.origin);return x?`Tó pọ̀ jù: a ní láti jẹ́ pé ${n.origin??"iye"} ${x.verb} ${r}${n.maximum} ${x.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${r}${n.maximum}`}case"too_small":{const r=n.inclusive?">=":">",x=s(n.origin);return x?`Kéré ju: a ní láti jẹ́ pé ${n.origin} ${x.verb} ${r}${n.minimum} ${x.unit}`:`Kéré ju: a ní láti jẹ́ ${r}${n.minimum}`}case"invalid_format":{const r=n;return r.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${r.prefix}"`:r.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${r.suffix}"`:r.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${r.includes}"`:r.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${r.pattern}`:`Aṣìṣe: ${u[r.format]??n.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${n.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${S.joinValues(n.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${n.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${n.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function U(){return{localeError:z()}}t.exports=m.default})(Vo,Vo.exports);var LE=Vo.exports;(function(t){var m=Ji&&Ji.__importDefault||function(tt){return tt&&tt.__esModule?tt:{default:tt}};Object.defineProperty(t,"__esModule",{value:!0}),t.zhCN=t.vi=t.uz=t.ur=t.uk=t.ua=t.tr=t.th=t.ta=t.sv=t.sl=t.ru=t.ro=t.pt=t.pl=t.ps=t.ota=t.no=t.nl=t.ms=t.mk=t.lt=t.ko=t.km=t.kh=t.ka=t.ja=t.it=t.is=t.id=t.hy=t.hu=t.hr=t.he=t.frCA=t.fr=t.fi=t.fa=t.es=t.eo=t.en=t.el=t.de=t.da=t.cs=t.ca=t.bg=t.be=t.az=t.ar=void 0,t.yo=t.zhTW=void 0;var N=QI;Object.defineProperty(t,"ar",{enumerable:!0,get:function(){return m(N).default}});var I=WI;Object.defineProperty(t,"az",{enumerable:!0,get:function(){return m(I).default}});var _=qI;Object.defineProperty(t,"be",{enumerable:!0,get:function(){return m(_).default}});var S=HI;Object.defineProperty(t,"bg",{enumerable:!0,get:function(){return m(S).default}});var z=JI;Object.defineProperty(t,"ca",{enumerable:!0,get:function(){return m(z).default}});var U=KI;Object.defineProperty(t,"cs",{enumerable:!0,get:function(){return m(U).default}});var c=XI;Object.defineProperty(t,"da",{enumerable:!0,get:function(){return m(c).default}});var s=YI;Object.defineProperty(t,"de",{enumerable:!0,get:function(){return m(s).default}});var u=eE;Object.defineProperty(t,"el",{enumerable:!0,get:function(){return m(u).default}});var p=Im;Object.defineProperty(t,"en",{enumerable:!0,get:function(){return m(p).default}});var n=tE;Object.defineProperty(t,"eo",{enumerable:!0,get:function(){return m(n).default}});var r=rE;Object.defineProperty(t,"es",{enumerable:!0,get:function(){return m(r).default}});var x=nE;Object.defineProperty(t,"fa",{enumerable:!0,get:function(){return m(x).default}});var D=iE;Object.defineProperty(t,"fi",{enumerable:!0,get:function(){return m(D).default}});var ee=aE;Object.defineProperty(t,"fr",{enumerable:!0,get:function(){return m(ee).default}});var Y=oE;Object.defineProperty(t,"frCA",{enumerable:!0,get:function(){return m(Y).default}});var ne=sE;Object.defineProperty(t,"he",{enumerable:!0,get:function(){return m(ne).default}});var ue=lE;Object.defineProperty(t,"hr",{enumerable:!0,get:function(){return m(ue).default}});var ge=cE;Object.defineProperty(t,"hu",{enumerable:!0,get:function(){return m(ge).default}});var ie=uE;Object.defineProperty(t,"hy",{enumerable:!0,get:function(){return m(ie).default}});var be=dE;Object.defineProperty(t,"id",{enumerable:!0,get:function(){return m(be).default}});var ye=fE;Object.defineProperty(t,"is",{enumerable:!0,get:function(){return m(ye).default}});var ze=mE;Object.defineProperty(t,"it",{enumerable:!0,get:function(){return m(ze).default}});var Me=gE;Object.defineProperty(t,"ja",{enumerable:!0,get:function(){return m(Me).default}});var Ye=pE;Object.defineProperty(t,"ka",{enumerable:!0,get:function(){return m(Ye).default}});var vt=hE;Object.defineProperty(t,"kh",{enumerable:!0,get:function(){return m(vt).default}});var Nt=Em;Object.defineProperty(t,"km",{enumerable:!0,get:function(){return m(Nt).default}});var Mt=vE;Object.defineProperty(t,"ko",{enumerable:!0,get:function(){return m(Mt).default}});var Dt=bE;Object.defineProperty(t,"lt",{enumerable:!0,get:function(){return m(Dt).default}});var zt=yE;Object.defineProperty(t,"mk",{enumerable:!0,get:function(){return m(zt).default}});var Zt=xE;Object.defineProperty(t,"ms",{enumerable:!0,get:function(){return m(Zt).default}});var xt=_E;Object.defineProperty(t,"nl",{enumerable:!0,get:function(){return m(xt).default}});var Ut=wE;Object.defineProperty(t,"no",{enumerable:!0,get:function(){return m(Ut).default}});var ur=SE;Object.defineProperty(t,"ota",{enumerable:!0,get:function(){return m(ur).default}});var $=jE;Object.defineProperty(t,"ps",{enumerable:!0,get:function(){return m($).default}});var C=$E;Object.defineProperty(t,"pl",{enumerable:!0,get:function(){return m(C).default}});var M=kE;Object.defineProperty(t,"pt",{enumerable:!0,get:function(){return m(M).default}});var L=PE;Object.defineProperty(t,"ro",{enumerable:!0,get:function(){return m(L).default}});var F=NE;Object.defineProperty(t,"ru",{enumerable:!0,get:function(){return m(F).default}});var W=CE;Object.defineProperty(t,"sl",{enumerable:!0,get:function(){return m(W).default}});var re=OE;Object.defineProperty(t,"sv",{enumerable:!0,get:function(){return m(re).default}});var fe=IE;Object.defineProperty(t,"ta",{enumerable:!0,get:function(){return m(fe).default}});var q=EE;Object.defineProperty(t,"th",{enumerable:!0,get:function(){return m(q).default}});var Q=ME;Object.defineProperty(t,"tr",{enumerable:!0,get:function(){return m(Q).default}});var se=DE;Object.defineProperty(t,"ua",{enumerable:!0,get:function(){return m(se).default}});var de=Mm;Object.defineProperty(t,"uk",{enumerable:!0,get:function(){return m(de).default}});var K=AE;Object.defineProperty(t,"ur",{enumerable:!0,get:function(){return m(K).default}});var ce=zE;Object.defineProperty(t,"uz",{enumerable:!0,get:function(){return m(ce).default}});var xe=TE;Object.defineProperty(t,"vi",{enumerable:!0,get:function(){return m(xe).default}});var et=RE;Object.defineProperty(t,"zhCN",{enumerable:!0,get:function(){return m(et).default}});var Ge=ZE;Object.defineProperty(t,"zhTW",{enumerable:!0,get:function(){return m(Ge).default}});var Je=LE;Object.defineProperty(t,"yo",{enumerable:!0,get:function(){return m(Je).default}})})(Ji);var Lt={},vm;Object.defineProperty(Lt,"__esModule",{value:!0});Lt.globalRegistry=Lt.$ZodRegistry=Lt.$input=Lt.$output=void 0;Lt.registry=Am;Lt.$output=Symbol("ZodOutput");Lt.$input=Symbol("ZodInput");class Dm{constructor(){this._map=new WeakMap,this._idmap=new Map}add(m,...N){const I=N[0];return this._map.set(m,I),I&&typeof I=="object"&&"id"in I&&this._idmap.set(I.id,m),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(m){const N=this._map.get(m);return N&&typeof N=="object"&&"id"in N&&this._idmap.delete(N.id),this._map.delete(m),this}get(m){const N=m._zod.parent;if(N){const I={...this.get(N)??{}};delete I.id;const _={...I,...this._map.get(m)};return Object.keys(_).length?_:void 0}return this._map.get(m)}has(m){return this._map.has(m)}}Lt.$ZodRegistry=Dm;function Am(){return new Dm}(vm=globalThis).__zod_globalRegistry??(vm.__zod_globalRegistry=Am());Lt.globalRegistry=globalThis.__zod_globalRegistry;var le={},UE=le&&le.__createBinding||(Object.create?(function(t,m,N,I){I===void 0&&(I=N);var _=Object.getOwnPropertyDescriptor(m,N);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[N]}}),Object.defineProperty(t,I,_)}):(function(t,m,N,I){I===void 0&&(I=N),t[I]=m[N]})),BE=le&&le.__setModuleDefault||(Object.create?(function(t,m){Object.defineProperty(t,"default",{enumerable:!0,value:m})}):function(t,m){t.default=m}),Jo=le&&le.__importStar||function(t){if(t&&t.__esModule)return t;var m={};if(t!=null)for(var N in t)N!=="default"&&Object.prototype.hasOwnProperty.call(t,N)&&UE(m,t,N);return BE(m,t),m};Object.defineProperty(le,"__esModule",{value:!0});le.TimePrecision=void 0;le._string=FE;le._coercedString=GE;le._email=VE;le._guid=QE;le._uuid=WE;le._uuidv4=qE;le._uuidv6=HE;le._uuidv7=JE;le._url=KE;le._emoji=XE;le._nanoid=YE;le._cuid=eM;le._cuid2=tM;le._ulid=rM;le._xid=nM;le._ksuid=iM;le._ipv4=aM;le._ipv6=oM;le._mac=sM;le._cidrv4=lM;le._cidrv6=cM;le._base64=uM;le._base64url=dM;le._e164=fM;le._jwt=mM;le._isoDateTime=gM;le._isoDate=pM;le._isoTime=hM;le._isoDuration=vM;le._number=bM;le._coercedNumber=yM;le._int=xM;le._float32=_M;le._float64=wM;le._int32=SM;le._uint32=jM;le._boolean=$M;le._coercedBoolean=kM;le._bigint=PM;le._coercedBigint=NM;le._int64=CM;le._uint64=OM;le._symbol=IM;le._undefined=EM;le._null=MM;le._any=DM;le._unknown=AM;le._never=zM;le._void=TM;le._date=RM;le._coercedDate=ZM;le._nan=LM;le._lt=zm;le._lte=Yi;le._max=Yi;le._lte=Yi;le._max=Yi;le._gt=Tm;le._gte=ea;le._min=ea;le._gte=ea;le._min=ea;le._positive=UM;le._negative=BM;le._nonpositive=FM;le._nonnegative=GM;le._multipleOf=VM;le._maxSize=QM;le._minSize=WM;le._size=qM;le._maxLength=HM;le._minLength=JM;le._length=KM;le._regex=XM;le._lowercase=YM;le._uppercase=e2;le._includes=t2;le._startsWith=r2;le._endsWith=n2;le._property=i2;le._mime=a2;le._overwrite=wi;le._normalize=o2;le._trim=s2;le._toLowerCase=l2;le._toUpperCase=c2;le._slugify=u2;le._array=d2;le._union=f2;le._xor=m2;le._discriminatedUnion=g2;le._intersection=p2;le._tuple=h2;le._record=v2;le._map=b2;le._set=y2;le._enum=x2;le._nativeEnum=_2;le._literal=w2;le._file=S2;le._transform=j2;le._optional=$2;le._nullable=k2;le._default=P2;le._nonoptional=N2;le._success=C2;le._catch=O2;le._pipe=I2;le._readonly=E2;le._templateLiteral=M2;le._lazy=D2;le._promise=A2;le._custom=z2;le._refine=T2;le._superRefine=R2;le._check=Rm;le.describe=Z2;le.meta=L2;le._stringbool=U2;le._stringFormat=B2;const St=Jo(vr),Qo=Jo(Lt),Qa=Jo(Nr),ve=Jo(oe);function FE(t,m){return new t({type:"string",...ve.normalizeParams(m)})}function GE(t,m){return new t({type:"string",coerce:!0,...ve.normalizeParams(m)})}function VE(t,m){return new t({type:"string",format:"email",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function QE(t,m){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function WE(t,m){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function qE(t,m){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ve.normalizeParams(m)})}function HE(t,m){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ve.normalizeParams(m)})}function JE(t,m){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ve.normalizeParams(m)})}function KE(t,m){return new t({type:"string",format:"url",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function XE(t,m){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function YE(t,m){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function eM(t,m){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function tM(t,m){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function rM(t,m){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function nM(t,m){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function iM(t,m){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function aM(t,m){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function oM(t,m){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function sM(t,m){return new t({type:"string",format:"mac",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function lM(t,m){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function cM(t,m){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function uM(t,m){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function dM(t,m){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function fM(t,m){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...ve.normalizeParams(m)})}function mM(t,m){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...ve.normalizeParams(m)})}le.TimePrecision={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function gM(t,m){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ve.normalizeParams(m)})}function pM(t,m){return new t({type:"string",format:"date",check:"string_format",...ve.normalizeParams(m)})}function hM(t,m){return new t({type:"string",format:"time",check:"string_format",precision:null,...ve.normalizeParams(m)})}function vM(t,m){return new t({type:"string",format:"duration",check:"string_format",...ve.normalizeParams(m)})}function bM(t,m){return new t({type:"number",checks:[],...ve.normalizeParams(m)})}function yM(t,m){return new t({type:"number",coerce:!0,checks:[],...ve.normalizeParams(m)})}function xM(t,m){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...ve.normalizeParams(m)})}function _M(t,m){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...ve.normalizeParams(m)})}function wM(t,m){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...ve.normalizeParams(m)})}function SM(t,m){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...ve.normalizeParams(m)})}function jM(t,m){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...ve.normalizeParams(m)})}function $M(t,m){return new t({type:"boolean",...ve.normalizeParams(m)})}function kM(t,m){return new t({type:"boolean",coerce:!0,...ve.normalizeParams(m)})}function PM(t,m){return new t({type:"bigint",...ve.normalizeParams(m)})}function NM(t,m){return new t({type:"bigint",coerce:!0,...ve.normalizeParams(m)})}function CM(t,m){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ve.normalizeParams(m)})}function OM(t,m){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ve.normalizeParams(m)})}function IM(t,m){return new t({type:"symbol",...ve.normalizeParams(m)})}function EM(t,m){return new t({type:"undefined",...ve.normalizeParams(m)})}function MM(t,m){return new t({type:"null",...ve.normalizeParams(m)})}function DM(t){return new t({type:"any"})}function AM(t){return new t({type:"unknown"})}function zM(t,m){return new t({type:"never",...ve.normalizeParams(m)})}function TM(t,m){return new t({type:"void",...ve.normalizeParams(m)})}function RM(t,m){return new t({type:"date",...ve.normalizeParams(m)})}function ZM(t,m){return new t({type:"date",coerce:!0,...ve.normalizeParams(m)})}function LM(t,m){return new t({type:"nan",...ve.normalizeParams(m)})}function zm(t,m){return new St.$ZodCheckLessThan({check:"less_than",...ve.normalizeParams(m),value:t,inclusive:!1})}function Yi(t,m){return new St.$ZodCheckLessThan({check:"less_than",...ve.normalizeParams(m),value:t,inclusive:!0})}function Tm(t,m){return new St.$ZodCheckGreaterThan({check:"greater_than",...ve.normalizeParams(m),value:t,inclusive:!1})}function ea(t,m){return new St.$ZodCheckGreaterThan({check:"greater_than",...ve.normalizeParams(m),value:t,inclusive:!0})}function UM(t){return Tm(0,t)}function BM(t){return zm(0,t)}function FM(t){return Yi(0,t)}function GM(t){return ea(0,t)}function VM(t,m){return new St.$ZodCheckMultipleOf({check:"multiple_of",...ve.normalizeParams(m),value:t})}function QM(t,m){return new St.$ZodCheckMaxSize({check:"max_size",...ve.normalizeParams(m),maximum:t})}function WM(t,m){return new St.$ZodCheckMinSize({check:"min_size",...ve.normalizeParams(m),minimum:t})}function qM(t,m){return new St.$ZodCheckSizeEquals({check:"size_equals",...ve.normalizeParams(m),size:t})}function HM(t,m){return new St.$ZodCheckMaxLength({check:"max_length",...ve.normalizeParams(m),maximum:t})}function JM(t,m){return new St.$ZodCheckMinLength({check:"min_length",...ve.normalizeParams(m),minimum:t})}function KM(t,m){return new St.$ZodCheckLengthEquals({check:"length_equals",...ve.normalizeParams(m),length:t})}function XM(t,m){return new St.$ZodCheckRegex({check:"string_format",format:"regex",...ve.normalizeParams(m),pattern:t})}function YM(t){return new St.$ZodCheckLowerCase({check:"string_format",format:"lowercase",...ve.normalizeParams(t)})}function e2(t){return new St.$ZodCheckUpperCase({check:"string_format",format:"uppercase",...ve.normalizeParams(t)})}function t2(t,m){return new St.$ZodCheckIncludes({check:"string_format",format:"includes",...ve.normalizeParams(m),includes:t})}function r2(t,m){return new St.$ZodCheckStartsWith({check:"string_format",format:"starts_with",...ve.normalizeParams(m),prefix:t})}function n2(t,m){return new St.$ZodCheckEndsWith({check:"string_format",format:"ends_with",...ve.normalizeParams(m),suffix:t})}function i2(t,m,N){return new St.$ZodCheckProperty({check:"property",property:t,schema:m,...ve.normalizeParams(N)})}function a2(t,m){return new St.$ZodCheckMimeType({check:"mime_type",mime:t,...ve.normalizeParams(m)})}function wi(t){return new St.$ZodCheckOverwrite({check:"overwrite",tx:t})}function o2(t){return wi(m=>m.normalize(t))}function s2(){return wi(t=>t.trim())}function l2(){return wi(t=>t.toLowerCase())}function c2(){return wi(t=>t.toUpperCase())}function u2(){return wi(t=>ve.slugify(t))}function d2(t,m,N){return new t({type:"array",element:m,...ve.normalizeParams(N)})}function f2(t,m,N){return new t({type:"union",options:m,...ve.normalizeParams(N)})}function m2(t,m,N){return new t({type:"union",options:m,inclusive:!1,...ve.normalizeParams(N)})}function g2(t,m,N,I){return new t({type:"union",options:N,discriminator:m,...ve.normalizeParams(I)})}function p2(t,m,N){return new t({type:"intersection",left:m,right:N})}function h2(t,m,N,I){const _=N instanceof Qa.$ZodType,S=_?I:N,z=_?N:null;return new t({type:"tuple",items:m,rest:z,...ve.normalizeParams(S)})}function v2(t,m,N,I){return new t({type:"record",keyType:m,valueType:N,...ve.normalizeParams(I)})}function b2(t,m,N,I){return new t({type:"map",keyType:m,valueType:N,...ve.normalizeParams(I)})}function y2(t,m,N){return new t({type:"set",valueType:m,...ve.normalizeParams(N)})}function x2(t,m,N){const I=Array.isArray(m)?Object.fromEntries(m.map(_=>[_,_])):m;return new t({type:"enum",entries:I,...ve.normalizeParams(N)})}function _2(t,m,N){return new t({type:"enum",entries:m,...ve.normalizeParams(N)})}function w2(t,m,N){return new t({type:"literal",values:Array.isArray(m)?m:[m],...ve.normalizeParams(N)})}function S2(t,m){return new t({type:"file",...ve.normalizeParams(m)})}function j2(t,m){return new t({type:"transform",transform:m})}function $2(t,m){return new t({type:"optional",innerType:m})}function k2(t,m){return new t({type:"nullable",innerType:m})}function P2(t,m,N){return new t({type:"default",innerType:m,get defaultValue(){return typeof N=="function"?N():ve.shallowClone(N)}})}function N2(t,m,N){return new t({type:"nonoptional",innerType:m,...ve.normalizeParams(N)})}function C2(t,m){return new t({type:"success",innerType:m})}function O2(t,m,N){return new t({type:"catch",innerType:m,catchValue:typeof N=="function"?N:()=>N})}function I2(t,m,N){return new t({type:"pipe",in:m,out:N})}function E2(t,m){return new t({type:"readonly",innerType:m})}function M2(t,m,N){return new t({type:"template_literal",parts:m,...ve.normalizeParams(N)})}function D2(t,m){return new t({type:"lazy",getter:m})}function A2(t,m){return new t({type:"promise",innerType:m})}function z2(t,m,N){const I=ve.normalizeParams(N);return I.abort??(I.abort=!0),new t({type:"custom",check:"custom",fn:m,...I})}function T2(t,m,N){return new t({type:"custom",check:"custom",fn:m,...ve.normalizeParams(N)})}function R2(t,m){const N=Rm(I=>(I.addIssue=_=>{if(typeof _=="string")I.issues.push(ve.issue(_,I.value,N._zod.def));else{const S=_;S.fatal&&(S.continue=!1),S.code??(S.code="custom"),S.input??(S.input=I.value),S.inst??(S.inst=N),S.continue??(S.continue=!N._zod.def.abort),I.issues.push(ve.issue(S))}},t(I.value,I)),m);return N}function Rm(t,m){const N=new St.$ZodCheck({check:"custom",...ve.normalizeParams(m)});return N._zod.check=t,N}function Z2(t){const m=new St.$ZodCheck({check:"describe"});return m._zod.onattach=[N=>{const I=Qo.globalRegistry.get(N)??{};Qo.globalRegistry.add(N,{...I,description:t})}],m._zod.check=()=>{},m}function L2(t){const m=new St.$ZodCheck({check:"meta"});return m._zod.onattach=[N=>{const I=Qo.globalRegistry.get(N)??{};Qo.globalRegistry.add(N,{...I,...t})}],m._zod.check=()=>{},m}function U2(t,m){const N=ve.normalizeParams(m);let I=N.truthy??["true","1","yes","on","y","enabled"],_=N.falsy??["false","0","no","off","n","disabled"];N.case!=="sensitive"&&(I=I.map(r=>typeof r=="string"?r.toLowerCase():r),_=_.map(r=>typeof r=="string"?r.toLowerCase():r));const S=new Set(I),z=new Set(_),U=t.Codec??Qa.$ZodCodec,c=t.Boolean??Qa.$ZodBoolean,s=t.String??Qa.$ZodString,u=new s({type:"string",error:N.error}),p=new c({type:"boolean",error:N.error}),n=new U({type:"pipe",in:u,out:p,transform:((r,x)=>{let D=r;return N.case!=="sensitive"&&(D=D.toLowerCase()),S.has(D)?!0:z.has(D)?!1:(x.issues.push({code:"invalid_value",expected:"stringbool",values:[...S,...z],input:x.value,inst:n,continue:!1}),{})}),reverseTransform:((r,x)=>r===!0?I[0]||"true":_[0]||"false"),error:N.error});return n}function B2(t,m,N,I={}){const _=ve.normalizeParams(I),S={...ve.normalizeParams(I),check:"string_format",type:"string",format:m,fn:typeof N=="function"?N:U=>N.test(U),..._};return N instanceof RegExp&&(S.pattern=N),new t(S)}var ta={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createStandardJSONSchemaMethod=t.createToJSONSchemaMethod=void 0,t.initializeContext=N,t.process=I,t.extractDefs=_,t.finalize=S;const m=Lt;function N(s){let u=s?.target??"draft-2020-12";return u==="draft-4"&&(u="draft-04"),u==="draft-7"&&(u="draft-07"),{processors:s.processors??{},metadataRegistry:s?.metadata??m.globalRegistry,target:u,unrepresentable:s?.unrepresentable??"throw",override:s?.override??(()=>{}),io:s?.io??"output",counter:0,seen:new Map,cycles:s?.cycles??"ref",reused:s?.reused??"inline",external:s?.external??void 0}}function I(s,u,p={path:[],schemaPath:[]}){var n;const r=s._zod.def,x=u.seen.get(s);if(x)return x.count++,p.schemaPath.includes(s)&&(x.cycle=p.path),x.schema;const D={schema:{},count:1,cycle:void 0,path:p.path};u.seen.set(s,D);const ee=s._zod.toJSONSchema?.();if(ee)D.schema=ee;else{const ue={...p,schemaPath:[...p.schemaPath,s],path:p.path};if(s._zod.processJSONSchema)s._zod.processJSONSchema(u,D.schema,ue);else{const ie=D.schema,be=u.processors[r.type];if(!be)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);be(s,u,ie,ue)}const ge=s._zod.parent;ge&&(D.ref||(D.ref=ge),I(ge,u,ue),u.seen.get(ge).isParent=!0)}const Y=u.metadataRegistry.get(s);return Y&&Object.assign(D.schema,Y),u.io==="input"&&z(s)&&(delete D.schema.examples,delete D.schema.default),u.io==="input"&&"_prefault"in D.schema&&((n=D.schema).default??(n.default=D.schema._prefault)),delete D.schema._prefault,u.seen.get(s).schema}function _(s,u){const p=s.seen.get(u);if(!p)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const D of s.seen.entries()){const ee=s.metadataRegistry.get(D[0])?.id;if(ee){const Y=n.get(ee);if(Y&&Y!==D[0])throw new Error(`Duplicate schema id "${ee}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(ee,D[0])}}const r=D=>{const ee=s.target==="draft-2020-12"?"$defs":"definitions";if(s.external){const ge=s.external.registry.get(D[0])?.id,ie=s.external.uri??(ye=>ye);if(ge)return{ref:ie(ge)};const be=D[1].defId??D[1].schema.id??`schema${s.counter++}`;return D[1].defId=be,{defId:be,ref:`${ie("__shared")}#/${ee}/${be}`}}if(D[1]===p)return{ref:"#"};const ne=`#/${ee}/`,ue=D[1].schema.id??`__schema${s.counter++}`;return{defId:ue,ref:ne+ue}},x=D=>{if(D[1].schema.$ref)return;const ee=D[1],{ref:Y,defId:ne}=r(D);ee.def={...ee.schema},ne&&(ee.defId=ne);const ue=ee.schema;for(const ge in ue)delete ue[ge];ue.$ref=Y};if(s.cycles==="throw")for(const D of s.seen.entries()){const ee=D[1];if(ee.cycle)throw new Error(`Cycle detected: #/${ee.cycle?.join("/")}/<root>
93
-
94
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const D of s.seen.entries()){const ee=D[1];if(u===D[0]){x(D);continue}if(s.external){const ne=s.external.registry.get(D[0])?.id;if(u!==D[0]&&ne){x(D);continue}}if(s.metadataRegistry.get(D[0])?.id){x(D);continue}if(ee.cycle){x(D);continue}if(ee.count>1&&s.reused==="ref"){x(D);continue}}}function S(s,u){const p=s.seen.get(u);if(!p)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=ee=>{const Y=s.seen.get(ee);if(Y.ref===null)return;const ne=Y.def??Y.schema,ue={...ne},ge=Y.ref;if(Y.ref=null,ge){n(ge);const be=s.seen.get(ge),ye=be.schema;if(ye.$ref&&(s.target==="draft-07"||s.target==="draft-04"||s.target==="openapi-3.0")?(ne.allOf=ne.allOf??[],ne.allOf.push(ye)):Object.assign(ne,ye),Object.assign(ne,ue),ee._zod.parent===ge)for(const Me in ne)Me==="$ref"||Me==="allOf"||Me in ue||delete ne[Me];if(ye.$ref&&be.def)for(const Me in ne)Me==="$ref"||Me==="allOf"||Me in be.def&&JSON.stringify(ne[Me])===JSON.stringify(be.def[Me])&&delete ne[Me]}const ie=ee._zod.parent;if(ie&&ie!==ge){n(ie);const be=s.seen.get(ie);if(be?.schema.$ref&&(ne.$ref=be.schema.$ref,be.def))for(const ye in ne)ye==="$ref"||ye==="allOf"||ye in be.def&&JSON.stringify(ne[ye])===JSON.stringify(be.def[ye])&&delete ne[ye]}s.override({zodSchema:ee,jsonSchema:ne,path:Y.path??[]})};for(const ee of[...s.seen.entries()].reverse())n(ee[0]);const r={};if(s.target==="draft-2020-12"?r.$schema="https://json-schema.org/draft/2020-12/schema":s.target==="draft-07"?r.$schema="http://json-schema.org/draft-07/schema#":s.target==="draft-04"?r.$schema="http://json-schema.org/draft-04/schema#":s.target,s.external?.uri){const ee=s.external.registry.get(u)?.id;if(!ee)throw new Error("Schema is missing an `id` property");r.$id=s.external.uri(ee)}Object.assign(r,p.def??p.schema);const x=s.metadataRegistry.get(u)?.id;x!==void 0&&r.id===x&&delete r.id;const D=s.external?.defs??{};for(const ee of s.seen.entries()){const Y=ee[1];Y.def&&Y.defId&&(Y.def.id===Y.defId&&delete Y.def.id,D[Y.defId]=Y.def)}s.external||Object.keys(D).length>0&&(s.target==="draft-2020-12"?r.$defs=D:r.definitions=D);try{const ee=JSON.parse(JSON.stringify(r));return Object.defineProperty(ee,"~standard",{value:{...u["~standard"],jsonSchema:{input:(0,t.createStandardJSONSchemaMethod)(u,"input",s.processors),output:(0,t.createStandardJSONSchemaMethod)(u,"output",s.processors)}},enumerable:!1,writable:!1}),ee}catch{throw new Error("Error converting schema to JSON.")}}function z(s,u){const p=u??{seen:new Set};if(p.seen.has(s))return!1;p.seen.add(s);const n=s._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return z(n.element,p);if(n.type==="set")return z(n.valueType,p);if(n.type==="lazy")return z(n.getter(),p);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return z(n.innerType,p);if(n.type==="intersection")return z(n.left,p)||z(n.right,p);if(n.type==="record"||n.type==="map")return z(n.keyType,p)||z(n.valueType,p);if(n.type==="pipe")return s._zod.traits.has("$ZodCodec")?!0:z(n.in,p)||z(n.out,p);if(n.type==="object"){for(const r in n.shape)if(z(n.shape[r],p))return!0;return!1}if(n.type==="union"){for(const r of n.options)if(z(r,p))return!0;return!1}if(n.type==="tuple"){for(const r of n.items)if(z(r,p))return!0;return!!(n.rest&&z(n.rest,p))}return!1}const U=(s,u={})=>p=>{const n=N({...p,processors:u});return I(s,n),_(n,s),S(n,s)};t.createToJSONSchemaMethod=U;const c=(s,u,p={})=>n=>{const{libraryOptions:r,target:x}=n??{},D=N({...r??{},target:x,io:u,processors:p});return I(s,D),_(D,s),S(D,s)};t.createStandardJSONSchemaMethod=c})(ta);var ra={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.allProcessors=t.lazyProcessor=t.optionalProcessor=t.promiseProcessor=t.readonlyProcessor=t.pipeProcessor=t.catchProcessor=t.prefaultProcessor=t.defaultProcessor=t.nonoptionalProcessor=t.nullableProcessor=t.recordProcessor=t.tupleProcessor=t.intersectionProcessor=t.unionProcessor=t.objectProcessor=t.arrayProcessor=t.setProcessor=t.mapProcessor=t.transformProcessor=t.functionProcessor=t.customProcessor=t.successProcessor=t.fileProcessor=t.templateLiteralProcessor=t.nanProcessor=t.literalProcessor=t.enumProcessor=t.dateProcessor=t.unknownProcessor=t.anyProcessor=t.neverProcessor=t.voidProcessor=t.undefinedProcessor=t.nullProcessor=t.symbolProcessor=t.bigintProcessor=t.booleanProcessor=t.numberProcessor=t.stringProcessor=void 0,t.toJSONSchema=fe;const m=ta,N=oe,I={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},_=(q,Q,se,de)=>{const K=se;K.type="string";const{minimum:ce,maximum:xe,format:et,patterns:Ge,contentEncoding:Je}=q._zod.bag;if(typeof ce=="number"&&(K.minLength=ce),typeof xe=="number"&&(K.maxLength=xe),et&&(K.format=I[et]??et,K.format===""&&delete K.format,et==="time"&&delete K.format),Je&&(K.contentEncoding=Je),Ge&&Ge.size>0){const tt=[...Ge];tt.length===1?K.pattern=tt[0].source:tt.length>1&&(K.allOf=[...tt.map(gt=>({...Q.target==="draft-07"||Q.target==="draft-04"||Q.target==="openapi-3.0"?{type:"string"}:{},pattern:gt.source}))])}};t.stringProcessor=_;const S=(q,Q,se,de)=>{const K=se,{minimum:ce,maximum:xe,format:et,multipleOf:Ge,exclusiveMaximum:Je,exclusiveMinimum:tt}=q._zod.bag;typeof et=="string"&&et.includes("int")?K.type="integer":K.type="number";const gt=typeof tt=="number"&&tt>=(ce??Number.NEGATIVE_INFINITY),it=typeof Je=="number"&&Je<=(xe??Number.POSITIVE_INFINITY),ft=Q.target==="draft-04"||Q.target==="openapi-3.0";gt?ft?(K.minimum=tt,K.exclusiveMinimum=!0):K.exclusiveMinimum=tt:typeof ce=="number"&&(K.minimum=ce),it?ft?(K.maximum=Je,K.exclusiveMaximum=!0):K.exclusiveMaximum=Je:typeof xe=="number"&&(K.maximum=xe),typeof Ge=="number"&&(K.multipleOf=Ge)};t.numberProcessor=S;const z=(q,Q,se,de)=>{se.type="boolean"};t.booleanProcessor=z;const U=(q,Q,se,de)=>{if(Q.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")};t.bigintProcessor=U;const c=(q,Q,se,de)=>{if(Q.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")};t.symbolProcessor=c;const s=(q,Q,se,de)=>{Q.target==="openapi-3.0"?(se.type="string",se.nullable=!0,se.enum=[null]):se.type="null"};t.nullProcessor=s;const u=(q,Q,se,de)=>{if(Q.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")};t.undefinedProcessor=u;const p=(q,Q,se,de)=>{if(Q.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")};t.voidProcessor=p;const n=(q,Q,se,de)=>{se.not={}};t.neverProcessor=n;const r=(q,Q,se,de)=>{};t.anyProcessor=r;const x=(q,Q,se,de)=>{};t.unknownProcessor=x;const D=(q,Q,se,de)=>{if(Q.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")};t.dateProcessor=D;const ee=(q,Q,se,de)=>{const K=q._zod.def,ce=(0,N.getEnumValues)(K.entries);ce.every(xe=>typeof xe=="number")&&(se.type="number"),ce.every(xe=>typeof xe=="string")&&(se.type="string"),se.enum=ce};t.enumProcessor=ee;const Y=(q,Q,se,de)=>{const K=q._zod.def,ce=[];for(const xe of K.values)if(xe===void 0){if(Q.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof xe=="bigint"){if(Q.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");ce.push(Number(xe))}else ce.push(xe);if(ce.length!==0)if(ce.length===1){const xe=ce[0];se.type=xe===null?"null":typeof xe,Q.target==="draft-04"||Q.target==="openapi-3.0"?se.enum=[xe]:se.const=xe}else ce.every(xe=>typeof xe=="number")&&(se.type="number"),ce.every(xe=>typeof xe=="string")&&(se.type="string"),ce.every(xe=>typeof xe=="boolean")&&(se.type="boolean"),ce.every(xe=>xe===null)&&(se.type="null"),se.enum=ce};t.literalProcessor=Y;const ne=(q,Q,se,de)=>{if(Q.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")};t.nanProcessor=ne;const ue=(q,Q,se,de)=>{const K=se,ce=q._zod.pattern;if(!ce)throw new Error("Pattern not found in template literal");K.type="string",K.pattern=ce.source};t.templateLiteralProcessor=ue;const ge=(q,Q,se,de)=>{const K=se,ce={type:"string",format:"binary",contentEncoding:"binary"},{minimum:xe,maximum:et,mime:Ge}=q._zod.bag;xe!==void 0&&(ce.minLength=xe),et!==void 0&&(ce.maxLength=et),Ge?Ge.length===1?(ce.contentMediaType=Ge[0],Object.assign(K,ce)):(Object.assign(K,ce),K.anyOf=Ge.map(Je=>({contentMediaType:Je}))):Object.assign(K,ce)};t.fileProcessor=ge;const ie=(q,Q,se,de)=>{se.type="boolean"};t.successProcessor=ie;const be=(q,Q,se,de)=>{if(Q.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")};t.customProcessor=be;const ye=(q,Q,se,de)=>{if(Q.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")};t.functionProcessor=ye;const ze=(q,Q,se,de)=>{if(Q.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")};t.transformProcessor=ze;const Me=(q,Q,se,de)=>{if(Q.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")};t.mapProcessor=Me;const Ye=(q,Q,se,de)=>{if(Q.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")};t.setProcessor=Ye;const vt=(q,Q,se,de)=>{const K=se,ce=q._zod.def,{minimum:xe,maximum:et}=q._zod.bag;typeof xe=="number"&&(K.minItems=xe),typeof et=="number"&&(K.maxItems=et),K.type="array",K.items=(0,m.process)(ce.element,Q,{...de,path:[...de.path,"items"]})};t.arrayProcessor=vt;const Nt=(q,Q,se,de)=>{const K=se,ce=q._zod.def;K.type="object",K.properties={};const xe=ce.shape;for(const Je in xe)K.properties[Je]=(0,m.process)(xe[Je],Q,{...de,path:[...de.path,"properties",Je]});const et=new Set(Object.keys(xe)),Ge=new Set([...et].filter(Je=>{const tt=ce.shape[Je]._zod;return Q.io==="input"?tt.optin===void 0:tt.optout===void 0}));Ge.size>0&&(K.required=Array.from(Ge)),ce.catchall?._zod.def.type==="never"?K.additionalProperties=!1:ce.catchall?ce.catchall&&(K.additionalProperties=(0,m.process)(ce.catchall,Q,{...de,path:[...de.path,"additionalProperties"]})):Q.io==="output"&&(K.additionalProperties=!1)};t.objectProcessor=Nt;const Mt=(q,Q,se,de)=>{const K=q._zod.def,ce=K.inclusive===!1,xe=K.options.map((et,Ge)=>(0,m.process)(et,Q,{...de,path:[...de.path,ce?"oneOf":"anyOf",Ge]}));ce?se.oneOf=xe:se.anyOf=xe};t.unionProcessor=Mt;const Dt=(q,Q,se,de)=>{const K=q._zod.def,ce=(0,m.process)(K.left,Q,{...de,path:[...de.path,"allOf",0]}),xe=(0,m.process)(K.right,Q,{...de,path:[...de.path,"allOf",1]}),et=Je=>"allOf"in Je&&Object.keys(Je).length===1,Ge=[...et(ce)?ce.allOf:[ce],...et(xe)?xe.allOf:[xe]];se.allOf=Ge};t.intersectionProcessor=Dt;const zt=(q,Q,se,de)=>{const K=se,ce=q._zod.def;K.type="array";const xe=Q.target==="draft-2020-12"?"prefixItems":"items",et=Q.target==="draft-2020-12"||Q.target==="openapi-3.0"?"items":"additionalItems",Ge=ce.items.map((it,ft)=>(0,m.process)(it,Q,{...de,path:[...de.path,xe,ft]})),Je=ce.rest?(0,m.process)(ce.rest,Q,{...de,path:[...de.path,et,...Q.target==="openapi-3.0"?[ce.items.length]:[]]}):null;Q.target==="draft-2020-12"?(K.prefixItems=Ge,Je&&(K.items=Je)):Q.target==="openapi-3.0"?(K.items={anyOf:Ge},Je&&K.items.anyOf.push(Je),K.minItems=Ge.length,Je||(K.maxItems=Ge.length)):(K.items=Ge,Je&&(K.additionalItems=Je));const{minimum:tt,maximum:gt}=q._zod.bag;typeof tt=="number"&&(K.minItems=tt),typeof gt=="number"&&(K.maxItems=gt)};t.tupleProcessor=zt;const Zt=(q,Q,se,de)=>{const K=se,ce=q._zod.def;K.type="object";const xe=ce.keyType,Ge=xe._zod.bag?.patterns;if(ce.mode==="loose"&&Ge&&Ge.size>0){const tt=(0,m.process)(ce.valueType,Q,{...de,path:[...de.path,"patternProperties","*"]});K.patternProperties={};for(const gt of Ge)K.patternProperties[gt.source]=tt}else(Q.target==="draft-07"||Q.target==="draft-2020-12")&&(K.propertyNames=(0,m.process)(ce.keyType,Q,{...de,path:[...de.path,"propertyNames"]})),K.additionalProperties=(0,m.process)(ce.valueType,Q,{...de,path:[...de.path,"additionalProperties"]});const Je=xe._zod.values;if(Je){const tt=[...Je].filter(gt=>typeof gt=="string"||typeof gt=="number");tt.length>0&&(K.required=tt)}};t.recordProcessor=Zt;const xt=(q,Q,se,de)=>{const K=q._zod.def,ce=(0,m.process)(K.innerType,Q,de),xe=Q.seen.get(q);Q.target==="openapi-3.0"?(xe.ref=K.innerType,se.nullable=!0):se.anyOf=[ce,{type:"null"}]};t.nullableProcessor=xt;const Ut=(q,Q,se,de)=>{const K=q._zod.def;(0,m.process)(K.innerType,Q,de);const ce=Q.seen.get(q);ce.ref=K.innerType};t.nonoptionalProcessor=Ut;const ur=(q,Q,se,de)=>{const K=q._zod.def;(0,m.process)(K.innerType,Q,de);const ce=Q.seen.get(q);ce.ref=K.innerType,se.default=JSON.parse(JSON.stringify(K.defaultValue))};t.defaultProcessor=ur;const $=(q,Q,se,de)=>{const K=q._zod.def;(0,m.process)(K.innerType,Q,de);const ce=Q.seen.get(q);ce.ref=K.innerType,Q.io==="input"&&(se._prefault=JSON.parse(JSON.stringify(K.defaultValue)))};t.prefaultProcessor=$;const C=(q,Q,se,de)=>{const K=q._zod.def;(0,m.process)(K.innerType,Q,de);const ce=Q.seen.get(q);ce.ref=K.innerType;let xe;try{xe=K.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}se.default=xe};t.catchProcessor=C;const M=(q,Q,se,de)=>{const K=q._zod.def,ce=K.in._zod.traits.has("$ZodTransform"),xe=Q.io==="input"?ce?K.out:K.in:K.out;(0,m.process)(xe,Q,de);const et=Q.seen.get(q);et.ref=xe};t.pipeProcessor=M;const L=(q,Q,se,de)=>{const K=q._zod.def;(0,m.process)(K.innerType,Q,de);const ce=Q.seen.get(q);ce.ref=K.innerType,se.readOnly=!0};t.readonlyProcessor=L;const F=(q,Q,se,de)=>{const K=q._zod.def;(0,m.process)(K.innerType,Q,de);const ce=Q.seen.get(q);ce.ref=K.innerType};t.promiseProcessor=F;const W=(q,Q,se,de)=>{const K=q._zod.def;(0,m.process)(K.innerType,Q,de);const ce=Q.seen.get(q);ce.ref=K.innerType};t.optionalProcessor=W;const re=(q,Q,se,de)=>{const K=q._zod.innerType;(0,m.process)(K,Q,de);const ce=Q.seen.get(q);ce.ref=K};t.lazyProcessor=re,t.allProcessors={string:t.stringProcessor,number:t.numberProcessor,boolean:t.booleanProcessor,bigint:t.bigintProcessor,symbol:t.symbolProcessor,null:t.nullProcessor,undefined:t.undefinedProcessor,void:t.voidProcessor,never:t.neverProcessor,any:t.anyProcessor,unknown:t.unknownProcessor,date:t.dateProcessor,enum:t.enumProcessor,literal:t.literalProcessor,nan:t.nanProcessor,template_literal:t.templateLiteralProcessor,file:t.fileProcessor,success:t.successProcessor,custom:t.customProcessor,function:t.functionProcessor,transform:t.transformProcessor,map:t.mapProcessor,set:t.setProcessor,array:t.arrayProcessor,object:t.objectProcessor,union:t.unionProcessor,intersection:t.intersectionProcessor,tuple:t.tupleProcessor,record:t.recordProcessor,nullable:t.nullableProcessor,nonoptional:t.nonoptionalProcessor,default:t.defaultProcessor,prefault:t.prefaultProcessor,catch:t.catchProcessor,pipe:t.pipeProcessor,readonly:t.readonlyProcessor,promise:t.promiseProcessor,optional:t.optionalProcessor,lazy:t.lazyProcessor};function fe(q,Q){if("_idmap"in q){const de=q,K=(0,m.initializeContext)({...Q,processors:t.allProcessors}),ce={};for(const Ge of de._idmap.entries()){const[Je,tt]=Ge;(0,m.process)(tt,K)}const xe={},et={registry:de,uri:Q?.uri,defs:ce};K.external=et;for(const Ge of de._idmap.entries()){const[Je,tt]=Ge;(0,m.extractDefs)(K,tt),xe[Je]=(0,m.finalize)(K,tt)}if(Object.keys(ce).length>0){const Ge=K.target==="draft-2020-12"?"$defs":"definitions";xe.__shared={[Ge]:ce}}return{schemas:xe}}const se=(0,m.initializeContext)({...Q,processors:t.allProcessors});return(0,m.process)(q,se),(0,m.extractDefs)(se,q),(0,m.finalize)(se,q)}})(ra);var Ko={};Object.defineProperty(Ko,"__esModule",{value:!0});Ko.JSONSchemaGenerator=void 0;const F2=ra,Va=ta;class G2{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(m){this.ctx.counter=m}get seen(){return this.ctx.seen}constructor(m){let N=m?.target??"draft-2020-12";N==="draft-4"&&(N="draft-04"),N==="draft-7"&&(N="draft-07"),this.ctx=(0,Va.initializeContext)({processors:F2.allProcessors,target:N,...m?.metadata&&{metadata:m.metadata},...m?.unrepresentable&&{unrepresentable:m.unrepresentable},...m?.override&&{override:m.override},...m?.io&&{io:m.io}})}process(m,N={path:[],schemaPath:[]}){return(0,Va.process)(m,this.ctx,N)}emit(m,N){N&&(N.cycles&&(this.ctx.cycles=N.cycles),N.reused&&(this.ctx.reused=N.reused),N.external&&(this.ctx.external=N.external)),(0,Va.extractDefs)(this.ctx,m);const I=(0,Va.finalize)(this.ctx,m),{"~standard":_,...S}=I;return S}}Ko.JSONSchemaGenerator=G2;var Zm={};Object.defineProperty(Zm,"__esModule",{value:!0});(function(t){var m=Pt&&Pt.__createBinding||(Object.create?(function(U,c,s,u){u===void 0&&(u=s);var p=Object.getOwnPropertyDescriptor(c,s);(!p||("get"in p?!c.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return c[s]}}),Object.defineProperty(U,u,p)}):(function(U,c,s,u){u===void 0&&(u=s),U[u]=c[s]})),N=Pt&&Pt.__setModuleDefault||(Object.create?(function(U,c){Object.defineProperty(U,"default",{enumerable:!0,value:c})}):function(U,c){U.default=c}),I=Pt&&Pt.__exportStar||function(U,c){for(var s in U)s!=="default"&&!Object.prototype.hasOwnProperty.call(c,s)&&m(c,U,s)},_=Pt&&Pt.__importStar||function(U){if(U&&U.__esModule)return U;var c={};if(U!=null)for(var s in U)s!=="default"&&Object.prototype.hasOwnProperty.call(U,s)&&m(c,U,s);return N(c,U),c};Object.defineProperty(t,"__esModule",{value:!0}),t.JSONSchema=t.JSONSchemaGenerator=t.toJSONSchema=t.locales=t.regexes=t.util=void 0,I(Yr,t),I(Pr,t),I(Et,t),I(Nr,t),I(vr,t),I(Xi,t),t.util=_(oe),t.regexes=_(br),t.locales=_(Ji),I(Lt,t),I(Ki,t),I(le,t),I(ta,t);var S=ra;Object.defineProperty(t,"toJSONSchema",{enumerable:!0,get:function(){return S.toJSONSchema}});var z=Ko;Object.defineProperty(t,"JSONSchemaGenerator",{enumerable:!0,get:function(){return z.JSONSchemaGenerator}}),t.JSONSchema=_(Zm)})(Pt);var $r={},Xo={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.slugify=t.toUpperCase=t.toLowerCase=t.trim=t.normalize=t.overwrite=t.mime=t.property=t.endsWith=t.startsWith=t.includes=t.uppercase=t.lowercase=t.regex=t.length=t.minLength=t.maxLength=t.size=t.minSize=t.maxSize=t.multipleOf=t.nonnegative=t.nonpositive=t.negative=t.positive=t.gte=t.gt=t.lte=t.lt=void 0;var m=Pt;Object.defineProperty(t,"lt",{enumerable:!0,get:function(){return m._lt}}),Object.defineProperty(t,"lte",{enumerable:!0,get:function(){return m._lte}}),Object.defineProperty(t,"gt",{enumerable:!0,get:function(){return m._gt}}),Object.defineProperty(t,"gte",{enumerable:!0,get:function(){return m._gte}}),Object.defineProperty(t,"positive",{enumerable:!0,get:function(){return m._positive}}),Object.defineProperty(t,"negative",{enumerable:!0,get:function(){return m._negative}}),Object.defineProperty(t,"nonpositive",{enumerable:!0,get:function(){return m._nonpositive}}),Object.defineProperty(t,"nonnegative",{enumerable:!0,get:function(){return m._nonnegative}}),Object.defineProperty(t,"multipleOf",{enumerable:!0,get:function(){return m._multipleOf}}),Object.defineProperty(t,"maxSize",{enumerable:!0,get:function(){return m._maxSize}}),Object.defineProperty(t,"minSize",{enumerable:!0,get:function(){return m._minSize}}),Object.defineProperty(t,"size",{enumerable:!0,get:function(){return m._size}}),Object.defineProperty(t,"maxLength",{enumerable:!0,get:function(){return m._maxLength}}),Object.defineProperty(t,"minLength",{enumerable:!0,get:function(){return m._minLength}}),Object.defineProperty(t,"length",{enumerable:!0,get:function(){return m._length}}),Object.defineProperty(t,"regex",{enumerable:!0,get:function(){return m._regex}}),Object.defineProperty(t,"lowercase",{enumerable:!0,get:function(){return m._lowercase}}),Object.defineProperty(t,"uppercase",{enumerable:!0,get:function(){return m._uppercase}}),Object.defineProperty(t,"includes",{enumerable:!0,get:function(){return m._includes}}),Object.defineProperty(t,"startsWith",{enumerable:!0,get:function(){return m._startsWith}}),Object.defineProperty(t,"endsWith",{enumerable:!0,get:function(){return m._endsWith}}),Object.defineProperty(t,"property",{enumerable:!0,get:function(){return m._property}}),Object.defineProperty(t,"mime",{enumerable:!0,get:function(){return m._mime}}),Object.defineProperty(t,"overwrite",{enumerable:!0,get:function(){return m._overwrite}}),Object.defineProperty(t,"normalize",{enumerable:!0,get:function(){return m._normalize}}),Object.defineProperty(t,"trim",{enumerable:!0,get:function(){return m._trim}}),Object.defineProperty(t,"toLowerCase",{enumerable:!0,get:function(){return m._toLowerCase}}),Object.defineProperty(t,"toUpperCase",{enumerable:!0,get:function(){return m._toUpperCase}}),Object.defineProperty(t,"slugify",{enumerable:!0,get:function(){return m._slugify}})})(Xo);var kr={},bm;function Wo(){return bm||(bm=1,(function(t){var m=kr&&kr.__createBinding||(Object.create?(function(u,p,n,r){r===void 0&&(r=n);var x=Object.getOwnPropertyDescriptor(p,n);(!x||("get"in x?!p.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return p[n]}}),Object.defineProperty(u,r,x)}):(function(u,p,n,r){r===void 0&&(r=n),u[r]=p[n]})),N=kr&&kr.__setModuleDefault||(Object.create?(function(u,p){Object.defineProperty(u,"default",{enumerable:!0,value:p})}):function(u,p){u.default=p}),I=kr&&kr.__importStar||function(u){if(u&&u.__esModule)return u;var p={};if(u!=null)for(var n in u)n!=="default"&&Object.prototype.hasOwnProperty.call(u,n)&&m(p,u,n);return N(p,u),p};Object.defineProperty(t,"__esModule",{value:!0}),t.ZodISODuration=t.ZodISOTime=t.ZodISODate=t.ZodISODateTime=void 0,t.datetime=z,t.date=U,t.time=c,t.duration=s;const _=I(Pt),S=I(Yo());t.ZodISODateTime=_.$constructor("ZodISODateTime",(u,p)=>{_.$ZodISODateTime.init(u,p),S.ZodStringFormat.init(u,p)});function z(u){return _._isoDateTime(t.ZodISODateTime,u)}t.ZodISODate=_.$constructor("ZodISODate",(u,p)=>{_.$ZodISODate.init(u,p),S.ZodStringFormat.init(u,p)});function U(u){return _._isoDate(t.ZodISODate,u)}t.ZodISOTime=_.$constructor("ZodISOTime",(u,p)=>{_.$ZodISOTime.init(u,p),S.ZodStringFormat.init(u,p)});function c(u){return _._isoTime(t.ZodISOTime,u)}t.ZodISODuration=_.$constructor("ZodISODuration",(u,p)=>{_.$ZodISODuration.init(u,p),S.ZodStringFormat.init(u,p)});function s(u){return _._isoDuration(t.ZodISODuration,u)}})(kr)),kr}var at={},Jt={},V2=Jt&&Jt.__createBinding||(Object.create?(function(t,m,N,I){I===void 0&&(I=N);var _=Object.getOwnPropertyDescriptor(m,N);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[N]}}),Object.defineProperty(t,I,_)}):(function(t,m,N,I){I===void 0&&(I=N),t[I]=m[N]})),Q2=Jt&&Jt.__setModuleDefault||(Object.create?(function(t,m){Object.defineProperty(t,"default",{enumerable:!0,value:m})}):function(t,m){t.default=m}),Lm=Jt&&Jt.__importStar||function(t){if(t&&t.__esModule)return t;var m={};if(t!=null)for(var N in t)N!=="default"&&Object.prototype.hasOwnProperty.call(t,N)&&V2(m,t,N);return Q2(m,t),m};Object.defineProperty(Jt,"__esModule",{value:!0});Jt.ZodRealError=Jt.ZodError=void 0;const qo=Lm(Pt),W2=Pt,ym=Lm(oe),Um=(t,m)=>{W2.$ZodError.init(t,m),t.name="ZodError",Object.defineProperties(t,{format:{value:N=>qo.formatError(t,N)},flatten:{value:N=>qo.flattenError(t,N)},addIssue:{value:N=>{t.issues.push(N),t.message=JSON.stringify(t.issues,ym.jsonStringifyReplacer,2)}},addIssues:{value:N=>{t.issues.push(...N),t.message=JSON.stringify(t.issues,ym.jsonStringifyReplacer,2)}},isEmpty:{get(){return t.issues.length===0}}})};Jt.ZodError=qo.$constructor("ZodError",Um);Jt.ZodRealError=qo.$constructor("ZodError",Um,{Parent:Error});var q2=at&&at.__createBinding||(Object.create?(function(t,m,N,I){I===void 0&&(I=N);var _=Object.getOwnPropertyDescriptor(m,N);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[N]}}),Object.defineProperty(t,I,_)}):(function(t,m,N,I){I===void 0&&(I=N),t[I]=m[N]})),H2=at&&at.__setModuleDefault||(Object.create?(function(t,m){Object.defineProperty(t,"default",{enumerable:!0,value:m})}):function(t,m){t.default=m}),J2=at&&at.__importStar||function(t){if(t&&t.__esModule)return t;var m={};if(t!=null)for(var N in t)N!=="default"&&Object.prototype.hasOwnProperty.call(t,N)&&q2(m,t,N);return H2(m,t),m};Object.defineProperty(at,"__esModule",{value:!0});at.safeDecodeAsync=at.safeEncodeAsync=at.safeDecode=at.safeEncode=at.decodeAsync=at.encodeAsync=at.decode=at.encode=at.safeParseAsync=at.safeParse=at.parseAsync=at.parse=void 0;const tr=J2(Pt),rr=Jt;at.parse=tr._parse(rr.ZodRealError);at.parseAsync=tr._parseAsync(rr.ZodRealError);at.safeParse=tr._safeParse(rr.ZodRealError);at.safeParseAsync=tr._safeParseAsync(rr.ZodRealError);at.encode=tr._encode(rr.ZodRealError);at.decode=tr._decode(rr.ZodRealError);at.encodeAsync=tr._encodeAsync(rr.ZodRealError);at.decodeAsync=tr._decodeAsync(rr.ZodRealError);at.safeEncode=tr._safeEncode(rr.ZodRealError);at.safeDecode=tr._safeDecode(rr.ZodRealError);at.safeEncodeAsync=tr._safeEncodeAsync(rr.ZodRealError);at.safeDecodeAsync=tr._safeDecodeAsync(rr.ZodRealError);var xm;function Yo(){return xm||(xm=1,(function(t){var m=$r&&$r.__createBinding||(Object.create?(function(y,P,T,B){B===void 0&&(B=T);var te=Object.getOwnPropertyDescriptor(P,T);(!te||("get"in te?!P.__esModule:te.writable||te.configurable))&&(te={enumerable:!0,get:function(){return P[T]}}),Object.defineProperty(y,B,te)}):(function(y,P,T,B){B===void 0&&(B=T),y[B]=P[T]})),N=$r&&$r.__setModuleDefault||(Object.create?(function(y,P){Object.defineProperty(y,"default",{enumerable:!0,value:P})}):function(y,P){y.default=P}),I=$r&&$r.__importStar||function(y){if(y&&y.__esModule)return y;var P={};if(y!=null)for(var T in y)T!=="default"&&Object.prototype.hasOwnProperty.call(y,T)&&m(P,y,T);return N(P,y),P};Object.defineProperty(t,"__esModule",{value:!0}),t.ZodLiteral=t.ZodEnum=t.ZodSet=t.ZodMap=t.ZodRecord=t.ZodTuple=t.ZodIntersection=t.ZodDiscriminatedUnion=t.ZodXor=t.ZodUnion=t.ZodObject=t.ZodArray=t.ZodDate=t.ZodVoid=t.ZodNever=t.ZodUnknown=t.ZodAny=t.ZodNull=t.ZodUndefined=t.ZodSymbol=t.ZodBigIntFormat=t.ZodBigInt=t.ZodBoolean=t.ZodNumberFormat=t.ZodNumber=t.ZodCustomStringFormat=t.ZodJWT=t.ZodE164=t.ZodBase64URL=t.ZodBase64=t.ZodCIDRv6=t.ZodCIDRv4=t.ZodIPv6=t.ZodMAC=t.ZodIPv4=t.ZodKSUID=t.ZodXID=t.ZodULID=t.ZodCUID2=t.ZodCUID=t.ZodNanoID=t.ZodEmoji=t.ZodURL=t.ZodUUID=t.ZodGUID=t.ZodEmail=t.ZodStringFormat=t.ZodString=t._ZodString=t.ZodType=void 0,t.stringbool=t.meta=t.describe=t.ZodCustom=t.ZodFunction=t.ZodPromise=t.ZodLazy=t.ZodTemplateLiteral=t.ZodReadonly=t.ZodPreprocess=t.ZodCodec=t.ZodPipe=t.ZodNaN=t.ZodCatch=t.ZodSuccess=t.ZodNonOptional=t.ZodPrefault=t.ZodDefault=t.ZodNullable=t.ZodExactOptional=t.ZodOptional=t.ZodTransform=t.ZodFile=void 0,t.string=r,t.email=x,t.guid=D,t.uuid=ee,t.uuidv4=Y,t.uuidv6=ne,t.uuidv7=ue,t.url=ge,t.httpUrl=ie,t.emoji=be,t.nanoid=ye,t.cuid=ze,t.cuid2=Me,t.ulid=Ye,t.xid=vt,t.ksuid=Nt,t.ipv4=Mt,t.mac=Dt,t.ipv6=zt,t.cidrv4=Zt,t.cidrv6=xt,t.base64=Ut,t.base64url=ur,t.e164=$,t.jwt=C,t.stringFormat=M,t.hostname=L,t.hex=F,t.hash=W,t.number=re,t.int=fe,t.float32=q,t.float64=Q,t.int32=se,t.uint32=de,t.boolean=K,t.bigint=ce,t.int64=xe,t.uint64=et,t.symbol=Ge,t.undefined=Je,t.null=tt,t.any=gt,t.unknown=it,t.never=ft,t.void=bt,t.date=Ur,t.array=yr,t.keyof=es,t.object=ts,t.strictObject=rs,t.looseObject=ns,t.union=Si,t.xor=is,t.discriminatedUnion=dr,t.intersection=Ke,t.tuple=nr,t.record=en,t.partialRecord=ir,t.looseRecord=aa,t.map=as,t.set=ji,t.enum=$i,t.nativeEnum=os,t.literal=ss,t.file=ls,t.transform=Ce,t.optional=Xt,t.exactOptional=ki,t.nullable=tn,t.nullish=cs,t._default=Pi,t.prefault=oa,t.nonoptional=Br,t.success=Ee,t.catch=Ir,t.nan=us,t.pipe=rn,t.codec=ds,t.invertCodec=fs,t.readonly=Fr,t.templateLiteral=ms,t.lazy=ar,t.promise=xr,t._function=Gr,t.function=Gr,t._function=Gr,t.function=Gr,t.check=sa,t.custom=la,t.refine=Ni,t.superRefine=ca,t.instanceof=ua,t.json=fa,t.preprocess=gs;const _=I(Pt),S=Pt,z=I(ra),U=ta,c=I(Xo),s=I(Wo()),u=I(at),p=new WeakMap;function n(y,P,T){const B=Object.getPrototypeOf(y);let te=p.get(B);if(te||(te=new Set,p.set(B,te)),!te.has(P)){te.add(P);for(const ct in T){const jt=T[ct];Object.defineProperty(B,ct,{configurable:!0,enumerable:!1,get(){const nn=jt.bind(this);return Object.defineProperty(this,ct,{configurable:!0,writable:!0,enumerable:!0,value:nn}),nn},set(nn){Object.defineProperty(this,ct,{configurable:!0,writable:!0,enumerable:!0,value:nn})}})}}}t.ZodType=_.$constructor("ZodType",(y,P)=>(_.$ZodType.init(y,P),Object.assign(y["~standard"],{jsonSchema:{input:(0,U.createStandardJSONSchemaMethod)(y,"input"),output:(0,U.createStandardJSONSchemaMethod)(y,"output")}}),y.toJSONSchema=(0,U.createToJSONSchemaMethod)(y,{}),y.def=P,y.type=P.type,Object.defineProperty(y,"_def",{value:P}),y.parse=(T,B)=>u.parse(y,T,B,{callee:y.parse}),y.safeParse=(T,B)=>u.safeParse(y,T,B),y.parseAsync=async(T,B)=>u.parseAsync(y,T,B,{callee:y.parseAsync}),y.safeParseAsync=async(T,B)=>u.safeParseAsync(y,T,B),y.spa=y.safeParseAsync,y.encode=(T,B)=>u.encode(y,T,B),y.decode=(T,B)=>u.decode(y,T,B),y.encodeAsync=async(T,B)=>u.encodeAsync(y,T,B),y.decodeAsync=async(T,B)=>u.decodeAsync(y,T,B),y.safeEncode=(T,B)=>u.safeEncode(y,T,B),y.safeDecode=(T,B)=>u.safeDecode(y,T,B),y.safeEncodeAsync=async(T,B)=>u.safeEncodeAsync(y,T,B),y.safeDecodeAsync=async(T,B)=>u.safeDecodeAsync(y,T,B),n(y,"ZodType",{check(...T){const B=this.def;return this.clone(S.util.mergeDefs(B,{checks:[...B.checks??[],...T.map(te=>typeof te=="function"?{_zod:{check:te,def:{check:"custom"},onattach:[]}}:te)]}),{parent:!0})},with(...T){return this.check(...T)},clone(T,B){return _.clone(this,T,B)},brand(){return this},register(T,B){return T.add(this,B),this},refine(T,B){return this.check(Ni(T,B))},superRefine(T,B){return this.check(ca(T,B))},overwrite(T){return this.check(c.overwrite(T))},optional(){return Xt(this)},exactOptional(){return ki(this)},nullable(){return tn(this)},nullish(){return Xt(tn(this))},nonoptional(T){return Br(this,T)},array(){return yr(this)},or(T){return Si([this,T])},and(T){return Ke(this,T)},transform(T){return rn(this,Ce(T))},default(T){return Pi(this,T)},prefault(T){return oa(this,T)},catch(T){return Ir(this,T)},pipe(T){return rn(this,T)},readonly(){return Fr(this)},describe(T){const B=this.clone();return _.globalRegistry.add(B,{description:T}),B},meta(...T){if(T.length===0)return _.globalRegistry.get(this);const B=this.clone();return _.globalRegistry.add(B,T[0]),B},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(T){return T(this)}}),Object.defineProperty(y,"description",{get(){return _.globalRegistry.get(y)?.description},configurable:!0}),y)),t._ZodString=_.$constructor("_ZodString",(y,P)=>{_.$ZodString.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(B,te,ct)=>z.stringProcessor(y,B,te,ct);const T=y._zod.bag;y.format=T.format??null,y.minLength=T.minimum??null,y.maxLength=T.maximum??null,n(y,"_ZodString",{regex(...B){return this.check(c.regex(...B))},includes(...B){return this.check(c.includes(...B))},startsWith(...B){return this.check(c.startsWith(...B))},endsWith(...B){return this.check(c.endsWith(...B))},min(...B){return this.check(c.minLength(...B))},max(...B){return this.check(c.maxLength(...B))},length(...B){return this.check(c.length(...B))},nonempty(...B){return this.check(c.minLength(1,...B))},lowercase(B){return this.check(c.lowercase(B))},uppercase(B){return this.check(c.uppercase(B))},trim(){return this.check(c.trim())},normalize(...B){return this.check(c.normalize(...B))},toLowerCase(){return this.check(c.toLowerCase())},toUpperCase(){return this.check(c.toUpperCase())},slugify(){return this.check(c.slugify())}})}),t.ZodString=_.$constructor("ZodString",(y,P)=>{_.$ZodString.init(y,P),t._ZodString.init(y,P),y.email=T=>y.check(_._email(t.ZodEmail,T)),y.url=T=>y.check(_._url(t.ZodURL,T)),y.jwt=T=>y.check(_._jwt(t.ZodJWT,T)),y.emoji=T=>y.check(_._emoji(t.ZodEmoji,T)),y.guid=T=>y.check(_._guid(t.ZodGUID,T)),y.uuid=T=>y.check(_._uuid(t.ZodUUID,T)),y.uuidv4=T=>y.check(_._uuidv4(t.ZodUUID,T)),y.uuidv6=T=>y.check(_._uuidv6(t.ZodUUID,T)),y.uuidv7=T=>y.check(_._uuidv7(t.ZodUUID,T)),y.nanoid=T=>y.check(_._nanoid(t.ZodNanoID,T)),y.guid=T=>y.check(_._guid(t.ZodGUID,T)),y.cuid=T=>y.check(_._cuid(t.ZodCUID,T)),y.cuid2=T=>y.check(_._cuid2(t.ZodCUID2,T)),y.ulid=T=>y.check(_._ulid(t.ZodULID,T)),y.base64=T=>y.check(_._base64(t.ZodBase64,T)),y.base64url=T=>y.check(_._base64url(t.ZodBase64URL,T)),y.xid=T=>y.check(_._xid(t.ZodXID,T)),y.ksuid=T=>y.check(_._ksuid(t.ZodKSUID,T)),y.ipv4=T=>y.check(_._ipv4(t.ZodIPv4,T)),y.ipv6=T=>y.check(_._ipv6(t.ZodIPv6,T)),y.cidrv4=T=>y.check(_._cidrv4(t.ZodCIDRv4,T)),y.cidrv6=T=>y.check(_._cidrv6(t.ZodCIDRv6,T)),y.e164=T=>y.check(_._e164(t.ZodE164,T)),y.datetime=T=>y.check(s.datetime(T)),y.date=T=>y.check(s.date(T)),y.time=T=>y.check(s.time(T)),y.duration=T=>y.check(s.duration(T))});function r(y){return _._string(t.ZodString,y)}t.ZodStringFormat=_.$constructor("ZodStringFormat",(y,P)=>{_.$ZodStringFormat.init(y,P),t._ZodString.init(y,P)}),t.ZodEmail=_.$constructor("ZodEmail",(y,P)=>{_.$ZodEmail.init(y,P),t.ZodStringFormat.init(y,P)});function x(y){return _._email(t.ZodEmail,y)}t.ZodGUID=_.$constructor("ZodGUID",(y,P)=>{_.$ZodGUID.init(y,P),t.ZodStringFormat.init(y,P)});function D(y){return _._guid(t.ZodGUID,y)}t.ZodUUID=_.$constructor("ZodUUID",(y,P)=>{_.$ZodUUID.init(y,P),t.ZodStringFormat.init(y,P)});function ee(y){return _._uuid(t.ZodUUID,y)}function Y(y){return _._uuidv4(t.ZodUUID,y)}function ne(y){return _._uuidv6(t.ZodUUID,y)}function ue(y){return _._uuidv7(t.ZodUUID,y)}t.ZodURL=_.$constructor("ZodURL",(y,P)=>{_.$ZodURL.init(y,P),t.ZodStringFormat.init(y,P)});function ge(y){return _._url(t.ZodURL,y)}function ie(y){return _._url(t.ZodURL,{protocol:_.regexes.httpProtocol,hostname:_.regexes.domain,...S.util.normalizeParams(y)})}t.ZodEmoji=_.$constructor("ZodEmoji",(y,P)=>{_.$ZodEmoji.init(y,P),t.ZodStringFormat.init(y,P)});function be(y){return _._emoji(t.ZodEmoji,y)}t.ZodNanoID=_.$constructor("ZodNanoID",(y,P)=>{_.$ZodNanoID.init(y,P),t.ZodStringFormat.init(y,P)});function ye(y){return _._nanoid(t.ZodNanoID,y)}t.ZodCUID=_.$constructor("ZodCUID",(y,P)=>{_.$ZodCUID.init(y,P),t.ZodStringFormat.init(y,P)});function ze(y){return _._cuid(t.ZodCUID,y)}t.ZodCUID2=_.$constructor("ZodCUID2",(y,P)=>{_.$ZodCUID2.init(y,P),t.ZodStringFormat.init(y,P)});function Me(y){return _._cuid2(t.ZodCUID2,y)}t.ZodULID=_.$constructor("ZodULID",(y,P)=>{_.$ZodULID.init(y,P),t.ZodStringFormat.init(y,P)});function Ye(y){return _._ulid(t.ZodULID,y)}t.ZodXID=_.$constructor("ZodXID",(y,P)=>{_.$ZodXID.init(y,P),t.ZodStringFormat.init(y,P)});function vt(y){return _._xid(t.ZodXID,y)}t.ZodKSUID=_.$constructor("ZodKSUID",(y,P)=>{_.$ZodKSUID.init(y,P),t.ZodStringFormat.init(y,P)});function Nt(y){return _._ksuid(t.ZodKSUID,y)}t.ZodIPv4=_.$constructor("ZodIPv4",(y,P)=>{_.$ZodIPv4.init(y,P),t.ZodStringFormat.init(y,P)});function Mt(y){return _._ipv4(t.ZodIPv4,y)}t.ZodMAC=_.$constructor("ZodMAC",(y,P)=>{_.$ZodMAC.init(y,P),t.ZodStringFormat.init(y,P)});function Dt(y){return _._mac(t.ZodMAC,y)}t.ZodIPv6=_.$constructor("ZodIPv6",(y,P)=>{_.$ZodIPv6.init(y,P),t.ZodStringFormat.init(y,P)});function zt(y){return _._ipv6(t.ZodIPv6,y)}t.ZodCIDRv4=_.$constructor("ZodCIDRv4",(y,P)=>{_.$ZodCIDRv4.init(y,P),t.ZodStringFormat.init(y,P)});function Zt(y){return _._cidrv4(t.ZodCIDRv4,y)}t.ZodCIDRv6=_.$constructor("ZodCIDRv6",(y,P)=>{_.$ZodCIDRv6.init(y,P),t.ZodStringFormat.init(y,P)});function xt(y){return _._cidrv6(t.ZodCIDRv6,y)}t.ZodBase64=_.$constructor("ZodBase64",(y,P)=>{_.$ZodBase64.init(y,P),t.ZodStringFormat.init(y,P)});function Ut(y){return _._base64(t.ZodBase64,y)}t.ZodBase64URL=_.$constructor("ZodBase64URL",(y,P)=>{_.$ZodBase64URL.init(y,P),t.ZodStringFormat.init(y,P)});function ur(y){return _._base64url(t.ZodBase64URL,y)}t.ZodE164=_.$constructor("ZodE164",(y,P)=>{_.$ZodE164.init(y,P),t.ZodStringFormat.init(y,P)});function $(y){return _._e164(t.ZodE164,y)}t.ZodJWT=_.$constructor("ZodJWT",(y,P)=>{_.$ZodJWT.init(y,P),t.ZodStringFormat.init(y,P)});function C(y){return _._jwt(t.ZodJWT,y)}t.ZodCustomStringFormat=_.$constructor("ZodCustomStringFormat",(y,P)=>{_.$ZodCustomStringFormat.init(y,P),t.ZodStringFormat.init(y,P)});function M(y,P,T={}){return _._stringFormat(t.ZodCustomStringFormat,y,P,T)}function L(y){return _._stringFormat(t.ZodCustomStringFormat,"hostname",_.regexes.hostname,y)}function F(y){return _._stringFormat(t.ZodCustomStringFormat,"hex",_.regexes.hex,y)}function W(y,P){const T=P?.enc??"hex",B=`${y}_${T}`,te=_.regexes[B];if(!te)throw new Error(`Unrecognized hash format: ${B}`);return _._stringFormat(t.ZodCustomStringFormat,B,te,P)}t.ZodNumber=_.$constructor("ZodNumber",(y,P)=>{_.$ZodNumber.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(B,te,ct)=>z.numberProcessor(y,B,te,ct),n(y,"ZodNumber",{gt(B,te){return this.check(c.gt(B,te))},gte(B,te){return this.check(c.gte(B,te))},min(B,te){return this.check(c.gte(B,te))},lt(B,te){return this.check(c.lt(B,te))},lte(B,te){return this.check(c.lte(B,te))},max(B,te){return this.check(c.lte(B,te))},int(B){return this.check(fe(B))},safe(B){return this.check(fe(B))},positive(B){return this.check(c.gt(0,B))},nonnegative(B){return this.check(c.gte(0,B))},negative(B){return this.check(c.lt(0,B))},nonpositive(B){return this.check(c.lte(0,B))},multipleOf(B,te){return this.check(c.multipleOf(B,te))},step(B,te){return this.check(c.multipleOf(B,te))},finite(){return this}});const T=y._zod.bag;y.minValue=Math.max(T.minimum??Number.NEGATIVE_INFINITY,T.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,y.maxValue=Math.min(T.maximum??Number.POSITIVE_INFINITY,T.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,y.isInt=(T.format??"").includes("int")||Number.isSafeInteger(T.multipleOf??.5),y.isFinite=!0,y.format=T.format??null});function re(y){return _._number(t.ZodNumber,y)}t.ZodNumberFormat=_.$constructor("ZodNumberFormat",(y,P)=>{_.$ZodNumberFormat.init(y,P),t.ZodNumber.init(y,P)});function fe(y){return _._int(t.ZodNumberFormat,y)}function q(y){return _._float32(t.ZodNumberFormat,y)}function Q(y){return _._float64(t.ZodNumberFormat,y)}function se(y){return _._int32(t.ZodNumberFormat,y)}function de(y){return _._uint32(t.ZodNumberFormat,y)}t.ZodBoolean=_.$constructor("ZodBoolean",(y,P)=>{_.$ZodBoolean.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.booleanProcessor(y,T,B,te)});function K(y){return _._boolean(t.ZodBoolean,y)}t.ZodBigInt=_.$constructor("ZodBigInt",(y,P)=>{_.$ZodBigInt.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(B,te,ct)=>z.bigintProcessor(y,B,te,ct),y.gte=(B,te)=>y.check(c.gte(B,te)),y.min=(B,te)=>y.check(c.gte(B,te)),y.gt=(B,te)=>y.check(c.gt(B,te)),y.gte=(B,te)=>y.check(c.gte(B,te)),y.min=(B,te)=>y.check(c.gte(B,te)),y.lt=(B,te)=>y.check(c.lt(B,te)),y.lte=(B,te)=>y.check(c.lte(B,te)),y.max=(B,te)=>y.check(c.lte(B,te)),y.positive=B=>y.check(c.gt(BigInt(0),B)),y.negative=B=>y.check(c.lt(BigInt(0),B)),y.nonpositive=B=>y.check(c.lte(BigInt(0),B)),y.nonnegative=B=>y.check(c.gte(BigInt(0),B)),y.multipleOf=(B,te)=>y.check(c.multipleOf(B,te));const T=y._zod.bag;y.minValue=T.minimum??null,y.maxValue=T.maximum??null,y.format=T.format??null});function ce(y){return _._bigint(t.ZodBigInt,y)}t.ZodBigIntFormat=_.$constructor("ZodBigIntFormat",(y,P)=>{_.$ZodBigIntFormat.init(y,P),t.ZodBigInt.init(y,P)});function xe(y){return _._int64(t.ZodBigIntFormat,y)}function et(y){return _._uint64(t.ZodBigIntFormat,y)}t.ZodSymbol=_.$constructor("ZodSymbol",(y,P)=>{_.$ZodSymbol.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.symbolProcessor(y,T,B,te)});function Ge(y){return _._symbol(t.ZodSymbol,y)}t.ZodUndefined=_.$constructor("ZodUndefined",(y,P)=>{_.$ZodUndefined.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.undefinedProcessor(y,T,B,te)});function Je(y){return _._undefined(t.ZodUndefined,y)}t.ZodNull=_.$constructor("ZodNull",(y,P)=>{_.$ZodNull.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.nullProcessor(y,T,B,te)});function tt(y){return _._null(t.ZodNull,y)}t.ZodAny=_.$constructor("ZodAny",(y,P)=>{_.$ZodAny.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.anyProcessor(y,T,B,te)});function gt(){return _._any(t.ZodAny)}t.ZodUnknown=_.$constructor("ZodUnknown",(y,P)=>{_.$ZodUnknown.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.unknownProcessor(y,T,B,te)});function it(){return _._unknown(t.ZodUnknown)}t.ZodNever=_.$constructor("ZodNever",(y,P)=>{_.$ZodNever.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.neverProcessor(y,T,B,te)});function ft(y){return _._never(t.ZodNever,y)}t.ZodVoid=_.$constructor("ZodVoid",(y,P)=>{_.$ZodVoid.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.voidProcessor(y,T,B,te)});function bt(y){return _._void(t.ZodVoid,y)}t.ZodDate=_.$constructor("ZodDate",(y,P)=>{_.$ZodDate.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(B,te,ct)=>z.dateProcessor(y,B,te,ct),y.min=(B,te)=>y.check(c.gte(B,te)),y.max=(B,te)=>y.check(c.lte(B,te));const T=y._zod.bag;y.minDate=T.minimum?new Date(T.minimum):null,y.maxDate=T.maximum?new Date(T.maximum):null});function Ur(y){return _._date(t.ZodDate,y)}t.ZodArray=_.$constructor("ZodArray",(y,P)=>{_.$ZodArray.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.arrayProcessor(y,T,B,te),y.element=P.element,n(y,"ZodArray",{min(T,B){return this.check(c.minLength(T,B))},nonempty(T){return this.check(c.minLength(1,T))},max(T,B){return this.check(c.maxLength(T,B))},length(T,B){return this.check(c.length(T,B))},unwrap(){return this.element}})});function yr(y,P){return _._array(t.ZodArray,y,P)}function es(y){const P=y._zod.def.shape;return $i(Object.keys(P))}t.ZodObject=_.$constructor("ZodObject",(y,P)=>{_.$ZodObjectJIT.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.objectProcessor(y,T,B,te),S.util.defineLazy(y,"shape",()=>P.shape),n(y,"ZodObject",{keyof(){return $i(Object.keys(this._zod.def.shape))},catchall(T){return this.clone({...this._zod.def,catchall:T})},passthrough(){return this.clone({...this._zod.def,catchall:it()})},loose(){return this.clone({...this._zod.def,catchall:it()})},strict(){return this.clone({...this._zod.def,catchall:ft()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(T){return S.util.extend(this,T)},safeExtend(T){return S.util.safeExtend(this,T)},merge(T){return S.util.merge(this,T)},pick(T){return S.util.pick(this,T)},omit(T){return S.util.omit(this,T)},partial(...T){return S.util.partial(t.ZodOptional,this,T[0])},required(...T){return S.util.required(t.ZodNonOptional,this,T[0])}})});function ts(y,P){const T={type:"object",shape:y??{},...S.util.normalizeParams(P)};return new t.ZodObject(T)}function rs(y,P){return new t.ZodObject({type:"object",shape:y,catchall:ft(),...S.util.normalizeParams(P)})}function ns(y,P){return new t.ZodObject({type:"object",shape:y,catchall:it(),...S.util.normalizeParams(P)})}t.ZodUnion=_.$constructor("ZodUnion",(y,P)=>{_.$ZodUnion.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.unionProcessor(y,T,B,te),y.options=P.options});function Si(y,P){return new t.ZodUnion({type:"union",options:y,...S.util.normalizeParams(P)})}t.ZodXor=_.$constructor("ZodXor",(y,P)=>{t.ZodUnion.init(y,P),_.$ZodXor.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.unionProcessor(y,T,B,te),y.options=P.options});function is(y,P){return new t.ZodXor({type:"union",options:y,inclusive:!1,...S.util.normalizeParams(P)})}t.ZodDiscriminatedUnion=_.$constructor("ZodDiscriminatedUnion",(y,P)=>{t.ZodUnion.init(y,P),_.$ZodDiscriminatedUnion.init(y,P)});function dr(y,P,T){return new t.ZodDiscriminatedUnion({type:"union",options:P,discriminator:y,...S.util.normalizeParams(T)})}t.ZodIntersection=_.$constructor("ZodIntersection",(y,P)=>{_.$ZodIntersection.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.intersectionProcessor(y,T,B,te)});function Ke(y,P){return new t.ZodIntersection({type:"intersection",left:y,right:P})}t.ZodTuple=_.$constructor("ZodTuple",(y,P)=>{_.$ZodTuple.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.tupleProcessor(y,T,B,te),y.rest=T=>y.clone({...y._zod.def,rest:T})});function nr(y,P,T){const B=P instanceof _.$ZodType,te=B?T:P,ct=B?P:null;return new t.ZodTuple({type:"tuple",items:y,rest:ct,...S.util.normalizeParams(te)})}t.ZodRecord=_.$constructor("ZodRecord",(y,P)=>{_.$ZodRecord.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.recordProcessor(y,T,B,te),y.keyType=P.keyType,y.valueType=P.valueType});function en(y,P,T){return!P||!P._zod?new t.ZodRecord({type:"record",keyType:r(),valueType:y,...S.util.normalizeParams(P)}):new t.ZodRecord({type:"record",keyType:y,valueType:P,...S.util.normalizeParams(T)})}function ir(y,P,T){const B=_.clone(y);return B._zod.values=void 0,new t.ZodRecord({type:"record",keyType:B,valueType:P,...S.util.normalizeParams(T)})}function aa(y,P,T){return new t.ZodRecord({type:"record",keyType:y,valueType:P,mode:"loose",...S.util.normalizeParams(T)})}t.ZodMap=_.$constructor("ZodMap",(y,P)=>{_.$ZodMap.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.mapProcessor(y,T,B,te),y.keyType=P.keyType,y.valueType=P.valueType,y.min=(...T)=>y.check(_._minSize(...T)),y.nonempty=T=>y.check(_._minSize(1,T)),y.max=(...T)=>y.check(_._maxSize(...T)),y.size=(...T)=>y.check(_._size(...T))});function as(y,P,T){return new t.ZodMap({type:"map",keyType:y,valueType:P,...S.util.normalizeParams(T)})}t.ZodSet=_.$constructor("ZodSet",(y,P)=>{_.$ZodSet.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.setProcessor(y,T,B,te),y.min=(...T)=>y.check(_._minSize(...T)),y.nonempty=T=>y.check(_._minSize(1,T)),y.max=(...T)=>y.check(_._maxSize(...T)),y.size=(...T)=>y.check(_._size(...T))});function ji(y,P){return new t.ZodSet({type:"set",valueType:y,...S.util.normalizeParams(P)})}t.ZodEnum=_.$constructor("ZodEnum",(y,P)=>{_.$ZodEnum.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(B,te,ct)=>z.enumProcessor(y,B,te,ct),y.enum=P.entries,y.options=Object.values(P.entries);const T=new Set(Object.keys(P.entries));y.extract=(B,te)=>{const ct={};for(const jt of B)if(T.has(jt))ct[jt]=P.entries[jt];else throw new Error(`Key ${jt} not found in enum`);return new t.ZodEnum({...P,checks:[],...S.util.normalizeParams(te),entries:ct})},y.exclude=(B,te)=>{const ct={...P.entries};for(const jt of B)if(T.has(jt))delete ct[jt];else throw new Error(`Key ${jt} not found in enum`);return new t.ZodEnum({...P,checks:[],...S.util.normalizeParams(te),entries:ct})}});function $i(y,P){const T=Array.isArray(y)?Object.fromEntries(y.map(B=>[B,B])):y;return new t.ZodEnum({type:"enum",entries:T,...S.util.normalizeParams(P)})}function os(y,P){return new t.ZodEnum({type:"enum",entries:y,...S.util.normalizeParams(P)})}t.ZodLiteral=_.$constructor("ZodLiteral",(y,P)=>{_.$ZodLiteral.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.literalProcessor(y,T,B,te),y.values=new Set(P.values),Object.defineProperty(y,"value",{get(){if(P.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return P.values[0]}})});function ss(y,P){return new t.ZodLiteral({type:"literal",values:Array.isArray(y)?y:[y],...S.util.normalizeParams(P)})}t.ZodFile=_.$constructor("ZodFile",(y,P)=>{_.$ZodFile.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.fileProcessor(y,T,B,te),y.min=(T,B)=>y.check(_._minSize(T,B)),y.max=(T,B)=>y.check(_._maxSize(T,B)),y.mime=(T,B)=>y.check(_._mime(Array.isArray(T)?T:[T],B))});function ls(y){return _._file(t.ZodFile,y)}t.ZodTransform=_.$constructor("ZodTransform",(y,P)=>{_.$ZodTransform.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.transformProcessor(y,T,B,te),y._zod.parse=(T,B)=>{if(B.direction==="backward")throw new _.$ZodEncodeError(y.constructor.name);T.addIssue=ct=>{if(typeof ct=="string")T.issues.push(S.util.issue(ct,T.value,P));else{const jt=ct;jt.fatal&&(jt.continue=!1),jt.code??(jt.code="custom"),jt.input??(jt.input=T.value),jt.inst??(jt.inst=y),T.issues.push(S.util.issue(jt))}};const te=P.transform(T.value,T);return te instanceof Promise?te.then(ct=>(T.value=ct,T.fallback=!0,T)):(T.value=te,T.fallback=!0,T)}});function Ce(y){return new t.ZodTransform({type:"transform",transform:y})}t.ZodOptional=_.$constructor("ZodOptional",(y,P)=>{_.$ZodOptional.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.optionalProcessor(y,T,B,te),y.unwrap=()=>y._zod.def.innerType});function Xt(y){return new t.ZodOptional({type:"optional",innerType:y})}t.ZodExactOptional=_.$constructor("ZodExactOptional",(y,P)=>{_.$ZodExactOptional.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.optionalProcessor(y,T,B,te),y.unwrap=()=>y._zod.def.innerType});function ki(y){return new t.ZodExactOptional({type:"optional",innerType:y})}t.ZodNullable=_.$constructor("ZodNullable",(y,P)=>{_.$ZodNullable.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.nullableProcessor(y,T,B,te),y.unwrap=()=>y._zod.def.innerType});function tn(y){return new t.ZodNullable({type:"nullable",innerType:y})}function cs(y){return Xt(tn(y))}t.ZodDefault=_.$constructor("ZodDefault",(y,P)=>{_.$ZodDefault.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.defaultProcessor(y,T,B,te),y.unwrap=()=>y._zod.def.innerType,y.removeDefault=y.unwrap});function Pi(y,P){return new t.ZodDefault({type:"default",innerType:y,get defaultValue(){return typeof P=="function"?P():S.util.shallowClone(P)}})}t.ZodPrefault=_.$constructor("ZodPrefault",(y,P)=>{_.$ZodPrefault.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.prefaultProcessor(y,T,B,te),y.unwrap=()=>y._zod.def.innerType});function oa(y,P){return new t.ZodPrefault({type:"prefault",innerType:y,get defaultValue(){return typeof P=="function"?P():S.util.shallowClone(P)}})}t.ZodNonOptional=_.$constructor("ZodNonOptional",(y,P)=>{_.$ZodNonOptional.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.nonoptionalProcessor(y,T,B,te),y.unwrap=()=>y._zod.def.innerType});function Br(y,P){return new t.ZodNonOptional({type:"nonoptional",innerType:y,...S.util.normalizeParams(P)})}t.ZodSuccess=_.$constructor("ZodSuccess",(y,P)=>{_.$ZodSuccess.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.successProcessor(y,T,B,te),y.unwrap=()=>y._zod.def.innerType});function Ee(y){return new t.ZodSuccess({type:"success",innerType:y})}t.ZodCatch=_.$constructor("ZodCatch",(y,P)=>{_.$ZodCatch.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.catchProcessor(y,T,B,te),y.unwrap=()=>y._zod.def.innerType,y.removeCatch=y.unwrap});function Ir(y,P){return new t.ZodCatch({type:"catch",innerType:y,catchValue:typeof P=="function"?P:()=>P})}t.ZodNaN=_.$constructor("ZodNaN",(y,P)=>{_.$ZodNaN.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.nanProcessor(y,T,B,te)});function us(y){return _._nan(t.ZodNaN,y)}t.ZodPipe=_.$constructor("ZodPipe",(y,P)=>{_.$ZodPipe.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.pipeProcessor(y,T,B,te),y.in=P.in,y.out=P.out});function rn(y,P){return new t.ZodPipe({type:"pipe",in:y,out:P})}t.ZodCodec=_.$constructor("ZodCodec",(y,P)=>{t.ZodPipe.init(y,P),_.$ZodCodec.init(y,P)});function ds(y,P,T){return new t.ZodCodec({type:"pipe",in:y,out:P,transform:T.decode,reverseTransform:T.encode})}function fs(y){const P=y._zod.def;return new t.ZodCodec({type:"pipe",in:P.out,out:P.in,transform:P.reverseTransform,reverseTransform:P.transform})}t.ZodPreprocess=_.$constructor("ZodPreprocess",(y,P)=>{t.ZodPipe.init(y,P),_.$ZodPreprocess.init(y,P)}),t.ZodReadonly=_.$constructor("ZodReadonly",(y,P)=>{_.$ZodReadonly.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.readonlyProcessor(y,T,B,te),y.unwrap=()=>y._zod.def.innerType});function Fr(y){return new t.ZodReadonly({type:"readonly",innerType:y})}t.ZodTemplateLiteral=_.$constructor("ZodTemplateLiteral",(y,P)=>{_.$ZodTemplateLiteral.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.templateLiteralProcessor(y,T,B,te)});function ms(y,P){return new t.ZodTemplateLiteral({type:"template_literal",parts:y,...S.util.normalizeParams(P)})}t.ZodLazy=_.$constructor("ZodLazy",(y,P)=>{_.$ZodLazy.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.lazyProcessor(y,T,B,te),y.unwrap=()=>y._zod.def.getter()});function ar(y){return new t.ZodLazy({type:"lazy",getter:y})}t.ZodPromise=_.$constructor("ZodPromise",(y,P)=>{_.$ZodPromise.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.promiseProcessor(y,T,B,te),y.unwrap=()=>y._zod.def.innerType});function xr(y){return new t.ZodPromise({type:"promise",innerType:y})}t.ZodFunction=_.$constructor("ZodFunction",(y,P)=>{_.$ZodFunction.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.functionProcessor(y,T,B,te)});function Gr(y){return new t.ZodFunction({type:"function",input:Array.isArray(y?.input)?nr(y?.input):y?.input??yr(it()),output:y?.output??it()})}t.ZodCustom=_.$constructor("ZodCustom",(y,P)=>{_.$ZodCustom.init(y,P),t.ZodType.init(y,P),y._zod.processJSONSchema=(T,B,te)=>z.customProcessor(y,T,B,te)});function sa(y){const P=new _.$ZodCheck({check:"custom"});return P._zod.check=y,P}function la(y,P){return _._custom(t.ZodCustom,y??(()=>!0),P)}function Ni(y,P={}){return _._refine(t.ZodCustom,y,P)}function ca(y,P){return _._superRefine(y,P)}t.describe=_.describe,t.meta=_.meta;function ua(y,P={}){const T=new t.ZodCustom({type:"custom",check:"custom",fn:B=>B instanceof y,abort:!0,...S.util.normalizeParams(P)});return T._zod.bag.Class=y,T._zod.check=B=>{B.value instanceof y||B.issues.push({code:"invalid_type",expected:y.name,input:B.value,inst:T,path:[...T._zod.def.path??[]]})},T}const da=(...y)=>_._stringbool({Codec:t.ZodCodec,Boolean:t.ZodBoolean,String:t.ZodString},...y);t.stringbool=da;function fa(y){const P=ar(()=>Si([r(y),re(),K(),tt(),yr(P),en(r(),P)]));return P}function gs(y,P){return new t.ZodPreprocess({type:"pipe",in:Ce(y),out:P})}})($r)),$r}var Rr={};(function(t){var m=Rr&&Rr.__createBinding||(Object.create?(function(s,u,p,n){n===void 0&&(n=p);var r=Object.getOwnPropertyDescriptor(u,p);(!r||("get"in r?!u.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return u[p]}}),Object.defineProperty(s,n,r)}):(function(s,u,p,n){n===void 0&&(n=p),s[n]=u[p]})),N=Rr&&Rr.__setModuleDefault||(Object.create?(function(s,u){Object.defineProperty(s,"default",{enumerable:!0,value:u})}):function(s,u){s.default=u}),I=Rr&&Rr.__importStar||function(s){if(s&&s.__esModule)return s;var u={};if(s!=null)for(var p in s)p!=="default"&&Object.prototype.hasOwnProperty.call(s,p)&&m(u,s,p);return N(u,s),u};Object.defineProperty(t,"__esModule",{value:!0}),t.ZodFirstPartyTypeKind=t.config=t.$brand=t.ZodIssueCode=void 0,t.setErrorMap=z,t.getErrorMap=U;const _=I(Pt);t.ZodIssueCode={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var S=Pt;Object.defineProperty(t,"$brand",{enumerable:!0,get:function(){return S.$brand}}),Object.defineProperty(t,"config",{enumerable:!0,get:function(){return S.config}});function z(s){_.config({customError:s})}function U(){return _.config().customError}var c;c||(t.ZodFirstPartyTypeKind=c={})})(Rr);var Cr={},K2=Cr&&Cr.__createBinding||(Object.create?(function(t,m,N,I){I===void 0&&(I=N);var _=Object.getOwnPropertyDescriptor(m,N);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[N]}}),Object.defineProperty(t,I,_)}):(function(t,m,N,I){I===void 0&&(I=N),t[I]=m[N]})),X2=Cr&&Cr.__setModuleDefault||(Object.create?(function(t,m){Object.defineProperty(t,"default",{enumerable:!0,value:m})}):function(t,m){t.default=m}),Gl=Cr&&Cr.__importStar||function(t){if(t&&t.__esModule)return t;var m={};if(t!=null)for(var N in t)N!=="default"&&Object.prototype.hasOwnProperty.call(t,N)&&K2(m,t,N);return X2(m,t),m};Object.defineProperty(Cr,"__esModule",{value:!0});Cr.fromJSONSchema=oD;const Y2=Lt,eD=Gl(Xo),tD=Gl(Wo()),rD=Gl(Yo()),je={...rD,...eD,iso:tD},nD=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function iD(t,m){const N=t.$schema;return N==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":N==="http://json-schema.org/draft-07/schema#"?"draft-7":N==="http://json-schema.org/draft-04/schema#"?"draft-4":m??"draft-2020-12"}function aD(t,m){if(!t.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const N=t.slice(1).split("/").filter(Boolean);if(N.length===0)return m.rootSchema;const I=m.version==="draft-2020-12"?"$defs":"definitions";if(N[0]===I){const _=N[1];if(!_||!m.defs[_])throw new Error(`Reference not found: ${t}`);return m.defs[_]}throw new Error(`Reference not found: ${t}`)}function Bm(t,m){if(t.not!==void 0){if(typeof t.not=="object"&&Object.keys(t.not).length===0)return je.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(t.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(t.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(t.if!==void 0||t.then!==void 0||t.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(t.dependentSchemas!==void 0||t.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(t.$ref){const _=t.$ref;if(m.refs.has(_))return m.refs.get(_);if(m.processing.has(_))return je.lazy(()=>{if(!m.refs.has(_))throw new Error(`Circular reference not resolved: ${_}`);return m.refs.get(_)});m.processing.add(_);const S=aD(_,m),z=At(S,m);return m.refs.set(_,z),m.processing.delete(_),z}if(t.enum!==void 0){const _=t.enum;if(m.version==="openapi-3.0"&&t.nullable===!0&&_.length===1&&_[0]===null)return je.null();if(_.length===0)return je.never();if(_.length===1)return je.literal(_[0]);if(_.every(z=>typeof z=="string"))return je.enum(_);const S=_.map(z=>je.literal(z));return S.length<2?S[0]:je.union([S[0],S[1],...S.slice(2)])}if(t.const!==void 0)return je.literal(t.const);const N=t.type;if(Array.isArray(N)){const _=N.map(S=>{const z={...t,type:S};return Bm(z,m)});return _.length===0?je.never():_.length===1?_[0]:je.union(_)}if(!N)return je.any();let I;switch(N){case"string":{let _=je.string();if(t.format){const S=t.format;S==="email"?_=_.check(je.email()):S==="uri"||S==="uri-reference"?_=_.check(je.url()):S==="uuid"||S==="guid"?_=_.check(je.uuid()):S==="date-time"?_=_.check(je.iso.datetime()):S==="date"?_=_.check(je.iso.date()):S==="time"?_=_.check(je.iso.time()):S==="duration"?_=_.check(je.iso.duration()):S==="ipv4"?_=_.check(je.ipv4()):S==="ipv6"?_=_.check(je.ipv6()):S==="mac"?_=_.check(je.mac()):S==="cidr"?_=_.check(je.cidrv4()):S==="cidr-v6"?_=_.check(je.cidrv6()):S==="base64"?_=_.check(je.base64()):S==="base64url"?_=_.check(je.base64url()):S==="e164"?_=_.check(je.e164()):S==="jwt"?_=_.check(je.jwt()):S==="emoji"?_=_.check(je.emoji()):S==="nanoid"?_=_.check(je.nanoid()):S==="cuid"?_=_.check(je.cuid()):S==="cuid2"?_=_.check(je.cuid2()):S==="ulid"?_=_.check(je.ulid()):S==="xid"?_=_.check(je.xid()):S==="ksuid"&&(_=_.check(je.ksuid()))}typeof t.minLength=="number"&&(_=_.min(t.minLength)),typeof t.maxLength=="number"&&(_=_.max(t.maxLength)),t.pattern&&(_=_.regex(new RegExp(t.pattern))),I=_;break}case"number":case"integer":{let _=N==="integer"?je.number().int():je.number();typeof t.minimum=="number"&&(_=_.min(t.minimum)),typeof t.maximum=="number"&&(_=_.max(t.maximum)),typeof t.exclusiveMinimum=="number"?_=_.gt(t.exclusiveMinimum):t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(_=_.gt(t.minimum)),typeof t.exclusiveMaximum=="number"?_=_.lt(t.exclusiveMaximum):t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(_=_.lt(t.maximum)),typeof t.multipleOf=="number"&&(_=_.multipleOf(t.multipleOf)),I=_;break}case"boolean":{I=je.boolean();break}case"null":{I=je.null();break}case"object":{const _={},S=t.properties||{},z=new Set(t.required||[]);for(const[c,s]of Object.entries(S)){const u=At(s,m);_[c]=z.has(c)?u:u.optional()}if(t.propertyNames){const c=At(t.propertyNames,m),s=t.additionalProperties&&typeof t.additionalProperties=="object"?At(t.additionalProperties,m):je.any();if(Object.keys(_).length===0){I=je.record(c,s);break}const u=je.object(_).passthrough(),p=je.looseRecord(c,s);I=je.intersection(u,p);break}if(t.patternProperties){const c=t.patternProperties,s=Object.keys(c),u=[];for(const n of s){const r=At(c[n],m),x=je.string().regex(new RegExp(n));u.push(je.looseRecord(x,r))}const p=[];if(Object.keys(_).length>0&&p.push(je.object(_).passthrough()),p.push(...u),p.length===0)I=je.object({}).passthrough();else if(p.length===1)I=p[0];else{let n=je.intersection(p[0],p[1]);for(let r=2;r<p.length;r++)n=je.intersection(n,p[r]);I=n}break}const U=je.object(_);t.additionalProperties===!1?I=U.strict():typeof t.additionalProperties=="object"?I=U.catchall(At(t.additionalProperties,m)):I=U.passthrough();break}case"array":{const _=t.prefixItems,S=t.items;if(_&&Array.isArray(_)){const z=_.map(c=>At(c,m)),U=S&&typeof S=="object"&&!Array.isArray(S)?At(S,m):void 0;U?I=je.tuple(z).rest(U):I=je.tuple(z),typeof t.minItems=="number"&&(I=I.check(je.minLength(t.minItems))),typeof t.maxItems=="number"&&(I=I.check(je.maxLength(t.maxItems)))}else if(Array.isArray(S)){const z=S.map(c=>At(c,m)),U=t.additionalItems&&typeof t.additionalItems=="object"?At(t.additionalItems,m):void 0;U?I=je.tuple(z).rest(U):I=je.tuple(z),typeof t.minItems=="number"&&(I=I.check(je.minLength(t.minItems))),typeof t.maxItems=="number"&&(I=I.check(je.maxLength(t.maxItems)))}else if(S!==void 0){const z=At(S,m);let U=je.array(z);typeof t.minItems=="number"&&(U=U.min(t.minItems)),typeof t.maxItems=="number"&&(U=U.max(t.maxItems)),I=U}else I=je.array(je.any());break}default:throw new Error(`Unsupported type: ${N}`)}return I}function At(t,m){if(typeof t=="boolean")return t?je.any():je.never();let N=Bm(t,m);const I=t.type||t.enum!==void 0||t.const!==void 0;if(t.anyOf&&Array.isArray(t.anyOf)){const U=t.anyOf.map(s=>At(s,m)),c=je.union(U);N=I?je.intersection(N,c):c}if(t.oneOf&&Array.isArray(t.oneOf)){const U=t.oneOf.map(s=>At(s,m)),c=je.xor(U);N=I?je.intersection(N,c):c}if(t.allOf&&Array.isArray(t.allOf))if(t.allOf.length===0)N=I?N:je.any();else{let U=I?N:At(t.allOf[0],m);const c=I?0:1;for(let s=c;s<t.allOf.length;s++)U=je.intersection(U,At(t.allOf[s],m));N=U}t.nullable===!0&&m.version==="openapi-3.0"&&(N=je.nullable(N)),t.readOnly===!0&&(N=je.readonly(N)),t.default!==void 0&&(N=N.default(t.default));const _={},S=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(const U of S)U in t&&(_[U]=t[U]);const z=["contentEncoding","contentMediaType","contentSchema"];for(const U of z)U in t&&(_[U]=t[U]);for(const U of Object.keys(t))nD.has(U)||(_[U]=t[U]);return Object.keys(_).length>0&&m.registry.add(N,_),t.description&&(N=N.describe(t.description)),N}function oD(t,m){if(typeof t=="boolean")return t?je.any():je.never();let N;try{N=JSON.parse(JSON.stringify(t))}catch{throw new Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}const I=iD(N,m?.defaultTarget),_=N.$defs||N.definitions||{},S={version:I,defs:_,refs:new Map,processing:new Set,rootSchema:N,registry:m?.registry??Y2.globalRegistry};return At(N,S)}var Kt={},sD=Kt&&Kt.__createBinding||(Object.create?(function(t,m,N,I){I===void 0&&(I=N);var _=Object.getOwnPropertyDescriptor(m,N);(!_||("get"in _?!m.__esModule:_.writable||_.configurable))&&(_={enumerable:!0,get:function(){return m[N]}}),Object.defineProperty(t,I,_)}):(function(t,m,N,I){I===void 0&&(I=N),t[I]=m[N]})),lD=Kt&&Kt.__setModuleDefault||(Object.create?(function(t,m){Object.defineProperty(t,"default",{enumerable:!0,value:m})}):function(t,m){t.default=m}),Fm=Kt&&Kt.__importStar||function(t){if(t&&t.__esModule)return t;var m={};if(t!=null)for(var N in t)N!=="default"&&Object.prototype.hasOwnProperty.call(t,N)&&sD(m,t,N);return lD(m,t),m};Object.defineProperty(Kt,"__esModule",{value:!0});Kt.string=cD;Kt.number=uD;Kt.boolean=dD;Kt.bigint=fD;Kt.date=mD;const na=Fm(Pt),ia=Fm(Yo());function cD(t){return na._coercedString(ia.ZodString,t)}function uD(t){return na._coercedNumber(ia.ZodNumber,t)}function dD(t){return na._coercedBoolean(ia.ZodBoolean,t)}function fD(t){return na._coercedBigint(ia.ZodBigInt,t)}function mD(t){return na._coercedDate(ia.ZodDate,t)}(function(t){var m=Ht&&Ht.__createBinding||(Object.create?(function(n,r,x,D){D===void 0&&(D=x);var ee=Object.getOwnPropertyDescriptor(r,x);(!ee||("get"in ee?!r.__esModule:ee.writable||ee.configurable))&&(ee={enumerable:!0,get:function(){return r[x]}}),Object.defineProperty(n,D,ee)}):(function(n,r,x,D){D===void 0&&(D=x),n[D]=r[x]})),N=Ht&&Ht.__setModuleDefault||(Object.create?(function(n,r){Object.defineProperty(n,"default",{enumerable:!0,value:r})}):function(n,r){n.default=r}),I=Ht&&Ht.__importStar||function(n){if(n&&n.__esModule)return n;var r={};if(n!=null)for(var x in n)x!=="default"&&Object.prototype.hasOwnProperty.call(n,x)&&m(r,n,x);return N(r,n),r},_=Ht&&Ht.__exportStar||function(n,r){for(var x in n)x!=="default"&&!Object.prototype.hasOwnProperty.call(r,x)&&m(r,n,x)},S=Ht&&Ht.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(t,"__esModule",{value:!0}),t.coerce=t.iso=t.ZodISODuration=t.ZodISOTime=t.ZodISODate=t.ZodISODateTime=t.locales=t.fromJSONSchema=t.toJSONSchema=t.NEVER=t.util=t.TimePrecision=t.flattenError=t.formatError=t.prettifyError=t.treeifyError=t.regexes=t.clone=t.$brand=t.$input=t.$output=t.config=t.registry=t.globalRegistry=t.core=void 0,t.core=I(Pt),_(Yo(),t),_(Xo,t),_(Jt,t),_(at,t),_(Rr,t);const z=Pt,U=S(Im);(0,z.config)((0,U.default)());var c=Pt;Object.defineProperty(t,"globalRegistry",{enumerable:!0,get:function(){return c.globalRegistry}}),Object.defineProperty(t,"registry",{enumerable:!0,get:function(){return c.registry}}),Object.defineProperty(t,"config",{enumerable:!0,get:function(){return c.config}}),Object.defineProperty(t,"$output",{enumerable:!0,get:function(){return c.$output}}),Object.defineProperty(t,"$input",{enumerable:!0,get:function(){return c.$input}}),Object.defineProperty(t,"$brand",{enumerable:!0,get:function(){return c.$brand}}),Object.defineProperty(t,"clone",{enumerable:!0,get:function(){return c.clone}}),Object.defineProperty(t,"regexes",{enumerable:!0,get:function(){return c.regexes}}),Object.defineProperty(t,"treeifyError",{enumerable:!0,get:function(){return c.treeifyError}}),Object.defineProperty(t,"prettifyError",{enumerable:!0,get:function(){return c.prettifyError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return c.formatError}}),Object.defineProperty(t,"flattenError",{enumerable:!0,get:function(){return c.flattenError}}),Object.defineProperty(t,"TimePrecision",{enumerable:!0,get:function(){return c.TimePrecision}}),Object.defineProperty(t,"util",{enumerable:!0,get:function(){return c.util}}),Object.defineProperty(t,"NEVER",{enumerable:!0,get:function(){return c.NEVER}});var s=ra;Object.defineProperty(t,"toJSONSchema",{enumerable:!0,get:function(){return s.toJSONSchema}});var u=Cr;Object.defineProperty(t,"fromJSONSchema",{enumerable:!0,get:function(){return u.fromJSONSchema}}),t.locales=I(Ji);var p=Wo();Object.defineProperty(t,"ZodISODateTime",{enumerable:!0,get:function(){return p.ZodISODateTime}}),Object.defineProperty(t,"ZodISODate",{enumerable:!0,get:function(){return p.ZodISODate}}),Object.defineProperty(t,"ZodISOTime",{enumerable:!0,get:function(){return p.ZodISOTime}}),Object.defineProperty(t,"ZodISODuration",{enumerable:!0,get:function(){return p.ZodISODuration}}),t.iso=I(Wo()),t.coerce=I(Kt)})(Ht);(function(t){var m=hr&&hr.__createBinding||(Object.create?(function(z,U,c,s){s===void 0&&(s=c);var u=Object.getOwnPropertyDescriptor(U,c);(!u||("get"in u?!U.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return U[c]}}),Object.defineProperty(z,s,u)}):(function(z,U,c,s){s===void 0&&(s=c),z[s]=U[c]})),N=hr&&hr.__setModuleDefault||(Object.create?(function(z,U){Object.defineProperty(z,"default",{enumerable:!0,value:U})}):function(z,U){z.default=U}),I=hr&&hr.__importStar||function(z){if(z&&z.__esModule)return z;var U={};if(z!=null)for(var c in z)c!=="default"&&Object.prototype.hasOwnProperty.call(z,c)&&m(U,z,c);return N(U,z),U},_=hr&&hr.__exportStar||function(z,U){for(var c in z)c!=="default"&&!Object.prototype.hasOwnProperty.call(U,c)&&m(U,z,c)};Object.defineProperty(t,"__esModule",{value:!0}),t.z=void 0;const S=I(Ht);t.z=S,_(Ht,t),t.default=S})(hr);var _m;function Gm(){return _m||(_m=1,(function(t){var m={};Object.defineProperty(t,Symbol.toStringTag,{value:"Module"});var N=Object.create,I=Object.defineProperty,_=Object.getOwnPropertyDescriptor,S=Object.getOwnPropertyNames,z=Object.getPrototypeOf,U=Object.prototype.hasOwnProperty,c=(e,i,a,o)=>{if(i&&typeof i=="object"||typeof i=="function")for(var l=S(i),d=0,f=l.length,h;d<f;d++)h=l[d],!U.call(e,h)&&h!==a&&I(e,h,{get:(g=>i[g]).bind(null,h),enumerable:!(o=_(i,h))||o.enumerable});return e},s=(e,i,a)=>(a=e!=null?N(z(e)):{},c(i||!e||!e.__esModule?I(a,"default",{value:e,enumerable:!0}):a,e));const u=UO();let p=wm,n=s(p,1);p=s(p);let r=Sm;r=s(r,1);let x=IO;x=s(x,1);let D=EO;D=s(D,1);let ee=MO;ee=s(ee,1);let Y=DO;Y=s(Y,1);let ne=AO;ne=s(ne,1);let ue=zO;ue=s(ue,1);let ge=TO;ge=s(ge,1);let ie=RO,be=BO,ye=hr;function ze(e){var i,a,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(i=0;i<l;i++)e[i]&&(a=ze(e[i]))&&(o&&(o+=" "),o+=a)}else for(a in e)e[a]&&(o&&(o+=" "),o+=a);return o}function Me(){for(var e,i,a=0,o="",l=arguments.length;a<l;a++)(e=arguments[a])&&(i=ze(e))&&(o&&(o+=" "),o+=i);return o}var Ye=(e,i)=>{const a=new Array(e.length+i.length);for(let o=0;o<e.length;o++)a[o]=e[o];for(let o=0;o<i.length;o++)a[e.length+o]=i[o];return a},vt=(e,i)=>({classGroupId:e,validator:i}),Nt=(e=new Map,i=null,a)=>({nextPart:e,validators:i,classGroupId:a}),Mt="-",Dt=[],zt="arbitrary..",Zt=e=>{const i=ur(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:f=>{if(f.startsWith("[")&&f.endsWith("]"))return Ut(f);const h=f.split(Mt);return xt(h,h[0]===""&&h.length>1?1:0,i)},getConflictingClassGroupIds:(f,h)=>{if(h){const g=o[f],v=a[f];return g?v?Ye(v,g):g:v||Dt}return a[f]||Dt}}},xt=(e,i,a)=>{if(e.length-i===0)return a.classGroupId;const o=e[i],l=a.nextPart.get(o);if(l){const g=xt(e,i+1,l);if(g)return g}const d=a.validators;if(d===null)return;const f=i===0?e.join(Mt):e.slice(i).join(Mt),h=d.length;for(let g=0;g<h;g++){const v=d[g];if(v.validator(f))return v.classGroupId}},Ut=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const i=e.slice(1,-1),a=i.indexOf(":"),o=i.slice(0,a);return o?zt+o:void 0})(),ur=e=>{const{theme:i,classGroups:a}=e;return $(a,i)},$=(e,i)=>{const a=Nt();for(const o in e){const l=e[o];C(l,a,o,i)}return a},C=(e,i,a,o)=>{const l=e.length;for(let d=0;d<l;d++){const f=e[d];M(f,i,a,o)}},M=(e,i,a,o)=>{if(typeof e=="string"){L(e,i,a);return}if(typeof e=="function"){F(e,i,a,o);return}W(e,i,a,o)},L=(e,i,a)=>{const o=e===""?i:re(i,e);o.classGroupId=a},F=(e,i,a,o)=>{if(fe(e)){C(e(o),i,a,o);return}i.validators===null&&(i.validators=[]),i.validators.push(vt(a,e))},W=(e,i,a,o)=>{const l=Object.entries(e),d=l.length;for(let f=0;f<d;f++){const[h,g]=l[f];C(g,re(i,h),a,o)}},re=(e,i)=>{let a=e;const o=i.split(Mt),l=o.length;for(let d=0;d<l;d++){const f=o[d];let h=a.nextPart.get(f);h||(h=Nt(),a.nextPart.set(f,h)),a=h}return a},fe=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,q=e=>{if(e<1)return{get:()=>{},set:()=>{}};let i=0,a=Object.create(null),o=Object.create(null);const l=(d,f)=>{a[d]=f,i++,i>e&&(i=0,o=a,a=Object.create(null))};return{get(d){let f=a[d];if(f!==void 0)return f;if((f=o[d])!==void 0)return l(d,f),f},set(d,f){d in a?a[d]=f:l(d,f)}}},Q="!",se=":",de=[],K=(e,i,a,o,l)=>({modifiers:e,hasImportantModifier:i,baseClassName:a,maybePostfixModifierPosition:o,isExternal:l}),ce=e=>{const{prefix:i,experimentalParseClassName:a}=e;let o=l=>{const d=[];let f=0,h=0,g=0,v;const b=l.length;for(let A=0;A<b;A++){const R=l[A];if(f===0&&h===0){if(R===se){d.push(l.slice(g,A)),g=A+1;continue}if(R==="/"){v=A;continue}}R==="["?f++:R==="]"?f--:R==="("?h++:R===")"&&h--}const w=d.length===0?l:l.slice(g);let k=w,O=!1;w.endsWith(Q)?(k=w.slice(0,-1),O=!0):w.startsWith(Q)&&(k=w.slice(1),O=!0);const E=v&&v>g?v-g:void 0;return K(d,O,k,E)};if(i){const l=i+se,d=o;o=f=>f.startsWith(l)?d(f.slice(l.length)):K(de,!1,f,void 0,!0)}if(a){const l=o;o=d=>a({className:d,parseClassName:l})}return o},xe=e=>{const i=new Map;return e.orderSensitiveModifiers.forEach((a,o)=>{i.set(a,1e6+o)}),a=>{const o=[];let l=[];for(let d=0;d<a.length;d++){const f=a[d],h=f[0]==="[",g=i.has(f);h||g?(l.length>0&&(l.sort(),o.push(...l),l=[]),o.push(f)):l.push(f)}return l.length>0&&(l.sort(),o.push(...l)),o}},et=e=>({cache:q(e.cacheSize),parseClassName:ce(e),sortModifiers:xe(e),...Zt(e)}),Ge=/\s+/,Je=(e,i)=>{const{parseClassName:a,getClassGroupId:o,getConflictingClassGroupIds:l,sortModifiers:d}=i,f=[],h=e.trim().split(Ge);let g="";for(let v=h.length-1;v>=0;v-=1){const b=h[v],{isExternal:w,modifiers:k,hasImportantModifier:O,baseClassName:E,maybePostfixModifierPosition:A}=a(b);if(w){g=b+(g.length>0?" "+g:g);continue}let R=!!A,Z=o(R?E.substring(0,A):E);if(!Z){if(!R){g=b+(g.length>0?" "+g:g);continue}if(Z=o(E),!Z){g=b+(g.length>0?" "+g:g);continue}R=!1}const V=k.length===0?"":k.length===1?k[0]:d(k).join(":"),G=O?V+Q:V,H=G+Z;if(f.indexOf(H)>-1)continue;f.push(H);const J=l(Z,R);for(let X=0;X<J.length;++X){const me=J[X];f.push(G+me)}g=b+(g.length>0?" "+g:g)}return g},tt=(...e)=>{let i=0,a,o,l="";for(;i<e.length;)(a=e[i++])&&(o=gt(a))&&(l&&(l+=" "),l+=o);return l},gt=e=>{if(typeof e=="string")return e;let i,a="";for(let o=0;o<e.length;o++)e[o]&&(i=gt(e[o]))&&(a&&(a+=" "),a+=i);return a},it=(e,...i)=>{let a,o,l,d;const f=g=>(a=et(i.reduce((v,b)=>b(v),e())),o=a.cache.get,l=a.cache.set,d=h,h(g)),h=g=>{const v=o(g);if(v)return v;const b=Je(g,a);return l(g,b),b};return d=f,(...g)=>d(tt(...g))},ft=[],bt=e=>{const i=a=>a[e]||ft;return i.isThemeGetter=!0,i},Ur=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,yr=/^\((?:(\w[\w-]*):)?(.+)\)$/i,es=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ts=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,rs=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ns=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Si=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,is=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,dr=e=>es.test(e),Ke=e=>!!e&&!Number.isNaN(Number(e)),nr=e=>!!e&&Number.isInteger(Number(e)),en=e=>e.endsWith("%")&&Ke(e.slice(0,-1)),ir=e=>ts.test(e),aa=()=>!0,as=e=>rs.test(e)&&!ns.test(e),ji=()=>!1,$i=e=>Si.test(e),os=e=>is.test(e),ss=e=>!Ce(e)&&!Ee(e),ls=e=>ar(e,la,ji),Ce=e=>Ur.test(e),Xt=e=>ar(e,Ni,as),ki=e=>ar(e,ca,Ke),tn=e=>ar(e,da,aa),cs=e=>ar(e,ua,ji),Pi=e=>ar(e,Gr,ji),oa=e=>ar(e,sa,os),Br=e=>ar(e,fa,$i),Ee=e=>yr.test(e),Ir=e=>xr(e,Ni),us=e=>xr(e,ua),rn=e=>xr(e,Gr),ds=e=>xr(e,la),fs=e=>xr(e,sa),Fr=e=>xr(e,fa,!0),ms=e=>xr(e,da,!0),ar=(e,i,a)=>{const o=Ur.exec(e);return o?o[1]?i(o[1]):a(o[2]):!1},xr=(e,i,a=!1)=>{const o=yr.exec(e);return o?o[1]?i(o[1]):a:!1},Gr=e=>e==="position"||e==="percentage",sa=e=>e==="image"||e==="url",la=e=>e==="length"||e==="size"||e==="bg-size",Ni=e=>e==="length",ca=e=>e==="number",ua=e=>e==="family-name",da=e=>e==="number"||e==="weight",fa=e=>e==="shadow",gs=()=>{const e=bt("color"),i=bt("font"),a=bt("text"),o=bt("font-weight"),l=bt("tracking"),d=bt("leading"),f=bt("breakpoint"),h=bt("container"),g=bt("spacing"),v=bt("radius"),b=bt("shadow"),w=bt("inset-shadow"),k=bt("text-shadow"),O=bt("drop-shadow"),E=bt("blur"),A=bt("perspective"),R=bt("aspect"),Z=bt("ease"),V=bt("animate"),G=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],J=()=>[...H(),Ee,Ce],X=()=>["auto","hidden","clip","visible","scroll"],me=()=>["auto","contain","none"],ae=()=>[Ee,Ce,g],Ae=()=>[dr,"full","auto",...ae()],De=()=>[nr,"none","subgrid",Ee,Ce],qe=()=>["auto",{span:["full",nr,Ee,Ce]},nr,Ee,Ce],ot=()=>[nr,"auto",Ee,Ce],Ve=()=>["auto","min","max","fr",Ee,Ce],We=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Qe=()=>["start","end","center","stretch","center-safe","end-safe"],Le=()=>["auto",...ae()],Te=()=>[dr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...ae()],st=()=>[dr,"screen","full","dvw","lvw","svw","min","max","fit",...ae()],Re=()=>[dr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...ae()],we=()=>[e,Ee,Ce],Oe=()=>[...H(),rn,Pi,{position:[Ee,Ce]}],$e=()=>["no-repeat",{repeat:["","x","y","space","round"]}],He=()=>["auto","cover","contain",ds,ls,{size:[Ee,Ce]}],he=()=>[en,Ir,Xt],Se=()=>["","none","full",v,Ee,Ce],Ie=()=>["",Ke,Ir,Xt],Pe=()=>["solid","dashed","dotted","double"],Be=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Ze=()=>[Ke,en,rn,Pi],Qt=()=>["","none",E,Ee,Ce],Wt=()=>["none",Ke,Ee,Ce],Ue=()=>["none",Ke,Ee,Ce],ut=()=>[Ke,Ee,Ce],_t=()=>[dr,"full",...ae()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ir],breakpoint:[ir],color:[aa],container:[ir],"drop-shadow":[ir],ease:["in","out","in-out"],font:[ss],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ir],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ir],shadow:[ir],spacing:["px",Ke],text:[ir],"text-shadow":[ir],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",dr,Ce,Ee,R]}],container:["container"],columns:[{columns:[Ke,Ce,Ee,h]}],"break-after":[{"break-after":G()}],"break-before":[{"break-before":G()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:J()}],overflow:[{overflow:X()}],"overflow-x":[{"overflow-x":X()}],"overflow-y":[{"overflow-y":X()}],overscroll:[{overscroll:me()}],"overscroll-x":[{"overscroll-x":me()}],"overscroll-y":[{"overscroll-y":me()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:Ae()}],"inset-x":[{"inset-x":Ae()}],"inset-y":[{"inset-y":Ae()}],start:[{"inset-s":Ae(),start:Ae()}],end:[{"inset-e":Ae(),end:Ae()}],"inset-bs":[{"inset-bs":Ae()}],"inset-be":[{"inset-be":Ae()}],top:[{top:Ae()}],right:[{right:Ae()}],bottom:[{bottom:Ae()}],left:[{left:Ae()}],visibility:["visible","invisible","collapse"],z:[{z:[nr,"auto",Ee,Ce]}],basis:[{basis:[dr,"full","auto",h,...ae()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ke,dr,"auto","initial","none",Ce]}],grow:[{grow:["",Ke,Ee,Ce]}],shrink:[{shrink:["",Ke,Ee,Ce]}],order:[{order:[nr,"first","last","none",Ee,Ce]}],"grid-cols":[{"grid-cols":De()}],"col-start-end":[{col:qe()}],"col-start":[{"col-start":ot()}],"col-end":[{"col-end":ot()}],"grid-rows":[{"grid-rows":De()}],"row-start-end":[{row:qe()}],"row-start":[{"row-start":ot()}],"row-end":[{"row-end":ot()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Ve()}],"auto-rows":[{"auto-rows":Ve()}],gap:[{gap:ae()}],"gap-x":[{"gap-x":ae()}],"gap-y":[{"gap-y":ae()}],"justify-content":[{justify:[...We(),"normal"]}],"justify-items":[{"justify-items":[...Qe(),"normal"]}],"justify-self":[{"justify-self":["auto",...Qe()]}],"align-content":[{content:["normal",...We()]}],"align-items":[{items:[...Qe(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Qe(),{baseline:["","last"]}]}],"place-content":[{"place-content":We()}],"place-items":[{"place-items":[...Qe(),"baseline"]}],"place-self":[{"place-self":["auto",...Qe()]}],p:[{p:ae()}],px:[{px:ae()}],py:[{py:ae()}],ps:[{ps:ae()}],pe:[{pe:ae()}],pbs:[{pbs:ae()}],pbe:[{pbe:ae()}],pt:[{pt:ae()}],pr:[{pr:ae()}],pb:[{pb:ae()}],pl:[{pl:ae()}],m:[{m:Le()}],mx:[{mx:Le()}],my:[{my:Le()}],ms:[{ms:Le()}],me:[{me:Le()}],mbs:[{mbs:Le()}],mbe:[{mbe:Le()}],mt:[{mt:Le()}],mr:[{mr:Le()}],mb:[{mb:Le()}],ml:[{ml:Le()}],"space-x":[{"space-x":ae()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":ae()}],"space-y-reverse":["space-y-reverse"],size:[{size:Te()}],"inline-size":[{inline:["auto",...st()]}],"min-inline-size":[{"min-inline":["auto",...st()]}],"max-inline-size":[{"max-inline":["none",...st()]}],"block-size":[{block:["auto",...Re()]}],"min-block-size":[{"min-block":["auto",...Re()]}],"max-block-size":[{"max-block":["none",...Re()]}],w:[{w:[h,"screen",...Te()]}],"min-w":[{"min-w":[h,"screen","none",...Te()]}],"max-w":[{"max-w":[h,"screen","none","prose",{screen:[f]},...Te()]}],h:[{h:["screen","lh",...Te()]}],"min-h":[{"min-h":["screen","lh","none",...Te()]}],"max-h":[{"max-h":["screen","lh",...Te()]}],"font-size":[{text:["base",a,Ir,Xt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,ms,tn]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",en,Ce]}],"font-family":[{font:[us,cs,i]}],"font-features":[{"font-features":[Ce]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[l,Ee,Ce]}],"line-clamp":[{"line-clamp":[Ke,"none",Ee,ki]}],leading:[{leading:[d,...ae()]}],"list-image":[{"list-image":["none",Ee,Ce]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ee,Ce]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:we()}],"text-color":[{text:we()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Pe(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ke,"from-font","auto",Ee,Xt]}],"text-decoration-color":[{decoration:we()}],"underline-offset":[{"underline-offset":[Ke,"auto",Ee,Ce]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ae()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ee,Ce]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ee,Ce]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Oe()}],"bg-repeat":[{bg:$e()}],"bg-size":[{bg:He()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},nr,Ee,Ce],radial:["",Ee,Ce],conic:[nr,Ee,Ce]},fs,oa]}],"bg-color":[{bg:we()}],"gradient-from-pos":[{from:he()}],"gradient-via-pos":[{via:he()}],"gradient-to-pos":[{to:he()}],"gradient-from":[{from:we()}],"gradient-via":[{via:we()}],"gradient-to":[{to:we()}],rounded:[{rounded:Se()}],"rounded-s":[{"rounded-s":Se()}],"rounded-e":[{"rounded-e":Se()}],"rounded-t":[{"rounded-t":Se()}],"rounded-r":[{"rounded-r":Se()}],"rounded-b":[{"rounded-b":Se()}],"rounded-l":[{"rounded-l":Se()}],"rounded-ss":[{"rounded-ss":Se()}],"rounded-se":[{"rounded-se":Se()}],"rounded-ee":[{"rounded-ee":Se()}],"rounded-es":[{"rounded-es":Se()}],"rounded-tl":[{"rounded-tl":Se()}],"rounded-tr":[{"rounded-tr":Se()}],"rounded-br":[{"rounded-br":Se()}],"rounded-bl":[{"rounded-bl":Se()}],"border-w":[{border:Ie()}],"border-w-x":[{"border-x":Ie()}],"border-w-y":[{"border-y":Ie()}],"border-w-s":[{"border-s":Ie()}],"border-w-e":[{"border-e":Ie()}],"border-w-bs":[{"border-bs":Ie()}],"border-w-be":[{"border-be":Ie()}],"border-w-t":[{"border-t":Ie()}],"border-w-r":[{"border-r":Ie()}],"border-w-b":[{"border-b":Ie()}],"border-w-l":[{"border-l":Ie()}],"divide-x":[{"divide-x":Ie()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Ie()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Pe(),"hidden","none"]}],"divide-style":[{divide:[...Pe(),"hidden","none"]}],"border-color":[{border:we()}],"border-color-x":[{"border-x":we()}],"border-color-y":[{"border-y":we()}],"border-color-s":[{"border-s":we()}],"border-color-e":[{"border-e":we()}],"border-color-bs":[{"border-bs":we()}],"border-color-be":[{"border-be":we()}],"border-color-t":[{"border-t":we()}],"border-color-r":[{"border-r":we()}],"border-color-b":[{"border-b":we()}],"border-color-l":[{"border-l":we()}],"divide-color":[{divide:we()}],"outline-style":[{outline:[...Pe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ke,Ee,Ce]}],"outline-w":[{outline:["",Ke,Ir,Xt]}],"outline-color":[{outline:we()}],shadow:[{shadow:["","none",b,Fr,Br]}],"shadow-color":[{shadow:we()}],"inset-shadow":[{"inset-shadow":["none",w,Fr,Br]}],"inset-shadow-color":[{"inset-shadow":we()}],"ring-w":[{ring:Ie()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:we()}],"ring-offset-w":[{"ring-offset":[Ke,Xt]}],"ring-offset-color":[{"ring-offset":we()}],"inset-ring-w":[{"inset-ring":Ie()}],"inset-ring-color":[{"inset-ring":we()}],"text-shadow":[{"text-shadow":["none",k,Fr,Br]}],"text-shadow-color":[{"text-shadow":we()}],opacity:[{opacity:[Ke,Ee,Ce]}],"mix-blend":[{"mix-blend":[...Be(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Be()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ke]}],"mask-image-linear-from-pos":[{"mask-linear-from":Ze()}],"mask-image-linear-to-pos":[{"mask-linear-to":Ze()}],"mask-image-linear-from-color":[{"mask-linear-from":we()}],"mask-image-linear-to-color":[{"mask-linear-to":we()}],"mask-image-t-from-pos":[{"mask-t-from":Ze()}],"mask-image-t-to-pos":[{"mask-t-to":Ze()}],"mask-image-t-from-color":[{"mask-t-from":we()}],"mask-image-t-to-color":[{"mask-t-to":we()}],"mask-image-r-from-pos":[{"mask-r-from":Ze()}],"mask-image-r-to-pos":[{"mask-r-to":Ze()}],"mask-image-r-from-color":[{"mask-r-from":we()}],"mask-image-r-to-color":[{"mask-r-to":we()}],"mask-image-b-from-pos":[{"mask-b-from":Ze()}],"mask-image-b-to-pos":[{"mask-b-to":Ze()}],"mask-image-b-from-color":[{"mask-b-from":we()}],"mask-image-b-to-color":[{"mask-b-to":we()}],"mask-image-l-from-pos":[{"mask-l-from":Ze()}],"mask-image-l-to-pos":[{"mask-l-to":Ze()}],"mask-image-l-from-color":[{"mask-l-from":we()}],"mask-image-l-to-color":[{"mask-l-to":we()}],"mask-image-x-from-pos":[{"mask-x-from":Ze()}],"mask-image-x-to-pos":[{"mask-x-to":Ze()}],"mask-image-x-from-color":[{"mask-x-from":we()}],"mask-image-x-to-color":[{"mask-x-to":we()}],"mask-image-y-from-pos":[{"mask-y-from":Ze()}],"mask-image-y-to-pos":[{"mask-y-to":Ze()}],"mask-image-y-from-color":[{"mask-y-from":we()}],"mask-image-y-to-color":[{"mask-y-to":we()}],"mask-image-radial":[{"mask-radial":[Ee,Ce]}],"mask-image-radial-from-pos":[{"mask-radial-from":Ze()}],"mask-image-radial-to-pos":[{"mask-radial-to":Ze()}],"mask-image-radial-from-color":[{"mask-radial-from":we()}],"mask-image-radial-to-color":[{"mask-radial-to":we()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":H()}],"mask-image-conic-pos":[{"mask-conic":[Ke]}],"mask-image-conic-from-pos":[{"mask-conic-from":Ze()}],"mask-image-conic-to-pos":[{"mask-conic-to":Ze()}],"mask-image-conic-from-color":[{"mask-conic-from":we()}],"mask-image-conic-to-color":[{"mask-conic-to":we()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Oe()}],"mask-repeat":[{mask:$e()}],"mask-size":[{mask:He()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ee,Ce]}],filter:[{filter:["","none",Ee,Ce]}],blur:[{blur:Qt()}],brightness:[{brightness:[Ke,Ee,Ce]}],contrast:[{contrast:[Ke,Ee,Ce]}],"drop-shadow":[{"drop-shadow":["","none",O,Fr,Br]}],"drop-shadow-color":[{"drop-shadow":we()}],grayscale:[{grayscale:["",Ke,Ee,Ce]}],"hue-rotate":[{"hue-rotate":[Ke,Ee,Ce]}],invert:[{invert:["",Ke,Ee,Ce]}],saturate:[{saturate:[Ke,Ee,Ce]}],sepia:[{sepia:["",Ke,Ee,Ce]}],"backdrop-filter":[{"backdrop-filter":["","none",Ee,Ce]}],"backdrop-blur":[{"backdrop-blur":Qt()}],"backdrop-brightness":[{"backdrop-brightness":[Ke,Ee,Ce]}],"backdrop-contrast":[{"backdrop-contrast":[Ke,Ee,Ce]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ke,Ee,Ce]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ke,Ee,Ce]}],"backdrop-invert":[{"backdrop-invert":["",Ke,Ee,Ce]}],"backdrop-opacity":[{"backdrop-opacity":[Ke,Ee,Ce]}],"backdrop-saturate":[{"backdrop-saturate":[Ke,Ee,Ce]}],"backdrop-sepia":[{"backdrop-sepia":["",Ke,Ee,Ce]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":ae()}],"border-spacing-x":[{"border-spacing-x":ae()}],"border-spacing-y":[{"border-spacing-y":ae()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ee,Ce]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ke,"initial",Ee,Ce]}],ease:[{ease:["linear","initial",Z,Ee,Ce]}],delay:[{delay:[Ke,Ee,Ce]}],animate:[{animate:["none",V,Ee,Ce]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[A,Ee,Ce]}],"perspective-origin":[{"perspective-origin":J()}],rotate:[{rotate:Wt()}],"rotate-x":[{"rotate-x":Wt()}],"rotate-y":[{"rotate-y":Wt()}],"rotate-z":[{"rotate-z":Wt()}],scale:[{scale:Ue()}],"scale-x":[{"scale-x":Ue()}],"scale-y":[{"scale-y":Ue()}],"scale-z":[{"scale-z":Ue()}],"scale-3d":["scale-3d"],skew:[{skew:ut()}],"skew-x":[{"skew-x":ut()}],"skew-y":[{"skew-y":ut()}],transform:[{transform:[Ee,Ce,"","none","gpu","cpu"]}],"transform-origin":[{origin:J()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:_t()}],"translate-x":[{"translate-x":_t()}],"translate-y":[{"translate-y":_t()}],"translate-z":[{"translate-z":_t()}],"translate-none":["translate-none"],accent:[{accent:we()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:we()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ee,Ce]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ae()}],"scroll-mx":[{"scroll-mx":ae()}],"scroll-my":[{"scroll-my":ae()}],"scroll-ms":[{"scroll-ms":ae()}],"scroll-me":[{"scroll-me":ae()}],"scroll-mbs":[{"scroll-mbs":ae()}],"scroll-mbe":[{"scroll-mbe":ae()}],"scroll-mt":[{"scroll-mt":ae()}],"scroll-mr":[{"scroll-mr":ae()}],"scroll-mb":[{"scroll-mb":ae()}],"scroll-ml":[{"scroll-ml":ae()}],"scroll-p":[{"scroll-p":ae()}],"scroll-px":[{"scroll-px":ae()}],"scroll-py":[{"scroll-py":ae()}],"scroll-ps":[{"scroll-ps":ae()}],"scroll-pe":[{"scroll-pe":ae()}],"scroll-pbs":[{"scroll-pbs":ae()}],"scroll-pbe":[{"scroll-pbe":ae()}],"scroll-pt":[{"scroll-pt":ae()}],"scroll-pr":[{"scroll-pr":ae()}],"scroll-pb":[{"scroll-pb":ae()}],"scroll-pl":[{"scroll-pl":ae()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ee,Ce]}],fill:[{fill:["none",...we()]}],"stroke-w":[{stroke:[Ke,Ir,Xt,ki]}],stroke:[{stroke:["none",...we()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},y=it(gs);function P(...e){return y(Me(e))}var T="rounded-lg border border-border bg-surface overflow-hidden",B="border-b border-border px-3 sm:px-4 py-1.5 sm:py-2",te="p-2 sm:p-3 lg:p-4",ct="space-y-3 sm:space-y-4",jt="gap-2 sm:gap-3",nn="px-3 sm:px-4 py-1.5 sm:py-2",Qm="grid grid-cols-2 sm:grid-cols-2 lg:grid-cols-4",Wm="grid grid-cols-1 lg:grid-cols-2",qm="flex flex-col-reverse md:flex-row",Hm="w-full md:w-44 lg:w-52 md:flex-shrink-0 border-b md:border-b-0 md:border-l border-border",Jm="text-[10px] sm:text-[11px] font-semibold text-foreground uppercase tracking-wider",Km="text-[11px] sm:text-xs text-foreground",Ci="text-[10px] text-foreground-subtle",Xm="text-[11px] sm:text-xs font-medium text-foreground",Ym="text-base sm:text-lg font-semibold leading-tight text-foreground",eg="inline-flex items-center justify-center gap-1 rounded border border-border bg-surface px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-foreground hover:bg-surface-hover transition-colors disabled:opacity-40",tg="inline-flex items-center justify-center gap-1 rounded border border-primary/40 bg-primary/15 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-primary hover:bg-primary/25 transition-colors disabled:opacity-40",rg="inline-flex items-center justify-center gap-1 rounded border border-danger/40 bg-danger/10 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-danger hover:bg-danger/20 transition-colors disabled:opacity-40",ng="inline-flex items-center justify-center gap-1 rounded border border-warning/40 bg-warning/10 px-1.5 py-0.5 sm:px-2 sm:py-1 text-[10px] sm:text-[11px] font-medium text-warning hover:bg-warning/20 transition-colors disabled:opacity-40",ig="w-full rounded border border-border bg-background px-1.5 py-0.5 sm:px-2 sm:py-1 text-[11px] sm:text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none",ag="inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[10px] font-medium transition-colors",og="border-primary/50 bg-primary/15 text-primary",sg="border-border bg-surface text-foreground-subtle hover:bg-surface-hover";function lg(e,i){for(const a of e.slots)for(const o of a.addons)if(o.id===i)return o;return null}function cg(e,i){return e.models.find(a=>a.id===i)??null}function ug(e,i){return e.models.find(a=>!!a.formats[i])??null}function dg(e,i){const a=new Set((i.configSchema??[]).map(l=>l.key)),o={};for(const[l,d]of Object.entries(e))a.has(l)&&(o[l]=d);return o}function fg(e){const{source:i,target:a,catalog:o,addonIds:l}=e,d=[];for(const f of l){const h=i.defaults[f];if(!h){d.push({addonId:f,outcome:"skip",modelId:null,reason:"no source entry",patch:null});continue}const g=lg(o,f);if(!g){d.push({addonId:f,outcome:"skip",modelId:null,reason:"addon not in target catalog",patch:null});continue}const v=cg(g,h.modelId),b=v!==null&&!!v.formats[a.engine.format];let w,k;if(b)w=h.modelId,k="exact";else{const E=ug(g,a.engine.format);if(!E){d.push({addonId:f,outcome:"skip",modelId:null,reason:"no compatible model for target format",patch:null});continue}w=E.id,k="mapped"}const O={enabled:h.enabled,modelId:w,settings:dg(h.settings,g)};d.push({addonId:f,outcome:k,modelId:w,patch:O})}return d}var ps={idle:{label:"Idle",textColor:"text-foreground-subtle",badgeClass:"border-border bg-surface-hover text-foreground-subtle",dotClass:"bg-gray-400",icon:"PowerOff"},active:{label:"Active",textColor:"text-success",badgeClass:"border-success/40 bg-success/10 text-success",dotClass:"bg-red-500 animate-pulse",icon:"Activity"},watching:{label:"Watching",textColor:"text-foreground-subtle",badgeClass:"border-border bg-surface-hover text-foreground-subtle",dotClass:"bg-emerald-500",icon:"Eye"},"load-shed":{label:"Load-Shed",textColor:"text-amber-500",badgeClass:"border-amber-500/40 bg-amber-500/10 text-amber-500",dotClass:"bg-amber-500",icon:"AlertTriangle"},paused:{label:"Paused",textColor:"text-gray-400",badgeClass:"border-gray-500/40 bg-gray-500/10 text-gray-400",dotClass:"bg-gray-400",icon:"PauseCircle"}};function hs(e){return ps[e]??ps.watching}function _r(e,i){if(typeof globalThis>"u")return(0,n.createContext)(i);const a=globalThis.__camstackSharedContexts,o=a??new Map;a||(globalThis.__camstackSharedContexts=o);const l=o.get(e);if(l)return l;const d=(0,n.createContext)(i);return o.set(e,d),d}var mg="FEDERATION_DEBUG",vs=(function(e){return e[e.UNKNOWN=1]="UNKNOWN",e[e.CALCULATED=2]="CALCULATED",e[e.NO_USE=0]="NO_USE",e})({}),Vl=!0;function gg(){return Vl}function pg(){try{if(gg()&&window.localStorage)return!!localStorage.getItem(mg)}catch{return!1}return!1}function bs(){return typeof process<"u"&&m&&m.FEDERATION_DEBUG?!!m.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&FEDERATION_DEBUG?!0:pg()}var hg="[ Federation Runtime ]",Ql=function(...e){return e.length?e.reduce((i,a)=>a?i?`${i}:${a}`:a:i,""):""},ys=(e,i)=>{if("getPublicPath"in e){let a;return e.getPublicPath.startsWith("function")?a=new Function("return "+e.getPublicPath)()():a=new Function(e.getPublicPath)(),`${a}${i}`}else return"publicPath"in e?`${e.publicPath}${i}`:(console.warn("Cannot get resource URL. If in debug mode, please ignore.",e,i),"")},Wl=e=>{console.warn(`${hg}: ${e}`)};function ql(e){try{return JSON.stringify(e,null,2)}catch{return""}}var xs=(e,i)=>{if(!e)return i;const o=(l=>{if(l===".")return"";if(l.startsWith("./"))return l.replace("./","");if(l.startsWith("/")){const d=l.slice(1);return d.endsWith("/")?d.slice(0,-1):d}return l})(e);return o?o.endsWith("/")?`${o}${i}`:`${o}/${i}`:i};function vg(e){return e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")}function bg(e,i={}){const{remotes:a={},overrides:o={},version:l}=i;let d;const f=()=>"publicPath"in e.metaData?(e.metaData.publicPath==="auto"||e.metaData.publicPath==="")&&l?vg(l):e.metaData.publicPath:e.metaData.getPublicPath,h=Object.keys(o);let g={};Object.keys(a).length||(g=e.remotes?.reduce((V,G)=>{let H;const J=G.federationContainerName;return h.includes(J)?H=o[J]:"version"in G?H=G.version:H=G.entry,V[J]={matchedVersion:H},V},{})||{}),Object.keys(a).forEach(V=>g[V]={matchedVersion:h.includes(V)?o[V]:a[V]});const{remoteEntry:{path:v,name:b,type:w},types:k={path:"",name:"",zip:"",api:""},buildInfo:{buildVersion:O},globalName:E,ssrRemoteEntry:A}=e.metaData,{exposes:R}=e;let Z={version:l||"",buildVersion:O,globalName:E,remoteEntry:xs(v,b),remoteEntryType:w,remoteTypes:xs(k.path,k.name),remoteTypesZip:k.zip||"",remoteTypesAPI:k.api||"",remotesInfo:g,shared:e?.shared.map(V=>({assets:V.assets,sharedName:V.name,version:V.version,usedExports:V.referenceExports||[]})),modules:R?.map(V=>({moduleName:V.name,modulePath:V.path,assets:V.assets}))};if("publicPath"in e.metaData?(d={...Z,publicPath:f()},typeof e.metaData.ssrPublicPath=="string"&&(d.ssrPublicPath=e.metaData.ssrPublicPath)):d={...Z,getPublicPath:f()},A){const V=xs(A.path,A.name);d.ssrRemoteEntry=V,d.ssrRemoteEntryType=A.type||"commonjs-module"}return d}function Hl(e){return!!("remoteEntry"in e&&e.remoteEntry.includes(".json"))}var yg="[ Module Federation ]",Oi=console,xg=["logger.ts","logger.js","captureStackTrace","Logger.emit","Logger.log","Logger.info","Logger.warn","Logger.error","Logger.debug"];function _g(){try{const e=new Error().stack;if(!e)return;const[,...i]=e.split(`
95
- `),a=i.filter(o=>!xg.some(l=>o.includes(l)));return a.length?`Stack trace:
96
- ${a.slice(0,5).join(`
97
- `)}`:void 0}catch{return}}var Jl=class{constructor(e,i=Oi){this.prefix=e,this.delegate=i??Oi}setPrefix(e){this.prefix=e}setDelegate(e){this.delegate=e??Oi}emit(e,i){const a=this.delegate,o=bs()?_g():void 0,l=o?[...i,o]:i,d=(()=>{switch(e){case"log":return["log","info"];case"info":return["info","log"];case"warn":return["warn","info","log"];case"error":return["error","warn","log"];default:return["debug","log"]}})();for(const f of d){const h=a[f];if(typeof h=="function"){h.call(a,this.prefix,...l);return}}for(const f of d){const h=Oi[f];if(typeof h=="function"){h.call(Oi,this.prefix,...l);return}}}log(...e){this.emit("log",e)}warn(...e){this.emit("warn",e)}error(...e){this.emit("error",e)}success(...e){this.emit("info",e)}info(...e){this.emit("info",e)}ready(...e){this.emit("info",e)}debug(...e){bs()&&this.emit("debug",e)}};function wg(e){return new Jl(e)}function Sg(e){const i=new Jl(e);return Object.defineProperty(i,"__mf_infrastructure_logger__",{value:!0,enumerable:!1,configurable:!1}),i}Sg(yg);async function Kl(e,i){try{return await e()}catch(a){Wl(a);return}}function _s(e,i){const a=/^(https?:)?\/\//i;return e.replace(a,"").replace(/\/$/,"")===i.replace(a,"").replace(/\/$/,"")}function Xl(e){let i=null,a=!0,o=2e4,l;const d=document.getElementsByTagName("script");for(let v=0;v<d.length;v++){const b=d[v],w=b.getAttribute("src");if(w&&_s(w,e.url)){i=b,a=!1;break}}if(!i){const v=e.attrs;i=document.createElement("script"),i.type=v?.type==="module"?"module":"text/javascript";let b;e.createScriptHook&&(b=e.createScriptHook(e.url,e.attrs),b instanceof HTMLScriptElement?i=b:typeof b=="object"&&("script"in b&&b.script&&(i=b.script),"timeout"in b&&b.timeout&&(o=b.timeout))),i.src||(i.src=e.url),v&&!b&&Object.keys(v).forEach(w=>{i&&(w==="async"||w==="defer"?i[w]=v[w]:i.getAttribute(w)||i.setAttribute(w,v[w]))})}let f=null;const h=typeof window<"u"?v=>{if(v.filename&&_s(v.filename,e.url)){const b=new Error(`ScriptExecutionError: Script "${e.url}" loaded but threw a runtime error during execution: ${v.message} (${v.filename}:${v.lineno}:${v.colno})`);b.name="ScriptExecutionError",f=b}}:null;h&&window.addEventListener("error",h);const g=async(v,b)=>{clearTimeout(l),h&&window.removeEventListener("error",h);const w=()=>{if(b?.type==="error"){const k=new Error(b?.isTimeout?`ScriptNetworkError: Script "${e.url}" timed out.`:`ScriptNetworkError: Failed to load script "${e.url}" - the script URL is unreachable or the server returned an error (network failure, 404, CORS, etc.)`);k.name="ScriptNetworkError",e?.onErrorCallback&&e?.onErrorCallback(k)}else f?e?.onErrorCallback&&e?.onErrorCallback(f):e?.cb&&e?.cb()};if(i&&(i.onerror=null,i.onload=null,Kl(()=>{const{needDeleteScript:k=!0}=e;k&&i?.parentNode&&i.parentNode.removeChild(i)}),v&&typeof v=="function")){const k=v(b);if(k instanceof Promise){const O=await k;return w(),O}return w(),k}w()};return i.onerror=g.bind(null,i.onerror),i.onload=g.bind(null,i.onload),l=setTimeout(()=>{g(null,{type:"error",isTimeout:!0})},o),{script:i,needAttach:a}}function ws(e){let i=null,a=!0;const o=document.getElementsByTagName("link");for(let d=0;d<o.length;d++){const f=o[d],h=f.getAttribute("href"),g=f.getAttribute("rel");if(h&&_s(h,e.url)&&g===e.attrs.rel){i=f,a=!1;break}}if(!i){i=document.createElement("link"),i.setAttribute("href",e.url);let d;const f=e.attrs;e.createLinkHook&&(d=e.createLinkHook(e.url,f),d instanceof HTMLLinkElement&&(i=d)),f&&!d&&Object.keys(f).forEach(h=>{i&&!i.getAttribute(h)&&i.setAttribute(h,f[h])})}const l=(d,f)=>{const h=()=>{f?.type==="error"?e?.onErrorCallback&&e?.onErrorCallback(f):e?.cb&&e?.cb()};if(i&&(i.onerror=null,i.onload=null,Kl(()=>{const{needDeleteLink:g=!0}=e;g&&i?.parentNode&&i.parentNode.removeChild(i)}),d)){const g=d(f);return h(),g}h()};return i.onerror=l.bind(null,i.onerror),i.onload=l.bind(null,i.onload),{link:i,needAttach:a}}function jg(e,i){const{attrs:a={},createScriptHook:o}=i;return new Promise((l,d)=>{const{script:f,needAttach:h}=Xl({url:e,cb:l,onErrorCallback:d,attrs:{fetchpriority:"high",...a},createScriptHook:o,needDeleteScript:!0});h&&document.head.appendChild(f)})}var $g=e=>`View the docs to see how to solve: https://module-federation.io/guide/troubleshooting/${e.split("-")[0].toLowerCase()}#${e.toLowerCase()}`,Yl=(e,i,a,o)=>{const l=[`${[i[e]]} #${e}`];return a&&l.push(`args: ${JSON.stringify(a)}`),l.push($g(e)),o&&l.push(`Original Error Message:
98
- ${o}`),l.join(`
99
- `)};function kg(e,i,a,o,l,d){return o(Yl(e,i,a,l))}var Vr="[ Federation Runtime ]",Ss=wg(Vr);function Bt(e,i,a,o,l){e||(a!==void 0?$t(i,a,o,void 0):$t(i))}function $t(e,i,a,o,l){if(i!==void 0)return kg(e,i,a??{},f=>{throw new Error(`${Vr}: ${f}`)},o);const d=e;throw d instanceof Error?(d.message.startsWith(Vr)||(d.message=`${Vr}: ${d.message}`),d):new Error(`${Vr}: ${d}`)}function js(e){e instanceof Error&&(e.message.startsWith(Vr)||(e.message=`${Vr}: ${e.message}`)),Ss.warn(e)}function Pg(e,i){return e.findIndex(a=>a===i)===-1&&e.push(i),e}function Ii(e){return"version"in e&&e.version?`${e.name}:${e.version}`:"entry"in e&&e.entry?`${e.name}:${e.entry}`:`${e.name}`}function $s(e){return typeof e.entry<"u"}function ec(e){return!e.entry.includes(".json")}function ks(e){return e&&typeof e=="object"}var Ng=Object.prototype.toString;function Cg(e){return Ng.call(e)==="[object Object]"}function tc(e){return Array.isArray(e)?e:[e]}function rc(e){const i={url:"",type:"global",globalName:""};return"remoteEntry"in e?{url:e.remoteEntry,type:e.remoteEntryType,globalName:e.globalName}:i}var Og=(e,i)=>{let a;return e.endsWith("/")?a=e.slice(0,-1):a=e,i.startsWith(".")&&(i=i.slice(1)),a=a+i,a},Ct=typeof globalThis=="object"?globalThis:window,or=(()=>{try{return document.defaultView}catch{return Ct}})(),Ei=or;function ma(e,i,a){Object.defineProperty(e,i,{value:a,configurable:!1,writable:!0})}function ga(e,i){return Object.hasOwnProperty.call(e,i)}ga(Ct,"__GLOBAL_LOADING_REMOTE_ENTRY__")||ma(Ct,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});var an=Ct.__GLOBAL_LOADING_REMOTE_ENTRY__;function nc(e){ga(e,"__VMOK__")&&!ga(e,"__FEDERATION__")&&ma(e,"__FEDERATION__",e.__VMOK__),ga(e,"__FEDERATION__")||(ma(e,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),ma(e,"__VMOK__",e.__FEDERATION__)),e.__FEDERATION__.__GLOBAL_PLUGIN__??=[],e.__FEDERATION__.__INSTANCES__??=[],e.__FEDERATION__.moduleInfo??={},e.__FEDERATION__.__SHARE__??={},e.__FEDERATION__.__MANIFEST_LOADING__??={},e.__FEDERATION__.__PRELOADED_MAP__??=new Map}nc(Ct),nc(or);function Ig(e){Ct.__FEDERATION__.__INSTANCES__.push(e)}function Eg(){return Ct.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function Mg(e,i=bs()){i&&(Ct.__FEDERATION__.__DEBUG_CONSTRUCTOR__=e,Ct.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="2.4.0")}function on(e,i){if(typeof i=="string"){if(e[i])return{value:e[i],key:i};{const a=Object.keys(e);for(const o of a){const[l,d]=o.split(":"),f=`${l}:${i}`,h=e[f];if(h)return{value:h,key:f}}return{value:void 0,key:i}}}else $t(`getInfoWithoutType: "key" must be a string, got ${typeof i} (${JSON.stringify(i)}).`)}var ic=()=>or.__FEDERATION__.moduleInfo,Dg=(e,i)=>{const a=on(i,Ii(e)).value;if(a&&!a.version&&"version"in e&&e.version&&(a.version=e.version),a)return a;if("version"in e&&e.version){const{version:o,...l}=e,d=Ii(l),f=on(or.__FEDERATION__.moduleInfo,d).value;if(f?.version===o)return f}},pa=e=>Dg(e,or.__FEDERATION__.moduleInfo),ac=(e,i)=>{const a=Ii(e);return or.__FEDERATION__.moduleInfo[a]=i,or.__FEDERATION__.moduleInfo},Ag=e=>(or.__FEDERATION__.moduleInfo={...or.__FEDERATION__.moduleInfo,...e},()=>{const i=Object.keys(e);for(const a of i)delete or.__FEDERATION__.moduleInfo[a]}),oc=(e,i)=>{const a=i||`__FEDERATION_${e}:custom__`;return{remoteEntryKey:a,entryExports:Ct[a]}},zg=()=>or.__FEDERATION__.__GLOBAL_PLUGIN__,Tg=e=>Ct.__FEDERATION__.__PRELOADED_MAP__.get(e),Rg=e=>Ct.__FEDERATION__.__PRELOADED_MAP__.set(e,!0),sc="[0-9A-Za-z-]+",Ps=`(?:\\+(${sc}(?:\\.${sc})*))`,Mi="0|[1-9]\\d*",ha="[0-9]+",lc="\\d*[a-zA-Z-][a-zA-Z0-9-]*",cc=`(?:${ha}|${lc})`,Zg=`(?:-?(${cc}(?:\\.${cc})*))`,uc=`(?:${Mi}|${lc})`,dc=`(?:-(${uc}(?:\\.${uc})*))`,Ns=`${Mi}|x|X|\\*`,sn=`[v=\\s]*(${Ns})(?:\\.(${Ns})(?:\\.(${Ns})(?:${dc})?${Ps}?)?)?`,Lg=`^\\s*(${sn})\\s+-\\s+(${sn})\\s*$`,Ug=`[v=\\s]*${`(${ha})\\.(${ha})\\.(${ha})`}${Zg}?${Ps}?`,Cs="((?:<|>)?=?)",Bg=`(\\s*)${Cs}\\s*(${Ug}|${sn})`,fc="(?:~>?)",Fg=`(\\s*)${fc}\\s+`,mc="(?:\\^)",Gg=`(\\s*)${mc}\\s+`,Vg="(<|>)?=?\\s*\\*",Qg=`^${mc}${sn}$`,Wg=`v?${`(${Mi})\\.(${Mi})\\.(${Mi})`}${dc}?${Ps}?`,qg=`^${fc}${sn}$`,Hg=`^${Cs}\\s*${sn}$`,Jg=`^${Cs}\\s*(${Wg})$|^$`,Kg="^\\s*>=\\s*0.0.0\\s*$";function fr(e){return new RegExp(e)}function Tt(e){return!e||e.toLowerCase()==="x"||e==="*"}function gc(...e){return i=>e.reduce((a,o)=>o(a),i)}function pc(e){return e.match(fr(Jg))}function hc(e,i,a,o){const l=`${e}.${i}.${a}`;return o?`${l}-${o}`:l}function Xg(e){return e.replace(fr(Lg),(i,a,o,l,d,f,h,g,v,b,w,k)=>(Tt(o)?a="":Tt(l)?a=`>=${o}.0.0`:Tt(d)?a=`>=${o}.${l}.0`:a=`>=${a}`,Tt(v)?g="":Tt(b)?g=`<${Number(v)+1}.0.0-0`:Tt(w)?g=`<${v}.${Number(b)+1}.0-0`:k?g=`<=${v}.${b}.${w}-${k}`:g=`<=${g}`,`${a} ${g}`.trim()))}function Yg(e){return e.replace(fr(Bg),"$1$2$3")}function ep(e){return e.replace(fr(Fg),"$1~")}function tp(e){return e.replace(fr(Gg),"$1^")}function rp(e){return e.trim().split(/\s+/).map(i=>i.replace(fr(Qg),(a,o,l,d,f)=>Tt(o)?"":Tt(l)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:Tt(d)?o==="0"?`>=${o}.${l}.0 <${o}.${Number(l)+1}.0-0`:`>=${o}.${l}.0 <${Number(o)+1}.0.0-0`:f?o==="0"?l==="0"?`>=${o}.${l}.${d}-${f} <${o}.${l}.${Number(d)+1}-0`:`>=${o}.${l}.${d}-${f} <${o}.${Number(l)+1}.0-0`:`>=${o}.${l}.${d}-${f} <${Number(o)+1}.0.0-0`:o==="0"?l==="0"?`>=${o}.${l}.${d} <${o}.${l}.${Number(d)+1}-0`:`>=${o}.${l}.${d} <${o}.${Number(l)+1}.0-0`:`>=${o}.${l}.${d} <${Number(o)+1}.0.0-0`)).join(" ")}function np(e){return e.trim().split(/\s+/).map(i=>i.replace(fr(qg),(a,o,l,d,f)=>Tt(o)?"":Tt(l)?`>=${o}.0.0 <${Number(o)+1}.0.0-0`:Tt(d)?`>=${o}.${l}.0 <${o}.${Number(l)+1}.0-0`:f?`>=${o}.${l}.${d}-${f} <${o}.${Number(l)+1}.0-0`:`>=${o}.${l}.${d} <${o}.${Number(l)+1}.0-0`)).join(" ")}function ip(e){return e.split(/\s+/).map(i=>i.trim().replace(fr(Hg),(a,o,l,d,f,h)=>{const g=Tt(l),v=g||Tt(d),b=v||Tt(f);return o==="="&&b&&(o=""),h="",g?o===">"||o==="<"?"<0.0.0-0":"*":o&&b?(v&&(d=0),f=0,o===">"?(o=">=",v?(l=Number(l)+1,d=0,f=0):(d=Number(d)+1,f=0)):o==="<="&&(o="<",v?l=Number(l)+1:d=Number(d)+1),o==="<"&&(h="-0"),`${o+l}.${d}.${f}${h}`):v?`>=${l}.0.0${h} <${Number(l)+1}.0.0-0`:b?`>=${l}.${d}.0${h} <${l}.${Number(d)+1}.0-0`:a})).join(" ")}function ap(e){return e.trim().replace(fr(Vg),"")}function op(e){return e.trim().replace(fr(Kg),"")}function va(e,i){return e=Number(e)||e,i=Number(i)||i,e>i?1:e===i?0:-1}function sp(e,i){const{preRelease:a}=e,{preRelease:o}=i;if(a===void 0&&o)return 1;if(a&&o===void 0)return-1;if(a===void 0&&o===void 0)return 0;for(let l=0,d=a.length;l<=d;l++){const f=a[l],h=o[l];if(f!==h)return f===void 0&&h===void 0?0:f?h?va(f,h):-1:1}return 0}function ba(e,i){return va(e.major,i.major)||va(e.minor,i.minor)||va(e.patch,i.patch)||sp(e,i)}function Os(e,i){return e.version===i.version}function lp(e,i){switch(e.operator){case"":case"=":return Os(e,i);case">":return ba(e,i)<0;case">=":return Os(e,i)||ba(e,i)<0;case"<":return ba(e,i)>0;case"<=":return Os(e,i)||ba(e,i)>0;case void 0:return!0;default:return!1}}function cp(e){return gc(rp,np,ip,ap)(e)}function up(e){return gc(Xg,Yg,ep,tp)(e.trim()).split(/\s+/).join(" ")}function Di(e,i){if(!e)return!1;const a=pc(e);if(!a)return!1;const[,o,,l,d,f,h]=a,g={operator:o,version:hc(l,d,f,h),major:l,minor:d,patch:f,preRelease:h?.split(".")},v=i.split("||");for(const b of v){const w=b.trim();if(!w||w==="*"||w==="x")return!0;try{const k=up(w);if(!k.trim())return!0;const O=k.split(" ").map(R=>cp(R)).join(" ");if(!O.trim())return!0;const E=O.split(/\s+/).map(R=>op(R)).filter(Boolean);if(E.length===0)continue;let A=!0;for(const R of E){const Z=pc(R);if(!Z){A=!1;break}const[,V,,G,H,J,X]=Z;if(!lp({operator:V,version:hc(G,H,J,X),major:G,minor:H,patch:J,preRelease:X?.split(".")},g)){A=!1;break}}if(A)return!0}catch(k){console.error(`[semver] Error processing range part "${w}":`,k);continue}}return!1}var ya="default",dp="global";function fp(e,i,a,o){let l;return"get"in e?l=e.get:"lib"in e?l=()=>Promise.resolve(e.lib):l=()=>Promise.resolve(()=>{$t(`Cannot get shared "${a}" from "${i}": neither "get" nor "lib" is provided in the share config.`)}),e.shareConfig?.eager&&e.treeShaking?.mode&&$t(`Invalid shared config for "${a}" from "${i}": cannot use both "eager: true" and "treeShaking.mode" simultaneously. Choose one strategy.`),{deps:[],useIn:[],from:i,loading:null,...e,shareConfig:{requiredVersion:`^${e.version}`,singleton:!1,eager:!1,strictVersion:!1,...e.shareConfig},get:l,loaded:e?.loaded||"lib"in e?!0:void 0,version:e.version??"0",scope:Array.isArray(e.scope)?e.scope:[e.scope??"default"],strategy:(e.strategy??o)||"version-first",treeShaking:e.treeShaking?{...e.treeShaking,mode:e.treeShaking.mode??"server-calc",status:e.treeShaking.status??vs.UNKNOWN,useIn:[]}:void 0}}function vc(e,i){const a=i.shared||{},o=i.name,l=Object.keys(a).reduce((f,h)=>{const g=tc(a[h]);return f[h]=f[h]||[],g.forEach(v=>{f[h].push(fp(v,o,h,i.shareStrategy))}),f},{}),d={...e.shared};return Object.keys(l).forEach(f=>{d[f]?l[f].forEach(h=>{d[f].find(g=>g.version===h.version)||d[f].push(h)}):d[f]=l[f]}),{allShareInfos:d,newShareInfos:l}}function Ai(e,i){if(!e)return!1;const{status:a,mode:o}=e;return a===vs.NO_USE?!1:a===vs.CALCULATED?!0:o==="runtime-infer"?i?gp(e,i):!0:!1}function Qr(e,i){const a=o=>{if(!Number.isNaN(Number(o))){const l=o.split(".");let d=o;for(let f=0;f<3-l.length;f++)d+=".0";return d}return o};return!!Di(a(e),`<=${a(i)}`)}var zi=(e,i)=>{const a=i||function(o,l){return Qr(o,l)};return Object.keys(e).reduce((o,l)=>!o||a(o,l)||o==="0"?l:o,0)},xa=e=>!!e.loaded||typeof e.lib=="function",mp=e=>!!e.loading,gp=(e,i)=>{if(!e||!i)return!1;const{usedExports:a}=e;return a?!!i.every(o=>a.includes(o)):!1};function pp(e,i,a,o){const l=e[i][a];let d="",f=Ai(o);const h=function(g,v){return f?l[g].treeShaking?l[v].treeShaking?!xa(l[g].treeShaking)&&Qr(g,v):!1:!0:!xa(l[g])&&Qr(g,v)};if(f){if(d=zi(e[i][a],h),d)return{version:d,useTreesShaking:f};f=!1}return{version:zi(e[i][a],h),useTreesShaking:f}}var ln=e=>xa(e)||mp(e);function hp(e,i,a,o){const l=e[i][a];let d="",f=Ai(o);const h=function(g,v){if(f){if(!l[g].treeShaking)return!0;if(!l[v].treeShaking)return!1;if(ln(l[v].treeShaking))return ln(l[g].treeShaking)?!!Qr(g,v):!0;if(ln(l[g].treeShaking))return!1}return ln(l[v])?ln(l[g])?!!Qr(g,v):!0:ln(l[g])?!1:Qr(g,v)};if(f){if(d=zi(e[i][a],h),d)return{version:d,useTreesShaking:f};f=!1}return{version:zi(e[i][a],h),useTreesShaking:f}}function vp(e){return e==="loaded-first"?hp:pp}function _a(e,i,a,o){if(!e)return;const{shareConfig:l,scope:d=ya,strategy:f,treeShaking:h}=a,g=Array.isArray(d)?d:[d];for(const v of g)if(l&&e[v]&&e[v][i]){const{requiredVersion:b}=l,{version:w,useTreesShaking:k}=vp(f)(e,v,i,h),O=()=>{const A=e[v][i][w];if(l.singleton){if(typeof b=="string"&&!Di(w,b)){const R=`Version ${w} from ${w&&A.from} of shared singleton module ${i} does not satisfy the requirement of ${a.from} which needs ${b})`;l.strictVersion?$t(R):js(R)}return{shared:A,useTreesShaking:k}}else{if(b===!1||b==="*")return{shared:A,useTreesShaking:k};if(Di(w,b))return{shared:A,useTreesShaking:k};const R=Ai(h);if(R){for(const[Z,V]of Object.entries(e[v][i]))if(Ai(V.treeShaking,h?.usedExports)&&Di(Z,b))return{shared:V,useTreesShaking:R}}for(const[Z,V]of Object.entries(e[v][i]))if(Di(Z,b))return{shared:V,useTreesShaking:!1}}},E={shareScopeMap:e,scope:v,pkgName:i,version:w,GlobalFederation:Ei.__FEDERATION__,shareInfo:a,resolver:O};return(o.emit(E)||E).resolver()}}function bc(){return Ei.__FEDERATION__.__SHARE__}function yc(e){const{pkgName:i,extraOptions:a,shareInfos:o}=e,l=g=>{if(!g)return;const v={};return g.forEach(w=>{v[w.version]=w}),v[zi(v,function(w,k){return!xa(v[w])&&Qr(w,k)})]},d=a?.resolver??l,f=g=>g!==null&&typeof g=="object"&&!Array.isArray(g),h=(...g)=>{const v={};for(const b of g)if(b)for(const[w,k]of Object.entries(b)){const O=v[w];f(O)&&f(k)?v[w]=h(O,k):k!==void 0&&(v[w]=k)}return v};return h(d(o[i]),a?.customShareInfo)}var cn=(e,i)=>{e.useIn||(e.useIn=[]),Pg(e.useIn,i)};function wa(e,i){return i&&e.treeShaking?e.treeShaking:e}function bp(e,i){for(const a of e){const o=i.startsWith(a.name);let l=i.replace(a.name,"");if(o){if(l.startsWith("/")){const h=a.name;return l=`.${l}`,{pkgNameOrAlias:h,expose:l,remote:a}}else if(l==="")return{pkgNameOrAlias:a.name,expose:".",remote:a}}const d=a.alias&&i.startsWith(a.alias);let f=a.alias&&i.replace(a.alias,"");if(a.alias&&d){if(f&&f.startsWith("/")){const h=a.alias;return f=`.${f}`,{pkgNameOrAlias:h,expose:f,remote:a}}else if(f==="")return{pkgNameOrAlias:a.alias,expose:".",remote:a}}}}function yp(e,i){for(const a of e)if(i===a.name||a.alias&&i===a.alias)return a}var xc="RUNTIME-001",_c="RUNTIME-002",wc="RUNTIME-003",Sc="RUNTIME-004",jc="RUNTIME-005",Is="RUNTIME-006",$c="RUNTIME-007",kc="RUNTIME-008",Es="RUNTIME-009",Pc="RUNTIME-010",Nc="RUNTIME-011",xp="RUNTIME-012",Ft={[xc]:"Failed to get remoteEntry exports.",[_c]:'The remote entry interface does not contain "init"',[wc]:"Failed to get manifest.",[Sc]:"Failed to locate remote.",[jc]:"Invalid loadShareSync function call from bundler runtime",[Is]:"Invalid loadShareSync function call from runtime",[$c]:"Failed to get remote snapshot.",[kc]:"Failed to load script resources.",[Es]:"Please call createInstance first.",[Pc]:'The name option cannot be changed after initialization. If you want to create a new instance with a different name, please use "createInstance" api.',[Nc]:"The remoteEntry URL is missing from the remote snapshot.",[xp]:'The getter for the shared module is not a function. This may be caused by setting "shared.import: false" without the host providing the corresponding lib.'};({...Ft});var Cc=".then(callbacks[0]).catch(callbacks[1])";async function _p({entry:e,remoteEntryExports:i}){return new Promise((a,o)=>{try{i?a(i):typeof FEDERATION_ALLOW_NEW_FUNCTION<"u"?new Function("callbacks",`import("${e}")${Cc}`)([a,o]):import(e).then(a).catch(o)}catch(l){$t(`Failed to load ESM entry from "${e}". ${l instanceof Error?l.message:String(l)}`)}})}async function wp({entry:e,remoteEntryExports:i}){return new Promise((a,o)=>{try{i?a(i):typeof __system_context__>"u"?System.import(e).then(a).catch(o):new Function("callbacks",`System.import("${e}")${Cc}`)([a,o])}catch(l){$t(`Failed to load SystemJS entry from "${e}". ${l instanceof Error?l.message:String(l)}`)}})}function Sp(e,i,a){const{remoteEntryKey:o,entryExports:l}=oc(e,i);return l||$t(xc,Ft,{remoteName:e,remoteEntryUrl:a,remoteEntryKey:o}),l}async function jp({name:e,globalName:i,entry:a,remoteInfo:o,loaderHook:l,getEntryUrl:d}){const{entryExports:f}=oc(e,i);if(f)return f;const h=d?d(a):a;return jg(h,{attrs:{},createScriptHook:(g,v)=>{const b=l.lifecycle.createScript.emit({url:g,attrs:v,remoteInfo:o});if(b&&(b instanceof HTMLScriptElement||"script"in b||"timeout"in b))return b}}).then(()=>Sp(e,i,a),g=>{const v=g instanceof Error?g.message:String(g);$t(kc,Ft,{remoteName:e,resourceUrl:h},v)})}async function $p({remoteInfo:e,remoteEntryExports:i,loaderHook:a,getEntryUrl:o}){const{entry:l,entryGlobalName:d,name:f,type:h}=e;switch(h){case"esm":case"module":return _p({entry:l,remoteEntryExports:i});case"system":return wp({entry:l,remoteEntryExports:i});default:return jp({entry:l,globalName:d,name:f,remoteInfo:e,loaderHook:a,getEntryUrl:o})}}function Ms(e){const{entry:i,name:a}=e;return Ql(a,i)}async function Sa(e){const{origin:i,remoteEntryExports:a,remoteInfo:o,getEntryUrl:l,_inErrorHandling:d=!1}=e,f=Ms(o);if(a)return a;if(!an[f]){const h=i.remoteHandler.hooks.lifecycle.loadEntry,g=i.loaderHook;an[f]=h.emit({loaderHook:g,remoteInfo:o,remoteEntryExports:a}).then(v=>v||$p({remoteInfo:o,remoteEntryExports:a,loaderHook:g,getEntryUrl:l})).catch(async v=>{const b=Ms(o),w=v instanceof Error&&v.message.includes("ScriptExecutionError");if(v instanceof Error&&v.message.includes("RUNTIME-008")&&!w&&!d){const k=E=>Sa({...E,_inErrorHandling:!0}),O=await i.loaderHook.lifecycle.loadEntryError.emit({getRemoteEntry:k,origin:i,remoteInfo:o,remoteEntryExports:a,globalLoading:an,uniqueKey:b});if(O)return O}throw v})}return an[f]}function ja(e){return{...e,entry:"entry"in e?e.entry:"",type:e.type||"global",entryGlobalName:e.entryGlobalName||e.name,shareScope:e.shareScope||"default"}}function kp(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Pp(e,i){const a=zg(),o=[i.hooks,i.remoteHandler.hooks,i.sharedHandler.hooks,i.snapshotHandler.hooks,i.loaderHook,i.bridgeHook];return a.length>0&&a.forEach(l=>{e?.find(d=>d.name!==l.name)&&e.push(l)}),e&&e.length>0&&e.forEach(l=>{o.forEach(d=>{d.applyPlugin(l,i)})}),e}function Np(e){return{name:e.name,alias:e.alias,entry:"entry"in e?e.entry:void 0,version:"version"in e?e.version:void 0,type:e.type,entryGlobalName:e.entryGlobalName,shareScope:e.shareScope}}function un(e){const i={};for(const[a,o]of Object.entries(e.shared)){const l=o[0];l&&(i[a]={version:l.version,singleton:l.shareConfig?.singleton,requiredVersion:l.shareConfig?.requiredVersion===!1?!1:l.shareConfig?.requiredVersion,eager:l.eager,strictVersion:l.shareConfig?.strictVersion})}return{project:{name:e.name,mfRole:e.remotes?.length>0?"host":"unknown"},mfConfig:{name:e.name,remotes:e.remotes?.map(Np)??[],shared:i}}}function Oc(e){return{resourceCategory:"sync",share:!0,depsRemote:!0,...e}}function Cp(e,i){return i.map(a=>{const o=yp(e,a.nameOrAlias);return Bt(o,`Unable to preload ${a.nameOrAlias} as it is not included in ${!o&&ql({remoteInfo:o,remotes:e})}`),{remote:o,preloadConfig:Oc(a)}})}function Op(e){return e?e.map(i=>i==="."?i:i.startsWith("./")?i.replace("./",""):i):[]}function Ic(e,i,a,o=!0){const{cssAssets:l,jsAssetsWithoutEntry:d,entryAssets:f}=a;if(i.options.inBrowser){if(f.forEach(h=>{const{moduleInfo:g}=h,v=i.moduleCache.get(e.name);Sa(v?{origin:i,remoteInfo:g,remoteEntryExports:v.remoteEntryExports}:{origin:i,remoteInfo:g,remoteEntryExports:void 0})}),o){const h={rel:"preload",as:"style"};l.forEach(g=>{const{link:v,needAttach:b}=ws({url:g,cb:()=>{},attrs:h,createLinkHook:(w,k)=>{const O=i.loaderHook.lifecycle.createLink.emit({url:w,attrs:k,remoteInfo:e});if(O instanceof HTMLLinkElement)return O}});b&&document.head.appendChild(v)})}else{const h={rel:"stylesheet",type:"text/css"};l.forEach(g=>{const{link:v,needAttach:b}=ws({url:g,cb:()=>{},attrs:h,createLinkHook:(w,k)=>{const O=i.loaderHook.lifecycle.createLink.emit({url:w,attrs:k,remoteInfo:e});if(O instanceof HTMLLinkElement)return O},needDeleteLink:!1});b&&document.head.appendChild(v)})}if(o){const h={rel:"preload",as:"script"};d.forEach(g=>{const{link:v,needAttach:b}=ws({url:g,cb:()=>{},attrs:h,createLinkHook:(w,k)=>{const O=i.loaderHook.lifecycle.createLink.emit({url:w,attrs:k,remoteInfo:e});if(O instanceof HTMLLinkElement)return O}});b&&document.head.appendChild(v)})}else{const h={fetchpriority:"high",type:e?.type==="module"?"module":"text/javascript"};d.forEach(g=>{const{script:v,needAttach:b}=Xl({url:g,cb:()=>{},attrs:h,createScriptHook:(w,k)=>{const O=i.loaderHook.lifecycle.createScript.emit({url:w,attrs:k,remoteInfo:e});if(O instanceof HTMLScriptElement)return O},needDeleteScript:!0});b&&document.head.appendChild(v)})}}}function Ip(e,i,a){const o=i,l=Array.isArray(e.shareScope)?e.shareScope:[e.shareScope];l.length||l.push("default"),l.forEach(f=>{o[f]||(o[f]={})});const d={version:e.version||"",shareScopeKeys:Array.isArray(e.shareScope)?l:e.shareScope||"default"};return Object.defineProperty(d,"shareScopeMap",{value:o,enumerable:!1}),{remoteEntryInitOptions:d,shareScope:o[l[0]],initScope:a??[]}}var Ec=class{constructor({remoteInfo:e,host:i}){this.inited=!1,this.initing=!1,this.lib=void 0,this.remoteInfo=e,this.host=i}async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const e=await Sa({origin:this.host,remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports});return Bt(e,`remoteEntryExports is undefined
100
- ${ql(this.remoteInfo)}`),this.remoteEntryExports=e,this.remoteEntryExports}async init(e,i,a){const o=await this.getEntry();if(this.inited)return o;if(this.initPromise)return await this.initPromise,o;this.initing=!0,this.initPromise=(async()=>{const{remoteEntryInitOptions:l,shareScope:d,initScope:f}=Ip(this.remoteInfo,this.host.shareScopeMap,a),h=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:d,remoteEntryInitOptions:l,initScope:f,remoteInfo:this.remoteInfo,origin:this.host});typeof o?.init>"u"&&$t(_c,Ft,{hostName:this.host.name,remoteName:this.remoteInfo.name,remoteEntryUrl:this.remoteInfo.entry,remoteEntryKey:this.remoteInfo.entryGlobalName},void 0,un(this.host.options)),await o.init(h.shareScope,h.initScope,h.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit({...h,id:e,remoteSnapshot:i,remoteEntryExports:o}),this.inited=!0})();try{await this.initPromise}finally{this.initing=!1,this.initPromise=void 0}return o}async get(e,i,a,o){const{loadFactory:l=!0}=a||{loadFactory:!0},d=await this.init(e,o);this.lib=d;let f;f=await this.host.loaderHook.lifecycle.getModuleFactory.emit({remoteEntryExports:d,expose:i,moduleInfo:this.remoteInfo}),f||(f=await d.get(i)),Bt(f,`${Ii(this.remoteInfo)} remote don't export ${i}.`);const h=Og(this.remoteInfo.name,i),g=this.wraperFactory(f,h);return l?await g():g}wraperFactory(e,i){function a(o,l){o&&typeof o=="object"&&Object.isExtensible(o)&&!Object.getOwnPropertyDescriptor(o,Symbol.for("mf_module_id"))&&Object.defineProperty(o,Symbol.for("mf_module_id"),{value:l,enumerable:!1})}return e instanceof Promise?async()=>{const o=await e();return a(o,i),o}:()=>{const o=e();return a(o,i),o}}},Yt=class{constructor(e){this.type="",this.listeners=new Set,e&&(this.type=e)}on(e){typeof e=="function"&&this.listeners.add(e)}once(e){const i=this;this.on(function a(...o){return i.remove(a),e.apply(null,o)})}emit(...e){let i;return this.listeners.size>0&&this.listeners.forEach(a=>{i=a(...e)}),i}remove(e){this.listeners.delete(e)}removeAll(){this.listeners.clear()}},sr=class extends Yt{emit(...e){let i;const a=Array.from(this.listeners);if(a.length>0){let o=0;const l=d=>d===!1?!1:o<a.length?Promise.resolve(a[o++].apply(null,e)).then(l):d;i=l()}return Promise.resolve(i)}};function Mc(e,i){if(!ks(i))return!1;if(e!==i){for(const a in e)if(!(a in i))return!1}return!0}var dn=class extends Yt{constructor(e){super(),this.onerror=$t,this.type=e}emit(e){ks(e)||$t(`The data for the "${this.type}" hook should be an object.`);for(const i of this.listeners)try{const a=i(e);if(Mc(e,a))e=a;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(a){js(a),this.onerror(a)}return e}},Er=class extends Yt{constructor(e){super(),this.onerror=$t,this.type=e}emit(e){ks(e)||$t(`The response data for the "${this.type}" hook must be an object.`);const i=Array.from(this.listeners);if(i.length>0){let a=0;const o=d=>(js(d),this.onerror(d),e),l=d=>{if(Mc(e,d)){if(e=d,a<i.length)try{return Promise.resolve(i[a++](e)).then(l,o)}catch(f){return o(f)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e};return Promise.resolve(l(e))}return Promise.resolve(e)}},fn=class{constructor(e){this.registerPlugins={},this.lifecycle=e,this.lifecycleKeys=Object.keys(e)}applyPlugin(e,i){Bt(Cg(e),"Plugin configuration is invalid.");const a=e.name;Bt(a,"A name must be provided by the plugin."),this.registerPlugins[a]||(this.registerPlugins[a]=e,e.apply?.(i),Object.keys(this.lifecycle).forEach(o=>{const l=e[o];l&&this.lifecycle[o].on(l)}))}removePlugin(e){Bt(e,"A name is required.");const i=this.registerPlugins[e];Bt(i,`The plugin "${e}" is not registered.`),Object.keys(i).forEach(a=>{a!=="name"&&this.lifecycle[a].remove(i[a])})}};function Dc(e,i){const a=rc(i);a.url||$t(Nc,Ft,{remoteName:e.name});let o=ys(i,a.url);e.type=a.type,e.entryGlobalName=a.globalName,e.entry=o,e.version=i.version,e.buildVersion=i.buildVersion}function Ep(){return{name:"snapshot-plugin",async afterResolve(e){const{remote:i,pkgNameOrAlias:a,expose:o,origin:l,remoteInfo:d,id:f}=e;if(!$s(i)||!ec(i)){const{remoteSnapshot:h,globalSnapshot:g}=await l.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:i,id:f});Dc(d,h);const v={remote:i,preloadConfig:{nameOrAlias:a,exposes:[o],resourceCategory:"sync",share:!1,depsRemote:!1}},b=await l.remoteHandler.hooks.lifecycle.generatePreloadAssets.emit({origin:l,preloadOptions:v,remoteInfo:d,remote:i,remoteSnapshot:h,globalSnapshot:g});return b&&Ic(d,l,b,!1),{...e,remoteSnapshot:h}}return e}}}function Mp(e){const i=e.split(":");return i.length===1?{name:i[0],version:void 0}:i.length===2?{name:i[0],version:i[1]}:{name:i[1],version:i[2]}}function Ac(e,i,a,o,l={},d){const{value:f}=on(e,Ii(i)),h=d||f;if(h&&!Hl(h)&&(a(h,i,o),h.remotesInfo)){const g=Object.keys(h.remotesInfo);for(const v of g){if(l[v])continue;l[v]=!0;const b=Mp(v),w=h.remotesInfo[v];Ac(e,{name:b.name,version:w.matchedVersion},a,!1,l,void 0)}}}var Ds=(e,i)=>document.querySelector(`${e}[${e==="link"?"href":"src"}="${i}"]`);function Dp(e,i,a,o,l){const d=[],f=[],h=[],g=new Set,v=new Set,{options:b}=e,{preloadConfig:w}=i,{depsRemote:k}=w;if(Ac(o,a,(E,A,R)=>{let Z;if(R)Z=w;else if(Array.isArray(k)){const X=k.find(me=>me.nameOrAlias===A.name||me.nameOrAlias===A.alias);if(!X)return;Z=Oc(X)}else if(k===!0)Z=w;else return;const V=ys(E,rc(E).url);V&&h.push({name:A.name,moduleInfo:{name:A.name,entry:V,type:"remoteEntryType"in E?E.remoteEntryType:"global",entryGlobalName:"globalName"in E?E.globalName:A.name,shareScope:"",version:"version"in E?E.version:void 0},url:V});let G="modules"in E?E.modules:[];const H=Op(Z.exposes);H.length&&"modules"in E&&(G=E?.modules?.reduce((X,me)=>(H?.indexOf(me.moduleName)!==-1&&X.push(me),X),[]));function J(X){const me=X.map(ae=>ys(E,ae));return Z.filter?me.filter(Z.filter):me}if(G){const X=G.length;for(let me=0;me<X;me++){const ae=G[me],Ae=`${A.name}/${ae.moduleName}`;e.remoteHandler.hooks.lifecycle.handlePreloadModule.emit({id:ae.moduleName==="."?A.name:Ae,name:A.name,remoteSnapshot:E,preloadConfig:Z,remote:A,origin:e}),!Tg(Ae)&&(Z.resourceCategory==="all"?(d.push(...J(ae.assets.css.async)),d.push(...J(ae.assets.css.sync)),f.push(...J(ae.assets.js.async)),f.push(...J(ae.assets.js.sync))):Z.resourceCategory==="sync"&&(d.push(...J(ae.assets.css.sync)),f.push(...J(ae.assets.js.sync))),Rg(Ae))}}},!0,{},l),l.shared&&l.shared.length>0){const E=(A,R)=>{const{shared:Z}=_a(e.shareScopeMap,R.sharedName,A,e.sharedHandler.hooks.lifecycle.resolveShare)||{};Z&&typeof Z.lib=="function"&&(R.assets.js.sync.forEach(V=>{g.add(V)}),R.assets.css.sync.forEach(V=>{v.add(V)}))};l.shared.forEach(A=>{const R=b.shared?.[A.sharedName];if(!R)return;const Z=A.version?R.find(V=>V.version===A.version):R;Z&&tc(Z).forEach(V=>{E(V,A)})})}const O=f.filter(E=>!g.has(E)&&!Ds("script",E));return{cssAssets:d.filter(E=>!v.has(E)&&!Ds("link",E)),jsAssetsWithoutEntry:O,entryAssets:h.filter(E=>!Ds("script",E.url))}}var Ap=function(){return{name:"generate-preload-assets-plugin",async generatePreloadAssets(e){const{origin:i,preloadOptions:a,remoteInfo:o,remote:l,globalSnapshot:d,remoteSnapshot:f}=e;return $s(l)&&ec(l)?{cssAssets:[],jsAssetsWithoutEntry:[],entryAssets:[{name:l.name,url:l.entry,moduleInfo:{name:o.name,entry:l.entry,type:o.type||"global",entryGlobalName:"",shareScope:""}}]}:(Dc(o,f),Dp(i,a,o,d,f))}}};function zc(e,i){const a=pa({name:i.name,version:i.options.version}),o=a&&"remotesInfo"in a&&a.remotesInfo&&on(a.remotesInfo,e.name).value;return o&&o.matchedVersion?{hostGlobalSnapshot:a,globalSnapshot:ic(),remoteSnapshot:pa({name:e.name,version:o.matchedVersion})}:{hostGlobalSnapshot:void 0,globalSnapshot:ic(),remoteSnapshot:pa({name:e.name,version:"version"in e?e.version:void 0})}}var zp=class{constructor(e){this.loadingHostSnapshot=null,this.manifestCache=new Map,this.hooks=new fn({beforeLoadRemoteSnapshot:new sr("beforeLoadRemoteSnapshot"),loadSnapshot:new Er("loadGlobalSnapshot"),loadRemoteSnapshot:new Er("loadRemoteSnapshot"),afterLoadSnapshot:new Er("afterLoadSnapshot")}),this.manifestLoading=Ei.__FEDERATION__.__MANIFEST_LOADING__,this.HostInstance=e,this.loaderHook=e.loaderHook}async loadRemoteSnapshotInfo({moduleInfo:e,id:i,expose:a}){const{options:o}=this.HostInstance;await this.hooks.lifecycle.beforeLoadRemoteSnapshot.emit({options:o,moduleInfo:e});let l=pa({name:this.HostInstance.options.name,version:this.HostInstance.options.version});l||(l={version:this.HostInstance.options.version||"",remoteEntry:"",remotesInfo:{}},Ag({[this.HostInstance.options.name]:l})),l&&"remotesInfo"in l&&!on(l.remotesInfo,e.name).value&&("version"in e||"entry"in e)&&(l.remotesInfo={...l?.remotesInfo,[e.name]:{matchedVersion:"version"in e?e.version:e.entry}});const{hostGlobalSnapshot:d,remoteSnapshot:f,globalSnapshot:h}=this.getGlobalRemoteInfo(e),{remoteSnapshot:g,globalSnapshot:v}=await this.hooks.lifecycle.loadSnapshot.emit({options:o,moduleInfo:e,hostGlobalSnapshot:d,remoteSnapshot:f,globalSnapshot:h});let b,w;if(g)if(Hl(g)){const k=g.remoteEntry,O=await this.getManifestJson(k,e,{}),E=ac({...e,entry:k},O);b=O,w=E}else{const{remoteSnapshot:k}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:g,from:"global"});b=k,w=v}else if($s(e)){const k=await this.getManifestJson(e.entry,e,{}),O=ac(e,k),{remoteSnapshot:E}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:e,remoteSnapshot:k,from:"global"});b=E,w=O}else $t($c,Ft,{remoteName:e.name,remoteVersion:e.version,hostName:this.HostInstance.options.name,globalSnapshot:JSON.stringify(v)},void 0,un(this.HostInstance.options));return await this.hooks.lifecycle.afterLoadSnapshot.emit({id:i,host:this.HostInstance,options:o,moduleInfo:e,remoteSnapshot:b}),{remoteSnapshot:b,globalSnapshot:w}}getGlobalRemoteInfo(e){return zc(e,this.HostInstance)}async getManifestJson(e,i,a){const o=async()=>{let d=this.manifestCache.get(e);if(d)return d;try{let f=await this.loaderHook.lifecycle.fetch.emit(e,{},ja(i));(!f||!(f instanceof Response))&&(f=await fetch(e,{})),d=await f.json()}catch(f){d=await this.HostInstance.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:e,error:f,from:"runtime",lifecycle:"afterResolve",origin:this.HostInstance}),d||(delete this.manifestLoading[e],$t(wc,Ft,{manifestUrl:e,moduleName:i.name,hostName:this.HostInstance.options.name},`${f}`,un(this.HostInstance.options)))}return Bt(d.metaData&&d.exposes&&d.shared,`"${e}" is not a valid federation manifest for remote "${i.name}". Missing required fields: ${[!d.metaData&&"metaData",!d.exposes&&"exposes",!d.shared&&"shared"].filter(Boolean).join(", ")}.`),this.manifestCache.set(e,d),d},l=async()=>{const d=await o(),f=bg(d,{version:e}),{remoteSnapshot:h}=await this.hooks.lifecycle.loadRemoteSnapshot.emit({options:this.HostInstance.options,moduleInfo:i,manifestJson:d,remoteSnapshot:f,manifestUrl:e,from:"manifest"});return h};return this.manifestLoading[e]||(this.manifestLoading[e]=l().then(d=>d)),this.manifestLoading[e]}},Tp=class{constructor(e){this.hooks=new fn({beforeRegisterShare:new dn("beforeRegisterShare"),afterResolve:new Er("afterResolve"),beforeLoadShare:new Er("beforeLoadShare"),loadShare:new sr,resolveShare:new dn("resolveShare"),initContainerShareScopeMap:new dn("initContainerShareScopeMap")}),this.host=e,this.shareScopeMap={},this.initTokens={},this._setGlobalShareScopeMap(e.options)}registerShared(e,i){const{newShareInfos:a,allShareInfos:o}=vc(e,i);return Object.keys(a).forEach(l=>{a[l].forEach(d=>{d.scope.forEach(f=>{this.hooks.lifecycle.beforeRegisterShare.emit({origin:this.host,pkgName:l,shared:d}),this.shareScopeMap[f]?.[l]||this.setShared({pkgName:l,lib:d.lib,get:d.get,loaded:d.loaded||!!d.lib,shared:d,from:i.name})})})}),{newShareInfos:a,allShareInfos:o}}async loadShare(e,i){const{host:a}=this,o=yc({pkgName:e,extraOptions:i,shareInfos:a.options.shared});o?.scope&&await Promise.all(o.scope.map(async h=>{await Promise.all(this.initializeSharing(h,{strategy:o.strategy}))}));const{shareInfo:l}=await this.hooks.lifecycle.beforeLoadShare.emit({pkgName:e,shareInfo:o,shared:a.options.shared,origin:a});Bt(l,`Cannot find shared "${e}" in host "${a.options.name}". Ensure the shared config for "${e}" is declared in the federation plugin options and the host has been initialized before loading shares.`);const{shared:d,useTreesShaking:f}=_a(this.shareScopeMap,e,l,this.hooks.lifecycle.resolveShare)||{};if(d){const h=wa(d,f);if(h.lib)return cn(h,a.options.name),h.lib;if(h.loading&&!h.loaded){const g=await h.loading;return h.loaded=!0,h.lib||(h.lib=g),cn(h,a.options.name),g}else{const v=(async()=>{const b=await h.get();return cn(h,a.options.name),h.loaded=!0,h.lib=b,b})();return this.setShared({pkgName:e,loaded:!1,shared:d,from:a.options.name,lib:null,loading:v,treeShaking:f?h:void 0}),v}}else{if(i?.customShareInfo)return!1;const h=Ai(l.treeShaking),g=wa(l,h),b=(async()=>{const w=await g.get();g.lib=w,g.loaded=!0,cn(g,a.options.name);const{shared:k,useTreesShaking:O}=_a(this.shareScopeMap,e,l,this.hooks.lifecycle.resolveShare)||{};if(k){const E=wa(k,O);E.lib=w,E.loaded=!0,k.from=l.from}return w})();return this.setShared({pkgName:e,loaded:!1,shared:l,from:a.options.name,lib:null,loading:b,treeShaking:h?g:void 0}),b}}initializeSharing(e=ya,i){const{host:a}=this,o=i?.from,l=i?.strategy;let d=i?.initScope;const f=[];if(o!=="build"){const{initTokens:k}=this;d||(d=[]);let O=k[e];if(O||(O=k[e]={from:this.host.name}),d.indexOf(O)>=0)return f;d.push(O)}const h=this.shareScopeMap,g=a.options.name;h[e]||(h[e]={});const v=h[e],b=(k,O)=>{const{version:E,eager:A}=O;v[k]=v[k]||{};const R=v[k],Z=R[E]&&wa(R[E]),V=!!(Z&&("eager"in Z&&Z.eager||"shareConfig"in Z&&Z.shareConfig?.eager));(!Z||Z.strategy!=="loaded-first"&&!Z.loaded&&(!A!=!V?A:g>R[E].from))&&(R[E]=O)},w=async k=>{const{module:O}=await a.remoteHandler.getRemoteModuleAndOptions({id:k});let E;try{E=await O.getEntry()}catch(A){if(E=await a.remoteHandler.hooks.lifecycle.errorLoadRemote.emit({id:k,error:A,from:"runtime",lifecycle:"beforeLoadShare",origin:a}),!E)return}finally{E?.init&&!O.initing&&(O.remoteEntryExports=E,await O.init(void 0,void 0,d))}};return Object.keys(a.options.shared).forEach(k=>{a.options.shared[k].forEach(O=>{O.scope.includes(e)&&b(k,O)})}),(a.options.shareStrategy==="version-first"||l==="version-first")&&a.options.remotes.forEach(k=>{k.shareScope===e&&f.push(w(k.name))}),f}loadShareSync(e,i){const{host:a}=this,o=yc({pkgName:e,extraOptions:i,shareInfos:a.options.shared});o?.scope&&o.scope.forEach(f=>{this.initializeSharing(f,{strategy:o.strategy})});const{shared:l,useTreesShaking:d}=_a(this.shareScopeMap,e,o,this.hooks.lifecycle.resolveShare)||{};if(l){if(typeof l.lib=="function")return cn(l,a.options.name),l.loaded||(l.loaded=!0,l.from===a.options.name&&(o.loaded=!0)),l.lib;if(typeof l.get=="function"){const f=l.get();if(!(f instanceof Promise))return cn(l,a.options.name),this.setShared({pkgName:e,loaded:!0,from:a.options.name,lib:f,shared:l}),f}}if(o.lib)return o.loaded||(o.loaded=!0),o.lib;if(o.get){const f=o.get();return f instanceof Promise&&$t(i?.from==="build"?jc:Is,Ft,{hostName:a.options.name,sharedPkgName:e},void 0,un(a.options)),o.lib=f,this.setShared({pkgName:e,loaded:!0,from:a.options.name,lib:o.lib,shared:o}),o.lib}$t(Is,Ft,{hostName:a.options.name,sharedPkgName:e},void 0,un(a.options))}initShareScopeMap(e,i,a={}){const{host:o}=this;this.shareScopeMap[e]=i,this.hooks.lifecycle.initContainerShareScopeMap.emit({shareScope:i,options:o.options,origin:o,scopeName:e,hostShareScopeMap:a.hostShareScopeMap})}setShared({pkgName:e,shared:i,from:a,lib:o,loading:l,loaded:d,get:f,treeShaking:h}){const{version:g,scope:v="default",...b}=i,w=Array.isArray(v)?v:[v],k=O=>{const E=(R,Z,V)=>{V&&!R[Z]&&(R[Z]=V)},A=h?O.treeShaking:O;E(A,"loaded",d),E(A,"loading",l),E(A,"get",f)};w.forEach(O=>{this.shareScopeMap[O]||(this.shareScopeMap[O]={}),this.shareScopeMap[O][e]||(this.shareScopeMap[O][e]={}),this.shareScopeMap[O][e][g]||(this.shareScopeMap[O][e][g]={version:g,scope:[O],...b,lib:o});const E=this.shareScopeMap[O][e][g];k(E),a&&E.from!==a&&(E.from=a)})}_setGlobalShareScopeMap(e){const i=bc(),a=e.id||e.name;a&&!i[a]&&(i[a]=this.shareScopeMap)}},Rp=class{constructor(e){this.hooks=new fn({beforeRegisterRemote:new dn("beforeRegisterRemote"),registerRemote:new dn("registerRemote"),beforeRequest:new Er("beforeRequest"),onLoad:new sr("onLoad"),handlePreloadModule:new Yt("handlePreloadModule"),errorLoadRemote:new sr("errorLoadRemote"),beforePreloadRemote:new sr("beforePreloadRemote"),generatePreloadAssets:new sr("generatePreloadAssets"),afterPreloadRemote:new sr,loadEntry:new sr}),this.host=e,this.idToRemoteMap={}}formatAndRegisterRemote(e,i){return(i.remotes||[]).reduce((a,o)=>(this.registerRemote(o,a,{force:!1}),a),e.remotes)}setIdToRemoteMap(e,i){const{remote:a,expose:o}=i,{name:l,alias:d}=a;if(this.idToRemoteMap[e]={name:a.name,expose:o},d&&e.startsWith(l)){const f=e.replace(l,d);this.idToRemoteMap[f]={name:a.name,expose:o};return}if(d&&e.startsWith(d)){const f=e.replace(d,l);this.idToRemoteMap[f]={name:a.name,expose:o}}}async loadRemote(e,i){const{host:a}=this;try{const{loadFactory:o=!0}=i||{loadFactory:!0},{module:l,moduleOptions:d,remoteMatchInfo:f}=await this.getRemoteModuleAndOptions({id:e}),{pkgNameOrAlias:h,remote:g,expose:v,id:b,remoteSnapshot:w}=f,k=await l.get(b,v,i,w),O=await this.hooks.lifecycle.onLoad.emit({id:b,pkgNameOrAlias:h,expose:v,exposeModule:o?k:void 0,exposeModuleFactory:o?void 0:k,remote:g,options:d,moduleInstance:l,origin:a});return this.setIdToRemoteMap(e,f),typeof O=="function"?O:k}catch(o){const{from:l="runtime"}=i||{from:"runtime"},d=await this.hooks.lifecycle.errorLoadRemote.emit({id:e,error:o,from:l,lifecycle:"onLoad",origin:a});if(!d)throw o;return d}}async preloadRemote(e){const{host:i}=this;await this.hooks.lifecycle.beforePreloadRemote.emit({preloadOps:e,options:i.options,origin:i});const a=Cp(i.options.remotes,e);await Promise.all(a.map(async o=>{const{remote:l}=o,d=ja(l),{globalSnapshot:f,remoteSnapshot:h}=await i.snapshotHandler.loadRemoteSnapshotInfo({moduleInfo:l}),g=await this.hooks.lifecycle.generatePreloadAssets.emit({origin:i,preloadOptions:o,remote:l,remoteInfo:d,globalSnapshot:f,remoteSnapshot:h});g&&Ic(d,i,g)}))}registerRemotes(e,i){const{host:a}=this;e.forEach(o=>{this.registerRemote(o,a.options.remotes,{force:i?.force})})}async getRemoteModuleAndOptions(e){const{host:i}=this,{id:a}=e;let o;try{o=await this.hooks.lifecycle.beforeRequest.emit({id:a,options:i.options,origin:i})}catch(O){if(o=await this.hooks.lifecycle.errorLoadRemote.emit({id:a,options:i.options,origin:i,from:"runtime",error:O,lifecycle:"beforeRequest"}),!o)throw O}const{id:l}=o,d=bp(i.options.remotes,l);d||$t(Sc,Ft,{hostName:i.options.name,requestId:l},void 0,un(i.options));const{remote:f}=d,h=ja(f),g=await i.sharedHandler.hooks.lifecycle.afterResolve.emit({id:l,...d,options:i.options,origin:i,remoteInfo:h}),{remote:v,expose:b}=g;Bt(v&&b,`The 'beforeRequest' hook was executed, but it failed to return the correct 'remote' and 'expose' values while loading ${l}.`);let w=i.moduleCache.get(v.name);const k={host:i,remoteInfo:h};return w||(w=new Ec(k),i.moduleCache.set(v.name,w)),{module:w,moduleOptions:k,remoteMatchInfo:g}}registerRemote(e,i,a){const{host:o}=this,l=()=>{if(e.alias){const f=i.find(h=>e.alias&&(h.name.startsWith(e.alias)||h.alias?.startsWith(e.alias)));Bt(!f,`The alias ${e.alias} of remote ${e.name} is not allowed to be the prefix of ${f&&f.name} name or alias`)}"entry"in e&&typeof window<"u"&&!e.entry.startsWith("http")&&(e.entry=new URL(e.entry,window.location.origin).href),e.shareScope||(e.shareScope=ya),e.type||(e.type=dp)};this.hooks.lifecycle.beforeRegisterRemote.emit({remote:e,origin:o});const d=i.find(f=>f.name===e.name);if(!d)l(),i.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o});else{const f=[`The remote "${e.name}" is already registered.`,"Please note that overriding it may cause unexpected errors."];a?.force&&(this.removeRemote(d),l(),i.push(e),this.hooks.lifecycle.registerRemote.emit({remote:e,origin:o}),Wl(f.join(" ")))}}removeRemote(e){try{const{host:i}=this,{name:a}=e,o=i.options.remotes.findIndex(d=>d.name===a);o!==-1&&i.options.remotes.splice(o,1);const l=i.moduleCache.get(e.name);if(l){const d=l.remoteInfo,f=d.entryGlobalName;Ct[f]&&(Object.getOwnPropertyDescriptor(Ct,f)?.configurable?delete Ct[f]:Ct[f]=void 0);const h=Ms(l.remoteInfo);an[h]&&delete an[h],i.snapshotHandler.manifestCache.delete(d.entry);let g=d.buildVersion?Ql(d.name,d.buildVersion):d.name;const v=Ct.__FEDERATION__.__INSTANCES__.findIndex(w=>d.buildVersion?w.options.id===g:w.name===g);if(v!==-1){const w=Ct.__FEDERATION__.__INSTANCES__[v];g=w.options.id||g;const k=bc();let O=!0;const E=[];Object.keys(k).forEach(A=>{const R=k[A];R&&Object.keys(R).forEach(Z=>{const V=R[Z];V&&Object.keys(V).forEach(G=>{const H=V[G];H&&Object.keys(H).forEach(J=>{const X=H[J];X&&typeof X=="object"&&X.from===d.name&&(X.loaded||X.loading?(X.useIn=X.useIn.filter(me=>me!==d.name),X.useIn.length?O=!1:E.push([A,Z,G,J])):E.push([A,Z,G,J]))})})})}),O&&(w.shareScopeMap={},delete k[g]),E.forEach(([A,R,Z,V])=>{delete k[A]?.[R]?.[Z]?.[V]}),Ct.__FEDERATION__.__INSTANCES__.splice(v,1)}const{hostGlobalSnapshot:b}=zc(e,i);if(b){const w=b&&"remotesInfo"in b&&b.remotesInfo&&on(b.remotesInfo,e.name).key;w&&(delete b.remotesInfo[w],Ei.__FEDERATION__.__MANIFEST_LOADING__[w]&&delete Ei.__FEDERATION__.__MANIFEST_LOADING__[w])}i.moduleCache.delete(e.name)}}catch(i){Ss.error(`removeRemote failed: ${i instanceof Error?i.message:String(i)}`)}}},Zp=typeof FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN=="boolean"?!FEDERATION_OPTIMIZE_NO_SNAPSHOT_PLUGIN:!0,Tc=class{constructor(e){this.hooks=new fn({beforeInit:new dn("beforeInit"),init:new Yt,beforeInitContainer:new Er("beforeInitContainer"),initContainer:new Er("initContainer")}),this.version="2.4.0",this.moduleCache=new Map,this.loaderHook=new fn({getModuleInfo:new Yt,createScript:new Yt,createLink:new Yt,fetch:new sr,loadEntryError:new sr,getModuleFactory:new sr}),this.bridgeHook=new fn({beforeBridgeRender:new Yt,afterBridgeRender:new Yt,beforeBridgeDestroy:new Yt,afterBridgeDestroy:new Yt});const i=Zp?[Ep(),Ap()]:[],a={id:kp(),name:e.name,plugins:i,remotes:[],shared:{},inBrowser:Vl};this.name=e.name,this.options=a,this.snapshotHandler=new zp(this),this.sharedHandler=new Tp(this),this.remoteHandler=new Rp(this),this.shareScopeMap=this.sharedHandler.shareScopeMap,this.registerPlugins([...a.plugins,...e.plugins||[]]),this.options=this.formatOptions(a,e)}initOptions(e){e.name&&e.name!==this.options.name&&$t(Yl(Pc,Ft)),this.registerPlugins(e.plugins);const i=this.formatOptions(this.options,e);return this.options=i,i}async loadShare(e,i){return this.sharedHandler.loadShare(e,i)}loadShareSync(e,i){return this.sharedHandler.loadShareSync(e,i)}initializeSharing(e=ya,i){return this.sharedHandler.initializeSharing(e,i)}initRawContainer(e,i,a){const o=ja({name:e,entry:i}),l=new Ec({host:this,remoteInfo:o});return l.remoteEntryExports=a,this.moduleCache.set(e,l),l}async loadRemote(e,i){return this.remoteHandler.loadRemote(e,i)}async preloadRemote(e){return this.remoteHandler.preloadRemote(e)}initShareScopeMap(e,i,a={}){this.sharedHandler.initShareScopeMap(e,i,a)}formatOptions(e,i){const{allShareInfos:a}=vc(e,i),{userOptions:o,options:l}=this.hooks.lifecycle.beforeInit.emit({origin:this,userOptions:i,options:e,shareInfo:a}),d=this.remoteHandler.formatAndRegisterRemote(l,o),{allShareInfos:f}=this.sharedHandler.registerShared(l,o),h=[...l.plugins];o.plugins&&o.plugins.forEach(v=>{h.includes(v)||h.push(v)});const g={...e,...i,plugins:h,remotes:d,shared:f,id:o.id||e.id};return this.hooks.lifecycle.init.emit({origin:this,options:g}),g}registerPlugins(e){const i=Pp(e,this);this.options.plugins=this.options.plugins.reduce((a,o)=>(o&&a&&!a.find(l=>l.name===o.name)&&a.push(o),a),i||[])}registerRemotes(e,i){return this.remoteHandler.registerRemotes(e,i)}registerShared(e){this.sharedHandler.registerShared(this.options,{...this.options,shared:e})}};function Lp(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function Up(e,i){const a=Lp();return Ct.__FEDERATION__.__INSTANCES__.find(o=>!!(a&&o.options.id===a||o.options.name===e&&!o.options.version&&!i||o.options.name===e&&i&&o.options.version===i))}function Bp(e){const i=new(Eg()||Tc)({id:`${e.name}@${e.version||Date.now()}`,...e});return Ig(i),i}var lr=null;function Fp(e){const i=Up(e.name,e.version),a={...e,id:e.id||""};return i?(i.initOptions(a),lr||(lr=i),i):(lr=Bp(a),lr)}function Gp(...e){return Bt(lr,Es,Ft),lr.loadRemote.apply(lr,e)}function Vp(...e){return Bt(lr,Es,Ft),lr.registerRemotes.apply(lr,e)}function Qp(){return lr}Mg(Tc);function mn(e){const i=(typeof globalThis<"u"?globalThis:void 0)?.[e];return i&&typeof i=="object"?i:{}}var Wp={singleton:!0,requiredVersion:!1,eager:!0},er=e=>({version:"0.0.0",scope:"default",lib:e,shareConfig:Wp}),Rc="__mf_module_cache__";function qp(){const e=globalThis,i=e[Rc];if(i&&typeof i=="object"){const o=i;return o.share??={},o.remote??={},o}const a={share:{},remote:{}};return e[Rc]=a,a}function Hp(){const e=qp();e.share.react??=n,e.share["react-dom"]??=x,e.share["react-dom/client"]??=D,e.share["react/jsx-runtime"]??=r,e.share["@tanstack/react-query"]??=ee,e.share["@trpc/client"]??=Y,e.share["@trpc/react-query"]??=ne,e.share["react-konva"]??=ue,e.share.konva??=ge,e.share["@camstack/ui-library"]??=mn("__camstackUiLibrary"),e.share["@camstack/sdk"]??=mn("__camstackSdk"),e.share["@camstack/types"]??=mn("__camstackTypes")}function Zc(){Hp(),Qp()===null&&Fp({name:"admin_ui_host",remotes:[],shared:{react:er(()=>n),"react-dom":er(()=>x),"react-dom/client":er(()=>D),"react/jsx-runtime":er(()=>r),"@tanstack/react-query":er(()=>ee),"@trpc/client":er(()=>Y),"@trpc/react-query":er(()=>ne),"react-konva":er(()=>ue),konva:er(()=>ge),"@camstack/ui-library":er(()=>mn("__camstackUiLibrary")),"@camstack/sdk":er(()=>mn("__camstackSdk")),"@camstack/types":er(()=>mn("__camstackTypes"))}})}/**
101
- * @license lucide-react v0.576.0 - ISC
102
- *
103
- * This source code is licensed under the ISC license.
104
- * See the LICENSE file in the root directory of this source tree.
105
- */var Lc=(...e)=>e.filter((i,a,o)=>!!i&&i.trim()!==""&&o.indexOf(i)===a).join(" ").trim();/**
106
- * @license lucide-react v0.576.0 - ISC
107
- *
108
- * This source code is licensed under the ISC license.
109
- * See the LICENSE file in the root directory of this source tree.
110
- */var Jp=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
111
- * @license lucide-react v0.576.0 - ISC
112
- *
113
- * This source code is licensed under the ISC license.
114
- * See the LICENSE file in the root directory of this source tree.
115
- */var Kp=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,a,o)=>o?o.toUpperCase():a.toLowerCase());/**
116
- * @license lucide-react v0.576.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */var Uc=e=>{const i=Kp(e);return i.charAt(0).toUpperCase()+i.slice(1)};/**
121
- * @license lucide-react v0.576.0 - ISC
122
- *
123
- * This source code is licensed under the ISC license.
124
- * See the LICENSE file in the root directory of this source tree.
125
- */var Xp={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
126
- * @license lucide-react v0.576.0 - ISC
127
- *
128
- * This source code is licensed under the ISC license.
129
- * See the LICENSE file in the root directory of this source tree.
130
- */var Yp=e=>{for(const i in e)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1};/**
131
- * @license lucide-react v0.576.0 - ISC
132
- *
133
- * This source code is licensed under the ISC license.
134
- * See the LICENSE file in the root directory of this source tree.
135
- */var eh=(0,p.forwardRef)(({color:e="currentColor",size:i=24,strokeWidth:a=2,absoluteStrokeWidth:o,className:l="",children:d,iconNode:f,...h},g)=>(0,p.createElement)("svg",{ref:g,...Xp,width:i,height:i,stroke:e,strokeWidth:o?Number(a)*24/Number(i):a,className:Lc("lucide",l),...!d&&!Yp(h)&&{"aria-hidden":"true"},...h},[...f.map(([v,b])=>(0,p.createElement)(v,b)),...Array.isArray(d)?d:[d]]));/**
136
- * @license lucide-react v0.576.0 - ISC
137
- *
138
- * This source code is licensed under the ISC license.
139
- * See the LICENSE file in the root directory of this source tree.
140
- */var pe=(e,i)=>{const a=(0,p.forwardRef)(({className:o,...l},d)=>(0,p.createElement)(eh,{ref:d,iconNode:i,className:Lc(`lucide-${Jp(Uc(e))}`,`lucide-${e}`,o),...l}));return a.displayName=Uc(e),a},Mr=pe("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]),th=pe("arrow-down",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]),rh=pe("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]),nh=pe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),Bc=pe("arrow-up-to-line",[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]]),ih=pe("arrow-up",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]),ah=pe("battery-full",[["path",{d:"M10 10v4",key:"1mb2ec"}],["path",{d:"M14 10v4",key:"1nt88p"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 10v4",key:"1n77qd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]),oh=pe("battery-low",[["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 14v-4",key:"14a6bd"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]),sh=pe("battery-warning",[["path",{d:"M10 17h.01",key:"nbq80n"}],["path",{d:"M10 7v6",key:"nne03l"}],["path",{d:"M14 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2",key:"1m83kb"}],["path",{d:"M22 14v-4",key:"14q9d5"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h2",key:"h8lgfh"}]]),Fc=pe("battery",[["path",{d:"M 22 14 L 22 10",key:"nqc4tb"}],["rect",{x:"2",y:"6",width:"16",height:"12",rx:"2",key:"13zb55"}]]),lh=pe("bell-ring",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]]),$a=pe("bell",[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]]),ch=pe("bug",[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]]),As=pe("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]),uh=pe("cast",[["path",{d:"M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6",key:"3zrzxg"}],["path",{d:"M2 12a9 9 0 0 1 8 8",key:"g6cvee"}],["path",{d:"M2 16a5 5 0 0 1 4 4",key:"1y1dii"}],["line",{x1:"2",x2:"2.01",y1:"20",y2:"20",key:"xu2jvo"}]]),Ti=pe("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Wr=pe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),dh=pe("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),Dr=pe("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),gn=pe("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),fh=pe("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),mh=pe("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),gh=pe("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]),ph=pe("circle-pause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]),hh=pe("circle-plus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]),Gc=pe("circle-question-mark",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),vh=pe("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]),bh=pe("copy-plus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),Ar=pe("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),yh=pe("cpu",[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]]),zs=pe("crosshair",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]]),xh=pe("database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]),Vc=pe("door-open",[["path",{d:"M11 20H2",key:"nlcfvz"}],["path",{d:"M11 4.562v16.157a1 1 0 0 0 1.242.97L19 20V5.562a2 2 0 0 0-1.515-1.94l-4-1A2 2 0 0 0 11 4.561z",key:"au4z13"}],["path",{d:"M11 4H8a2 2 0 0 0-2 2v14",key:"74r1mk"}],["path",{d:"M14 12h.01",key:"1jfl7z"}],["path",{d:"M22 20h-3",key:"vhrsz"}]]),Ts=pe("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),Qc=pe("ellipsis-vertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]),Rs=pe("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),Zs=pe("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),pn=pe("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Wc=pe("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]]),_h=pe("grip-horizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]),qc=pe("house",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]]),wh=pe("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),Sh=pe("inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]),jh=pe("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]),$h=pe("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),Hc=pe("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]),Gt=pe("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),kh=pe("locate-fixed",[["line",{x1:"2",x2:"5",y1:"12",y2:"12",key:"bvdh0s"}],["line",{x1:"19",x2:"22",y1:"12",y2:"12",key:"1tbv5k"}],["line",{x1:"12",x2:"12",y1:"2",y2:"5",key:"11lu5j"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}],["circle",{cx:"12",cy:"12",r:"7",key:"fim9np"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]),Jc=pe("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]),Ph=pe("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]),Kc=pe("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),Xc=pe("minimize-2",[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]]),Yc=pe("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),Ls=pe("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),Nh=pe("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]),Us=pe("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]),Ch=pe("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),Bs=pe("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),hn=pe("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Oh=pe("plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z",key:"1xoxul"}],["path",{d:"M9 8V2",key:"14iosj"}]]),Ih=pe("power-off",[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),Eh=pe("qr-code",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]),eu=pe("radar",[["path",{d:"M19.07 4.93A10 10 0 0 0 6.99 3.34",key:"z3du51"}],["path",{d:"M4 6h.01",key:"oypzma"}],["path",{d:"M2.29 9.62A10 10 0 1 0 21.31 8.35",key:"qzzz0"}],["path",{d:"M16.24 7.76A6 6 0 1 0 8.23 16.67",key:"1yjesh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M17.99 11.66A6 6 0 0 1 15.77 16.67",key:"1u2y91"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"m13.41 10.59 5.66-5.66",key:"mhq4k0"}]]),Mh=pe("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),ka=pe("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),tu=pe("rotate-ccw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]),ru=pe("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),Dh=pe("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]),Ah=pe("scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]),zh=pe("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),Ri=pe("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]),Th=pe("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),nu=pe("share-2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]),Rh=pe("shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]),Zh=pe("ship",[["path",{d:"M12 10.189V14",key:"1p8cqu"}],["path",{d:"M12 2v3",key:"qbqxhf"}],["path",{d:"M19 13V7a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v6",key:"qpkstq"}],["path",{d:"M19.38 20A11.6 11.6 0 0 0 21 14l-8.188-3.639a2 2 0 0 0-1.624 0L3 14a11.6 11.6 0 0 0 2.81 7.76",key:"7tigtc"}],["path",{d:"M2 21c.6.5 1.2 1 2.5 1 2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1s1.2 1 2.5 1c2.5 0 2.5-2 5-2 1.3 0 1.9.5 2.5 1",key:"1924j5"}]]),Lh=pe("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]),iu=pe("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]),Uh=pe("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),au=pe("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]),Bh=pe("table-2",[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]]),ou=pe("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]),Fh=pe("thermometer",[["path",{d:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z",key:"17jzev"}]]),Gh=pe("toggle-left",[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]]),wr=pe("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),Vh=pe("trending-up",[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]]),Qh=pe("trending-down",[["path",{d:"M16 17h6v-6",key:"t6n2it"}],["path",{d:"m22 17-8.5-8.5-5 5L2 7",key:"x473p"}]]),vn=pe("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]),Wh=pe("unlink-2",[["path",{d:"M15 7h2a5 5 0 0 1 0 10h-2m-6 0H7A5 5 0 0 1 7 7h2",key:"1re2ne"}]]),su=pe("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]),qh=pe("wifi-off",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]),lu=pe("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]),Fs=pe("wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]]),It=pe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),cu=pe("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),Hh=pe("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Jh=pe("zoom-out",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]),Kh={frigate:Zh,scrypted:Rh,reolink:Mh,homeAssistant:qc,rtsp:uh},Xh={online:mh,offline:vh,degraded:gn,unknown:Gc},uu=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,du=Me,qr=(e,i)=>a=>{var o;if(i?.variants==null)return du(e,a?.class,a?.className);const{variants:l,defaultVariants:d}=i,f=Object.keys(l).map(g=>{const v=a?.[g],b=d?.[g];if(v===null)return null;const w=uu(v)||uu(b);return l[g][w]}),h=a&&Object.entries(a).reduce((g,v)=>{let[b,w]=v;return w===void 0||(g[b]=w),g},{});return du(e,f,i==null||(o=i.compoundVariants)===null||o===void 0?void 0:o.reduce((g,v)=>{let{class:b,className:w,...k}=v;return Object.entries(k).every(O=>{let[E,A]=O;return Array.isArray(A)?A.includes({...d,...h}[E]):{...d,...h}[E]===A})?[...g,b,w]:g},[]),a?.class,a?.className)},Yh=qr("inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 px-2.5 text-xs gap-1.5",md:"h-8 px-3 text-sm gap-2",lg:"h-9 px-4 text-sm gap-2"}},defaultVariants:{variant:"primary",size:"sm"}}),Sr=(0,n.forwardRef)(({className:e,variant:i,size:a,...o},l)=>(0,r.jsx)("button",{ref:l,className:P(Yh({variant:i,size:a}),e),...o}));Sr.displayName="Button";var ev=qr("inline-flex items-center justify-center rounded-md font-medium transition-colors cursor-pointer disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 w-7",md:"h-8 w-8",lg:"h-9 w-9"}},defaultVariants:{variant:"primary",size:"sm"}}),Gs=(0,n.forwardRef)(({className:e,variant:i,size:a,icon:o,...l},d)=>(0,r.jsx)("button",{ref:d,className:P(ev({variant:i,size:a}),e),...l,children:(0,r.jsx)(o,{className:"h-4 w-4"})}));Gs.displayName="IconButton";var tv=qr("inline-flex items-center rounded-full text-xs font-medium px-2 py-0.5",{variants:{variant:{default:"bg-surface-hover text-foreground",success:"bg-success/15 text-success",warning:"bg-warning/15 text-warning",danger:"bg-danger/15 text-danger",info:"bg-info/15 text-info"},styleVariant:{solid:"",outline:"border bg-transparent"}},defaultVariants:{variant:"default",styleVariant:"solid"}}),zr=(0,n.forwardRef)(({className:e,variant:i,style:a,...o},l)=>(0,r.jsx)("span",{ref:l,className:P(tv({variant:i,styleVariant:a}),e),...o}));zr.displayName="Badge";var rv=qr("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),Vs=(0,n.forwardRef)(({className:e,variant:i,...a},o)=>(0,r.jsx)("div",{ref:o,className:P(rv({variant:i}),e),...a}));Vs.displayName="Card";function fu({expanded:e,onExpandedChange:i,header:a,children:o,dimmed:l=!1,hideChevron:d=!1,className:f}){return(0,r.jsxs)("div",{className:P("rounded-lg border border-border bg-surface overflow-hidden",l&&"opacity-[0.45]",f),children:[(0,r.jsxs)("div",{role:"button",tabIndex:0,className:"flex items-center gap-2.5 px-3 py-2.5 cursor-pointer select-none",onClick:()=>i(!e),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),i(!e))},children:[!d&&(0,r.jsx)("span",{className:"text-foreground-subtle shrink-0",children:e?(0,r.jsx)(Wr,{className:"h-4 w-4"}):(0,r.jsx)(Dr,{className:"h-4 w-4"})}),a]}),e&&o&&(0,r.jsx)("div",{className:"border-t border-border px-3 py-3",children:o})]})}var Qs=(0,n.forwardRef)(({className:e,...i},a)=>(0,r.jsx)("label",{ref:a,className:P("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",e),...i}));Qs.displayName="Label";var nv=qr("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),Ws=(0,n.forwardRef)(({className:e,orientation:i,...a},o)=>(0,r.jsx)("div",{ref:o,role:"separator",className:P(nv({orientation:i}),e),...a}));Ws.displayName="Separator";var mu=(0,n.forwardRef)(({className:e,...i},a)=>(0,r.jsx)("div",{ref:a,className:P("animate-pulse bg-surface-hover rounded-md h-4 w-full",e),...i}));mu.displayName="Skeleton";var gu=qr("h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary transition-colors",{variants:{state:{default:"border-border",error:"border-danger"}},defaultVariants:{state:"default"}}),Pa=(0,n.forwardRef)(({className:e,state:i,leftSlot:a,rightSlot:o,...l},d)=>a||o?(0,r.jsxs)("div",{className:"relative flex items-center w-full",children:[a&&(0,r.jsx)("div",{className:"absolute left-2.5 flex items-center pointer-events-none",children:a}),(0,r.jsx)("input",{ref:d,className:P(gu({state:i}),a?"pl-7":"",o?"pr-7":"",e),...l}),o&&(0,r.jsx)("div",{className:"absolute right-2.5 flex items-center pointer-events-none",children:o})]}):(0,r.jsx)("input",{ref:d,className:P(gu({state:i}),e),...l}));Pa.displayName="Input";var Zi=(0,n.forwardRef)(({className:e,options:i,...a},o)=>(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)("select",{ref:o,className:P("h-7 w-full px-2.5 text-xs bg-surface border border-border rounded-md text-foreground appearance-none pr-7 focus:outline-none focus:ring-1 focus:ring-primary",e),...a,children:i.map(l=>(0,r.jsx)("option",{value:l.value,children:l.label},l.value))}),(0,r.jsx)("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted",children:(0,r.jsx)(Wr,{className:"h-3.5 w-3.5"})})]}));Zi.displayName="Select";var pu=(0,n.forwardRef)(({className:e,...i},a)=>(0,r.jsx)("input",{ref:a,type:"checkbox",className:P("w-3.5 h-3.5 rounded-sm border border-border accent-primary",e),...i}));pu.displayName="Checkbox";var hu=(0,n.forwardRef)(({className:e,checked:i,onCheckedChange:a,label:o,...l},d)=>(0,r.jsxs)("button",{ref:d,role:"switch","aria-checked":i,type:"button",onClick:()=>a(!i),className:P("inline-flex items-center gap-2",e),...l,children:[(0,r.jsx)("span",{className:P("w-8 h-4 rounded-full transition-colors",i?"bg-primary":"bg-surface-hover"),children:(0,r.jsx)("span",{className:P("block w-3.5 h-3.5 rounded-full bg-white transition-transform",i?"translate-x-4":"translate-x-0.5")})}),o&&(0,r.jsx)("span",{className:"text-xs text-foreground",children:o})]}));hu.displayName="Switch";var vu=(0,n.createContext)(null);function bu(){const e=(0,n.useContext)(vu);if(!e)throw new Error("Dialog compound components must be used within <Dialog>");return e}function yu({children:e,open:i,onOpenChange:a}){const[o,l]=(0,n.useState)(!1),d=i??o,f=(0,n.useId)(),h=(0,n.useCallback)(g=>{a?.(g),i===void 0&&l(g)},[i,a]);return(0,r.jsx)(vu.Provider,{value:{open:d,setOpen:h,contentId:f},children:e})}function iv({children:e,...i}){const{setOpen:a}=bu();return(0,r.jsx)("button",{type:"button",onClick:()=>a(!0),...i,children:e})}var av=qr("bg-background-elevated border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm max-w-[calc(100vw-2rem)] max-h-[calc(100dvh-2rem)] overflow-y-auto",{variants:{width:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}},defaultVariants:{width:"md"}}),qs=(0,n.forwardRef)(({className:e,width:i,children:a,...o},l)=>{const{open:d,setOpen:f,contentId:h}=bu(),g=(0,n.useRef)(null),v=l??g;(0,n.useEffect)(()=>{const w=v.current;w&&(d&&!w.open&&w.showModal(),!d&&w.open&&w.close())},[d,v]);const b=w=>{w.target===w.currentTarget&&f(!1)};return(0,r.jsx)("dialog",{ref:v,id:h,className:P(av({width:i}),"w-full",e),onClick:b,onClose:()=>f(!1),...o,children:a})});qs.displayName="DialogContent";function xu({className:e,...i}){return(0,r.jsx)("div",{className:P("flex flex-col gap-1 mb-3",e),...i})}function _u({className:e,...i}){return(0,r.jsx)("div",{className:P("flex justify-end gap-2 mt-4",e),...i})}function wu({className:e,...i}){return(0,r.jsx)("h2",{className:P("text-sm font-semibold text-foreground",e),...i})}function Su({className:e,...i}){return(0,r.jsx)("p",{className:P("text-xs text-foreground-muted",e),...i})}var ju=(0,n.createContext)(null);function Hs(){const e=(0,n.useContext)(ju);if(!e)throw new Error("Dropdown compound components must be used within <Dropdown>");return e}function ov({children:e}){const[i,a]=(0,n.useState)(!1),o=(0,n.useId)(),l=(0,n.useId)(),d=(0,n.useRef)(null);return(0,r.jsx)(ju.Provider,{value:{open:i,setOpen:a,triggerId:o,contentId:l,triggerRef:d},children:(0,r.jsx)("div",{className:"relative inline-block",children:e})})}function sv({children:e,...i}){const{open:a,setOpen:o,triggerId:l,contentId:d,triggerRef:f}=Hs();return(0,r.jsx)("button",{type:"button",ref:f,id:l,"aria-haspopup":"menu","aria-expanded":a,"aria-controls":a?d:void 0,onClick:()=>o(!a),...i,children:e})}function lv({className:e,children:i,align:a="start",offset:o=4,...l}){const{open:d,setOpen:f,contentId:h,triggerId:g,triggerRef:v}=Hs(),b=(0,n.useRef)(null),[w,k]=(0,n.useState)(null);return(0,n.useLayoutEffect)(()=>{if(!d){k(null);return}const O=()=>{const E=v.current;if(!E)return;const A=E.getBoundingClientRect(),R=a==="end"?A.right:A.left;k({top:A.bottom+o,left:R,minWidth:A.width})};return O(),window.addEventListener("resize",O),window.addEventListener("scroll",O,!0),()=>{window.removeEventListener("resize",O),window.removeEventListener("scroll",O,!0)}},[d,a,o,v]),(0,n.useEffect)(()=>{if(!d)return;const O=A=>{const R=b.current,Z=v.current;R&&!R.contains(A.target)&&!Z?.contains(A.target)&&f(!1)},E=A=>{A.key==="Escape"&&f(!1)};return document.addEventListener("mousedown",O),document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",O),document.removeEventListener("keydown",E)}},[d,f,v]),!d||!w||typeof document>"u"?null:(0,x.createPortal)((0,r.jsx)("div",{ref:b,id:h,role:"menu","aria-labelledby":g,style:{position:"fixed",top:w.top,...a==="end"?{right:window.innerWidth-w.left}:{left:w.left},minWidth:w.minWidth},className:P("z-50 bg-background-elevated border border-border rounded-md shadow-lg py-1 min-w-[160px]",e),...l,children:i}),document.body)}function cv({className:e,icon:i,variant:a="default",children:o,onClick:l,...d}){const{setOpen:f}=Hs(),h=(0,n.useCallback)(g=>{l?.(g),f(!1)},[l,f]);return(0,r.jsxs)("button",{type:"button",role:"menuitem",className:P("h-7 text-xs px-2 w-full text-left flex items-center gap-2",a==="danger"?"text-danger hover:bg-danger/10":"text-foreground hover:bg-surface-hover",e),onClick:h,...d,children:[i&&(0,r.jsx)(i,{size:14}),o]})}var $u=(0,n.createContext)(null);function ku(){const e=(0,n.useContext)($u);if(!e)throw new Error("Tooltip compound components must be used within <Tooltip>");return e}function uv({children:e}){const[i,a]=(0,n.useState)(!1),o=(0,n.useRef)(null),l=(0,n.useId)(),d=()=>{o.current=setTimeout(()=>a(!0),300)},f=()=>{o.current&&clearTimeout(o.current),a(!1)};return(0,r.jsx)($u.Provider,{value:{open:i,show:d,hide:f,tooltipId:l},children:(0,r.jsx)("div",{className:"relative inline-block",children:e})})}function dv({children:e,...i}){const{show:a,hide:o,tooltipId:l,open:d}=ku();return(0,r.jsx)("div",{onMouseEnter:a,onMouseLeave:o,onFocus:a,onBlur:o,"aria-describedby":d?l:void 0,...i,children:e})}function fv({className:e,children:i,...a}){const{open:o,tooltipId:l}=ku();return(0,r.jsx)("div",{id:l,role:"tooltip",className:P("absolute bottom-full left-1/2 -translate-x-1/2 mb-2 bg-foreground text-background text-xs px-2 py-1 rounded-md shadow-md whitespace-nowrap pointer-events-none transition-opacity duration-150",o?"opacity-100":"opacity-0",e),...a,children:i})}var Pu="(max-width: 767px)",Nu="(min-width: 768px) and (max-width: 1023px)";function Cu(e){return i=>{const a=window.matchMedia(e);return a.addEventListener("change",i),()=>a.removeEventListener("change",i)}}function Ou(e){return()=>window.matchMedia(e).matches}function Iu(){return!1}function Li(){return(0,n.useSyncExternalStore)(Cu(Pu),Ou(Pu),Iu)}function mv(){return(0,n.useSyncExternalStore)(Cu(Nu),Ou(Nu),Iu)}function Js({open:e,onClose:i,title:a,children:o,className:l}){return(0,n.useEffect)(()=>{if(!e)return;const d=f=>{f.key==="Escape"&&i()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[e,i]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:P("fixed inset-0 z-40 bg-black/50 transition-opacity duration-200",e?"opacity-100":"pointer-events-none opacity-0"),onClick:i,"aria-hidden":"true"}),(0,r.jsxs)("div",{role:"dialog","aria-modal":"true",className:P("fixed inset-x-0 bottom-0 z-50 flex flex-col bg-background-elevated border-t border-border rounded-t-xl shadow-2xl transition-transform duration-200 ease-out","max-h-[80dvh]",e?"translate-y-0":"translate-y-full",l),children:[(0,r.jsx)("div",{className:"flex justify-center pt-2 pb-1",children:(0,r.jsx)("div",{className:"h-1 w-8 rounded-full bg-foreground-subtle/30"})}),a&&(0,r.jsxs)("div",{className:"flex items-center justify-between px-4 pb-2",children:[(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:a}),(0,r.jsx)("button",{onClick:i,className:"p-1 rounded-md hover:bg-surface-hover text-foreground-muted transition-colors",children:(0,r.jsx)(It,{className:"h-4 w-4"})})]}),(0,r.jsx)("div",{className:"flex-1 overflow-y-auto px-4 pb-4",children:o})]})]})}var Eu=(0,n.createContext)(null);function Mu(){const e=(0,n.useContext)(Eu);if(!e)throw new Error("Popover compound components must be used within <Popover>");return e}function Du({children:e,open:i,onOpenChange:a}){const[o,l]=(0,n.useState)(!1),d=i??o,f=(0,n.useId)(),h=(0,n.useId)(),g=(0,n.useCallback)(v=>{a?.(v),i===void 0&&l(v)},[i,a]);return(0,r.jsx)(Eu.Provider,{value:{open:d,setOpen:g,triggerId:f,contentId:h},children:(0,r.jsx)("div",{className:"relative inline-block",children:e})})}function Au({children:e,...i}){const{open:a,setOpen:o,triggerId:l,contentId:d}=Mu();return(0,r.jsx)("button",{type:"button",id:l,"aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?d:void 0,onClick:()=>o(!a),...i,children:e})}function zu({className:e,children:i,...a}){const{open:o,setOpen:l,contentId:d,triggerId:f}=Mu(),h=Li(),g=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!o||h)return;const v=w=>{const k=g.current,O=document.getElementById(f);k&&!k.contains(w.target)&&!O?.contains(w.target)&&l(!1)},b=w=>{w.key==="Escape"&&l(!1)};return document.addEventListener("mousedown",v),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",v),document.removeEventListener("keydown",b)}},[o,l,f,h]),o?h?(0,r.jsx)(Js,{open:o,onClose:()=>l(!1),children:i}):(0,r.jsx)("div",{ref:g,id:d,role:"dialog","aria-labelledby":f,className:P("absolute left-0 top-full z-50 mt-1 bg-background-elevated border border-border rounded-lg shadow-lg p-3",e),...a,children:i}):null}var Tu=(0,n.createContext)(null);function Ru(){const e=(0,n.useContext)(Tu);if(!e)throw new Error("Tabs compound components must be used within <Tabs>");return e}function gv({value:e,onValueChange:i,defaultValue:a="",className:o,...l}){const[d,f]=(0,n.useState)(a),h=e??d,g=(0,n.useCallback)(v=>{i?.(v),e===void 0&&f(v)},[e,i]);return(0,r.jsx)(Tu.Provider,{value:{value:h,setValue:g},children:(0,r.jsx)("div",{className:o,...l})})}function pv({className:e,...i}){return(0,r.jsx)("div",{role:"tablist",className:P("flex flex-row border-b border-border-subtle",e),...i})}function hv({value:e,className:i,...a}){const{value:o,setValue:l}=Ru(),d=e===o;return(0,r.jsx)("button",{type:"button",role:"tab","aria-selected":d,"aria-controls":`tabpanel-${e}`,tabIndex:d?0:-1,className:P("h-7 text-xs px-3 transition-colors",d?"border-b-2 border-primary text-foreground font-medium":"text-foreground-muted hover:text-foreground",i),onClick:()=>l(e),...a})}function vv({value:e,className:i,...a}){const{value:o}=Ru();return e!==o?null:(0,r.jsx)("div",{role:"tabpanel",id:`tabpanel-${e}`,className:P("pt-3",i),...a})}var Ks=(0,n.forwardRef)(({className:e,...i},a)=>(0,r.jsx)("div",{ref:a,className:P("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",e),...i}));Ks.displayName="ScrollArea";function bv({title:e,onClose:i,children:a,defaultWidth:o=360,defaultHeight:l=280,minWidth:d=280,minHeight:f=160,offsetIndex:h=0,className:g}){const[v,b]=(0,n.useState)({x:80+h*30,y:80+h*30}),[w,k]=(0,n.useState)({w:o,h:l}),[O,E]=(0,n.useState)(!1),A=(0,n.useRef)(!1),R=(0,n.useRef)(!1),Z=(0,n.useRef)({x:0,y:0}),V=Li(),G=(0,n.useCallback)(J=>{J.preventDefault(),A.current=!0,Z.current={x:J.clientX-v.x,y:J.clientY-v.y}},[v]),H=(0,n.useCallback)(J=>{J.preventDefault(),J.stopPropagation(),R.current=!0,Z.current={x:J.clientX,y:J.clientY}},[]);return(0,n.useEffect)(()=>{const J=me=>{if(A.current&&b({x:me.clientX-Z.current.x,y:me.clientY-Z.current.y}),R.current){const ae=me.clientX-Z.current.x,Ae=me.clientY-Z.current.y;Z.current={x:me.clientX,y:me.clientY},k(De=>({w:Math.max(d,De.w+ae),h:Math.max(f,De.h+Ae)}))}},X=()=>{A.current=!1,R.current=!1};return window.addEventListener("mousemove",J),window.addEventListener("mouseup",X),()=>{window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",X)}},[d,f]),V?(0,r.jsxs)("div",{className:P("fixed inset-x-0 bottom-0 z-50 rounded-t-xl border-t border-border bg-background-elevated shadow-2xl flex flex-col overflow-hidden",g),style:{maxHeight:"60dvh"},children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border shrink-0 bg-surface",children:[(0,r.jsx)("span",{className:"text-[11px] font-medium truncate",children:e}),(0,r.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,r.jsx)("button",{onClick:()=>E(!O),className:"p-0.5 rounded hover:bg-surface-hover text-foreground-muted transition-colors",children:O?(0,r.jsx)(Jc,{size:12}):(0,r.jsx)(Xc,{size:12})}),(0,r.jsx)("button",{onClick:i,className:"p-0.5 rounded hover:bg-danger/20 text-foreground-muted hover:text-danger transition-colors",children:(0,r.jsx)(It,{size:12})})]})]}),!O&&(0,r.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:a})]}):(0,r.jsxs)("div",{className:P("fixed z-50 rounded-lg border border-border bg-background-elevated shadow-2xl flex flex-col overflow-hidden",g),style:{left:v.x,top:v.y,width:O?280:w.w,height:O?"auto":w.h},children:[(0,r.jsxs)("div",{onMouseDown:G,className:"flex items-center justify-between gap-2 px-3 py-2 border-b border-border cursor-move select-none shrink-0 bg-surface",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(_h,{size:12,className:"text-foreground-subtle shrink-0"}),(0,r.jsx)("span",{className:"text-[11px] font-medium truncate",children:e})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,r.jsx)("button",{onClick:()=>E(!O),className:"p-0.5 rounded hover:bg-surface-hover text-foreground-muted transition-colors",title:O?"Restore":"Minimize",children:O?(0,r.jsx)(Jc,{size:12}):(0,r.jsx)(Xc,{size:12})}),(0,r.jsx)("button",{onClick:i,className:"p-0.5 rounded hover:bg-danger/20 text-foreground-muted hover:text-danger transition-colors",title:"Close",children:(0,r.jsx)(It,{size:12})})]})]}),!O&&(0,r.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto relative",children:[a,(0,r.jsx)("div",{onMouseDown:H,className:"absolute bottom-0 right-0 w-4 h-4 cursor-nwse-resize",style:{background:"linear-gradient(135deg, transparent 50%, var(--color-foreground-subtle) 50%)",opacity:.4}})]})]})}function Zu({open:e,onClose:i,children:a,className:o,width:l="w-64"}){const d=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!e)return;const f=h=>{h.key==="Escape"&&i()};return document.addEventListener("keydown",f),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",f),document.body.style.overflow=""}},[e,i]),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:P("fixed inset-0 z-40 bg-black/50 backdrop-blur-sm transition-opacity duration-200",e?"opacity-100":"pointer-events-none opacity-0"),onClick:i,"aria-hidden":"true"}),(0,r.jsx)("div",{ref:d,role:"dialog","aria-modal":"true",className:P("fixed inset-y-0 left-0 z-50 flex flex-col bg-surface border-r border-border shadow-2xl transition-transform duration-200 ease-out",l,e?"translate-x-0":"-translate-x-full",o),children:a})]})}function yv({items:e,className:i}){return(0,r.jsx)("nav",{className:`flex items-center gap-1 text-[11px] text-foreground-subtle ${i??""}`,children:e.map((a,o)=>{const l=o===e.length-1,d=!l&&(a.onClick||a.href);return(0,r.jsxs)(n.default.Fragment,{children:[o>0&&(0,r.jsx)(Dr,{className:"h-3 w-3 flex-shrink-0"}),d?a.onClick?(0,r.jsx)("button",{type:"button",onClick:a.onClick,className:"hover:text-foreground transition-colors",children:a.label}):(0,r.jsx)("a",{href:a.href,className:"hover:text-foreground transition-colors",children:a.label}):(0,r.jsx)("span",{className:l?"text-foreground font-medium":"",children:a.label})]},o)})})}var Lu={left:"text-left",right:"text-right",center:"text-center"};function Uu({columns:e,rows:i,rowKey:a,onRowClick:o,minWidthPx:l=480,emptyMessage:d,className:f,bordered:h=!0,rowClassName:g}){return i.length===0&&d?(0,r.jsx)("div",{className:`rounded-lg ${h?"border border-border":""} bg-surface px-3 py-4 text-xs text-foreground-subtle text-center ${f??""}`,children:d}):i.length===0?null:(0,r.jsx)("div",{className:`rounded-lg ${h?"border border-border":""} bg-surface overflow-x-auto ${f??""}`,children:(0,r.jsxs)("table",{className:"w-full text-xs",style:{minWidth:`${l}px`},children:[(0,r.jsx)("thead",{className:"bg-surface",children:(0,r.jsx)("tr",{children:e.map(v=>{const b=v.align??"left",w=v.nowrap??!0;return(0,r.jsx)("th",{className:["px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",Lu[b],w?"whitespace-nowrap":"",v.width??""].filter(Boolean).join(" "),children:v.headerRender?v.headerRender():v.header},v.key)})})}),(0,r.jsx)("tbody",{children:i.map((v,b)=>{const w=a?a(v,b):b,k=g?.(v,b)??"",O=o!==void 0;return(0,r.jsx)("tr",{onClick:O?()=>o(v,b):void 0,className:[O?"cursor-pointer hover:bg-primary/5":"hover:bg-primary/5",k].filter(Boolean).join(" "),children:e.map(E=>{const A=E.align??"left",R=E.nowrap??!1;return(0,r.jsx)("td",{className:["px-3 py-2 text-foreground border-b border-border",Lu[A],R?"whitespace-nowrap":""].filter(Boolean).join(" "),children:E.render(v,b)},E.key)})},w)})})]})})}function xv({open:e,onClose:i,title:a,subtitle:o,footer:l,children:d,widthClass:f="w-[360px]"}){return(0,n.useEffect)(()=>{if(!e)return;const h=g=>{g.key==="Escape"&&i()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[e,i]),e?(0,r.jsxs)("aside",{className:P("absolute top-0 right-0 bottom-0 z-20 flex flex-col","bg-surface border-l border-border shadow-xl",f),role:"dialog","aria-modal":"false",children:[(0,r.jsxs)("header",{className:"flex items-start justify-between gap-2 px-4 py-3 border-b border-border",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"text-sm font-semibold text-foreground truncate",children:a}),o!==void 0&&(0,r.jsx)("div",{className:"text-[11px] text-foreground-subtle mt-0.5 truncate",children:o})]}),(0,r.jsx)("button",{type:"button",onClick:i,className:"p-1 rounded hover:bg-muted text-foreground-subtle hover:text-foreground","aria-label":"Close panel",children:(0,r.jsx)(It,{className:"w-4 h-4"})})]}),(0,r.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto px-4 py-3",children:d}),l!==void 0&&(0,r.jsx)("footer",{className:"flex items-center gap-2 justify-end px-4 py-3 border-t border-border",children:l})]}):null}var _v={inherit:"bg-muted",on:"bg-emerald-500",off:"bg-orange-500",na:"bg-gray-300 opacity-50"};function Bu({node:e,depth:i,selectedAddonId:a,onSelect:o,agentDots:l}){const d=e.addonId===a,f=l?.[e.addonId]??[];return(0,r.jsxs)("div",{children:[(0,r.jsxs)("button",{type:"button",onClick:()=>o(e.addonId),className:P("w-full flex items-center justify-between gap-2 text-left px-3 py-1.5 text-xs","border-l-2",d?"bg-accent border-primary text-foreground font-medium":"border-transparent hover:bg-muted/40 text-foreground"),style:{paddingLeft:`${12+i*14}px`},children:[(0,r.jsx)("span",{className:"truncate",children:e.addonName}),f.length>0&&(0,r.jsx)("span",{className:"flex items-center gap-1 shrink-0",children:f.map(h=>(0,r.jsx)("span",{title:`${h.agentNodeId}: ${h.state}`,className:P("w-2 h-2 rounded-full",_v[h.state])},h.agentNodeId))})]}),e.children.map(h=>(0,r.jsx)(Bu,{node:h,depth:i+1,selectedAddonId:a,onSelect:o,agentDots:l},h.addonId))]})}function wv({tree:e,selectedAddonId:i,onSelect:a,agentDots:o,className:l}){return(0,r.jsx)("div",{className:P("flex flex-col py-2",l),children:e.map(d=>(0,r.jsx)(Bu,{node:d,depth:0,selectedAddonId:i,onSelect:a,agentDots:o},d.addonId))})}function Sv(e){const i=[],a=[],o=new Map;for(const d of e.slots)for(const f of d.addons){const h={addonId:f.id,addonName:f.name,slot:f.slot,inputClasses:f.inputClasses,outputClasses:f.outputClasses,children:[]};f.slot==="audio-classifier"?i.push(h):(a.push(h),o.set(f.id,h))}const l=[];for(const d of a){if(d.inputClasses.length===0){l.push(d);continue}const f=a.find(h=>h.addonId!==d.addonId&&h.outputClasses.some(g=>d.inputClasses.includes(g)));f&&f.children.push(d)}return[...l,...i]}function jv(e){return e?e.models.map(i=>({id:i.id,name:i.name})):[]}function Na({step:e,schema:i,allSchemas:a,depth:o=0,onChange:l,onDelete:d,readOnly:f=!1,toggleMode:h="simple",overrideState:g=null,onOverrideChange:v,inheritedEnabled:b,hideModelAndSettings:w=!1}){const[k,O]=(0,n.useState)(!1),E=jv(i);if(E.length>0&&!E.some(R=>R.id===e.modelId)&&!f){const R=(i?.defaultModelId?E.find(Z=>Z.id===i.defaultModelId):null)??E[0];R&&R.id!==e.modelId&&queueMicrotask(()=>l({...e,modelId:R.id}))}const A=(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-[10px] uppercase tracking-wider font-medium text-foreground-subtle/60 block leading-none",children:e.slot}),(0,r.jsx)("span",{className:"text-sm font-semibold text-foreground truncate block leading-tight",children:e.addonName}),(0,r.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[e.inputClasses.map(R=>(0,r.jsx)("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/12 text-blue-400",children:R},R)),e.inputClasses.length>0&&e.outputClasses.length>0&&(0,r.jsx)("span",{className:"text-foreground-subtle/40 text-[10px]",children:"→"}),e.outputClasses.map(R=>(0,r.jsx)("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/12 text-green-400",children:R},R))]})]}),!f&&h==="simple"&&(0,r.jsx)("button",{onClick:R=>{R.stopPropagation(),l({...e,enabled:!e.enabled})},className:P("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors",e.enabled?"bg-success":"bg-foreground-subtle/30"),children:(0,r.jsx)("span",{className:P("inline-block h-4 w-4 rounded-full bg-white shadow transition-transform",e.enabled?"translate-x-6":"translate-x-1")})}),!f&&h==="threeState"&&v&&(0,r.jsxs)("div",{className:"flex items-center gap-0.5 rounded-md border border-border p-0.5",onClick:R=>R.stopPropagation(),children:[(0,r.jsx)(Ys,{label:"Inherit",active:g===null,variant:"inherit",subtext:b===void 0?void 0:b?"on":"off",onClick:()=>v(null)}),(0,r.jsx)(Ys,{label:"On",active:g===!0,variant:"on",onClick:()=>v(!0)}),(0,r.jsx)(Ys,{label:"Off",active:g===!1,variant:"off",onClick:()=>v(!1)})]})]});return(0,r.jsx)(fu,{expanded:k,onExpandedChange:O,dimmed:!e.enabled,header:A,children:w?(0,r.jsx)("p",{className:"text-[11px] text-foreground-subtle",children:"Model and detection settings are managed per agent — open the Pipeline page for this camera's agent to edit them."}):(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(Xs,{label:"Model",value:e.modelId,disabled:f,options:E.map(R=>({value:R.id,label:R.name})),onChange:R=>l({...e,modelId:R})}),e.slot==="audio-classifier"&&e.engine&&(0,r.jsx)(Xs,{label:"Runtime",value:`${e.engine.runtime}/${e.engine.backend}`,disabled:f,options:[{value:"node/cpu",label:"Node.js — ONNX CPU"},{value:"node/coreml",label:"Node.js — Apple SoundAnalysis (macOS)"},{value:"python/cpu",label:"Python — ONNX CPU"}],onChange:R=>{const[Z,V]=R.split("/");l({...e,engine:{runtime:Z,backend:V,format:V==="coreml"?"coreml":"onnx"}})}}),i?.configSchema?.map(R=>(0,r.jsx)(Ca,{field:R,allFields:i.configSchema??[],step:e,disabled:f,onChange:l},R.key))]})})}function Xs({label:e,value:i,options:a,disabled:o,onChange:l}){return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:e}),(0,r.jsxs)("select",{value:i,onChange:d=>l(d.target.value),disabled:o,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground focus:outline-none focus:border-primary/50",children:[a.length===0&&(0,r.jsx)("option",{value:i,children:i||"default"}),a.map(d=>(0,r.jsx)("option",{value:d.value,disabled:d.disabled,children:d.label},d.value))]})]})}function $v({label:e,description:i,value:a,options:o,disabled:l,onChange:d}){function f(h){l||d(a.includes(h)?a.filter(g=>g!==h):[...a,h])}return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1",children:e}),i&&(0,r.jsx)("p",{className:"text-[10px] text-foreground-subtle/60 mb-1.5",children:i}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:o.map(h=>(0,r.jsx)("button",{type:"button",disabled:l,onClick:()=>f(h.value),className:P("text-[10px] font-medium px-2 py-1 rounded-md border transition-colors",a.includes(h.value)?"bg-primary/20 text-primary border-primary/40":"bg-surface text-foreground-subtle border-border hover:border-primary/30",l&&"opacity-50 cursor-not-allowed"),children:h.label},h.value))})]})}function kv(e,i,a){const o=i.settings?.[e];if(o!==void 0)return o;const l=a.find(d=>"key"in d&&d.key===e);return l&&"default"in l?l.default:void 0}function Ca({field:e,allFields:i,step:a,disabled:o,onChange:l}){const d=e.type!=="separator"&&e.type!=="info"?e.showWhen:void 0;if(d){const{field:h,equals:g,notEquals:v,in:b,notIn:w}=d,k=kv(h,a,i);if(g!==void 0&&k!==g||v!==void 0&&k===v||b!==void 0&&!b.includes(k)||w!==void 0&&w.includes(k))return null}function f(h){l({...a,settings:{...a.settings,[e.key]:h}})}if(e.type==="select"){const h=a.settings?.[e.key],g=typeof h=="string"?h:e.default??"";return(0,r.jsx)(Xs,{label:e.label,value:g,disabled:o||e.disabled,options:e.options,onChange:f})}if(e.type==="multiselect"){const h=a.settings?.[e.key],g=Array.isArray(h)?h:Array.isArray(e.default)?e.default:[];return(0,r.jsx)($v,{label:e.label,description:e.description,value:g,options:e.options,disabled:o||e.disabled,onChange:f})}if(e.type==="slider"||e.type==="number"){const h=a.settings?.[e.key],g=typeof e.default=="number"?e.default:e.min??0,v=typeof h=="number"?h:g,b=e.min??0,w=e.max??1,k=e.step??.01,O=e.type==="slider"?e.showValue:!0,E="unit"in e?e.unit:void 0,A=e.type==="slider"?e.displayScale:void 0,R=A?v/A:v;return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,r.jsx)("span",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide",children:e.label}),O&&(0,r.jsxs)("span",{className:"text-xs font-medium text-foreground tabular-nums",children:[typeof R=="number"?R.toFixed(2).replace(/\.?0+$/,""):R,E?` ${E}`:""]})]}),e.description&&(0,r.jsx)("p",{className:"text-[10px] text-foreground-subtle/60 mb-1.5",children:e.description}),(0,r.jsx)("input",{type:"range",min:b,max:w,step:k,value:v,disabled:o||e.disabled,onChange:Z=>f(Number(Z.target.value)),className:"w-full accent-primary h-1.5"})]})}if(e.type==="boolean"){const h=a.settings?.[e.key];return(0,r.jsxs)("label",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"checkbox",checked:typeof h=="boolean"?h:e.default===!0,disabled:o||e.disabled,onChange:g=>f(g.target.checked),className:"h-3.5 w-3.5 accent-primary"}),(0,r.jsx)("span",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide",children:e.label})]})}if(e.type==="text"||e.type==="password"||e.type==="textarea"){const h=a.settings?.[e.key],g=typeof h=="string"?h:e.default??"",v=e.type==="password"?"password":"text";return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:e.label}),e.type==="textarea"?(0,r.jsx)("textarea",{value:g,disabled:o||e.disabled,placeholder:e.placeholder,onChange:b=>f(b.target.value),rows:3,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground focus:outline-none focus:border-primary/50 resize-y"}):(0,r.jsx)("input",{type:v,value:g,disabled:o||e.disabled,placeholder:e.placeholder,onChange:b=>f(b.target.value),className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground focus:outline-none focus:border-primary/50"})]})}return e.type==="separator"?(0,r.jsx)("div",{className:"border-t border-border my-2"}):e.type==="info"?(0,r.jsx)("div",{className:"rounded-md border border-border bg-surface px-2 py-1.5 text-[10px] text-foreground-subtle",children:e.content}):null}function Ys({label:e,active:i,variant:a,subtext:o,onClick:l}){return(0,r.jsxs)("button",{type:"button",onClick:l,className:P("px-2 py-1 text-[10px] font-medium rounded transition-colors",i?a==="on"?"bg-green-500/20 text-green-400":a==="off"?"bg-red-500/20 text-red-400":"bg-primary/20 text-primary":"text-foreground-subtle hover:bg-surface-hover"),children:[e,o&&i&&(0,r.jsxs)("span",{className:"ml-1 opacity-60",children:["(",o,")"]})]})}function Fu(e,i){return{addonId:e.id,addonName:e.name,slot:e.slot,inputClasses:[...e.inputClasses],outputClasses:[...e.outputClasses],enabled:i.enabled,modelId:i.modelId,children:[],settings:{...i.settings}}}function Pv(e,i,a){return a?{enabled:a.enabled??i.enabled,modelId:a.modelId??i.modelId,settings:a.settings??i.settings}:i}function Nv({addon:e,agentDefault:i,modelsForFormat:a,onChangeAgentConfig:o}){const l=d=>{o?.({...i,...d})};return(0,r.jsxs)("div",{className:"space-y-4 text-xs",children:[(0,r.jsxs)("label",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"checkbox",checked:i.enabled,onChange:d=>l({enabled:d.target.checked})}),(0,r.jsxs)("span",{children:["Enabled on this agent (",e.name,")"]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle mb-1",children:"Model"}),(0,r.jsx)("select",{className:"w-full bg-surface border border-border rounded px-2 py-1 text-xs",value:i.modelId,onChange:d=>l({modelId:d.target.value}),children:a.map(d=>(0,r.jsx)("option",{value:d.id,children:d.name},d.id))})]}),(e.configSchema?.length??0)>0&&(0,r.jsxs)("div",{className:"pt-2 border-t border-border/50 space-y-3",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle",children:"Settings"}),e.configSchema?.map(d=>(0,r.jsx)(Ca,{field:d,allFields:e.configSchema??[],step:Fu(e,i),disabled:!1,onChange:f=>l({settings:{...f.settings}})},d.key))]})]})}function Cv({addon:e,agentDefault:i,agentNodeId:a,currentPatch:o,modelsForFormat:l,onChangePatch:d}){const f=Pv("device",i,o),h=O=>{const E=O.enabled!==void 0||O.modelId!==void 0||O.settings!==void 0;d?.(E?O:null)},g=O=>{const{enabled:E,...A}=o??{};h(O==="inherit"?A:{...A,enabled:O==="on"})},v=O=>{const{modelId:E,...A}=o??{};h(O===void 0?A:{...A,modelId:O})},b=O=>{const{settings:E,...A}=o??{};h(O===void 0?A:{...A,settings:O})},w=o?.enabled===void 0?"inherit":o.enabled?"on":"off",k=o?.modelId!==void 0;return(0,r.jsxs)("div",{className:"space-y-4 text-xs",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[["inherit","on","off"].map(O=>(0,r.jsx)("button",{type:"button",onClick:()=>g(O),className:P("px-3 py-1 border border-border rounded text-xs capitalize",w===O?"bg-primary text-primary-foreground border-primary":"bg-surface text-foreground hover:bg-muted"),children:O},O)),(0,r.jsxs)("span",{className:"ml-2 text-[10px] text-foreground-subtle",children:["agent default: ",(0,r.jsx)("span",{className:"font-semibold",children:i.enabled?"on":"off"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle",children:"Model"}),k?(0,r.jsx)("button",{type:"button",className:"text-[10px] text-foreground-subtle hover:text-foreground",onClick:()=>v(void 0),children:"Clear"}):(0,r.jsx)("button",{type:"button",className:"text-[10px] text-primary hover:underline",onClick:()=>v(i.modelId),children:"Override"})]}),(0,r.jsx)("select",{disabled:!k,className:"w-full bg-surface border border-border rounded px-2 py-1 text-xs disabled:opacity-50",value:k?o?.modelId??i.modelId:i.modelId,onChange:O=>v(O.target.value),children:l.map(O=>(0,r.jsx)("option",{value:O.id,children:O.name},O.id))}),!k&&(0,r.jsxs)("div",{className:"text-[10px] text-foreground-subtle mt-1",children:["inherits from ",a]})]}),(e.configSchema?.length??0)>0&&(()=>{const O=o?.settings!==void 0;return(0,r.jsxs)("div",{className:"pt-2 border-t border-border/50 space-y-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("div",{className:"text-[10px] uppercase tracking-widest text-foreground-subtle",children:"Settings"}),O?(0,r.jsx)("button",{type:"button",className:"text-[10px] text-foreground-subtle hover:text-foreground",onClick:()=>b(void 0),children:"Clear"}):(0,r.jsx)("button",{type:"button",className:"text-[10px] text-primary hover:underline",onClick:()=>b({...i.settings}),children:"Override"})]}),e.configSchema?.map(E=>(0,r.jsx)(Ca,{field:E,allFields:e.configSchema??[],step:Fu(e,f),disabled:!O,onChange:A=>b({...A.settings})},E.key)),!O&&(0,r.jsxs)("div",{className:"text-[10px] text-foreground-subtle",children:["inherits from ",a]})]})})(),(0,r.jsxs)("div",{className:"rounded bg-muted/40 px-3 py-2 text-[11px] text-foreground-subtle",children:[(0,r.jsx)("div",{className:"font-semibold text-foreground mb-0.5",children:"Effective config preview"}),(0,r.jsxs)("div",{className:"font-mono truncate",children:[e.id," · model: ",f.modelId," · ",f.enabled?"on":"off"]})]})]})}function Ov(e){const{mode:i,addon:a,agentDefault:o,agentNodeId:l,currentPatch:d,onChangeAgentConfig:f,onChangePatch:h,engineFormat:g}=e,v=(0,n.useMemo)(()=>a.models.filter(b=>!!b.formats[g]),[a.models,g]);return i==="agent"?(0,r.jsx)(Nv,{addon:a,agentDefault:o,modelsForFormat:v,onChangeAgentConfig:f}):(0,r.jsx)(Cv,{addon:a,agentDefault:o,agentNodeId:l,currentPatch:d,modelsForFormat:v,onChangePatch:h})}function Iv(e){const i=[],a=(o,l)=>{for(const d of o)i.push({node:d,depth:l}),a(d.children,l+1)};return a(e,0),i}var Gu={detector:{label:"detector",className:"text-emerald-500"},cropper:{label:"cropper",className:"text-blue-500"},classifier:{label:"classifier",className:"text-violet-500"},refiner:{label:"refiner",className:"text-amber-500"},"audio-classifier":{label:"audio classifier",className:"text-pink-500"}};function Ev({slot:e}){const i=Gu[e]??Gu.classifier;return(0,r.jsx)("span",{className:P("text-[9px] font-semibold uppercase tracking-widest leading-none",i.className),children:i.label})}var Vu="inline-flex items-center rounded bg-muted px-1.5 py-px text-[9px] font-medium text-foreground-subtle";function Mv({inputs:e,outputs:i}){return e.length===0&&i.length===0?null:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 flex-wrap",children:[e.map(a=>(0,r.jsx)("span",{className:P(Vu,"bg-blue-500/10 text-blue-500"),children:a},`in-${a}`)),e.length>0&&i.length>0&&(0,r.jsx)("span",{className:"text-foreground-subtle/60 text-[9px]",children:"→"}),i.map(a=>(0,r.jsx)("span",{className:P(Vu,"bg-emerald-500/10 text-emerald-500"),children:a},`out-${a}`))]})}function Dv({enabled:e,onChange:i,disabled:a}){return(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":e,disabled:a,onClick:o=>{o.stopPropagation(),i(!e)},className:P("relative inline-flex h-3.5 w-7 shrink-0 items-center rounded-full transition-colors",e?"bg-emerald-500":"bg-foreground-subtle/30",a?"opacity-50 cursor-not-allowed":"cursor-pointer"),title:e?"Click to disable":"Click to enable",children:(0,r.jsx)("span",{className:P("inline-block h-3 w-3 rounded-full bg-white shadow transition-transform",e?"translate-x-3.5":"translate-x-0.5")})})}function Av(e){return e.kind==="enabled"?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-500 shrink-0"}),(0,r.jsx)("span",{className:"font-mono text-foreground",children:e.modelId})]}):e.kind==="disabled"?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground-subtle",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full border border-foreground-subtle/60 shrink-0"}),"off"]}):(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-foreground-subtle/70",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-muted shrink-0"}),"n/a"]})}function zv({node:e,depth:i,agents:a,getCellState:o,onCellClick:l,selectedCell:d,toggleProps:f}){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sticky left-0 z-10 bg-surface px-3 py-2 border-b border-border text-xs flex items-start gap-2",style:{paddingLeft:`${12+i*14}px`},children:[(0,r.jsxs)("div",{className:"flex flex-col gap-1 min-w-0 flex-1",children:[(0,r.jsx)(Ev,{slot:e.slot}),(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("span",{className:"font-semibold truncate",children:e.addonName}),(0,r.jsx)(Mv,{inputs:e.inputClasses,outputs:e.outputClasses})]})]}),f&&(0,r.jsx)("span",{className:"pl-2 pt-0.5 shrink-0",children:(0,r.jsx)(Dv,{enabled:f.enabled,onChange:f.onChange,disabled:f.disabled})})]}),a.map(h=>{const g=o(e.addonId,h.agentNodeId),v=d?.addonId===e.addonId&&d.agentNodeId===h.agentNodeId;return(0,r.jsx)("button",{type:"button",onClick:()=>l(e.addonId,h.agentNodeId),className:P("text-left px-3 py-1.5 border-b border-l border-border text-xs hover:bg-muted/40",g.kind==="enabled"&&"bg-emerald-500/5",g.kind==="na"&&"bg-muted/30",v&&"ring-2 ring-primary ring-inset"),children:Av(g)},h.agentNodeId)})]})}function Tv({tree:e,agents:i,getCellState:a,onCellClick:o,selectedCell:l,onToggleEnabled:d}){const f=(0,n.useMemo)(()=>Iv(e),[e]),h=`minmax(320px, 1fr) repeat(${i.length}, minmax(160px, 220px))`,g=d!==void 0&&i.length===1,v=i[0]?.agentNodeId;return(0,r.jsx)("div",{className:"overflow-auto border border-border rounded",children:(0,r.jsxs)("div",{className:"grid",style:{gridTemplateColumns:h},children:[(0,r.jsx)("div",{className:"sticky top-0 left-0 z-20 bg-muted/60 px-3 py-2 text-[10px] uppercase tracking-widest text-foreground-subtle border-b border-border",children:"Step"}),i.map(b=>(0,r.jsxs)("div",{className:"sticky top-0 z-10 bg-muted/60 px-3 py-2 border-b border-l border-border",children:[(0,r.jsx)("div",{className:"text-xs font-semibold text-foreground",children:b.agentNodeId}),(0,r.jsx)("div",{className:"text-[10px] text-foreground-subtle truncate",children:b.engineLabel})]},b.agentNodeId)),f.map(({node:b,depth:w})=>{const k=g&&v!==void 0?a(b.addonId,v):null;return(0,r.jsx)(zv,{node:b,depth:w,agents:i,getCellState:a,onCellClick:o,selectedCell:l,toggleProps:g&&k!==null?{enabled:k.kind==="enabled",onChange:O=>d?.(b.addonId,O),disabled:k.kind==="na"}:void 0},b.addonId)})]})})}var Qu=typeof globalThis<"u"?globalThis.__camstackTrpcReact:void 0,j=Qu??(0,ne.createTRPCReact)();typeof globalThis<"u"&&!Qu&&(globalThis.__camstackTrpcReact=j);var el=_r("camstack:system",null);function Wu({system:e,children:i}){return(0,r.jsx)(el.Provider,{value:e,children:i})}function mr(){const e=(0,n.useContext)(el);if(!e)throw new Error("useSystem(): no <SystemProvider> in tree");return e}function Rv(){return(0,n.useContext)(el)}function Ui(e,i){const a=mr(),o=(0,n.useRef)(i);o.current=i;const[l,d]=(0,n.useState)(a.connectionVersion);(0,n.useEffect)(()=>a.subscribeConnectionEvents((f,h)=>{f==="connected"&&d(h)}),[a]),(0,n.useEffect)(()=>a.subscribeEvent(e,f=>{o.current(f)}),[a,e,l])}function tl(e){const i=(0,n.useRef)(e);return i.current=e,i}function rl(e,i){const[a,o]=(0,n.useState)(null),l=tl(i);return Ui(e,d=>{const f=d.data,h=l.current;h&&!h(f)||o(f)}),a}function Zv(e,i,a){const[o,l]=(0,n.useState)(()=>new Map),d=tl(i),f=tl(a);return Ui(e,h=>{const g=h.data,v=f.current;if(v&&!v(g))return;const b=d.current(g);l(w=>{const k=new Map(w);return k.set(b,g),k})}),{map:o,values:(0,n.useMemo)(()=>Array.from(o.values()),[o])}}function Oa(){const{data:e,isLoading:i}=j.nodes.topology.useQuery(void 0,{staleTime:6e4}),a=rl("cluster.topology-snapshot")?.nodes??e;return{nodes:(0,n.useMemo)(()=>{const o=[];for(const l of a??[])o.push({id:String(l.id??""),name:String(l.name??l.id??""),shortName:l.isHub?"HUB":String(l.name??l.id??""),isHub:!!l.isHub,isOnline:!!l.isOnline,localIps:l.localIps??[],addons:(l.addons??[]).map(d=>({addonId:d.id,capabilities:d.capabilities}))});return o.sort((l,d)=>l.isHub!==d.isHub?l.isHub?-1:1:l.name.localeCompare(d.name)),o},[a]),isLoading:i}}function Lv({selectedNodeId:e,onSelect:i,label:a="Node",hideIcon:o=!1,alwaysShow:l=!1}){const{nodes:d}=Oa();return!l&&d.length<=1?null:(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[!o&&(0,r.jsx)(Th,{className:"h-3.5 w-3.5 text-foreground-subtle"}),a&&(0,r.jsx)("span",{className:"text-[10px] uppercase tracking-wider text-foreground-subtle",children:a}),(0,r.jsx)("div",{className:"flex rounded-md border border-border overflow-hidden text-[11px] font-medium",children:d.map((f,h)=>{const g=e===f.id;return(0,r.jsx)("button",{type:"button",onClick:()=>i(f.id),disabled:!f.isOnline,title:f.isOnline?f.name:`${f.name} (offline)`,className:P("px-2.5 py-1 transition-colors",g?"bg-primary/15 text-primary":"bg-transparent text-foreground-subtle hover:bg-surface-hover hover:text-foreground",h>0&&"border-l border-border",!f.isOnline&&"opacity-50 cursor-not-allowed"),children:f.shortName},f.id)})})]})}var Uv={online:{colorClass:"bg-success",label:"Online"},offline:{colorClass:"bg-danger",label:"Offline"},degraded:{colorClass:"bg-warning",label:"Degraded"},unknown:{colorClass:"bg-foreground-subtle",label:"Unknown"}};function Bv({status:e,showDot:i=!0,showLabel:a=!0,size:o="sm",className:l}){const d=Uv[e];return(0,r.jsxs)("span",{className:P("inline-flex items-center gap-1.5",o==="sm"?"text-xs":"text-sm",l),children:[i&&(0,r.jsx)("span",{className:P("h-1.5 w-1.5 shrink-0 rounded-full",d.colorClass),"aria-hidden":"true"}),a&&(0,r.jsx)("span",{className:"text-foreground",children:d.label})]})}var Fv={frigate:{colorClass:"bg-provider-frigate",label:"Frigate"},scrypted:{colorClass:"bg-provider-scrypted",label:"Scrypted"},reolink:{colorClass:"bg-provider-reolink",label:"Reolink"},homeAssistant:{colorClass:"bg-provider-homeAssistant",label:"Home Assistant"},rtsp:{colorClass:"bg-provider-rtsp",label:"RTSP"}};function Gv({provider:e,showLabel:i=!0,className:a}){const o=Fv[e];return(0,r.jsxs)("span",{className:P("inline-flex items-center gap-1.5 text-xs",a),children:[(0,r.jsx)("span",{className:P("h-1.5 w-1.5 shrink-0 rounded-sm",o.colorClass),"aria-hidden":"true"}),i&&(0,r.jsx)("span",{className:"text-foreground",children:o.label})]})}var Vv={success:"bg-emerald-400 text-emerald-950",warning:"bg-amber-400 text-amber-950",danger:"bg-red-400 text-red-950",info:"bg-blue-400 text-blue-950",neutral:"bg-foreground-subtle/20 text-foreground"};function qu({children:e,variant:i="neutral",mono:a,className:o}){return(0,r.jsx)("span",{className:P("inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-bold leading-tight",a&&"font-mono",Vv[i],o),children:e})}function Qv({version:e,preRelease:i,className:a}){return(0,r.jsx)(qu,{variant:i??/-(alpha|beta|rc|dev|canary|next)/i.test(e)?"warning":"success",mono:!0,className:a,children:e})}function Wv({label:e,description:i,error:a,required:o,children:l,orientation:d="vertical",className:f}){const h=d==="horizontal";return(0,r.jsxs)("div",{className:P("flex gap-2",h?"flex-row items-center justify-between":"flex-col",f),children:[(0,r.jsxs)("div",{className:P(h?"flex-1":""),children:[(0,r.jsxs)(Qs,{children:[e,o&&(0,r.jsx)("span",{className:"text-danger ml-0.5",children:"*"})]}),i&&(0,r.jsx)("p",{className:"text-foreground-subtle text-xs mt-0.5",children:i})]}),(0,r.jsx)("div",{className:P(h?"shrink-0":""),children:l}),a&&(0,r.jsx)("p",{className:"text-danger text-xs",children:a})]})}function qv({title:e,subtitle:i,actions:a,className:o}){return(0,r.jsxs)("div",{className:P("flex flex-col gap-2 mb-3 sm:flex-row sm:items-center sm:justify-between",o),children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-sm font-semibold text-foreground",children:e}),i&&(0,r.jsx)("p",{className:"text-foreground-subtle text-xs",children:i})]}),a&&(0,r.jsx)("div",{className:"flex items-center gap-2 flex-wrap",children:a})]})}function Hu({icon:e,title:i,description:a,action:o,className:l}){return(0,r.jsxs)("div",{className:P("flex flex-col items-center justify-center gap-3 py-12",l),children:[e&&(0,r.jsx)(e,{className:"h-12 w-12 text-foreground-subtle","aria-hidden":"true"}),(0,r.jsxs)("div",{className:"flex flex-col items-center gap-1 text-center",children:[(0,r.jsx)("p",{className:"text-foreground-muted text-sm font-medium",children:i}),a&&(0,r.jsx)("p",{className:"text-foreground-subtle text-xs max-w-xs",children:a})]}),o&&(0,r.jsx)("div",{className:"mt-1",children:o})]})}var Hv={danger:{box:"border-danger/40 bg-danger/10",icon:"text-danger",title:"text-danger",message:"text-danger"},warning:{box:"border-amber-500/40 bg-amber-500/10",icon:"text-amber-600 dark:text-amber-400",title:"text-amber-700 dark:text-amber-300",message:"text-amber-700 dark:text-amber-300"}};function Ju({message:e,title:i,onRetry:a,action:o,variant:l="danger",className:d}){const f=Hv[l],h=l==="warning"?vn:gn;return(0,r.jsxs)("div",{role:"alert",className:P("flex items-start gap-2.5 rounded border px-3 py-2.5",f.box,d),children:[(0,r.jsx)(h,{className:P("h-4 w-4 mt-0.5 shrink-0",f.icon),"aria-hidden":"true"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[i&&(0,r.jsx)("p",{className:P("text-xs font-semibold",f.title),children:i}),(0,r.jsx)("div",{className:P("text-xs break-words",f.message,i?"mt-0.5":""),children:e})]}),o??(a&&(0,r.jsxs)("button",{type:"button",onClick:a,className:P("shrink-0 inline-flex items-center gap-1 rounded px-2 py-1 text-[11px] font-medium","border border-current/30 hover:bg-current/10 transition-colors",f.message),children:[(0,r.jsx)(ka,{className:"h-3 w-3","aria-hidden":"true"}),"Retry"]}))]})}var Ku=_r("camstack:confirm-dialog",null);function Bi(){const e=(0,n.useContext)(Ku);if(!e)throw new Error("useConfirm must be used within ConfirmDialogProvider");return e.confirm}function Jv({children:e}){const[i,a]=(0,n.useState)(null),o=(0,n.useCallback)(g=>new Promise(v=>{a({...g,resolve:v})}),[]),l=()=>{i?.resolve(!0),a(null)},d=()=>{i?.resolve(!1),a(null)},f={danger:{icon:"text-red-400",button:"bg-red-500 hover:bg-red-600 text-white"},warning:{icon:"text-orange-400",button:"bg-orange-500 hover:bg-orange-600 text-white"},default:{icon:"text-primary",button:"bg-primary hover:bg-primary/90 text-white"}},h=i?f[i.variant??"default"]:f.default;return(0,r.jsxs)(Ku.Provider,{value:{confirm:o},children:[e,i&&(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[(0,r.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:d}),(0,r.jsxs)("div",{className:"relative z-10 w-full max-w-sm mx-4 rounded-xl border border-border bg-surface shadow-2xl overflow-hidden animate-in fade-in zoom-in-95 duration-150",onClick:g=>g.stopPropagation(),children:[(0,r.jsxs)("div",{className:"px-5 pt-5 pb-4",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:i.title}),(0,r.jsx)("p",{className:"mt-2 text-xs text-foreground-subtle leading-relaxed",children:i.message})]}),(0,r.jsxs)("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border bg-surface-hover/30",children:[(0,r.jsx)("button",{type:"button",onClick:d,className:"px-3 py-1.5 text-xs font-medium rounded-md border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:i.cancelLabel??"Cancel"}),(0,r.jsx)("button",{type:"button",onClick:l,className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${h.button}`,children:i.confirmLabel??"Confirm"})]})]})]})]})}function Kv({value:e,label:i,trend:a,className:o}){return(0,r.jsxs)(Vs,{className:P("flex flex-col gap-1",o),children:[(0,r.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,r.jsx)("span",{className:"text-2xl font-semibold text-foreground",children:e}),a&&(0,r.jsxs)("span",{className:P("inline-flex items-center gap-0.5 text-xs font-medium",a.direction==="up"?"text-success":"text-danger"),children:[a.direction==="up"?(0,r.jsx)(Vh,{className:"h-3 w-3"}):(0,r.jsx)(Qh,{className:"h-3 w-3"}),a.value,"%"]})]}),(0,r.jsx)("span",{className:"text-xs text-foreground-muted",children:i})]})}function Xv({items:e,className:i}){return(0,r.jsx)("dl",{className:P("flex flex-col",i),children:e.map(a=>(0,r.jsxs)("div",{className:"flex items-center h-7",children:[(0,r.jsx)("dt",{className:"text-foreground-subtle text-xs w-1/3 shrink-0",children:a.key}),(0,r.jsx)("dd",{className:"text-foreground text-xs",children:a.value})]},a.key))})}function Yv({children:e,maxHeight:i=300,className:a}){const[o,l]=(0,n.useState)(!1),d=(0,n.useCallback)(()=>{navigator.clipboard.writeText(e).then(()=>{l(!0),setTimeout(()=>l(!1),2e3)})},[e]);return(0,r.jsxs)("div",{className:P("relative group",a),children:[(0,r.jsx)(Ks,{style:{maxHeight:i},children:(0,r.jsx)("pre",{className:"font-mono text-xs bg-surface p-3 rounded-md border border-border-subtle",children:(0,r.jsx)("code",{children:e})})}),(0,r.jsx)("div",{className:"absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:(0,r.jsx)(Gs,{icon:o?Ti:Ar,"aria-label":"Copy code",variant:"ghost",size:"sm",onClick:d})})]})}function eb({filters:e,values:i,onChange:a,className:o}){const l=Li(),[d,f]=(0,n.useState)(!1),h=(v,b)=>{a({...i,[v]:b})},g=Object.values(i).filter(v=>v!==void 0&&v!=="").length;if(l){const v=e.find(w=>w.type==="search"),b=e.some(w=>w.type!=="search");return(0,r.jsxs)("div",{className:P("flex items-center gap-2",o),children:[v&&(0,r.jsx)(Pa,{placeholder:v.placeholder??"Search...",value:i[v.key]??"",onChange:w=>h(v.key,w.target.value),leftSlot:(0,r.jsx)(Ri,{className:"h-3 w-3 text-foreground-subtle"}),className:"flex-1"}),b&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("button",{onClick:()=>f(!0),className:"flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1.5 text-xs text-foreground-muted hover:bg-surface-hover transition-colors shrink-0",children:[(0,r.jsx)(Lh,{className:"h-3.5 w-3.5"}),"Filters",g>0&&(0,r.jsx)(zr,{variant:"info",className:"ml-1 text-[10px] px-1 py-0",children:g})]}),(0,r.jsx)(Js,{open:d,onClose:()=>f(!1),title:"Filters",children:(0,r.jsx)("div",{className:"flex flex-col gap-3",children:e.filter(w=>w.type!=="search").map(w=>{switch(w.type){case"select":return(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"text-xs text-foreground-muted mb-1 block",children:w.label}),(0,r.jsx)(Zi,{options:w.options,value:i[w.key]??"",onChange:k=>h(w.key,k.target.value),className:"w-full"})]},w.key);case"badge-toggle":return(0,r.jsx)("div",{className:"flex items-center gap-1 flex-wrap",children:w.options.map(k=>{const O=i[w.key]===k.value;return(0,r.jsx)("button",{type:"button",onClick:()=>h(w.key,O?void 0:k.value),children:(0,r.jsx)(zr,{variant:O?"info":"default",className:"cursor-pointer",children:k.label})},k.value)})},w.key);default:return null}})})})]})]})}return(0,r.jsx)("div",{className:P("flex items-center gap-2 flex-wrap",o),children:e.map(v=>{switch(v.type){case"search":return(0,r.jsx)(Pa,{placeholder:v.placeholder??"Search...",value:i[v.key]??"",onChange:b=>h(v.key,b.target.value),leftSlot:(0,r.jsx)(Ri,{className:"h-3 w-3 text-foreground-subtle"}),className:"w-48"},v.key);case"select":return(0,r.jsx)(Zi,{options:v.options,value:i[v.key]??"",onChange:b=>h(v.key,b.target.value),className:"w-36"},v.key);case"badge-toggle":return(0,r.jsx)("div",{className:"flex items-center gap-1",children:v.options.map(b=>{const w=i[v.key]===b.value;return(0,r.jsx)("button",{type:"button",onClick:()=>h(v.key,w?void 0:b.value),children:(0,r.jsx)(zr,{variant:w?"info":"default",className:"cursor-pointer",children:b.label})},b.value)})},v.key);default:return null}})})}function nl({label:e,icon:i,href:a,badge:o,active:l=!1,className:d}){return(0,r.jsxs)("a",{href:a,className:P("flex items-center gap-2 h-7 px-2 text-[11px] transition-colors",l?"border-l-2 border-primary bg-primary/[0.08] text-foreground rounded-r-md":"text-foreground-subtle hover:bg-surface-hover rounded-md",d),children:[(0,r.jsx)(i,{className:"h-3.5 w-3.5 shrink-0"}),(0,r.jsx)("span",{className:"truncate flex-1",children:e}),o!==void 0&&(0,r.jsx)(zr,{className:"ml-auto text-[10px] px-1.5 py-0",children:o})]})}function il({logo:e,sections:i,footer:a,onNavigate:o,className:l}){return(0,r.jsxs)("nav",{className:P("bg-surface border-r border-border h-full flex flex-col",l),children:[e&&(0,r.jsx)("div",{className:"px-3 py-2 shrink-0",children:e}),(0,r.jsx)("div",{className:"flex-1 overflow-auto px-1 py-1",children:i.map((d,f)=>(0,r.jsxs)("div",{className:P(f>0?"mt-3":""),children:[d.label&&(0,r.jsx)("span",{className:"text-[10px] text-foreground-disabled uppercase tracking-wider px-2 mb-1 block",children:d.label}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",onClick:o,children:d.items.map(h=>(0,r.jsx)(nl,{...h},h.href))})]},f))}),a&&a.length>0&&(0,r.jsxs)("div",{className:"shrink-0 px-1 pb-1",children:[(0,r.jsx)(Ws,{className:"mb-1"}),(0,r.jsx)("div",{className:"flex flex-col gap-0.5",onClick:o,children:a.map(d=>(0,r.jsx)(nl,{...d},d.href))})]})]})}function tb({sidebar:e,header:i,mobileLogo:a,mobileActions:o,children:l,className:d}){const f=Li(),[h,g]=(0,n.useState)(!1);return(0,r.jsxs)("div",{className:P("flex h-screen",d),children:[!f&&(0,r.jsx)(il,{...e,className:P("w-44",e.className)}),f&&(0,r.jsx)(Zu,{open:h,onClose:()=>g(!1),width:"w-64",children:(0,r.jsx)(il,{...e,onNavigate:()=>g(!1),className:"w-full border-r-0"})}),(0,r.jsxs)("div",{className:"flex flex-1 flex-col min-w-0",children:[f&&(0,r.jsxs)("header",{className:"flex items-center h-12 border-b border-border px-3 shrink-0 bg-surface/80 backdrop-blur-sm",children:[(0,r.jsx)("button",{onClick:()=>g(!0),className:"p-1.5 -ml-1.5 rounded-md hover:bg-surface-hover text-foreground-muted transition-colors","aria-label":"Open menu",children:(0,r.jsx)(Ph,{className:"h-5 w-5"})}),a&&(0,r.jsx)("div",{className:"flex-1 flex justify-center",children:a}),o&&(0,r.jsx)("div",{className:"shrink-0",children:o})]}),!f&&i&&(0,r.jsxs)("header",{className:"flex items-center h-10 border-b border-border px-4 shrink-0",children:[i.breadcrumbs&&i.breadcrumbs.length>0&&(0,r.jsx)("nav",{className:"flex items-center gap-1 text-xs flex-1 min-w-0",children:i.breadcrumbs.map((v,b)=>{const w=b===i.breadcrumbs.length-1;return(0,r.jsxs)("span",{className:"flex items-center gap-1",children:[b>0&&(0,r.jsx)(Dr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}),v.href&&!w?(0,r.jsx)("a",{href:v.href,className:"text-foreground-subtle hover:text-foreground transition-colors truncate",children:v.label}):(0,r.jsx)("span",{className:"text-foreground truncate",children:v.label})]},b)})}),i.actions&&(0,r.jsx)("div",{className:"flex items-center gap-2 ml-auto shrink-0",children:i.actions})]}),(0,r.jsx)("main",{className:"flex-1 overflow-auto p-4",children:l})]})]})}var rb={online:"bg-success",offline:"bg-danger",warning:"bg-warning",unknown:"bg-foreground-subtle"};function nb({title:e,subtitle:i,status:a,selected:o,onClick:l,badges:d,actions:f,offlineAction:h,className:g}){const v=a==="offline";return(0,r.jsxs)("div",{onClick:l,className:P("w-full rounded-lg border p-3 text-left transition-colors",l&&"cursor-pointer",o?"border-primary bg-primary/10":"border-border bg-surface hover:bg-surface-hover",v&&!o&&"opacity-50",g),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("span",{className:"text-sm font-medium truncate",children:e}),a&&(0,r.jsx)("span",{className:P("h-2 w-2 rounded-full shrink-0",rb[a])})]}),i&&(0,r.jsx)("div",{className:"text-[11px] text-foreground-muted",children:i}),d&&d.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1 mt-2",children:d.map((b,w)=>{const k=P("rounded px-1.5 py-0.5 text-[10px] flex items-center gap-0.5",o?"bg-primary/20":"bg-surface-hover",b.onClick&&"hover:opacity-80 transition-opacity cursor-pointer");return b.onClick?(0,r.jsxs)("button",{onClick:O=>{O.stopPropagation(),b.onClick()},className:k,children:[b.icon,b.label]},w):(0,r.jsxs)("span",{className:k,children:[b.icon,b.label]},w)})}),!v&&f&&f.length>0&&(0,r.jsx)("div",{className:"flex items-center gap-0.5 mt-2 -mb-1",children:f.map((b,w)=>(0,r.jsx)("button",{onClick:k=>{k.stopPropagation(),b.onClick()},className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",title:b.label,"aria-label":b.label,children:b.icon},w))}),v&&h&&(0,r.jsx)("div",{className:"mt-2",onClick:b=>b.stopPropagation(),children:h})]})}function ib({children:e,minCardWidth:i=220,gap:a=3,className:o}){return(0,r.jsx)("div",{className:P("p-4 overflow-y-auto flex-1 content-start",o),style:{display:"grid",gridTemplateColumns:`repeat(auto-fill, minmax(${i}px, 1fr))`,gap:`${a*4}px`},children:e})}var ab="capability.binding-changed";function Hr(e,i){const[a,o]=(0,n.useState)(null);return(0,n.useEffect)(()=>{if(i===null){o(null);return}let l=!1;const d=async()=>{try{const h=await e.deviceManager.getBindings.query({deviceId:i});l||o(h)}catch{l||o(h=>h)}};d();const f=e.live?.onEvent.subscribe({category:ab},{onData:h=>{const g=h.data?.source;if(!g){d();return}g.type==="device"&&g.id===i&&d()}});return()=>{l=!0,f?.unsubscribe()}},[e,i]),(0,n.useMemo)(()=>a?(0,ie.createDeviceProxy)(e,a):null,[e,a])}function al(e){const i=(0,n.useCallback)(o=>e?e.subscribe(()=>o()):()=>{},[e]),a=(0,n.useCallback)(()=>e?.value,[e]);return(0,n.useSyncExternalStore)(i,a,a)}function Xu(e,i,a){const o=Hr(e,i);return al(o?a(o.state):void 0)}function bn(e){const i=Hr(e.trpc,e.deviceId),a=al(i!==null?e.slice(i):void 0),o=i!==null?e.cap(i):void 0;return{dev:i,cap:o,slice:a,available:(e.requireFeature===void 0||(e.deviceFeatures??[]).includes(e.requireFeature))&&o!==void 0&&a!==void 0}}function ob(e){return e.parentDeviceId===null?"top-level":e.role?"accessory":"adopted"}var sb={minimal:{showIntegrationIcon:!1,showParentBadge:!1,showSnapshot:!1,showBattery:!1,showStableId:!1,showId:!1,showSwitchToggle:!0,showChildrenAccordion:!1},compact:{showIntegrationIcon:!0,showParentBadge:!0,showSnapshot:!0,showBattery:!0,showStableId:!1,showId:!1,showSwitchToggle:!0,showChildrenAccordion:!0},expanded:{showIntegrationIcon:!1,showParentBadge:!0,showSnapshot:!0,showBattery:!0,showStableId:!0,showId:!0,showSwitchToggle:!0,showChildrenAccordion:!0}};function lb(e){const i=sb[e.variant??"compact"];return{showIntegrationIcon:e.showIntegrationIcon??i.showIntegrationIcon,showParentBadge:e.showParentBadge??i.showParentBadge,showSnapshot:e.showSnapshot??i.showSnapshot,showBattery:e.showBattery??i.showBattery,showStableId:e.showStableId??i.showStableId,showId:e.showId??i.showId,showSwitchToggle:e.showSwitchToggle??i.showSwitchToggle,showChildrenAccordion:e.showChildrenAccordion??i.showChildrenAccordion}}var cb={siren:$a,floodlight:Hc,spotlight:au,"pir-sensor":eu,chime:Nh,autotrack:zs,nightvision:Ls,"privacy-mask":Zs,doorbell:Vc},ub={camera:As,hub:Us,nvr:Us,light:Hc,siren:$a,switch:Gh,sensor:eu,thermostat:Fh,button:gh,generic:Fs};function Yu(e){return e.role?cb[e.role]??Fs:ub[e.type.toLowerCase()]??As}var ed={"native-snapshot":wh,"two-way-audio":Kc,"pan-tilt-zoom":zs,"ptz-autotrack":kh,"doorbell-button":Vc,"motion-trigger":Mr,"battery-operated":Fc,rebootable:ru},td={"native-snapshot":"Native snapshot","two-way-audio":"Two-way audio","pan-tilt-zoom":"Pan-Tilt-Zoom","ptz-autotrack":"PTZ autotrack","doorbell-button":"Doorbell button","motion-trigger":"Motion trigger","battery-operated":"Battery operated",rebootable:"Rebootable"},db={"native-snapshot":"snapshot",rebootable:"reboot","pan-tilt-zoom":"ptz","ptz-autotrack":"ptz-autotrack","two-way-audio":"intercom","motion-trigger":"motion-trigger"},rd=new Set(["camera","hub","nvr"]);function nd(e){return!rd.has(e.type.toLowerCase())}function id(e){return e.role?!0:!rd.has(e.type.toLowerCase())}function ad(e){return(e.features??[]).includes("motion-trigger")}function fb(e){if(e.length<=24)return e;const i=e.lastIndexOf(":");if(i>=0&&i<e.length-4)return e.slice(i+1);const a=e.split("-");if(a.length>2){const o=a.slice(-2).join("-");if(o.length>=6)return o}return`…${e.slice(-18)}`}function mb({trpc:e,accessoryChildren:i,adoptedChildren:a,onNavigate:o}){return(0,r.jsxs)("div",{className:"border-t border-border-subtle/50",children:[a.length>0&&(0,r.jsx)(od,{trpc:e,label:"Adopted devices",rows:a,onNavigate:o}),i.length>0&&(0,r.jsx)(od,{trpc:e,label:"Accessories",rows:i,onNavigate:o})]})}function od({trpc:e,label:i,rows:a,onNavigate:o}){return(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"px-3 pt-1.5 pb-1 text-[9px] font-semibold uppercase tracking-wide text-foreground-subtle",children:i}),(0,r.jsx)("ul",{children:a.map(l=>(0,r.jsx)(gb,{trpc:e,child:l,onNavigate:o},l.id))})]})}function gb({trpc:e,child:i,onNavigate:a}){const o=!i.disabled,l=o&&nd(i),d=o&&ad(i);return(0,r.jsx)("li",{children:(0,r.jsxs)("div",{onClick:f=>{f.stopPropagation(),a(i.id)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-left hover:bg-surface-hover transition-colors cursor-pointer",children:[(0,r.jsx)(Yu(i),{className:"h-3 w-3 text-foreground-subtle flex-shrink-0"}),(0,r.jsx)("span",{className:"text-[10.5px] text-foreground flex-1 truncate",children:i.name}),d&&(0,r.jsx)(hb,{trpc:e,deviceId:i.id,features:i.features}),l&&(0,r.jsx)(pb,{trpc:e,deviceId:i.id}),(0,r.jsx)("span",{className:P("h-1.5 w-1.5 rounded-full flex-shrink-0",i.online?"bg-success":"bg-foreground-subtle/40"),title:i.online?"Online":"Offline"})]})})}function pb({trpc:e,deviceId:i}){const{dev:a,cap:o,slice:l,available:d}=bn({trpc:e,deviceId:i,cap:w=>w.switch,slice:w=>w.state.switch}),[f,h]=(0,n.useState)(!1);if(a!==null&&!o)return null;const g=l?.on===!0,v={transform:g?"translateX(14px)":"translateX(2px)"},b=async w=>{if(w.stopPropagation(),!(f||!d||!o)){h(!0);try{await o.setState({on:!g})}finally{h(!1)}}};return(0,r.jsx)("button",{type:"button",onClick:w=>{b(w)},disabled:f||!d,className:P("relative inline-flex h-4 w-7 items-center rounded-full border transition-colors flex-shrink-0",g?"bg-success/30 border-success/50":"bg-surface-hover border-border",f&&"opacity-60",!d&&"opacity-40 cursor-not-allowed"),title:d?g?"Turn off":"Turn on":"Awaiting state…","aria-pressed":g,children:(0,r.jsx)("span",{className:P("absolute h-3 w-3 rounded-full transition-all",g?"bg-success":"bg-foreground-subtle"),style:v})})}function hb({trpc:e,deviceId:i,features:a}){const{dev:o,cap:l,slice:d,available:f}=bn({trpc:e,deviceId:i,cap:w=>w.motionTrigger,slice:w=>w.state.motionTrigger,requireFeature:"motion-trigger",deviceFeatures:a}),[h,g]=(0,n.useState)(!1);if(o!==null&&!l)return null;const v=d?.enabled===!0,b=async w=>{if(w.stopPropagation(),!(h||!f||!l)){g(!0);try{await l.setMotionTrigger({enabled:!v})}finally{g(!1)}}};return(0,r.jsx)("button",{type:"button",onClick:w=>{b(w)},disabled:h||!f,className:P("inline-flex h-4 w-4 items-center justify-center rounded transition-colors flex-shrink-0",v?"text-primary bg-primary/10":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",(h||!f)&&"opacity-50"),title:f?v?"Motion-trigger: on (click to disable)":"Motion-trigger: off (click to enable)":"Awaiting state…","aria-pressed":v,children:(0,r.jsx)(Mr,{className:"h-2.5 w-2.5"})})}function sd({trpc:e,device:i,flags:a}){if(i.disabled)return null;const o=i.type.toLowerCase(),l=a.showSwitchToggle&&nd(i),d=ad(i),f=o==="hub"||o==="nvr",h=(i.features??[]).includes("rebootable"),g=f&&h;return(0,r.jsxs)(r.Fragment,{children:[d&&(0,r.jsx)(bb,{trpc:e,deviceId:i.id,features:i.features}),l&&(0,r.jsx)(vb,{trpc:e,deviceId:i.id}),g&&(0,r.jsx)(xb,{trpc:e,deviceId:i.id})]})}function vb({trpc:e,deviceId:i}){const{dev:a,cap:o,slice:l,available:d}=bn({trpc:e,deviceId:i,cap:w=>w.switch,slice:w=>w.state.switch}),[f,h]=(0,n.useState)(!1);if(a!==null&&!o)return null;const g=l?.on===!0,v={transform:g?"translateX(14px)":"translateX(2px)"},b=async w=>{if(w.stopPropagation(),!(f||!d||!o)){h(!0);try{await o.setState({on:!g})}finally{h(!1)}}};return(0,r.jsx)("button",{type:"button",onClick:w=>{b(w)},disabled:f||!d,className:P("relative inline-flex h-4 w-7 items-center rounded-full border transition-colors flex-shrink-0",g?"bg-success/30 border-success/50":"bg-surface-hover border-border",f&&"opacity-60",!d&&"opacity-40 cursor-not-allowed"),title:d?g?"Turn off":"Turn on":"Awaiting state…","aria-pressed":g,children:(0,r.jsx)("span",{className:P("absolute h-3 w-3 rounded-full transition-all",g?"bg-success":"bg-foreground-subtle"),style:v})})}function bb({trpc:e,deviceId:i,features:a}){const{dev:o,cap:l,slice:d,available:f}=bn({trpc:e,deviceId:i,cap:w=>w.motionTrigger,slice:w=>w.state.motionTrigger,requireFeature:"motion-trigger",deviceFeatures:a}),[h,g]=(0,n.useState)(!1);if(o!==null&&!l)return null;const v=d?.enabled===!0,b=async w=>{if(w.stopPropagation(),!(h||!f||!l)){g(!0);try{await l.setMotionTrigger({enabled:!v})}finally{g(!1)}}};return(0,r.jsx)("button",{type:"button",onClick:w=>{b(w)},disabled:h||!f,className:P("inline-flex h-4 w-4 items-center justify-center rounded transition-colors flex-shrink-0",v?"text-primary bg-primary/10":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover",(h||!f)&&"opacity-50"),title:f?v?"Motion-trigger: on (click to disable)":"Motion-trigger: off (click to enable)":"Awaiting state…","aria-pressed":v,children:(0,r.jsx)(Mr,{className:"h-2.5 w-2.5"})})}var ol=168,yb=4;function xb({trpc:e,deviceId:i}){const{dev:a,cap:o}=bn({trpc:e,deviceId:i,cap:R=>R.reboot,slice:()=>{}}),l=(0,n.useRef)(null),d=(0,n.useRef)(null),[f,h]=(0,n.useState)(null),[g,v]=(0,n.useState)(!1),b=a!==null&&o!==void 0&&o!==null,w=f!==null,k=()=>h(null),O=()=>{const R=l.current;if(!R)return;const Z=R.getBoundingClientRect(),V=Z.right-ol,G=Math.max(8,Math.min(V,window.innerWidth-ol-8));h({top:Z.bottom+yb,left:G})};if((0,n.useEffect)(()=>{if(!w)return;const R=V=>{const G=l.current,H=d.current,J=V.target;J!==null&&(G&&G.contains(J)||H&&H.contains(J)||k())},Z=V=>{V.key==="Escape"&&(V.stopPropagation(),k())};return document.addEventListener("mousedown",R),document.addEventListener("keydown",Z),()=>{document.removeEventListener("mousedown",R),document.removeEventListener("keydown",Z)}},[w]),a!==null&&!o)return null;const E=R=>{R.stopPropagation(),w?k():O()},A=async()=>{if(!(g||!b||!o)){v(!0),k();try{await o.reboot({})}finally{v(!1)}}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{ref:l,type:"button",onClick:E,disabled:g||!b,className:P("inline-flex h-5 w-5 items-center justify-center rounded text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors flex-shrink-0",(g||!b)&&"opacity-50",w&&"bg-surface-hover text-foreground"),title:"More actions","aria-label":"More actions","aria-haspopup":"menu","aria-expanded":w,children:(0,r.jsx)(Qc,{className:"h-3 w-3"})}),f&&(0,x.createPortal)((0,r.jsx)("div",{ref:d,role:"menu",style:{position:"fixed",top:f.top,left:f.left,width:ol},className:"z-[9999] rounded-md border border-border bg-surface shadow-lg shadow-black/30 p-1",onClick:R=>R.stopPropagation(),children:(0,r.jsxs)("button",{type:"button",role:"menuitem",onClick:()=>{A()},disabled:g||!b,className:P("flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[11px] text-foreground","hover:bg-surface-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed"),children:[(0,r.jsx)(ru,{className:"h-3 w-3 shrink-0 text-foreground-subtle"}),(0,r.jsx)("span",{children:"Reboot device"})]})}),document.body)]})}var _b=Object.freeze([]);function wb(e){return e==="native"?"native":"enhanced"}function Sb(e){return e.map(i=>({kind:"marker",feature:i}))}function jb(e,i){const a=new Map,o=i.entries??[];for(const d of o)a.set(d.capName,d);const l=[];for(const d of e){const f=db[d];if(f===void 0){l.push({kind:"marker",feature:d});continue}const h=a.get(f);h&&l.push({kind:wb(h.kind),feature:d,capName:f})}return l}function $b(e,i,a){const[o,l]=(0,n.useState)(null),[d,f]=(0,n.useState)(!1),[h,g]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{if(i===null){l(null),f(!1),g(!1);return}let v=!1;g(!0),f(!1);const b=async()=>{try{const k=await e.deviceManager.getBindings.query({deviceId:i});if(v)return;l(k),g(!1)}catch{if(v)return;f(!0),g(!1)}};b();const w=e.live?.onEvent.subscribe({category:"capability.binding-changed"},{onData:k=>{const O=k.data?.source;if(!O){b();return}O.type==="device"&&O.id===i&&b()}});return()=>{v=!0,w?.unsubscribe()}},[e,i]),a.length===0?{loading:h,resolved:_b}:h||d||!o?{loading:h,resolved:Sb(a)}:{loading:!1,resolved:jb(a,o)}}var kb=[];function ld({trpc:e,device:i,flags:a,accessoryCount:o,adoptedCount:l,showFeatureRow:d=!1}){const f=o+l,h=a.showChildrenAccordion&&f>0,g=i.features??kb,v=d&&g.length>0,{resolved:b}=$b(e,v?i.id:null,g),w=v&&b.length>0;return!h&&!w?null:(0,r.jsxs)("div",{className:"flex items-center gap-1.5 flex-nowrap whitespace-nowrap min-w-0",children:[h&&(0,r.jsx)(Pb,{accessoryCount:o,adoptedCount:l}),w&&(0,r.jsx)(Nb,{resolved:b})]})}function Pb({accessoryCount:e,adoptedCount:i}){const a=e+i;return a===0?null:(0,r.jsxs)("span",{className:"text-[9px] font-medium text-foreground-subtle bg-surface-elevated/60 rounded px-1.5 py-0.5 flex-shrink-0",title:i>0&&e>0?`${String(i)} adopted · ${String(e)} accessor${e===1?"y":"ies"}`:i>0?`${String(i)} adopted`:`${String(e)} accessor${e===1?"y":"ies"}`,children:["+",a]})}var cd=240,ud=200;function Nb({resolved:e}){const i=(0,n.useRef)(null),[a,o]=(0,n.useState)(null),l=()=>{const f=i.current;if(!f)return;const h=f.getBoundingClientRect();o({top:window.innerHeight-h.bottom>=ud?h.bottom+4:h.top-ud-4,left:Math.max(8,Math.min(h.left,window.innerWidth-cd-8))})},d=()=>o(null);return(0,r.jsxs)("span",{ref:i,className:"relative inline-flex items-center gap-1 cursor-help",onMouseEnter:l,onMouseLeave:d,children:[e.map(f=>{const h=ed[f.feature];return h?(0,r.jsx)("span",{className:"inline-flex items-center justify-center h-4 w-4 rounded bg-surface-elevated/60 text-foreground-subtle",title:td[f.feature]??f.feature,children:(0,r.jsx)(h,{className:"h-2.5 w-2.5"})},f.feature):null}),a&&(0,x.createPortal)((0,r.jsx)(Cb,{resolved:e,position:a}),document.body)]})}function Cb({resolved:e,position:i}){return(0,r.jsxs)("div",{style:{position:"fixed",top:i.top,left:i.left,width:cd,pointerEvents:"none"},className:"z-[9999] rounded-md border border-border bg-surface shadow-lg shadow-black/30 p-2",children:[(0,r.jsx)("h5",{className:"text-[9px] font-semibold uppercase tracking-wider text-foreground-subtle mb-1.5",children:"Features"}),(0,r.jsx)("ul",{className:"space-y-0.5",children:e.map(a=>(0,r.jsx)(Ob,{entry:a},a.feature))})]})}function Ob({entry:e}){const i=ed[e.feature],a=td[e.feature]??e.feature;return(0,r.jsxs)("li",{className:"flex items-center justify-between gap-2 text-[10px]",children:[(0,r.jsxs)("span",{className:"flex items-center gap-1.5 text-foreground",children:[i&&(0,r.jsx)(i,{className:"h-3 w-3 text-foreground-subtle"}),(0,r.jsx)("span",{children:a})]}),(0,r.jsx)(Ib,{kind:e.kind})]})}function Ib({kind:e}){return e==="marker"?(0,r.jsx)("span",{className:"text-[8.5px] px-1 rounded text-foreground-subtle",title:"Informational marker (no cap registered)",children:"marker"}):(0,r.jsx)("span",{className:P("text-[8.5px] px-1 rounded",e==="native"?"bg-success/15 text-success":"bg-primary/15 text-primary"),children:e})}function dd({device:e,variant:i,flags:a,parent:o,integrationIcon:l,hasChildren:d,expanded:f,onToggleExpand:h,onNavigateToParent:g}){const v=Yu(e);return(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-1 min-w-0",children:[a.showChildrenAccordion&&d?(0,r.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),h()},className:"flex h-3.5 w-3.5 items-center justify-center text-foreground-subtle hover:text-foreground transition-colors flex-shrink-0","aria-label":f?"Collapse children":"Expand children","aria-expanded":f,children:f?(0,r.jsx)(Wr,{className:"h-3 w-3"}):(0,r.jsx)(Dr,{className:"h-3 w-3"})}):a.showChildrenAccordion?(0,r.jsx)("span",{className:"h-3.5 w-3.5 flex-shrink-0"}):null,(0,r.jsx)(v,{className:P("text-foreground-subtle flex-shrink-0",i==="minimal"?"h-3 w-3":"h-3.5 w-3.5")}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[a.showIntegrationIcon&&l&&(0,r.jsx)("span",{className:"flex-shrink-0",children:l}),(0,r.jsx)("span",{className:P("font-semibold text-foreground truncate",i==="minimal"?"text-[10.5px]":"text-[11px]"),title:e.name,children:e.name})]}),(a.showId||a.showStableId)&&(0,r.jsxs)("div",{className:"mt-0.5 flex items-center gap-1 text-[9px] text-foreground-subtle font-mono truncate",title:a.showStableId?`stableId: ${e.stableId}`:void 0,children:[a.showId&&(0,r.jsxs)("span",{className:"flex-shrink-0 tabular-nums",children:["#",String(e.id)]}),a.showId&&a.showStableId&&(0,r.jsx)("span",{className:"flex-shrink-0 opacity-50",children:"·"}),a.showStableId&&(0,r.jsx)("span",{className:"truncate",children:fb(e.stableId)})]}),a.showParentBadge&&o&&(0,r.jsxs)("button",{type:"button",onClick:b=>{b.stopPropagation(),g(o.id)},className:"mt-0.5 inline-flex max-w-full items-center gap-1 text-[9px] text-foreground-subtle hover:text-primary transition-colors",title:`Open parent: ${o.name} (#${String(o.id)})`,children:[(0,r.jsx)(Us,{className:"h-2.5 w-2.5 shrink-0"}),(0,r.jsxs)("span",{className:"truncate",children:["Under: ",o.name]})]})]})]})}function fd(e,i){return Xu(e,i,a=>a.battery)??null}function md(e,i){const a=Hr(e,i),o=(0,n.useRef)(!1),{data:l,isLoading:d,isFetching:f,refetch:h}=(0,ee.useQuery)({queryKey:["device",i,"snapshot"],queryFn:()=>{if(!a)throw new Error("useDeviceSnapshotImage: device proxy not ready");const b=o.current;return o.current=!1,a.snapshot?.getSnapshot({force:b})??null},enabled:a!==null&&i!==null,staleTime:1e4,gcTime:1440*60*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:!1}),g=l?`data:${l.contentType};base64,${l.base64}`:null;function v(){o.current=!0,h()}return{src:g,loading:d||f,refresh:v}}function Eb(e){return e<=10?sh:e<=30?oh:e>=95?ah:Fc}function Mb(e,i){return i!=="none"?"text-emerald-400":e<=10?"text-rose-400":e<=30?"text-amber-400":"text-foreground-subtle"}function gd({status:e,variant:i="compact",className:a}){if(!e)return null;const o=Eb(e.percentage),l=Mb(e.percentage,e.charging),d=e.charging==="solar"?au:e.charging==="dc"?Oh:null,f=e.sleeping;return(0,r.jsxs)("span",{className:P("inline-flex items-center gap-1 text-[10px] font-medium",l,a),title:`Battery: ${Math.round(e.percentage)}%`+(e.charging!=="none"?` · charging (${e.charging})`:"")+(e.sleeping?" · sleeping":""),children:[(0,r.jsx)(o,{className:"h-3.5 w-3.5"}),(0,r.jsxs)("span",{children:[Math.round(e.percentage),"%"]}),d&&(0,r.jsx)(d,{className:"h-3 w-3"}),f&&(0,r.jsx)(Ls,{className:"h-3 w-3 text-blue-300"}),i==="full"&&e.charging!=="none"&&(0,r.jsx)("span",{className:"text-foreground-subtle",children:e.charging})]})}function pd({trpc:e,device:i,status:a,enabled:o,showStatusPills:l=!1}){const d=md(e,o&&i.online?i.id:null),f=(i.features??[]).includes("battery-operated"),h=l&&f&&!i.disabled,g=fd(e,h?i.id:null);return!o&&!h?null:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 flex-nowrap whitespace-nowrap",children:[h&&g&&(0,r.jsx)(gd,{status:g}),o&&(0,r.jsx)(Db,{deviceName:i.name,snapshotUrl:d.src,status:a})]})}var sl=288,hd=196,ll=8;function Db({deviceName:e,snapshotUrl:i,status:a}){const o=(0,n.useRef)(null),[l,d]=(0,n.useState)(null),f=a==="offline"||a==="disabled",h=()=>{const v=o.current;if(!v)return;const b=v.getBoundingClientRect(),w=b.top,k=window.innerHeight-b.bottom,O=w<hd+ll&&k>w,E=O?b.bottom+ll:b.top-hd-ll,A=b.right-sl;d({top:E,left:Math.max(8,Math.min(A,window.innerWidth-sl-8)),placeBelow:O})},g=()=>d(null);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{ref:o,type:"button",onClick:v=>v.stopPropagation(),onMouseEnter:h,onMouseLeave:g,onFocus:h,onBlur:g,className:"flex h-6 w-6 items-center justify-center rounded text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors flex-shrink-0",title:"Preview","aria-label":"Preview snapshot",children:(0,r.jsx)(pn,{className:"h-3.5 w-3.5"})}),l&&(0,x.createPortal)((0,r.jsxs)("div",{style:{position:"fixed",top:l.top,left:l.left,width:sl,pointerEvents:"none"},className:"rounded-lg border border-border bg-surface shadow-lg shadow-black/30 z-[9999] overflow-hidden",children:[(0,r.jsx)("div",{className:"h-40 bg-background flex items-center justify-center",children:i&&!f?(0,r.jsx)("img",{src:i,alt:e,className:"h-full w-full object-cover"}):(0,r.jsx)("span",{className:"text-xs text-foreground-subtle",children:a==="offline"?"Offline — no snapshot":a==="disabled"?"Disabled":"No snapshot yet"})}),(0,r.jsx)("div",{className:"px-3 py-2",children:(0,r.jsx)("p",{className:"text-xs font-semibold text-foreground truncate",children:e})})]}),document.body)]})}function vd({status:e}){const i=e==="disabled"?"bg-warning":e==="online"?"bg-success":"bg-danger",a=e==="disabled"?"Disabled":e==="online"?"Online":"Offline";return(0,r.jsx)("span",{className:P("h-1.5 w-1.5 rounded-full flex-shrink-0",i),title:a})}function Ia(e){const{trpc:i,device:a,parent:o,integrationIcon:l,onNavigate:d,className:f}=e,h=lb(e),g=e.variant??"compact",v=e.view??"card",b=!a.disabled,w=a.isCamera??a.type.toLowerCase()==="camera",k=e.children??[],O=k.filter(id),E=k.filter(me=>!id(me)),A=k.length>0,[R,Z]=(0,n.useState)(!1),V=e.expanded??R,G=e.onToggleExpand??(()=>Z(me=>!me)),H=me=>{d?.(me)},J=e.indentLevel??(e.isAccessoryRow?2:0),X=b?a.online?"online":"offline":"disabled";return v==="table"?(0,r.jsx)(zb,{trpc:i,device:a,variant:g,flags:h,parent:o??null,integrationIcon:l??null,accessoryCount:O.length,adoptedCount:E.length,hasChildren:A,expanded:V,onToggleExpand:G,onNavigate:H,displayStatus:X,isCamera:w,showSnapshot:h.showSnapshot&&w,isAccessoryRow:e.isAccessoryRow??!1,indentLevel:J,className:f}):(0,r.jsxs)("div",{className:P("rounded-lg border border-border bg-surface transition-colors",!b&&"opacity-60",f),children:[(0,r.jsxs)("div",{onClick:()=>H(a.id),className:P("flex items-center gap-2 cursor-pointer hover:border-foreground-subtle/30 w-full",g==="minimal"?"px-2.5 py-1.5":"px-3 py-2.5"),children:[(0,r.jsx)(dd,{device:a,variant:g,flags:h,parent:o??null,integrationIcon:l??null,hasChildren:A,expanded:V,onToggleExpand:G,onNavigateToParent:H}),(0,r.jsx)(ld,{trpc:i,device:a,flags:h,accessoryCount:O.length,adoptedCount:E.length,showFeatureRow:!1}),(0,r.jsx)(pd,{trpc:i,device:a,status:X,enabled:h.showSnapshot&&w,showStatusPills:!0}),(0,r.jsx)(sd,{trpc:i,device:a,flags:h}),(0,r.jsx)(vd,{status:X})]}),V&&A&&(0,r.jsx)(mb,{trpc:i,accessoryChildren:O,adoptedChildren:E,onNavigate:H})]})}var Ab={0:"pl-2",1:"pl-6",2:"pl-8"};function zb(e){const{trpc:i,device:a,variant:o,flags:l,parent:d,integrationIcon:f,accessoryCount:h,adoptedCount:g,hasChildren:v,expanded:b,onToggleExpand:w,onNavigate:k,displayStatus:O,isCamera:E,showSnapshot:A,isAccessoryRow:R,indentLevel:Z,className:V}=e;return(0,r.jsxs)("tr",{onClick:()=>k(a.id),className:P("cursor-pointer hover:bg-surface-hover transition-colors",!l.showChildrenAccordion&&"border-b border-border-subtle/40",R&&"bg-foreground-subtle/[0.03]",V),children:[(0,r.jsx)("td",{className:P("py-2 align-middle pr-2",Ab[Z]),children:(0,r.jsx)(dd,{device:a,variant:o,flags:l,parent:d,integrationIcon:f,hasChildren:v,expanded:b,onToggleExpand:w,onNavigateToParent:k})}),(0,r.jsx)("td",{className:"px-2 py-2 align-middle text-[10px] text-foreground-subtle whitespace-nowrap",children:a.type}),(0,r.jsx)("td",{className:"px-2 py-2 align-middle",children:(0,r.jsx)(ld,{trpc:i,device:a,flags:l,accessoryCount:h,adoptedCount:g,showFeatureRow:!0})}),(0,r.jsx)("td",{className:"px-2 py-2 align-middle",children:(0,r.jsx)(pd,{trpc:i,device:a,status:O,enabled:A&&E,showStatusPills:!0})}),(0,r.jsx)("td",{className:"px-2 py-2 align-middle text-right whitespace-nowrap",children:(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)(sd,{trpc:i,device:a,flags:l}),(0,r.jsx)(vd,{status:O})]})})]})}function bd(e,i){const[a,o]=(0,n.useState)(e);return(0,n.useEffect)(()=>{const l=setTimeout(()=>o(e),i);return()=>clearTimeout(l)},[e,i]),a}var Tb=new Set(["hub","nvr"]);function Rb(e){const i=new Map;for(const l of e)i.set(l.id,l);const a=[],o=new Map;for(const l of e){const d=l.parentDeviceId;if(d==null){a.push(l);continue}const f=i.get(d);if(!f){a.push(l);continue}const h=l.role!==null&&l.role!==void 0;if(Tb.has(f.type)&&!h){a.push(l);continue}const g=o.get(d);g?g.push(l):o.set(d,[l])}return{topLevel:a,accessoriesByParent:o}}var yd=2;function Zb(e,i){if(i<=1)return[{kind:"page",n:1}];if(i<=7){const d=[];for(let f=1;f<=i;f++)d.push({kind:"page",n:f});return d}const a=[],o=Math.max(2,e-yd),l=Math.min(i-1,e+yd);a.push({kind:"page",n:1}),o>2&&a.push({kind:"ellipsis",side:"left"});for(let d=o;d<=l;d++)a.push({kind:"page",n:d});return l<i-1&&a.push({kind:"ellipsis",side:"right"}),a.push({kind:"page",n:i}),a}function Lb({currentPage:e,totalItems:i,pageSize:a,onPageChange:o,itemNoun:l="devices"}){if(i<=a)return null;const d=Math.ceil(i/a),f=(e-1)*a+1,h=Math.min(e*a,i),g=Zb(e,d);return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4 flex-wrap pt-2 text-[11px] text-foreground-subtle",children:[(0,r.jsxs)("span",{children:["Showing ",f,"–",h," of ",i," ",l]}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,r.jsx)("button",{type:"button","aria-label":"Previous page",disabled:e===1,onClick:()=>o(e-1),className:P("inline-flex items-center justify-center h-7 w-7 rounded border border-border bg-surface text-foreground-subtle","hover:text-foreground hover:bg-surface-hover transition-colors","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-surface"),children:(0,r.jsx)(dh,{className:"h-3 w-3"})}),g.map((v,b)=>v.kind==="ellipsis"?(0,r.jsx)("span",{className:"px-1 text-foreground-subtle/60 select-none",children:"…"},`e-${b}`):(0,r.jsx)("button",{type:"button",onClick:()=>o(v.n),className:P("inline-flex items-center justify-center h-7 min-w-7 px-1.5 rounded border text-[10.5px] font-medium transition-colors",v.n===e?"border-primary/40 bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover"),children:v.n},`p-${v.n}`)),(0,r.jsx)("button",{type:"button","aria-label":"Next page",disabled:e===d,onClick:()=>o(e+1),className:P("inline-flex items-center justify-center h-7 w-7 rounded border border-border bg-surface text-foreground-subtle","hover:text-foreground hover:bg-surface-hover transition-colors","disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-surface"),children:(0,r.jsx)(Dr,{className:"h-3 w-3"})})]})]})}function Ub({view:e,onViewChange:i,types:a,currentType:o,onTypeChange:l,addons:d,currentAddon:f,onAddonChange:h,hideAddons:g=!1}){return(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsxs)("span",{className:"inline-flex border border-border rounded-md overflow-hidden",children:[(0,r.jsx)("button",{type:"button",onClick:()=>i("cards"),className:P("inline-flex items-center justify-center h-7 w-8 transition-colors",e==="cards"?"bg-primary/10 text-primary":"bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover"),"aria-label":"Cards view",children:(0,r.jsx)($h,{className:"h-3.5 w-3.5"})}),(0,r.jsx)("button",{type:"button",onClick:()=>i("table"),className:P("inline-flex items-center justify-center h-7 w-8 border-l border-border transition-colors",e==="table"?"bg-primary/10 text-primary":"bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover"),"aria-label":"Table view",children:(0,r.jsx)(Bh,{className:"h-3.5 w-3.5"})})]}),a&&a.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(xd,{children:"Type"}),(0,r.jsx)(cl,{active:o===null,onClick:()=>l(null),children:"All"}),a.map(v=>(0,r.jsx)(cl,{active:o===v,onClick:()=>l(o===v?null:v),children:Bb(v)},v))]}),!g&&d&&d.length>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(xd,{children:"Integration"}),d.map(v=>(0,r.jsx)(cl,{active:f===v.id,icon:v.icon,onClick:()=>h(f===v.id?null:v.id),showClearIcon:f===v.id,children:v.name},v.id))]})]})}function xd({children:e}){return(0,r.jsx)("span",{className:"text-[10px] font-medium uppercase tracking-wider text-foreground-subtle ml-1",children:e})}function cl({active:e,icon:i,onClick:a,showClearIcon:o,children:l}){return(0,r.jsxs)("button",{type:"button",onClick:a,className:P("inline-flex items-center gap-1.5 h-7 px-2.5 rounded-full border text-[10.5px] font-medium transition-colors",e?"border-primary/40 bg-primary/15 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover"),children:[i&&(0,r.jsx)("span",{className:"inline-flex items-center",children:i}),(0,r.jsx)("span",{children:l}),e&&o&&(0,r.jsx)(It,{className:"h-2.5 w-2.5 opacity-70"})]})}function Bb(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}function Fb({variant:e,onClearFilters:i}){return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)(Sh,{className:"h-8 w-8 text-foreground-subtle/40 mb-3"}),(0,r.jsx)("p",{className:"text-sm font-medium text-foreground-subtle",children:e==="filtered"?"No devices match the current filters":"No devices yet"}),e==="filtered"&&i&&(0,r.jsx)("button",{type:"button",onClick:i,className:"mt-2 text-[11px] text-primary hover:underline",children:"Clear filters"})]})}function gr(e,i){if(e==="root")return i;switch(i){case"view":return"deviceView";case"page":return"devicePage";case"type":return"deviceType";case"q":return"deviceQ";case"addon":return"deviceAddon"}}function _d(e){try{const i=localStorage.getItem(`camstack:${e}:lastFilters`);if(!i)return{};const a=JSON.parse(i);return typeof a!="object"||a===null?{}:a}catch{return{}}}function Gb(e,i){try{localStorage.setItem(`camstack:${e}:lastFilters`,JSON.stringify(i))}catch{}}function wd(e,i,a){const o=new URLSearchParams(window.location.search),l=o.get(gr(e,"view")),d=l==="cards"||l==="table"?l:a.view??i,f=o.get(gr(e,"page")),h=f?parseInt(f,10):1;return{view:d,page:Number.isFinite(h)&&h>=1?h:1,addon:o.get(gr(e,"addon"))??a.addon??null,type:o.get(gr(e,"type"))??a.type??null,q:o.get(gr(e,"q"))??a.q??""}}function Vb(e,i,a){const o=new URLSearchParams(window.location.search),l=(h,g)=>{g===null||g===""?o.delete(h):o.set(h,g)};l(gr(e,"view"),i.view===a?null:i.view),l(gr(e,"page"),i.page===1?null:String(i.page)),l(gr(e,"addon"),i.addon),l(gr(e,"type"),i.type),l(gr(e,"q"),i.q||null);const d=o.toString(),f=d?`${window.location.pathname}?${d}`:window.location.pathname;window.history.replaceState(null,"",f)}function Qb(e){const{scope:i,defaultView:a,lsKey:o}=e,[l,d]=(0,n.useState)(()=>wd(i,a,_d(o))),f=(0,n.useRef)(l);f.current=l,(0,n.useEffect)(()=>{const g=()=>{const v=wd(i,a,_d(o));f.current=v,d(v)};return window.addEventListener("popstate",g),()=>window.removeEventListener("popstate",g)},[i,a,o]);const h=(0,n.useCallback)(g=>{const v=g(f.current);f.current=v,d(v),Vb(i,v,a),Gb(o,{view:v.view,addon:v.addon,type:v.type,q:v.q})},[i,a,o]);return{state:l,setView:(0,n.useCallback)(g=>h(v=>({...v,view:g})),[h]),setPage:(0,n.useCallback)(g=>h(v=>({...v,page:g})),[h]),setAddon:(0,n.useCallback)(g=>h(v=>({...v,addon:g,page:1})),[h]),setType:(0,n.useCallback)(g=>h(v=>({...v,type:g,page:1})),[h]),setQ:(0,n.useCallback)(g=>h(v=>({...v,q:g,page:1})),[h]),clearFilters:(0,n.useCallback)(()=>h(g=>({...g,addon:null,type:null,q:"",page:1})),[h])}}var Wb={cards:24,table:50};function qb(e){const{devices:i,trpc:a,defaultView:o="table",filters:l,forceAddon:d,resolveIntegrationIcon:f,resolveParent:h,onNavigate:g,pageSize:v=Wb,urlScope:b="root",lsKey:w=b==="root"?"devices":"integrations:nested"}=e,k=Qb({scope:b,defaultView:o,lsKey:w}),O=k.state.view,E=O==="cards"?v.cards:v.table,[A,R]=(0,n.useState)(k.state.q),Z=bd(A,300);(0,n.useEffect)(()=>{Z!==k.state.q&&k.setQ(Z)},[Z]);const V=d??k.state.addon,G=(0,n.useMemo)(()=>{const Ve=k.state.q.toLowerCase().trim();return i.filter(We=>!(V&&We.addonId!==V||k.state.type&&We.type!==k.state.type||Ve&&!We.name.toLowerCase().includes(Ve)&&!We.stableId.toLowerCase().includes(Ve)))},[i,V,k.state.type,k.state.q]),H=(0,n.useMemo)(()=>Rb(G),[G]),J=(0,n.useMemo)(()=>{if(k.state.q.trim()==="")return new Set;const Ve=k.state.q.toLowerCase().trim(),We=new Set;for(const[Qe,Le]of H.accessoriesByParent.entries())Le.some(Te=>Te.name.toLowerCase().includes(Ve)||Te.stableId.toLowerCase().includes(Ve))&&We.add(Qe);return We},[H.accessoriesByParent,k.state.q]),X=H.topLevel.length,me=Math.max(1,Math.ceil(X/E)),ae=Math.min(k.state.page,me),Ae=(ae-1)*E,De=H.topLevel.slice(Ae,Ae+E);(0,n.useEffect)(()=>{ae!==k.state.page&&k.setPage(ae)},[ae]),ey();const qe=V!=null||k.state.type!==null||k.state.q!=="",ot=X===0;return(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[(0,r.jsx)(Ub,{view:O,onViewChange:k.setView,types:l?.types,currentType:k.state.type,onTypeChange:k.setType,addons:l?.addons,currentAddon:k.state.addon,onAddonChange:k.setAddon,hideAddons:d!==void 0}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)(Ri,{className:"absolute left-2 top-1/2 -translate-y-1/2 h-3 w-3 text-foreground-subtle pointer-events-none"}),(0,r.jsx)("input",{type:"text",value:A,onChange:Ve=>R(Ve.target.value),placeholder:"Search by name or stableId","aria-label":"Search devices by name or stableId",className:"h-7 pl-7 pr-2.5 rounded-md border border-border bg-surface text-[11px] text-foreground placeholder:text-foreground-subtle/60 focus:outline-none focus:ring-1 focus:ring-primary/40 w-56"})]})]}),ot?(0,r.jsx)(Fb,{variant:qe?"filtered":"nofilter",onClearFilters:qe?k.clearFilters:void 0}):O==="cards"?(0,r.jsx)(Hb,{rows:De,accessoriesByParent:H.accessoriesByParent,trpc:a,resolveIntegrationIcon:f??null,resolveParent:h??null,onNavigate:g??null}):(0,r.jsx)(Xb,{rows:De,accessoriesByParent:H.accessoriesByParent,autoExpandedParents:J,devices:G,trpc:a,resolveIntegrationIcon:f??null,resolveParent:h??null,onNavigate:g??null}),(0,r.jsx)(Lb,{currentPage:ae,totalItems:X,pageSize:E,onPageChange:k.setPage}),d===void 0&&qe&&X>0&&(0,r.jsxs)("p",{className:"text-[11px] text-foreground-subtle",children:["Showing ",X," of ",i.length," devices",V&&(0,r.jsxs)(r.Fragment,{children:[" ","· filtered by"," ",(0,r.jsx)("strong",{className:"text-primary",children:l?.addons?.find(Ve=>Ve.id===V)?.name??V})]})]})]})}function Hb({rows:e,accessoriesByParent:i,trpc:a,resolveIntegrationIcon:o,resolveParent:l,onNavigate:d}){return(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:e.map(f=>{const h=i.get(f.id)??[];return(0,r.jsx)(Ia,{trpc:a,device:f,view:"card",integrationIcon:o?.(f.addonId)??null,parent:f.parentDeviceId!==null?l?.(f.parentDeviceId)??null:null,children:h,onNavigate:d??void 0},f.id)})})}var Jb=new Set(["hub","nvr"]);function Kb(e,i){return e.parentDeviceId===null||i===null?0:Jb.has(i.toLowerCase())?1:0}function Xb({rows:e,accessoriesByParent:i,autoExpandedParents:a,devices:o,trpc:l,resolveIntegrationIcon:d,resolveParent:f,onNavigate:h}){const g=(0,n.useMemo)(()=>{const v=new Map;for(const b of o)v.set(b.id,b.type);return v},[o]);return(0,r.jsx)("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:(0,r.jsxs)("table",{className:"w-full border-collapse",children:[(0,r.jsx)("thead",{children:(0,r.jsxs)("tr",{className:"border-b border-border",children:[(0,r.jsx)("th",{className:"text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle",children:"Name"}),(0,r.jsx)("th",{className:"text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle w-24",children:"Type"}),(0,r.jsx)("th",{className:"text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle w-32",children:"Features"}),(0,r.jsx)("th",{className:"text-left px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle w-20",children:"Preview"}),(0,r.jsx)("th",{className:"text-right px-2 py-2 text-[9.5px] font-medium uppercase tracking-wider text-foreground-subtle w-32",children:"Actions"})]})}),(0,r.jsx)("tbody",{children:e.map(v=>{const b=i.get(v.id)??[],w=b.length>0,k=a.has(v.id),O=v.parentDeviceId!==null?f?.(v.parentDeviceId)??null:null,E=v.parentDeviceId!==null?g.get(v.parentDeviceId)??null:null;return(0,r.jsx)(Yb,{parent:v,accessories:b,hasAccessories:w,forceExpanded:k,trpc:l,integrationIcon:d?.(v.addonId)??null,parentRowParent:O,indentLevel:Kb(v,E),onNavigate:h??null},v.id)})})]})})}function Yb({parent:e,accessories:i,hasAccessories:a,forceExpanded:o,trpc:l,integrationIcon:d,parentRowParent:f,indentLevel:h,onNavigate:g}){const[v,b]=(0,n.useState)(o),w=(0,n.useRef)(o);(0,n.useEffect)(()=>{w.current!==o&&(b(o),w.current=o)},[o]);const k=()=>b(O=>!O);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Ia,{trpc:l,device:e,view:"table",integrationIcon:d,parent:f,children:i,onNavigate:g??void 0,showChildrenAccordion:a,expanded:v,onToggleExpand:k,indentLevel:h}),a&&v&&i.map(O=>(0,r.jsx)(Ia,{trpc:l,device:O,view:"table",integrationIcon:null,parent:null,isAccessoryRow:!0,showChildrenAccordion:!1,onNavigate:g??void 0},O.id))]})}function ey(){(0,ee.useQueryClient)()}function ty({options:e,value:i,onChange:a}){return(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(o=>{const l=o.id===i;return(0,r.jsxs)("button",{onClick:()=>o.available&&a(o.id),disabled:!o.available,className:`flex items-center gap-2 rounded-lg border px-3 py-2 text-xs font-medium transition-all ${l?"border-primary/40 bg-primary/10 text-primary":o.available?"border-border bg-surface text-foreground-subtle hover:bg-surface-hover hover:text-foreground":"border-border/40 bg-surface/40 text-foreground-subtle/40 cursor-not-allowed"}`,children:[(0,r.jsx)(yh,{className:"h-3.5 w-3.5 shrink-0"}),o.label,o.isBest&&(0,r.jsxs)("span",{className:"inline-flex items-center gap-0.5 rounded-full bg-amber-500/15 px-1.5 py-0.5 text-[10px] font-semibold text-amber-400",children:[(0,r.jsx)(Uh,{className:"h-2.5 w-2.5"}),"Best"]}),o.platformScore!=null&&(0,r.jsxs)("span",{className:"text-[10px] text-foreground-subtle/60",children:["(",o.platformScore,")"]}),(0,r.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${o.available?"bg-success":"bg-danger"}`})]},o.id)})})}function ry(e,i){const a=new Set(i.slots.flatMap(f=>f.addons.map(h=>h.id))),o=[];function l(f){if(!a.has(f.addonId))return o.push(`Addon "${f.addonId}" is no longer available — step removed`),null;const h=i.slots.flatMap(b=>b.addons).find(b=>b.id===f.addonId);let g=f.modelId;if(h&&!h.models.some(b=>b.id===g)){const b=h.defaultModelId;o.push(`Model "${g}" not available for ${f.addonId} — using "${b}"`),g=b}const v=f.children.map(b=>l(b)).filter(b=>b!==null);return{...f,modelId:g,children:v}}const d=e.map(f=>l(f)).filter(f=>f!==null);return{valid:o.length===0,steps:d,warnings:o}}function ny(e){const i=new Map;for(const a of e.slots)for(const o of a.addons)i.set(o.id,o);return i}function ul(e){return{addonId:e.id,addonName:e.name,slot:e.slot,inputClasses:[...e.inputClasses],outputClasses:[...e.outputClasses],enabled:!0,modelId:e.defaultModelId,children:[]}}function dl({addon:e,onClick:i}){return(0,r.jsx)("button",{type:"button",onClick:i,className:"w-full rounded-lg border border-dashed border-border/60 px-3 py-2.5 text-left transition-all hover:border-primary/30 hover:bg-surface/60 group",children:(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(hh,{className:"h-[18px] w-[18px] text-foreground-subtle/30 group-hover:text-primary/60 shrink-0"}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"text-[13px] font-medium text-foreground-subtle/50 group-hover:text-foreground-subtle block truncate",children:e.name}),(0,r.jsxs)("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[e.inputClasses.map(a=>(0,r.jsx)("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/8 text-blue-400/50",children:a},a)),e.inputClasses.length>0&&e.outputClasses.length>0&&(0,r.jsx)("span",{className:"text-foreground-subtle/25 text-[10px]",children:"→"}),e.outputClasses.map(a=>(0,r.jsx)("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/8 text-green-400/50",children:a},a))]})]})]})})}function iy({schema:e,steps:i,onChange:a,templates:o,selectedTemplateId:l,onSelectTemplate:d,onSaveTemplate:f,onUpdateTemplate:h,onDeleteTemplate:g,readOnly:v=!1,excludeAddons:b=[],hideTemplates:w=!1,showOnlyEnabled:k=!1,showSlotLabels:O=!1,toggleMode:E="simple",overrides:A={},onOverrideChange:R,inheritedEnabledByAddon:Z={},hideModelAndSettings:V=!1}){const G=Oe=>({toggleMode:E,hideModelAndSettings:V,...E==="threeState"?{overrideState:A[Oe]!==void 0?A[Oe]:null,onOverrideChange:R?$e=>R(Oe,$e):void 0,inheritedEnabled:Z[Oe]}:{}}),H=(0,n.useMemo)(()=>new Set(b),[b]),J=(0,n.useMemo)(()=>ny(e),[e]),[X,me]=(0,n.useState)([]),ae=l?JSON.stringify(i)!==JSON.stringify(o.find(Oe=>Oe.id===l)?.steps):!1;function Ae(Oe){const $e=Oe.target.value||null;if($e){const He=o.find(he=>he.id===$e);He&&me([...ry(He.steps,e).warnings])}else me([]);d($e)}function De(){l&&h(l,i)}function qe(){const Oe=window.prompt("Template name:");Oe?.trim()&&f(Oe.trim(),i)}function ot(){if(!l)return;const Oe=o.find($e=>$e.id===l);Oe&&window.confirm(`Delete template "${Oe.name}"?`)&&g(l)}function Ve(Oe){a(i.map($e=>$e.addonId!==Oe.addonId?$e:We(Oe)))}function We(Oe){const $e=Oe.children.some(He=>He.enabled||He.children.some(he=>he.enabled));return{...Oe,enabled:Oe.enabled||$e,children:Oe.children.map(He=>{const he=He.children.some(Se=>Se.enabled);return{...He,enabled:He.enabled||he}})}}function Qe(Oe,$e){const He=ul($e);a(i.map(he=>he.addonId!==Oe?he:{...he,children:[...he.children,He]}))}function Le(Oe){const $e=new Set;for(const He of Oe){$e.add(He.addonId);for(const Se of He.children)$e.add(Se.addonId);const he=Le(He.children);for(const Se of he)$e.add(Se)}return $e}const Te=Le(i);function st(Oe){const $e=J.get(Oe.addonId);if(!$e)return[];const He=e.slots.find(Pe=>Pe.id===$e.slot)?.parentSlot==null,he=$e.childSlots,Se=new Set(Oe.children.map(Pe=>Pe.addonId)),Ie=[];for(const Pe of e.slots)if(he.includes(Pe.id))for(const Be of Pe.addons){if(Se.has(Be.id)||H.has(Be.id))continue;const Ze=Be.inputClasses.length===0;Ze&&!He||(Ze||Be.inputClasses.some(Qt=>Oe.outputClasses.includes(Qt)))&&Ie.push(Be)}return Ie}function Re(Oe){const $e=k?{...Oe,children:Oe.children.filter(he=>he.enabled).map(he=>({...he,children:he.children.filter(Se=>Se.enabled)}))}:Oe,He=k?[]:st($e);return(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(Na,{step:$e,schema:J.get($e.addonId)??null,allSchemas:J,onChange:Ve,onDelete:v?void 0:he=>a(i.filter(Se=>Se.addonId!==he)),readOnly:v,...G($e.addonId)}),($e.children.length>0||He.length>0)&&(0,r.jsxs)("div",{className:"ml-4 pl-3 border-l border-border/60 space-y-1.5",children:[O&&(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/40",children:"Slot: Cropper / Classifier"}),$e.children.map(he=>{const Se=st(he);return(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)(Na,{step:he,schema:J.get(he.addonId)??null,allSchemas:J,depth:1,onChange:Ie=>{Ve({...$e,children:$e.children.map(Pe=>Pe.addonId===Ie.addonId?Ie:Pe)})},onDelete:v?void 0:Ie=>{Ve({...$e,children:$e.children.filter(Pe=>Pe.addonId!==Ie)})},readOnly:v,...G(he.addonId)}),(he.children.length>0||Se.length>0)&&(0,r.jsxs)("div",{className:"ml-4 pl-3 border-l border-border/40 space-y-1.5",children:[O&&(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/30",children:"Slot: Recognizer"}),he.children.map(Ie=>(0,r.jsx)(Na,{step:Ie,schema:J.get(Ie.addonId)??null,allSchemas:J,depth:2,onChange:Pe=>{Ve({...$e,children:$e.children.map(Be=>Be.addonId===he.addonId?{...Be,children:Be.children.map(Ze=>Ze.addonId===Pe.addonId?Pe:Ze)}:Be)})},onDelete:v?void 0:Pe=>{Ve({...$e,children:$e.children.map(Be=>Be.addonId===he.addonId?{...Be,children:Be.children.filter(Ze=>Ze.addonId!==Pe)}:Be)})},readOnly:v,...G(Ie.addonId)},Ie.addonId)),!v&&Se.map(Ie=>(0,r.jsx)(dl,{addon:Ie,onClick:()=>{const Pe=ul(Ie);Ve({...$e,children:$e.children.map(Be=>Be.addonId===he.addonId?{...Be,children:[...Be.children,Pe]}:Be)})}},Ie.id))]})]},he.addonId)}),!v&&He.map(he=>(0,r.jsx)(dl,{addon:he,onClick:()=>Qe($e.addonId,he)},he.id))]})]},$e.addonId)}const we=e.slots.filter(Oe=>Oe.parentSlot===null).sort((Oe,$e)=>Oe.priority-$e.priority);return(0,r.jsxs)("div",{className:"space-y-4",children:[!w&&(0,r.jsx)("div",{className:"rounded-lg border border-border bg-surface p-3",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"relative flex-1 min-w-0",children:(0,r.jsxs)("select",{value:l??"",onChange:Ae,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:border-primary/50",children:[(0,r.jsx)("option",{value:"",children:"No template"}),o.map(Oe=>(0,r.jsx)("option",{value:Oe.id,children:Oe.name},Oe.id))]})}),ae&&(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500 shrink-0"}),(0,r.jsx)("button",{onClick:De,disabled:!l||v,title:"Save",className:P("p-2 rounded-lg border border-border transition-colors",l&&!v?"text-foreground-subtle hover:bg-surface-hover":"text-foreground-subtle/30 cursor-not-allowed"),children:(0,r.jsx)(Dh,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:qe,disabled:v,title:"Save As",className:P("p-2 rounded-lg border border-border transition-colors",v?"text-foreground-subtle/30 cursor-not-allowed":"text-foreground-subtle hover:bg-surface-hover"),children:(0,r.jsx)(bh,{className:"h-4 w-4"})}),(0,r.jsx)("button",{onClick:ot,disabled:!l||v,title:"Delete",className:P("p-2 rounded-lg border border-border transition-colors",l&&!v?"text-foreground-subtle hover:text-danger":"text-foreground-subtle/30 cursor-not-allowed"),children:(0,r.jsx)(wr,{className:"h-4 w-4"})})]})}),X.length>0&&(0,r.jsxs)("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-3 text-xs text-amber-400 space-y-1",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"font-medium",children:"Template loaded with warnings:"}),(0,r.jsx)("button",{onClick:()=>me([]),className:"text-amber-400/60 hover:text-amber-400",children:(0,r.jsx)(It,{className:"h-3.5 w-3.5"})})]}),X.map((Oe,$e)=>(0,r.jsxs)("div",{children:["• ",Oe]},$e))]}),we.map(Oe=>{const $e=i.filter(Pe=>Pe.slot===Oe.id&&!H.has(Pe.addonId)),He=k?$e.filter(Pe=>Pe.enabled):$e,he=k?[]:Oe.addons.filter(Pe=>!Te.has(Pe.id)&&!H.has(Pe.id)),Se=new Map,Ie=[];for(const Pe of He)Pe.group?(Se.has(Pe.group)||Se.set(Pe.group,[]),Se.get(Pe.group).push(Pe)):Ie.push(Pe);return(0,r.jsxs)("div",{className:"space-y-2",children:[O&&(0,r.jsxs)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/50",children:["Slot: ",Oe.label]}),Ie.map(Pe=>Re(Pe)),[...Se.entries()].map(([Pe,Be])=>(0,r.jsxs)("div",{className:"space-y-2 rounded-lg border border-border/40 p-2",children:[(0,r.jsx)("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/50 px-1",children:Pe}),Be.map(Ze=>Re(Ze))]},Pe)),!v&&he.map(Pe=>(0,r.jsx)(dl,{addon:Pe,onClick:()=>{a([...i,ul(Pe)])}},Pe.id))]},Oe.id)})]})}var Fi={person:"#3b82f6",vehicle:"#f59e0b",animal:"#22c55e",face:"#a855f7",plate:"#ec4899",bird:"#14b8a6",dog:"#84cc16",cat:"#f97316",car:"#f59e0b",truck:"#d97706",bus:"#b45309",motorcycle:"#eab308",bicycle:"#ca8a04",motion:"#facc15"},Sd=["#ef4444","#8b5cf6","#06b6d4","#f97316","#10b981","#6366f1","#e11d48","#0891b2","#7c3aed","#059669"],ay="#f59e42";function Vt(e,i){if(i?.[e])return i[e];if(i?.[e.toLowerCase()])return i[e.toLowerCase()];if(Fi[e])return Fi[e];if(Fi[e.toLowerCase()])return Fi[e.toLowerCase()];let a=0;for(let o=0;o<e.length;o++)a=a*31+(e.codePointAt(o)??0)>>>0;return Sd[a%Sd.length]??"#f59e42"}function oy({src:e,imageWidth:i,imageHeight:a,detections:o=[],classColors:l,aspectRatio:d,className:f,placeholder:h,showConfidence:g=!0,minConfidence:v=0,borderWidth:b=2}){function w(Z){return Vt(Z,l)}const k=d??(i&&a?`${i}/${a}`:"16/9"),O=o.filter(Z=>Z.score>=v),E=O.filter(Z=>Z.kind==="first-level"),A=O.filter(Z=>Z.kind==="detail"),R=cy(A,Z=>Z.parentId??"");return(0,r.jsx)("div",{className:P("rounded-lg border border-border bg-surface overflow-hidden relative",f),style:{aspectRatio:k},children:e?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:e,className:"absolute inset-0 w-full h-full object-fill",alt:""}),O.map((Z,V)=>Z.debug?.mask&&Z.debug.maskWidth&&Z.debug.maskHeight?(0,r.jsx)(sy,{mask:Z.debug.mask,maskWidth:Z.debug.maskWidth,maskHeight:Z.debug.maskHeight,bbox:Z.bbox,imageWidth:i,imageHeight:a,color:w(Z.macroClass)},`mask-${V}`):null),E.map(Z=>{const V=R.get(Z.id)??[];return(0,r.jsx)(jd,{detection:Z,imageWidth:i,imageHeight:a,color:w(Z.macroClass),showConfidence:g,borderWidth:Z.debug?.mask?1:b,children:V.map(G=>(0,r.jsx)(ly,{child:G,parentBbox:Z.bbox,color:w(G.macroClass),showConfidence:g},`child-${G.id}`))},`det-${Z.id}`)}),A.filter(Z=>!Z.parentId||!E.some(V=>V.id===Z.parentId)).map(Z=>(0,r.jsx)(jd,{detection:Z,imageWidth:i,imageHeight:a,color:w(Z.macroClass),showConfidence:g,borderWidth:b},`orphan-${Z.id}`))]}):(0,r.jsx)("div",{className:"w-full h-full flex items-center justify-center text-foreground-subtle text-sm",children:h??"No image loaded"})})}function jd({detection:e,imageWidth:i,imageHeight:a,color:o,showConfidence:l,borderWidth:d,children:f}){const{x:h,y:g,width:v,height:b}=e.bbox,w=(0,r.jsxs)("div",{className:"absolute left-0 flex flex-col items-start gap-px",style:{bottom:"100%",marginBottom:"2px"},children:[(0,r.jsxs)("span",{className:"text-[10px] px-1 rounded-sm whitespace-nowrap text-white",style:{backgroundColor:o},children:[e.macroClass,l&&` ${(e.score*100).toFixed(0)}%`]}),e.labels.map((k,O)=>(0,r.jsxs)("span",{className:"text-[9px] font-semibold px-1 rounded-sm whitespace-nowrap text-white",style:{backgroundColor:Vt(k.label)},children:[k.label," ",(k.score*100).toFixed(0),"%"]},`${e.id}-lbl-${O}`))]});return(0,r.jsxs)("div",{className:"absolute rounded-sm",style:{left:`${h/i*100}%`,top:`${g/a*100}%`,width:`${v/i*100}%`,height:`${b/a*100}%`,borderWidth:`${d}px`,borderStyle:"solid",borderColor:o},children:[w,f]})}function sy({mask:e,maskWidth:i,maskHeight:a,bbox:o,imageWidth:l,imageHeight:d,color:f}){const h=(0,n.useRef)(null);return(0,n.useEffect)(()=>{const g=h.current;if(!g)return;const v=g.getContext("2d");if(!v)return;const b=atob(e),w=new Uint8Array(b.length);for(let Z=0;Z<b.length;Z++)w[Z]=b.charCodeAt(Z);const k=parseInt(f.slice(1,3),16),O=parseInt(f.slice(3,5),16),E=parseInt(f.slice(5,7),16);g.width=i,g.height=a;const A=v.createImageData(i,a),R=i*a;for(let Z=0;Z<R;Z++){const V=Z<w.length?w[Z]:0,G=Z*4;V>0&&(A.data[G]=k,A.data[G+1]=O,A.data[G+2]=E,A.data[G+3]=120)}v.putImageData(A,0,0)},[e,i,a,f]),(0,r.jsx)("canvas",{ref:h,className:"absolute pointer-events-none",style:{left:`${o.x/l*100}%`,top:`${o.y/d*100}%`,width:`${o.width/l*100}%`,height:`${o.height/d*100}%`,imageRendering:"pixelated"}})}function ly({child:e,parentBbox:i,color:a,showConfidence:o}){if(i.width<=0||i.height<=0)return null;const l=(e.bbox.x-i.x)/i.width*100,d=(e.bbox.y-i.y)/i.height*100,f=e.bbox.width/i.width*100,h=e.bbox.height/i.height*100;return(0,r.jsx)("div",{className:"absolute rounded-sm",style:{left:`${Math.max(0,l)}%`,top:`${Math.max(0,d)}%`,width:`${Math.min(100,f)}%`,height:`${Math.min(100,h)}%`,borderWidth:"1px",borderStyle:"solid",borderColor:a},children:(0,r.jsxs)("div",{className:"absolute left-0 flex flex-col items-start gap-px",style:{bottom:"100%",marginBottom:"1px"},children:[(0,r.jsxs)("span",{className:"text-[9px] px-0.5 rounded-sm whitespace-nowrap text-white",style:{backgroundColor:a},children:[e.macroClass,o&&` ${(e.score*100).toFixed(0)}%`]}),e.labels.map((g,v)=>(0,r.jsxs)("span",{className:"text-[8px] font-semibold px-0.5 rounded-sm whitespace-nowrap text-white",style:{backgroundColor:Vt(g.label)},children:[g.label," ",(g.score*100).toFixed(0),"%"]},`${e.id}-lbl-${v}`))]})})}function cy(e,i){const a=new Map;for(const o of e){const l=i(o),d=a.get(l)??[];d.push(o),a.set(l,d)}return a}function uy({detections:e,classColors:i,className:a,hiddenKeys:o,onToggleVisibility:l}){const d=i;if(e.length===0)return(0,r.jsx)("div",{className:"text-sm text-foreground-subtle italic text-center py-4",children:"No detections"});const f=e.filter(b=>b.kind==="first-level"),h=e.filter(b=>b.kind==="detail"),g=new Map;for(const b of h){if(!b.parentId)continue;const w=g.get(b.parentId)??[];w.push(b),g.set(b.parentId,w)}const v=h.filter(b=>!b.parentId||!f.some(w=>w.id===b.parentId));return(0,r.jsxs)("div",{className:a,children:[(0,r.jsxs)("div",{className:"text-xs font-medium text-foreground-subtle uppercase tracking-wide mb-2",children:["Detections (",e.length,")"]}),(0,r.jsxs)("div",{className:"space-y-2",children:[f.map(b=>(0,r.jsx)($d,{detection:b,children_:g.get(b.id)??[],colors:d,hiddenKeys:o,onToggleVisibility:l},b.id)),v.map(b=>(0,r.jsx)($d,{detection:b,children_:[],colors:d,hiddenKeys:o,onToggleVisibility:l},b.id))]})]})}function $d({detection:e,children_:i,colors:a,hiddenKeys:o,onToggleVisibility:l}){const d=Vt(e.macroClass,a),f=!o?.has(e.id),h=e.debug?.mask,g=e.debug?.maskWidth,v=e.debug?.maskHeight,b=e.debug?.alternateLabels;return(0,r.jsxs)("div",{className:`rounded-md border border-border bg-surface p-3 space-y-1 ${f?"":"opacity-40"}`,children:[(0,r.jsxs)("div",{className:"flex justify-between items-center",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[l&&(0,r.jsx)("input",{type:"checkbox",checked:f,onChange:()=>l(e.id,!f),className:"h-3.5 w-3.5 rounded border-border accent-primary cursor-pointer shrink-0"}),(0,r.jsx)("span",{className:"h-2.5 w-2.5 rounded-full shrink-0",style:{backgroundColor:d}}),(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.macroClass}),e.kind==="detail"&&(0,r.jsx)("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-primary/10 text-primary",children:"detail"}),h&&g&&v&&(0,r.jsxs)("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-primary/10 text-primary",children:["mask ",g,"x",v]})]}),(0,r.jsx)(my,{confidence:e.score})]}),(0,r.jsxs)("div",{className:"text-[10px] text-foreground-subtle font-mono",children:["bbox: [",Math.round(e.bbox.x),", ",Math.round(e.bbox.y),","," ",Math.round(e.bbox.x+e.bbox.width),","," ",Math.round(e.bbox.y+e.bbox.height),"]"]}),e.labels.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1 mt-1",children:e.labels.map((w,k)=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-[10px] font-medium px-1.5 py-0.5 rounded-full",style:{backgroundColor:Vt(w.label,a)+"20",color:Vt(w.label,a)},children:[w.label,(0,r.jsxs)("span",{className:"opacity-60",children:[(w.score*100).toFixed(0),"%"]}),w.detectionId&&(0,r.jsxs)("span",{className:"opacity-40 text-[8px]",children:["→ ",w.detectionId]})]},k))}),b&&Object.keys(b).length>0&&(0,r.jsx)(fy,{alternateLabels:b,colors:a}),i.length>0&&(0,r.jsx)(dy,{items:i,colors:a,hiddenKeys:o,onToggleVisibility:l})]})}function dy({items:e,colors:i,hiddenKeys:a,onToggleVisibility:o}){return(0,r.jsx)("div",{className:"ml-4 mt-1.5 space-y-1.5 border-l-2 border-border pl-3",children:e.map(l=>{const d=Vt(l.macroClass,i),f=!a?.has(l.id),h=l.debug?.mask,g=l.debug?.maskWidth,v=l.debug?.maskHeight;return(0,r.jsxs)("div",{className:`text-xs space-y-0.5 ${f?"":"opacity-40"}`,children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[o&&(0,r.jsx)("input",{type:"checkbox",checked:f,onChange:()=>o(l.id,!f),className:"h-3 w-3 rounded border-border accent-primary cursor-pointer shrink-0"}),(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full shrink-0",style:{backgroundColor:d}}),(0,r.jsx)("span",{className:"font-medium",style:{color:d},children:l.macroClass}),(0,r.jsxs)("span",{className:"text-foreground-subtle",children:[(l.score*100).toFixed(0),"%"]}),h&&g&&v&&(0,r.jsxs)("span",{className:"text-[9px] font-mono px-1 py-0.5 rounded bg-primary/10 text-primary",children:["mask ",g,"x",v]})]}),l.labels.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1 ml-5 mt-0.5",children:l.labels.map((b,w)=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-[9px] font-medium px-1 py-0.5 rounded-full",style:{backgroundColor:Vt(b.label,i)+"20",color:Vt(b.label,i)},children:[b.label," ",(0,r.jsxs)("span",{className:"opacity-60",children:[(b.score*100).toFixed(0),"%"]})]},w))})]},l.id)})})}function fy({alternateLabels:e,colors:i}){const[a,o]=(0,n.useState)(!1),l=Object.keys(e);return(0,r.jsxs)("div",{className:"mt-1",children:[(0,r.jsxs)("button",{onClick:()=>o(d=>!d),className:"text-[9px] text-foreground-subtle hover:text-foreground transition-colors flex items-center gap-1",children:[(0,r.jsx)("span",{className:`transition-transform ${a?"rotate-90":""}`,children:"▶"}),"Alternates (",l.length," source",l.length!==1?"s":"",")"]}),a&&(0,r.jsx)("div",{className:"mt-1 ml-3 space-y-1.5",children:l.map(d=>{const f=e[d];return!f||f.length===0?null:(0,r.jsxs)("div",{children:[(0,r.jsx)("div",{className:"text-[9px] font-medium text-foreground-subtle mb-0.5",children:d}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1",children:f.map((h,g)=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-0.5 text-[9px] px-1 py-0.5 rounded-full",style:{backgroundColor:Vt(d,i)+"10",color:Vt(d,i),opacity:Math.max(.4,h.score)},children:[h.label,(0,r.jsxs)("span",{className:"opacity-60",children:[(h.score*100).toFixed(1),"%"]})]},g))})]},d)})})]})}function my({confidence:e}){return(0,r.jsxs)("span",{className:`text-xs font-medium px-2 py-0.5 rounded-full ${e>=.8?"bg-success/10 text-success":e>=.5?"bg-warning/10 text-warning":"bg-danger/10 text-danger"}`,children:[(e*100).toFixed(1),"%"]})}function gy({timings:e,totalMs:i,className:a}){const o=Object.entries(e);return o.length===0&&i===void 0?null:(0,r.jsxs)("div",{className:`rounded-lg border border-border bg-surface p-3 space-y-2 ${a??""}`,children:[(0,r.jsx)("div",{className:"text-xs font-medium text-foreground-subtle uppercase tracking-wide",children:"Timings"}),(0,r.jsxs)("div",{className:"space-y-1 text-xs",children:[o.map(([l,d])=>(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsx)("span",{className:"text-foreground-subtle",children:l}),(0,r.jsxs)("span",{className:"font-mono text-foreground",children:[d.toFixed(1),"ms"]})]},l)),i!==void 0&&(0,r.jsxs)("div",{className:"flex justify-between pt-1 border-t border-border font-medium text-foreground",children:[(0,r.jsx)("span",{children:"Total"}),(0,r.jsxs)("span",{className:"font-mono",children:[i.toFixed(1),"ms"]})]})]})]})}function py({images:e,selectedFilename:i,uploadedName:a,onSelect:o,onUpload:l,className:d,accept:f="image/*",uploadLabel:h="Upload..."}){const g=()=>{const v=document.createElement("input");v.type="file",v.accept=f,v.onchange=()=>{const b=v.files?.[0];if(!b)return;const w=new FileReader;w.onload=()=>{const k=w.result,O=k.split(",")[1];O&&l(O,b.name,k)},w.readAsDataURL(b)},v.click()};return(0,r.jsxs)("div",{className:`flex flex-wrap items-center gap-2 ${d??""}`,children:[e.map(v=>(0,r.jsx)("button",{onClick:()=>o(v.filename),className:`px-3 py-1.5 text-xs rounded-md border transition-colors ${i===v.filename?"bg-primary text-primary-foreground border-primary":"bg-surface border-border text-foreground hover:border-primary/50"}`,children:v.id??v.filename.replace(/\.[^.]+$/,"")},v.filename)),(0,r.jsx)("button",{onClick:g,className:"px-3 py-1.5 text-xs rounded-md border border-border bg-surface text-foreground hover:bg-surface-hover transition-colors",children:h}),a&&(0,r.jsx)("span",{className:"text-xs text-foreground-subtle",children:a})]})}var Ea="w-full px-3 py-2 text-sm rounded-md border border-border bg-surface text-foreground focus:outline-none focus:ring-2 focus:ring-primary/50";function hy({runtime:e,backend:i,modelId:a,agentId:o="hub",runtimes:l,backends:d,models:f,agents:h=[],onRuntimeChange:g,onBackendChange:v,onModelChange:b,onAgentChange:w,layout:k="grid",className:O,showAgent:E=!1}){return(0,r.jsxs)("div",{className:`${k==="grid"?"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4":k==="horizontal"?"flex flex-wrap items-end gap-4":"space-y-3"} ${O??""}`,children:[E&&h.length>0&&(0,r.jsxs)("label",{className:"space-y-1",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Agent"}),(0,r.jsx)("select",{value:o,onChange:A=>w?.(A.target.value),className:Ea,children:h.map(A=>(0,r.jsxs)("option",{value:A.id,children:[A.name," (",A.status,")"]},A.id))})]}),(0,r.jsxs)("label",{className:"space-y-1",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Runtime"}),(0,r.jsx)("select",{value:e,onChange:A=>g(A.target.value),className:Ea,children:l.map(A=>(0,r.jsxs)("option",{value:A.value,disabled:!A.available,children:[A.label,A.available?"":" (unavailable)"]},A.value))})]}),(0,r.jsxs)("label",{className:"space-y-1",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Backend"}),(0,r.jsx)("select",{value:i,onChange:A=>v(A.target.value),className:Ea,children:d.map(A=>(0,r.jsxs)("option",{value:A.id,disabled:!A.available,children:[A.label,A.available?"":" (unavailable)"]},A.id))})]}),(0,r.jsxs)("label",{className:"space-y-1",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-foreground-subtle",children:"Model"}),(0,r.jsx)("select",{value:a,onChange:A=>b(A.target.value),className:Ea,children:f.length===0?(0,r.jsx)("option",{value:"",children:"No compatible models"}):f.map(A=>(0,r.jsxs)("option",{value:A.id,children:[A.name,A.downloaded?" ✓":""]},A.id))})]})]})}var vy=class{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,i){this.keyToValue.set(e,i),this.valueToKey.set(i,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}},kd=class{constructor(e){this.generateIdentifier=e,this.kv=new vy}register(e,i){this.kv.getByValue(e)||(i||(i=this.generateIdentifier(e)),this.kv.set(i,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}},by=class extends kd{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,i){typeof i=="object"?(i.allowProps&&this.classToAllowedProps.set(e,i.allowProps),super.register(e,i.identifier)):super.register(e,i)}getAllowedProps(e){return this.classToAllowedProps.get(e)}};function yy(e){if("values"in Object)return Object.values(e);const i=[];for(const a in e)e.hasOwnProperty(a)&&i.push(e[a]);return i}function xy(e,i){const a=yy(e);if("find"in a)return a.find(i);const o=a;for(let l=0;l<o.length;l++){const d=o[l];if(i(d))return d}}function yn(e,i){Object.entries(e).forEach(([a,o])=>i(o,a))}function Ma(e,i){return e.indexOf(i)!==-1}function Pd(e,i){for(let a=0;a<e.length;a++){const o=e[a];if(i(o))return o}}var _y=class{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return xy(this.transfomers,i=>i.isApplicable(e))}findByName(e){return this.transfomers[e]}},wy=e=>Object.prototype.toString.call(e).slice(8,-1),Nd=e=>typeof e>"u",Sy=e=>e===null,Gi=e=>typeof e!="object"||e===null||e===Object.prototype?!1:Object.getPrototypeOf(e)===null?!0:Object.getPrototypeOf(e)===Object.prototype,fl=e=>Gi(e)&&Object.keys(e).length===0,Tr=e=>Array.isArray(e),jy=e=>typeof e=="string",$y=e=>typeof e=="number"&&!isNaN(e),ky=e=>typeof e=="boolean",Py=e=>e instanceof RegExp,Vi=e=>e instanceof Map,Qi=e=>e instanceof Set,Cd=e=>wy(e)==="Symbol",Ny=e=>e instanceof Date&&!isNaN(e.valueOf()),Od=e=>e instanceof Error,Id=e=>typeof e=="number"&&isNaN(e),Cy=e=>ky(e)||Sy(e)||Nd(e)||$y(e)||jy(e)||Cd(e),Oy=e=>typeof e=="bigint",Iy=e=>e===1/0||e===-1/0,Ey=e=>ArrayBuffer.isView(e)&&!(e instanceof DataView),My=e=>e instanceof URL,ml=e=>e.replace(/\\/g,"\\\\").replace(/\./g,"\\."),gl=e=>e.map(String).map(ml).join("."),Wi=(e,i)=>{const a=[];let o="";for(let d=0;d<e.length;d++){let f=e.charAt(d);if(!i&&f==="\\"){const h=e.charAt(d+1);if(h==="\\"){o+="\\",d++;continue}else if(h!==".")throw Error("invalid path")}if(f==="\\"&&e.charAt(d+1)==="."){o+=".",d++;continue}if(f==="."){a.push(o),o="";continue}o+=f}const l=o;return a.push(l),a};function pr(e,i,a,o){return{isApplicable:e,annotation:i,transform:a,untransform:o}}var Ed=[pr(Nd,"undefined",()=>null,()=>{}),pr(Oy,"bigint",e=>e.toString(),e=>typeof BigInt<"u"?BigInt(e):(console.error("Please add a BigInt polyfill."),e)),pr(Ny,"Date",e=>e.toISOString(),e=>new Date(e)),pr(Od,"Error",(e,i)=>{const a={name:e.name,message:e.message};return"cause"in e&&(a.cause=e.cause),i.allowedErrorProps.forEach(o=>{a[o]=e[o]}),a},(e,i)=>{const a=new Error(e.message,{cause:e.cause});return a.name=e.name,a.stack=e.stack,i.allowedErrorProps.forEach(o=>{a[o]=e[o]}),a}),pr(Py,"regexp",e=>""+e,e=>{const i=e.slice(1,e.lastIndexOf("/")),a=e.slice(e.lastIndexOf("/")+1);return new RegExp(i,a)}),pr(Qi,"set",e=>[...e.values()],e=>new Set(e)),pr(Vi,"map",e=>[...e.entries()],e=>new Map(e)),pr(e=>Id(e)||Iy(e),"number",e=>Id(e)?"NaN":e>0?"Infinity":"-Infinity",Number),pr(e=>e===0&&1/e===-1/0,"number",()=>"-0",Number),pr(My,"URL",e=>e.toString(),e=>new URL(e))];function Da(e,i,a,o){return{isApplicable:e,annotation:i,transform:a,untransform:o}}var Md=Da((e,i)=>Cd(e)?!!i.symbolRegistry.getIdentifier(e):!1,(e,i)=>["symbol",i.symbolRegistry.getIdentifier(e)],e=>e.description,(e,i,a)=>{const o=a.symbolRegistry.getValue(i[1]);if(!o)throw new Error("Trying to deserialize unknown symbol");return o}),Dy=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((e,i)=>(e[i.name]=i,e),{}),Dd=Da(Ey,e=>["typed-array",e.constructor.name],e=>[...e],(e,i)=>{const a=Dy[i[1]];if(!a)throw new Error("Trying to deserialize unknown typed array");return new a(e)});function Ad(e,i){return e?.constructor?!!i.classRegistry.getIdentifier(e.constructor):!1}var zd=Da(Ad,(e,i)=>["class",i.classRegistry.getIdentifier(e.constructor)],(e,i)=>{const a=i.classRegistry.getAllowedProps(e.constructor);if(!a)return{...e};const o={};return a.forEach(l=>{o[l]=e[l]}),o},(e,i,a)=>{const o=a.classRegistry.getValue(i[1]);if(!o)throw new Error(`Trying to deserialize unknown class '${i[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(o.prototype),e)}),Td=Da((e,i)=>!!i.customTransformerRegistry.findApplicable(e),(e,i)=>["custom",i.customTransformerRegistry.findApplicable(e).name],(e,i)=>i.customTransformerRegistry.findApplicable(e).serialize(e),(e,i,a)=>{const o=a.customTransformerRegistry.findByName(i[1]);if(!o)throw new Error("Trying to deserialize unknown custom value");return o.deserialize(e)}),Ay=[zd,Md,Td,Dd],Rd=(e,i)=>{const a=Pd(Ay,l=>l.isApplicable(e,i));if(a)return{value:a.transform(e,i),type:a.annotation(e,i)};const o=Pd(Ed,l=>l.isApplicable(e,i));if(o)return{value:o.transform(e,i),type:o.annotation}},Zd={};Ed.forEach(e=>{Zd[e.annotation]=e});var zy=(e,i,a)=>{if(Tr(i))switch(i[0]){case"symbol":return Md.untransform(e,i,a);case"class":return zd.untransform(e,i,a);case"custom":return Td.untransform(e,i,a);case"typed-array":return Dd.untransform(e,i,a);default:throw new Error("Unknown transformation: "+i)}else{const o=Zd[i];if(!o)throw new Error("Unknown transformation: "+i);return o.untransform(e,a)}},xn=(e,i)=>{if(i>e.size)throw new Error("index out of bounds");const a=e.keys();for(;i>0;)a.next(),i--;return a.next().value};function Ld(e){if(Ma(e,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(Ma(e,"prototype"))throw new Error("prototype is not allowed as a property");if(Ma(e,"constructor"))throw new Error("constructor is not allowed as a property")}var Ty=(e,i)=>{Ld(i);for(let a=0;a<i.length;a++){const o=i[a];if(Qi(e))e=xn(e,+o);else if(Vi(e)){const l=+o,d=+i[++a]==0?"key":"value",f=xn(e,l);switch(d){case"key":e=f;break;case"value":e=e.get(f);break}}else e=e[o]}return e},pl=(e,i,a)=>{if(Ld(i),i.length===0)return a(e);let o=e;for(let d=0;d<i.length-1;d++){const f=i[d];if(Tr(o)){const h=+f;o=o[h]}else if(Gi(o))o=o[f];else if(Qi(o)){const h=+f;o=xn(o,h)}else if(Vi(o)){if(d===i.length-2)break;const h=+f,g=+i[++d]==0?"key":"value",v=xn(o,h);switch(g){case"key":o=v;break;case"value":o=o.get(v);break}}}const l=i[i.length-1];if(Tr(o)?o[+l]=a(o[+l]):Gi(o)&&(o[l]=a(o[l])),Qi(o)){const d=xn(o,+l),f=a(d);d!==f&&(o.delete(d),o.add(f))}if(Vi(o)){const d=+i[i.length-2],f=xn(o,d);switch(+l==0?"key":"value"){case"key":{const h=a(f);o.set(h,o.get(f)),h!==f&&o.delete(f);break}case"value":o.set(f,a(o.get(f)));break}}return e},Ud=e=>e<1;function hl(e,i,a,o=[]){if(!e)return;const l=Ud(a);if(!Tr(e)){yn(e,(h,g)=>hl(h,i,a,[...o,...Wi(g,l)]));return}const[d,f]=e;f&&yn(f,(h,g)=>{hl(h,i,a,[...o,...Wi(g,l)])}),i(d,o)}function Ry(e,i,a,o){return hl(i,(l,d)=>{e=pl(e,d,f=>zy(f,l,o))},a),e}function Zy(e,i,a){const o=Ud(a);function l(d,f){const h=Ty(e,Wi(f,o));d.map(g=>Wi(g,o)).forEach(g=>{e=pl(e,g,()=>h)})}if(Tr(i)){const[d,f]=i;d.forEach(h=>{e=pl(e,Wi(h,o),()=>e)}),f&&yn(f,l)}else yn(i,l);return e}var Ly=(e,i)=>Gi(e)||Tr(e)||Vi(e)||Qi(e)||Od(e)||Ad(e,i);function Uy(e,i,a){const o=a.get(e);o?o.push(i):a.set(e,[i])}function By(e,i){const a={};let o;return e.forEach(l=>{if(l.length<=1)return;i||(l=l.map(h=>h.map(String)).sort((h,g)=>h.length-g.length));const[d,...f]=l;d.length===0?o=f.map(gl):a[gl(d)]=f.map(gl)}),o?fl(a)?[o]:[o,a]:fl(a)?void 0:a}var Bd=(e,i,a,o,l=[],d=[],f=new Map)=>{const h=Cy(e);if(!h){Uy(e,l,i);const O=f.get(e);if(O)return o?{transformedValue:null}:O}if(!Ly(e,a)){const O=Rd(e,a),E=O?{transformedValue:O.value,annotations:[O.type]}:{transformedValue:e};return h||f.set(e,E),E}if(Ma(d,e))return{transformedValue:null};const g=Rd(e,a),v=g?.value??e,b=Tr(v)?[]:{},w={};yn(v,(O,E)=>{if(E==="__proto__"||E==="constructor"||E==="prototype")throw new Error(`Detected property ${E}. This is a prototype pollution risk, please remove it from your object.`);const A=Bd(O,i,a,o,[...l,E],[...d,e],f);b[E]=A.transformedValue,Tr(A.annotations)?w[ml(E)]=A.annotations:Gi(A.annotations)&&yn(A.annotations,(R,Z)=>{w[ml(E)+"."+Z]=R})});const k=fl(w)?{transformedValue:b,annotations:g?[g.type]:void 0}:{transformedValue:b,annotations:g?[g.type,w]:w};return h||f.set(e,k),k};function Fd(e){return Object.prototype.toString.call(e).slice(8,-1)}function Gd(e){return Fd(e)==="Array"}function Fy(e){if(Fd(e)!=="Object")return!1;const i=Object.getPrototypeOf(e);return!!i&&i.constructor===Object&&i===Object.prototype}function Gy(e,i,a,o,l){const d={}.propertyIsEnumerable.call(o,i)?"enumerable":"nonenumerable";d==="enumerable"&&(e[i]=a),l&&d==="nonenumerable"&&Object.defineProperty(e,i,{value:a,enumerable:!1,writable:!0,configurable:!0})}function vl(e,i={}){if(Gd(e))return e.map(l=>vl(l,i));if(!Fy(e))return e;const a=Object.getOwnPropertyNames(e),o=Object.getOwnPropertySymbols(e);return[...a,...o].reduce((l,d)=>{if(d==="__proto__"||Gd(i.props)&&!i.props.includes(d))return l;const f=e[d];return Gy(l,d,vl(f,i),e,i.nonenumerable),l},{})}var rt=class{constructor({dedupe:e=!1}={}){this.classRegistry=new by,this.symbolRegistry=new kd(i=>i.description??""),this.customTransformerRegistry=new _y,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const i=new Map,a=Bd(e,i,this,this.dedupe),o={json:a.transformedValue};a.annotations&&(o.meta={...o.meta,values:a.annotations});const l=By(i,this.dedupe);return l&&(o.meta={...o.meta,referentialEqualities:l}),o.meta&&(o.meta.v=1),o}deserialize(e,i){const{json:a,meta:o}=e;let l=i?.inPlace?a:vl(a);return o?.values&&(l=Ry(l,o.values,o.v??0,this)),o?.referentialEqualities&&(l=Zy(l,o.referentialEqualities,o.v??0)),l}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,i){this.classRegistry.register(e,i)}registerSymbol(e,i){this.symbolRegistry.register(e,i)}registerCustom(e,i){this.customTransformerRegistry.register({name:i,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}};rt.defaultInstance=new rt,rt.serialize=rt.defaultInstance.serialize.bind(rt.defaultInstance),rt.deserialize=rt.defaultInstance.deserialize.bind(rt.defaultInstance),rt.stringify=rt.defaultInstance.stringify.bind(rt.defaultInstance),rt.parse=rt.defaultInstance.parse.bind(rt.defaultInstance),rt.registerClass=rt.defaultInstance.registerClass.bind(rt.defaultInstance),rt.registerSymbol=rt.defaultInstance.registerSymbol.bind(rt.defaultInstance),rt.registerCustom=rt.defaultInstance.registerCustom.bind(rt.defaultInstance),rt.allowErrorProps=rt.defaultInstance.allowErrorProps.bind(rt.defaultInstance),rt.serialize,rt.deserialize,rt.stringify,rt.parse,rt.registerClass,rt.registerCustom,rt.registerSymbol,rt.allowErrorProps;function Vy({className:e}){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[(0,r.jsx)("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"3"})]})}function Qy({className:e}){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[(0,r.jsx)("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),(0,r.jsx)("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),(0,r.jsx)("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),(0,r.jsx)("path",{d:"m2 2 20 20"})]})}function Wy({className:e}){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:(0,r.jsx)("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})})}function Vd({onLogin:e,serverUrl:i,logoSrc:a,error:o,className:l}){const[d,f]=(0,n.useState)(""),[h,g]=(0,n.useState)(""),[v,b]=(0,n.useState)(!1),[w,k]=(0,n.useState)(!1),[O,E]=(0,n.useState)(null),A=o??O,R=async Z=>{if(Z.preventDefault(),!w){E(null),k(!0);try{await e(d,h)}catch(V){E(V instanceof Error?V.message:"Login failed. Please try again.")}finally{k(!1)}}};return(0,r.jsx)("div",{className:P("flex min-h-screen items-center justify-center bg-background p-4",l),children:(0,r.jsxs)("div",{className:"w-full max-w-sm",children:[a&&(0,r.jsx)("div",{className:"flex justify-center mb-8",children:(0,r.jsx)("img",{src:a,alt:"Logo",className:"h-12"})}),i&&(0,r.jsx)("p",{className:"mb-4 text-center text-xs text-foreground-subtle truncate",children:i}),(0,r.jsxs)("form",{onSubmit:R,className:"space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10",children:[A&&(0,r.jsx)("div",{className:"rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger",children:A}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("label",{className:"text-xs font-medium text-foreground-subtle",children:"Username"}),(0,r.jsx)("input",{type:"text",value:d,onChange:Z=>f(Z.target.value),autoComplete:"username",required:!0,className:"w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary"})]}),(0,r.jsxs)("div",{className:"space-y-1.5",children:[(0,r.jsx)("label",{className:"text-xs font-medium text-foreground-subtle",children:"Password"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:v?"text":"password",value:h,onChange:Z=>g(Z.target.value),autoComplete:"current-password",required:!0,className:"w-full rounded-lg border border-border bg-background px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-2 focus:ring-primary/50 focus:border-primary"}),(0,r.jsx)("button",{type:"button",onClick:()=>b(Z=>!Z),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",tabIndex:-1,children:v?(0,r.jsx)(Qy,{className:"h-4 w-4"}):(0,r.jsx)(Vy,{className:"h-4 w-4"})})]})]}),(0,r.jsxs)("button",{type:"submit",disabled:w,className:"w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors flex items-center justify-center gap-2",children:[w&&(0,r.jsx)(Wy,{className:"h-4 w-4 animate-spin"}),w?"Logging in...":"Log in"]})]})]})})}var bl="camstack_dev_token",Qd=(0,n.createContext)(null);function qy(){const e=(0,n.useContext)(Qd);if(!e)throw new Error("useDevShell must be used within a DevShell");return e}function Hy(){return typeof window>"u"?null:localStorage.getItem(bl)}function Jy({className:e}){return(0,r.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:[(0,r.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,r.jsx)("path",{d:"M12 2v2"}),(0,r.jsx)("path",{d:"M12 20v2"}),(0,r.jsx)("path",{d:"m4.93 4.93 1.41 1.41"}),(0,r.jsx)("path",{d:"m17.66 17.66 1.41 1.41"}),(0,r.jsx)("path",{d:"M2 12h2"}),(0,r.jsx)("path",{d:"M20 12h2"}),(0,r.jsx)("path",{d:"m6.34 17.66-1.41 1.41"}),(0,r.jsx)("path",{d:"m19.07 4.93-1.41 1.41"})]})}function Ky({className:e}){return(0,r.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:e,children:(0,r.jsx)("path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"})})}function Xy({children:e,serverUrl:i,title:a,token:o,onLogout:l}){const d=u.useThemeMode$1(),f=(0,n.useMemo)(()=>[(0,Y.splitLink)({condition:k=>k.type==="subscription",true:(0,Y.wsLink)({client:(0,Y.createWSClient)({url:i.replace(/^http/,"ws")+"/trpc",connectionParams:()=>({token:o})}),transformer:rt}),false:(0,Y.httpLink)({url:`${i}/trpc`,transformer:rt,headers:()=>({authorization:`Bearer ${o}`})})})],[i,o]),h=(0,n.useMemo)(()=>(0,Y.createTRPCClient)({links:f}),[f]),g=(0,n.useMemo)(()=>j.createClient({links:f}),[f]),v=(0,n.useMemo)(()=>(0,be.createSystem)({serverUrl:i,token:o}),[i,o]);(0,n.useEffect)(()=>(v.init().catch(()=>{}),()=>{v.close()}),[v]);const b=(0,n.useMemo)(()=>new ee.QueryClient,[]),w=(0,n.useMemo)(()=>({trpc:h,token:o,logout:l}),[h,o,l]);return(0,r.jsx)(Wu,{system:v,children:(0,r.jsx)(j.Provider,{client:g,queryClient:b,children:(0,r.jsx)(ee.QueryClientProvider,{client:b,children:(0,r.jsx)(Qd.Provider,{value:w,children:(0,r.jsxs)("div",{className:"min-h-screen bg-background text-foreground",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-border bg-surface px-4 py-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"rounded bg-warning/20 px-2 py-0.5 text-xs font-bold text-warning",children:"DEV MODE"}),a&&(0,r.jsx)("span",{className:"text-sm font-medium text-foreground",children:a}),(0,r.jsx)("span",{className:"text-xs text-foreground-subtle",children:i})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("button",{type:"button",onClick:d.toggleMode,className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",title:`Theme: ${d.mode}`,children:[d.resolvedMode==="dark"?(0,r.jsx)(Jy,{className:"h-3.5 w-3.5"}):(0,r.jsx)(Ky,{className:"h-3.5 w-3.5"}),d.mode==="dark"?"Dark":d.mode==="light"?"Light":"System"]}),(0,r.jsx)("button",{type:"button",onClick:l,className:"rounded-md px-2.5 py-1 text-xs font-medium text-danger hover:bg-danger/10 transition-colors",children:"Logout"})]})]}),(0,r.jsx)("div",{className:"p-4",children:e({trpc:h,theme:d})})]})})})})})}function Wd({children:e,serverUrl:i="https://localhost:4443",title:a}){const[o,l]=(0,n.useState)(Hy),d=(0,n.useCallback)(async(h,g)=>{const v=await(0,Y.createTRPCClient)({links:[(0,Y.httpLink)({url:`${i}/trpc`,transformer:rt})]}).auth.login.mutate({username:h,password:g});if(!v.token)throw new Error("No token returned");localStorage.setItem(bl,v.token),l(v.token)},[i]),f=(0,n.useCallback)(()=>{localStorage.removeItem(bl),l(null)},[]);return o?(0,r.jsx)(u.ThemeProvider$1,{children:(0,r.jsx)(Xy,{serverUrl:i,title:a,token:o,onLogout:f,children:e})}):(0,r.jsx)(u.ThemeProvider$1,{children:(0,r.jsx)(Vd,{onLogin:d,serverUrl:i})})}function Yy(e,i={}){const{serverUrl:a="https://localhost:4443",title:o,rootId:l="root"}=i,d=document.getElementById(l);if(!d){console.error(`[mountAddonPage] Element #${l} not found`);return}(0,D.createRoot)(d).render((0,n.createElement)(Wd,{serverUrl:a,title:o,children:({trpc:f,theme:h})=>(0,n.createElement)(e,{trpc:f,theme:{isDark:h.resolvedMode==="dark"},navigate:g=>{console.log("[dev] navigate:",g)}})}))}var qd=_r("camstack:custom-field-renderers",{});function e0({renderers:e,children:i}){return(0,r.jsx)(qd.Provider,{value:e,children:i})}function Hd(e){return(0,n.useContext)(qd)[e]??null}var yl=_r("camstack:device-context",null);function t0({deviceId:e,device:i,children:a}){const o={deviceId:e,device:i??null};return(0,r.jsx)(yl.Provider,{value:o,children:a})}function Jd(){return(0,n.useContext)(yl)?.deviceId??null}function r0(){return(0,n.useContext)(yl)?.device??null}var n0=j.accessories.getStatus.useQuery,i0=j.addonPages.listPages.useQuery,Kd=j.addons.list.useQuery,a0=j.addons.getLogs.useQuery,o0=j.addons.listPackages.useQuery,s0=j.addons.installPackage.useMutation,l0=j.addons.installFromWorkspace.useMutation,c0=j.addons.isWorkspaceAvailable.useQuery,u0=j.addons.listWorkspacePackages.useQuery,d0=j.addons.uninstallPackage.useMutation,f0=j.addons.reloadPackages.useMutation,m0=j.addons.searchAvailable.useQuery,g0=j.addons.listUpdates.useQuery,p0=j.addons.updatePackage.useMutation,h0=j.addons.rollbackPackage.useMutation,v0=j.addons.forceRefresh.useMutation,b0=j.addons.restartServer.useMutation,y0=j.addons.getLastRestart.useQuery,x0=j.addons.listFrameworkPackages.useQuery,_0=j.addons.listCapabilityProviders.useQuery,w0=j.addons.setCapabilityProviderEnabled.useMutation,S0=j.addons.updateFrameworkPackage.useMutation,j0=j.addons.getVersions.useQuery,$0=j.addons.restartAddon.useMutation,k0=j.addons.retryLoad.useMutation,P0=j.addons.getAutoUpdateSettings.useQuery,N0=j.addons.setAutoUpdateSettings.useMutation,C0=j.addons.getAddonAutoUpdate.useQuery,O0=j.addons.setAddonAutoUpdate.useMutation,I0=j.addons.applyAutoUpdateToAll.useMutation,E0=j.addons.custom.useMutation,M0=j.addons.onAddonLogs.useSubscription,D0=j.addonSettings.getGlobalSettings.useQuery,A0=j.addonSettings.updateGlobalSettings.useMutation,z0=j.addonSettings.getDeviceSettings.useQuery,T0=j.addonSettings.updateDeviceSettings.useMutation,Xd=j.addonWidgets.listWidgets.useQuery,R0=j.alerts.emit.useMutation,Z0=j.alerts.update.useMutation,L0=j.alerts.list.useQuery,U0=j.alerts.getUnreadCount.useQuery,B0=j.alerts.markRead.useMutation,F0=j.alerts.markAllRead.useMutation,G0=j.alerts.dismiss.useMutation,V0=j.audioAnalysis.resolveDeviceSettings.useQuery,Q0=j.audioAnalysis.getDeviceSettingsContribution.useQuery,W0=j.audioAnalysis.getDeviceLiveContribution.useQuery,q0=j.audioAnalysis.applyDeviceSettingsPatch.useMutation,H0=j.audioAnalyzer.analyseChunk.useMutation,J0=j.audioAnalyzer.classify.useQuery,K0=j.audioAnalyzer.isReady.useQuery,X0=j.audioAnalyzer.dispose.useMutation,Y0=j.audioAnalyzer.reprobeAudioEngine.useMutation,ex=j.audioCodec.listSupportedCodecs.useQuery,tx=j.audioCodec.canHandle.useQuery,rx=j.audioCodec.createDecodeSession.useMutation,nx=j.audioCodec.createEncodeSession.useMutation,ix=j.audioCodec.closeSession.useMutation,ax=j.audioCodec.pushEncodedFrame.useMutation,ox=j.audioCodec.pullPcm.useQuery,sx=j.audioCodec.pushPcm.useMutation,lx=j.audioCodec.pullEncoded.useQuery,cx=j.audioCodec.flushEncode.useMutation,ux=j.audioCodec.listActiveSessions.useQuery,dx=j.audioMetrics.getCurrentSnapshot.useQuery,fx=j.audioMetrics.getHistory.useQuery,mx=j.backup.listDestinations.useQuery,gx=j.backup.trigger.useMutation,px=j.backup.list.useQuery,hx=j.backup.listLocations.useQuery,vx=j.backup.getEntries.useQuery,bx=j.backup.restore.useMutation,yx=j.backup.delete.useMutation,xx=j.backup.listArchives.useQuery,_x=j.backup.upsertDestinationPolicy.useMutation,wx=j.backup.previewSchedule.useQuery,Sx=j.battery.getStatus.useQuery,jx=j.brightness.setBrightness.useMutation,$x=j.brightness.getStatus.useQuery,kx=j.cameraCredentials.getCredentials.useQuery,Px=j.cameraCredentials.getStatus.useQuery,Nx=j.cameraStreams.getCameraStreams.useQuery,Cx=j.cameraStreams.getBrokerStreams.useQuery,Yd=j.cameraStreams.getRtspEntries.useQuery,Ox=j.decoder.supportsCodec.useQuery,Ix=j.decoder.getInfo.useQuery,Ex=j.decoder.createSession.useQuery,Mx=j.decoder.destroySession.useQuery,Dx=j.decoder.pushPacket.useQuery,Ax=j.decoder.openStream.useQuery,zx=j.decoder.pullFrames.useQuery,Tx=j.decoder.pullHandles.useQuery,Rx=j.decoder.getFrame.useQuery,Zx=j.decoder.getShmStats.useQuery,Lx=j.decoder.updateConfig.useQuery,Ux=j.decoder.getStats.useQuery,Bx=j.decoder.listActiveSessions.useQuery,Fx=j.decoder.reprobeHwaccel.useMutation,Gx=j.detectionPipeline.getDeviceSettingsContribution.useQuery,Vx=j.detectionPipeline.getDeviceLiveContribution.useQuery,Qx=j.detectionPipeline.applyDeviceSettingsPatch.useMutation,Wx=j.deviceDiscovery.listDiscovered.useQuery,qx=j.deviceDiscovery.refreshDiscovery.useMutation,Hx=j.deviceDiscovery.adoptDevice.useMutation,Jx=j.deviceDiscovery.releaseDevice.useMutation,Kx=j.deviceDiscovery.getStatus.useQuery,ef=j.deviceExport.getStatus.useQuery,Xx=j.deviceExport.listSupportedDeviceKinds.useQuery,tf=j.deviceExport.listExposedDevices.useQuery,Yx=j.deviceExport.exposeDevice.useMutation,rf=j.deviceExport.unexposeDevice.useMutation,e_=j.deviceExport.getDeviceSettingsContribution.useQuery,t_=j.deviceExport.getDeviceLiveContribution.useQuery,r_=j.deviceExport.applyDeviceSettingsPatch.useMutation,n_=j.deviceManager.allocateDeviceId.useMutation,i_=j.deviceManager.registerDevice.useMutation,a_=j.deviceManager.removeDevice.useMutation,o_=j.deviceManager.persistConfig.useMutation,s_=j.deviceManager.loadConfig.useQuery,l_=j.deviceManager.loadRuntimeState.useQuery,c_=j.deviceManager.loadMeta.useQuery,u_=j.deviceManager.setName.useMutation,d_=j.deviceManager.setLocation.useMutation,f_=j.deviceManager.setMetadata.useMutation,m_=j.deviceManager.listLocations.useQuery,g_=j.deviceManager.addLocation.useMutation,p_=j.deviceManager.removeLocation.useMutation,h_=j.deviceManager.setDisabled.useMutation,v_=j.deviceManager.listPersistedByAddon.useQuery,nf=j.deviceManager.listAll.useQuery,b_=j.deviceManager.getDevice.useQuery,y_=j.deviceManager.getChildren.useQuery,x_=j.deviceManager.getStreamSources.useQuery,__=j.deviceManager.getConfigSchema.useQuery,w_=j.deviceManager.getSettingsSchema.useQuery,S_=j.deviceManager.updateConfig.useMutation,j_=j.deviceManager.enable.useMutation,$_=j.deviceManager.disable.useMutation,k_=j.deviceManager.remove.useMutation,P_=j.deviceManager.getStreamProfileMap.useQuery,N_=j.deviceManager.setStreamProfileMap.useMutation,C_=j.deviceManager.probeStreams.useMutation,O_=j.deviceManager.getBindings.useQuery,I_=j.deviceManager.getAllBindings.useQuery,E_=j.deviceManager.setWrapperActive.useMutation,M_=j.deviceManager.listWrappersForCap.useQuery,D_=j.deviceManager.listBindableCapsForDeviceType.useQuery,A_=j.deviceManager.getDeviceSettingsAggregate.useQuery,z_=j.deviceManager.getDeviceLiveInfoAggregate.useQuery,T_=j.deviceManager.getDeviceAggregate.useQuery,R_=j.deviceManager.updateDeviceField.useMutation,Z_=j.deviceManager.updateDeviceFieldsBatch.useMutation,L_=j.deviceManager.discoverDevices.useMutation,U_=j.deviceManager.adoptDevice.useMutation,B_=j.deviceManager.getCreationSchema.useQuery,F_=j.deviceManager.createDevice.useMutation,G_=j.deviceManager.testCreationField.useMutation,V_=j.deviceManager.testField.useMutation,Q_=j.deviceManager.getDeviceStatusAggregate.useQuery,W_=j.deviceOps.getStreamSources.useQuery,q_=j.deviceOps.getConfigEntries.useQuery,H_=j.deviceOps.setConfig.useMutation,J_=j.deviceOps.removeDevice.useMutation,K_=j.deviceOps.getSettingsSchema.useQuery,X_=j.deviceProvider.start.useMutation,Y_=j.deviceProvider.stop.useMutation,e1=j.deviceProvider.getStatus.useQuery,t1=j.deviceProvider.getDevices.useQuery,r1=j.deviceProvider.supportsDiscovery.useQuery,n1=j.deviceProvider.discoverDevices.useMutation,i1=j.deviceProvider.adoptDiscoveredDevice.useMutation,a1=j.deviceProvider.supportsManualCreation.useQuery,o1=j.deviceProvider.getChildCreationSchema.useQuery,s1=j.deviceProvider.createDevice.useMutation,l1=j.deviceProvider.testCreationField.useMutation,c1=j.deviceState.getSnapshot.useQuery,u1=j.deviceState.getCapSlice.useQuery,d1=j.deviceState.getAllSnapshots.useQuery,f1=j.deviceState.setCapSlice.useMutation,m1=j.deviceStatus.getStatus.useQuery,g1=j.doorbell.getStatus.useQuery,p1=j.events.getEvents.useQuery,h1=j.events.getEventThumbnail.useQuery,v1=j.events.getEventClipUrl.useQuery,b1=j.featureProbe.getStatus.useQuery,y1=j.integrations.list.useQuery,x1=j.integrations.get.useQuery,_1=j.integrations.getByAddonId.useQuery,w1=j.integrations.create.useMutation,S1=j.integrations.update.useMutation,j1=j.integrations.delete.useMutation,$1=j.integrations.getSettings.useQuery,k1=j.integrations.setSettings.useMutation,P1=j.integrations.getAvailableTypes.useQuery,N1=j.integrations.testConnection.useMutation,C1=j.intercom.startSession.useMutation,O1=j.intercom.handleAnswer.useMutation,I1=j.intercom.stopSession.useMutation,E1=j.intercom.startTalkSession.useMutation,M1=j.intercom.pushTalkPcm.useMutation,D1=j.intercom.endTalkSession.useMutation,A1=j.intercom.getStatus.useQuery,z1=j.localNetwork.list.useQuery,T1=j.localNetwork.getPreferred.useQuery,R1=j.localNetwork.getConnectionEndpoints.useQuery,Z1=j.localNetwork.getAllowedAddresses.useQuery,L1=j.localNetwork.setAllowedAddresses.useMutation,U1=j.localNetwork.resetAllowlistToBestMatch.useMutation,B1=j.meshNetwork.getStatus.useQuery,F1=j.meshNetwork.join.useMutation,G1=j.meshNetwork.startLogin.useMutation,V1=j.meshNetwork.leave.useMutation,Q1=j.meshNetwork.logout.useMutation,W1=j.meshNetwork.listPeers.useQuery,q1=j.meshNetwork.testConnection.useMutation,H1=j.metricsProvider.collectSnapshot.useQuery,J1=j.metricsProvider.getCached.useQuery,K1=j.metricsProvider.getCurrent.useQuery,X1=j.metricsProvider.getDiskSpace.useQuery,Y1=j.metricsProvider.getGpuInfo.useQuery,ew=j.metricsProvider.getCpuTemperature.useQuery,tw=j.metricsProvider.getProcessStats.useQuery,rw=j.metricsProvider.listAddonInstances.useQuery,nw=j.metricsProvider.getAddonStats.useQuery,iw=j.metricsProvider.listNodeProcesses.useQuery,aw=j.metricsProvider.killProcess.useMutation,ow=j.motion.isDetected.useQuery,sw=j.motion.getStatus.useQuery,lw=j.motionDetection.analyze.useMutation,cw=j.motionDetection.removeCamera.useMutation,uw=j.motionDetection.reset.useMutation,dw=j.motionDetection.getDeviceSettingsContribution.useQuery,fw=j.motionDetection.getDeviceLiveContribution.useQuery,mw=j.motionDetection.applyDeviceSettingsPatch.useMutation,gw=j.motionTrigger.setMotionTrigger.useMutation,pw=j.motionTrigger.getStatus.useQuery,hw=j.motionZones.getOptions.useQuery,vw=j.motionZones.setZone.useMutation,bw=j.motionZones.getStatus.useQuery,yw=j.mqttBroker.listBrokers.useQuery,xw=j.mqttBroker.getBrokerConfig.useQuery,_w=j.mqttBroker.addBroker.useMutation,ww=j.mqttBroker.removeBroker.useMutation,Sw=j.mqttBroker.testConnection.useMutation,jw=j.mqttBroker.startEmbeddedBroker.useMutation,$w=j.mqttBroker.stopEmbeddedBroker.useMutation,kw=j.mqttBroker.getStatus.useQuery,Pw=j.nativeObjectDetection.getStatus.useQuery,Nw=j.networkAccess.start.useMutation,Cw=j.networkAccess.stop.useMutation,Ow=j.networkAccess.getEndpoint.useQuery,Iw=j.networkAccess.getStatus.useQuery,Ew=j.networkAccess.listEndpoints.useQuery,Mw=j.networkQuality.getDeviceStats.useQuery,Dw=j.networkQuality.getAllStats.useQuery,Aw=j.networkQuality.reportClientStats.useMutation,zw=j.nodes.topology.useQuery,Tw=j.nodes.deployAddon.useMutation,Rw=j.nodes.undeployAddon.useMutation,Zw=j.nodes.restartAddon.useMutation,Lw=j.nodes.restartProcess.useMutation,Uw=j.nodes.restartNode.useMutation,Bw=j.nodes.shutdownNode.useMutation,Fw=j.nodes.renameNode.useMutation,Gw=j.nodes.clusterAddonStatus.useQuery,Vw=j.nodes.getCapUsageGraph.useQuery,Qw=j.nodes.getNodeAddons.useQuery,Ww=j.nodes.setProcessLogLevel.useMutation,qw=j.nodes.executeQuery.useMutation,Hw=j.notificationOutput.send.useMutation,Jw=j.notificationOutput.sendTest.useMutation,Kw=j.osd.setOverlay.useMutation,Xw=j.osd.getStatus.useQuery,Yw=j.pipelineAnalytics.getActiveTracks.useQuery,eS=j.pipelineAnalytics.getTrack.useQuery,tS=j.pipelineAnalytics.listTracks.useQuery,rS=j.pipelineAnalytics.clearTracks.useMutation,nS=j.pipelineAnalytics.getMotionEvents.useQuery,iS=j.pipelineAnalytics.getObjectEvents.useQuery,aS=j.pipelineAnalytics.getAudioEvents.useQuery,oS=j.pipelineAnalytics.getEventMedia.useQuery,sS=j.pipelineAnalytics.getTrackMedia.useQuery,lS=j.pipelineAnalytics.getDeviceSettingsContribution.useQuery,cS=j.pipelineAnalytics.getDeviceLiveContribution.useQuery,uS=j.pipelineAnalytics.applyDeviceSettingsPatch.useMutation,dS=j.pipelineExecutor.getAvailableEngines.useQuery,fS=j.pipelineExecutor.getSelectedEngine.useQuery,mS=j.pipelineExecutor.getDefaultSteps.useQuery,gS=j.pipelineExecutor.reprobeEngine.useMutation,pS=j.pipelineExecutor.getVideoPipelineSteps.useQuery,hS=j.pipelineExecutor.setVideoPipelineSteps.useMutation,vS=j.pipelineExecutor.getSchema.useQuery,bS=j.pipelineExecutor.getGlobalSteps.useQuery,yS=j.pipelineExecutor.getGlobalPipelineConfig.useQuery,xS=j.pipelineExecutor.getOrchestratorConfigSchema.useQuery,_S=j.pipelineExecutor.listTemplates.useQuery,wS=j.pipelineExecutor.saveTemplate.useMutation,SS=j.pipelineExecutor.updateTemplate.useMutation,jS=j.pipelineExecutor.deleteTemplate.useMutation,$S=j.pipelineExecutor.getCapabilities.useQuery,kS=j.pipelineExecutor.getAddonModels.useQuery,PS=j.pipelineExecutor.downloadModel.useMutation,NS=j.pipelineExecutor.deleteModel.useMutation,CS=j.pipelineExecutor.detect.useQuery,OS=j.pipelineExecutor.runPipeline.useMutation,IS=j.pipelineExecutor.runPipelineBatch.useMutation,ES=j.pipelineExecutor.cacheFrameInPool.useMutation,MS=j.pipelineExecutor.inferCached.useMutation,DS=j.pipelineExecutor.uncacheFrame.useMutation,AS=j.pipelineExecutor.getEffectiveTuning.useQuery,zS=j.pipelineExecutor.listLoadedEngines.useQuery,TS=j.pipelineExecutor.spinEngine.useMutation,RS=j.pipelineExecutor.killEngine.useMutation,ZS=j.pipelineExecutor.listReferenceImages.useQuery,LS=j.pipelineExecutor.getReferenceImage.useQuery,US=j.pipelineExecutor.getReferenceAudioFiles.useQuery,BS=j.pipelineExecutor.getReferenceAudio.useQuery,FS=j.pipelineExecutor.getAudioCapabilities.useQuery,GS=j.pipelineExecutor.runAudioTest.useMutation,VS=j.pipelineExecutor.getDetectionConfigSchema.useQuery,QS=j.pipelineOrchestrator.assignPipeline.useMutation,WS=j.pipelineOrchestrator.unassignPipeline.useMutation,qS=j.pipelineOrchestrator.rebalance.useMutation,HS=j.pipelineOrchestrator.getPipelineAssignments.useQuery,JS=j.pipelineOrchestrator.getPipelineAssignment.useQuery,KS=j.pipelineOrchestrator.getAgentLoad.useQuery,XS=j.pipelineOrchestrator.getGlobalMetrics.useQuery,YS=j.pipelineOrchestrator.getCameraMetrics.useQuery,ej=j.pipelineOrchestrator.getCapabilityBindings.useQuery,tj=j.pipelineOrchestrator.setCapabilityBinding.useMutation,rj=j.pipelineOrchestrator.assignDecoder.useMutation,nj=j.pipelineOrchestrator.unassignDecoder.useMutation,ij=j.pipelineOrchestrator.getDecoderAssignments.useQuery,aj=j.pipelineOrchestrator.assignAudio.useMutation,oj=j.pipelineOrchestrator.unassignAudio.useMutation,sj=j.pipelineOrchestrator.getAudioAssignment.useQuery,lj=j.pipelineOrchestrator.getAudioNodeLoad.useQuery,cj=j.pipelineOrchestrator.getAudioAssignments.useQuery,uj=j.pipelineOrchestrator.getDecoderAssignment.useQuery,dj=j.pipelineOrchestrator.getAgentSettings.useQuery,fj=j.pipelineOrchestrator.listAgentSettings.useQuery,mj=j.pipelineOrchestrator.setAgentAddonDefaults.useMutation,gj=j.pipelineOrchestrator.removeAgentSettings.useMutation,pj=j.pipelineOrchestrator.getCameraSettings.useQuery,hj=j.pipelineOrchestrator.setCameraStepToggle.useMutation,vj=j.pipelineOrchestrator.getCameraStepOverrides.useQuery,bj=j.pipelineOrchestrator.setCameraStepOverride.useMutation,yj=j.pipelineOrchestrator.setCameraPipelineForAgent.useMutation,xj=j.pipelineOrchestrator.resolvePipeline.useQuery,_j=j.pipelineOrchestrator.listTemplates.useQuery,wj=j.pipelineOrchestrator.saveTemplate.useMutation,Sj=j.pipelineOrchestrator.updateTemplate.useMutation,jj=j.pipelineOrchestrator.deleteTemplate.useMutation,$j=j.pipelineOrchestrator.getDeviceSettingsContribution.useQuery,kj=j.pipelineOrchestrator.getDeviceLiveContribution.useQuery,Pj=j.pipelineOrchestrator.applyDeviceSettingsPatch.useMutation,Nj=j.pipelineRunner.attachCamera.useMutation,Cj=j.pipelineRunner.detachCamera.useMutation,Oj=j.pipelineRunner.reportMotion.useMutation,Ij=j.pipelineRunner.getLocalLoad.useQuery,Ej=j.pipelineRunner.getLocalMetrics.useQuery,Mj=j.pipelineRunner.getCameraMetrics.useQuery,Dj=j.pipelineRunner.getAllCameraMetrics.useQuery,Aj=j.pipelineRunner.getLocalCameras.useQuery,zj=j.platformProbe.getCapabilities.useQuery,Tj=j.platformProbe.getHardware.useQuery,Rj=j.platformProbe.resolveInferenceConfig.useQuery,Zj=j.platformProbe.resolveHwAccel.useQuery,Lj=j.platformProbe.getHardwareEncoders.useQuery,Uj=j.platformProbe.refreshHardwareEncoders.useMutation,Bj=j.ptz.move.useMutation,Fj=j.ptz.continuousMove.useMutation,Gj=j.ptz.stop.useMutation,Vj=j.ptz.getPresets.useQuery,Qj=j.ptz.goToPreset.useMutation,Wj=j.ptz.savePreset.useMutation,qj=j.ptz.deletePreset.useMutation,Hj=j.ptz.getOptions.useQuery,Jj=j.ptz.goHome.useMutation,Kj=j.ptz.getPosition.useQuery,Xj=j.ptz.setAutofocus.useMutation,Yj=j.ptz.getStatus.useQuery,af=j.ptzAutotrack.getStatus.useQuery,of=j.ptzAutotrack.setEnabled.useMutation,e$=j.ptzAutotrack.getSettings.useQuery,sf=j.ptzAutotrack.setSettings.useMutation,t$=j.reboot.reboot.useMutation,r$=j.recording.getSegments.useQuery,n$=j.recording.getPlaybackUrl.useQuery,i$=j.recording.getThumbnailAt.useQuery,a$=j.recordingEngine.getStatus.useQuery,o$=j.recordingEngine.enable.useMutation,s$=j.recordingEngine.disable.useMutation,l$=j.recordingEngine.getConfig.useQuery,c$=j.recordingEngine.updateConfig.useMutation,u$=j.recordingEngine.getPlaylist.useQuery,d$=j.recordingEngine.getThumbnail.useQuery,f$=j.recordingEngine.getSegments.useQuery,m$=j.recordingEngine.getAvailability.useQuery,g$=j.recordingEngine.estimateStorage.useQuery,p$=j.recordingEngine.estimateGlobalStorage.useQuery,h$=j.recordingEngine.getStorageUsage.useQuery,v$=j.recordingEngine.setPolicy.useMutation,b$=j.recordingEngine.getPolicy.useQuery,y$=j.recordingEngine.getPolicyStatus.useQuery,x$=j.recordingEngine.getRetentionConfig.useQuery,_$=j.recordingEngine.updateRetentionConfig.useMutation,w$=j.recordingEngine.getMotionStats.useQuery,S$=j.settingsStore.get.useQuery,j$=j.settingsStore.set.useMutation,$$=j.settingsStore.query.useQuery,k$=j.settingsStore.insert.useMutation,P$=j.settingsStore.update.useMutation,N$=j.settingsStore.delete.useMutation,C$=j.settingsStore.count.useQuery,O$=j.settingsStore.isEmpty.useQuery,I$=j.settingsStore.declareCollection.useMutation,E$=j.snapshot.getSnapshot.useQuery,M$=j.snapshot.invalidateCache.useMutation,D$=j.snapshot.getStatus.useQuery,A$=j.snapshot.getDeviceSettingsContribution.useQuery,z$=j.snapshot.getDeviceLiveContribution.useQuery,T$=j.snapshot.applyDeviceSettingsPatch.useMutation,R$=j.snapshotProvider.supportsDevice.useQuery,Z$=j.snapshotProvider.getSnapshot.useQuery,L$=j.storage.resolve.useQuery,U$=j.storage.write.useMutation,B$=j.storage.read.useQuery,F$=j.storage.exists.useQuery,G$=j.storage.list.useQuery,V$=j.storage.delete.useMutation,Q$=j.storage.getAvailableSpace.useQuery,W$=j.storage.beginUpload.useMutation,q$=j.storage.writeChunk.useMutation,H$=j.storage.finalizeUpload.useMutation,J$=j.storage.abortUpload.useMutation,K$=j.storage.beginDownload.useMutation,X$=j.storage.readChunk.useQuery,Y$=j.storage.endDownload.useMutation,ek=j.storage.listLocations.useQuery,tk=j.storage.getDefaultLocation.useQuery,rk=j.storage.upsertLocation.useMutation,nk=j.storage.deleteLocation.useMutation,ik=j.storage.testLocation.useQuery,ak=j.storage.listProviders.useQuery,ok=j.storage.testConfig.useQuery,sk=j.streamBroker.publishCameraStream.useMutation,lk=j.streamBroker.retractCameraStream.useMutation,ck=j.streamBroker.assignProfile.useMutation,uk=j.streamBroker.unassignProfile.useMutation,dk=j.streamBroker.listAllCameraStreams.useQuery,fk=j.streamBroker.listAllProfileSlots.useQuery,mk=j.streamBroker.getBrokerStats.useQuery,gk=j.streamBroker.listClients.useQuery,pk=j.streamBroker.killClient.useMutation,hk=j.streamBroker.restartProfile.useMutation,vk=j.streamBroker.getStreamUrl.useQuery,bk=j.streamBroker.getStreamWithCodec.useMutation,yk=j.streamBroker.releaseStreamWithCodec.useMutation,xk=j.streamBroker.subscribeAudioChunks.useMutation,_k=j.streamBroker.pullAudioChunks.useQuery,wk=j.streamBroker.unsubscribeAudioChunks.useMutation,Sk=j.streamBroker.subscribeFrames.useMutation,jk=j.streamBroker.pullFrameHandles.useQuery,$k=j.streamBroker.unsubscribeFrames.useMutation,kk=j.streamBroker.setPreBufferDuration.useMutation,Pk=j.streamBroker.getPreBufferInfo.useQuery,Nk=j.streamBroker.getRtspPort.useQuery,Ck=j.streamBroker.getAllRtspEntries.useQuery,Ok=j.streamBroker.getRtspEntry.useQuery,Ik=j.streamBroker.regenerateRtspToken.useMutation,Ek=j.streamBroker.setRtspEnabled.useMutation,Mk=j.streamBroker.isRtspEnabled.useQuery,Dk=j.streamBroker.getDeviceSettingsContribution.useQuery,Ak=j.streamBroker.getDeviceLiveContribution.useQuery,zk=j.streamBroker.applyDeviceSettingsPatch.useMutation,Tk=j.streamParams.getOptions.useQuery,Rk=j.streamParams.setProfile.useMutation,Zk=j.streamParams.getConfigSchema.useQuery,Lk=j.streamParams.getStatus.useQuery,Uk=j.switch.setState.useMutation,Bk=j.switch.getStatus.useQuery,Fk=j.system.info.useQuery,Gk=j.system.health.useQuery,Vk=j.system.featureFlags.useQuery,Qk=j.system.networkAddresses.useQuery,Wk=j.system.getRetentionConfig.useQuery,qk=j.system.setRetentionConfig.useMutation,Hk=j.system.forceRetentionCleanup.useMutation,Jk=j.toast.onToast.useSubscription,Kk=j.turnProvider.getTurnServers.useQuery,Xk=j.userManagement.listUsers.useQuery,Yk=j.userManagement.createUser.useMutation,eP=j.userManagement.updateUser.useMutation,tP=j.userManagement.deleteUser.useMutation,rP=j.userManagement.resetPassword.useMutation,nP=j.userManagement.setUserScopes.useMutation,iP=j.userManagement.validateCredentials.useMutation,aP=j.userManagement.listApiKeys.useQuery,oP=j.userManagement.createApiKey.useMutation,sP=j.userManagement.revokeApiKey.useMutation,lP=j.userManagement.validateApiKey.useMutation,cP=j.userManagement.createScopedToken.useMutation,uP=j.userManagement.revokeScopedToken.useMutation,dP=j.userManagement.validateScopedToken.useQuery,fP=j.userManagement.listScopedTokens.useQuery,mP=j.userManagement.setupTotp.useMutation,gP=j.userManagement.confirmTotp.useMutation,pP=j.userManagement.disableTotp.useMutation,hP=j.userManagement.getTotpStatus.useQuery,vP=j.userManagement.verifyTotp.useMutation,bP=j.userManagement.oauthIssueCode.useMutation,yP=j.userManagement.oauthExchangeCode.useMutation,xP=j.userManagement.oauthRefresh.useMutation,_P=j.userManagement.oauthVerifyAccessToken.useQuery,wP=j.userManagement.listOauthSessions.useQuery,SP=j.userManagement.revokeOauthSession.useMutation,jP=j.webrtcSession.listStreams.useQuery,$P=j.webrtcSession.createSession.useMutation,kP=j.webrtcSession.handleOffer.useMutation,PP=j.webrtcSession.handleAnswer.useMutation,NP=j.webrtcSession.closeSession.useMutation,CP=j.webrtcSession.hasAdaptiveBitrate.useQuery,OP=j.zoneAnalytics.getCurrentSnapshot.useQuery,IP=j.zoneAnalytics.getZoneHistory.useQuery,EP=j.zoneAnalytics.getCameraHistory.useQuery,MP=j.zoneAnalytics.getUnzonedHistory.useQuery,DP=j.zoneRules.listRules.useQuery,AP=j.zoneRules.setRules.useMutation,zP=j.zones.listZones.useQuery,TP=j.zones.addZone.useMutation,RP=j.zones.removeZone.useMutation,ZP=j.zones.updateZone.useMutation,lf=_r("camstack:widget-registry",null),Aa=new Map,za=new Map,cf=new Set;function xl(e,i){return`${e}::${i}`}function LP(e){if(!e||typeof e!="object")return!1;const i=e.default;return i!==null&&typeof i=="object"}function UP(e){if(!e||typeof e!="object")return typeof e;const i=e,a=Object.getPrototypeOf(i),o=a&&typeof a=="object"?a.constructor?.name:void 0;return{ownKeys:Object.keys(i),allKeys:Object.getOwnPropertyNames(i),proto:typeof o=="string"?o:void 0}}async function _l(e,i,a){const o=xl(e,i),l=Aa.get(o);if(l)return l;const d=za.get(o);if(d)return d;cf.has(e)||(Zc(),Vp([{name:e,entry:a,type:"module"}],{force:!1}),cf.add(e));const f=Gp(`${e}/${i.startsWith("./")?i.slice(2):i}`).then(h=>{if(!LP(h)){const v=UP(h);throw new Error(`Remote ${e} (${a}) does not expose a default record on '${i}'. Got: ${JSON.stringify(v)}`)}const g=h.default;return Aa.set(o,g),za.delete(o),g}).catch(h=>{throw za.delete(o),h});return za.set(o,f),f}function wl(e,i){return Aa.get(xl(e,i))}var BP=3e4,FP=2e3;function GP({children:e}){const i=(0,ee.useQueryClient)(),a=(0,n.useRef)(Date.now()),{data:o}=Xd(void 0,{staleTime:0,refetchOnMount:"always",refetchInterval:g=>{const v=g.state.data;return v&&v.length>0||Date.now()-a.current>=BP?!1:FP}});Ui("addon.widget-ready",()=>{i.invalidateQueries({queryKey:[["addonWidgets","listWidgets"]]})});const[l,d]=(0,n.useState)(0),f=(0,n.useMemo)(()=>o??[],[o]);(0,n.useEffect)(()=>{if(f.length===0)return;let g=!1;const v=new Set;for(const b of f){const w=xl(b.remote.remoteName,b.remote.exposedModule);if(v.has(w)||(v.add(w),Aa.has(w)))continue;const k=b.bundleUrl;_l(b.remote.remoteName,b.remote.exposedModule,k).then(()=>{g||d(O=>O+1)}).catch(O=>{const E=O instanceof Error?O.message:String(O);(typeof globalThis<"u"?globalThis.console:void 0)?.error?.("[WidgetRegistry] Failed to load widget remote",{remoteName:b.remote.remoteName,exposedModule:b.remote.exposedModule,entryUrl:k,reason:E})})}return()=>{g=!0}},[f]);const h=(0,n.useMemo)(()=>{const g=new Map,v=new Map;for(const w of f)g.set(`${w.addonId}/${w.stableId}`,w),v.set(w.remote.remoteName,w.bundleUrl);const b=(w,k)=>({widgetId:w,addonId:k.addonId,stableId:k.stableId,tab:k.tab,subTab:k.subTab,label:k.label,order:k.order,kind:k.kind,remote:k.remote,description:k.description,icon:k.icon,bundleUrl:k.bundleUrl,hosts:k.hosts,requires:k.requires,defaultSize:k.defaultSize,allowedSizes:k.allowedSizes,defaultColumns:k.defaultColumns,defaultRows:k.defaultRows});return{resolve:w=>{const k=g.get(w);if(!k)return;const O=wl(k.remote.remoteName,k.remote.exposedModule);if(!O)return null;const E=O[k.remote.componentKey??k.stableId];if(E)return E},metadata:w=>{const k=g.get(w);if(k)return b(w,k)},listAll:()=>{const w=[];for(const[k,O]of g)w.push(b(k,O));return w},entryUrlFor:w=>v.get(w)}},[f,l]);return(0,r.jsx)(lf.Provider,{value:h,children:e})}function VP(e){return Ta().resolve(e)}function uf(e){return Ta().metadata(e)}function QP(){return Ta().listAll()}function df(e,i){const a=Sl(),o=i??a?.entryUrlFor(e.remoteName),[l,d]=(0,n.useState)(0),[f,h]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(!o||(h(!1),wl(e.remoteName,e.exposedModule)))return;let g=!1;return _l(e.remoteName,e.exposedModule,o).then(()=>{g||d(v=>v+1)}).catch(v=>{const b=v instanceof Error?v.message:String(v);(typeof globalThis<"u"?globalThis.console:void 0)?.error?.("[WidgetRegistry] Failed to load remote component",{remoteName:e.remoteName,exposedModule:e.exposedModule,entryUrl:o,reason:b}),g||h(!0)}),()=>{g=!0}},[e.remoteName,e.exposedModule,o]),(0,n.useMemo)(()=>{if(!o||f)return;const g=wl(e.remoteName,e.exposedModule);if(!g)return null;const v=e.componentKey;return v===void 0?Object.values(g)[0]??void 0:g[v]??void 0},[e.remoteName,e.exposedModule,e.componentKey,o,l,f])}function Ta(){const e=Sl();if(!e)throw new Error("useWidgetRegistry(): no <WidgetRegistryProvider> in tree");return e}function Sl(){return WP(lf)}function WP(e){return(0,n.useContext)(e)}var ff={up:{pan:0,tilt:1},down:{pan:0,tilt:-1},left:{pan:-1,tilt:0},right:{pan:1,tilt:0},"up-left":{pan:-1,tilt:1},"up-right":{pan:1,tilt:1},"down-left":{pan:-1,tilt:-1},"down-right":{pan:1,tilt:-1}};function mf(e,i,a){const o=a?.defaultSpeed??.5,l=a?.pulseMs??250,d=a?.enabled??!0,f=Hr(e,d?i:null)?.ptz,[h,g]=(0,n.useState)([]),[v,b]=(0,n.useState)(null),[w,k]=(0,n.useState)(!1),[O,E]=(0,n.useState)(null),A=G=>{const H=G instanceof Error?G.message:String(G);return H.includes("provider not available")||H.includes("no 'ptz' binding")},R=(0,n.useCallback)(async()=>{if(!(!d||!f))try{g(await f.getPresets({}))}catch(G){if(A(G))return;E(G instanceof Error?G.message:String(G))}},[f,d]),Z=(0,n.useCallback)(async()=>{if(!(!d||!f))try{b(await f.getOptions({}))}catch(G){if(A(G))return;E(G instanceof Error?G.message:String(G))}},[f,d]);(0,n.useEffect)(()=>{R(),Z()},[R,Z]);const V=(0,n.useCallback)(async G=>{if(!(!d||!f)){E(null),k(!0);try{return await G()}catch(H){E(H instanceof Error?H.message:String(H));return}finally{k(!1)}}},[d,f]);return{move:(0,n.useCallback)(async(G,H)=>{if(!f)return;const J=ff[G],X=H??o;await V(async()=>{await f.move({pan:J.pan,tilt:J.tilt,speed:X}),await new Promise(me=>setTimeout(me,l)),await f.stop({})})},[f,o,l,V]),startContinuous:(0,n.useCallback)(async(G,H)=>{if(!f)return;const J=ff[G],X=H??o;await V(()=>f.continuousMove({pan:J.pan,tilt:J.tilt,speed:X}))},[f,o,V]),stopContinuous:(0,n.useCallback)(async()=>{f&&await V(()=>f.stop({}))},[f,V]),zoom:(0,n.useCallback)(async(G,H)=>{if(!f)return;const J=G==="in"?1:-1,X=H??o;await V(async()=>{await f.move({zoom:J,speed:X}),await new Promise(me=>setTimeout(me,l)),await f.stop({})})},[f,o,l,V]),goHome:(0,n.useCallback)(async()=>{f&&await V(()=>f.goHome({}))},[f,V]),goToPreset:(0,n.useCallback)(async G=>{f&&await V(()=>f.goToPreset({presetId:G}))},[f,V]),savePreset:(0,n.useCallback)(async G=>{if(f)return V(async()=>{const H=new Set(h.map(me=>Number(me.id)).filter(me=>Number.isInteger(me)&&me>=0));let J=0;for(;H.has(J);)J+=1;const X=String(J);return await f.savePreset({presetId:X,name:G}),await R(),X})},[f,h,R,V]),deletePreset:(0,n.useCallback)(async G=>{f&&await V(async()=>{await f.deletePreset({presetId:G}),await R()})},[f,R,V]),presets:h,refreshPresets:R,options:v,busy:w,error:O}}function Ra({direction:e,icon:i,disabled:a,className:o,variant:l,onMove:d,onStart:f,onStop:h}){const[g,v]=(0,n.useState)(null),[b,w]=(0,n.useState)(!1),k=(0,n.useCallback)(Z=>{if(a)return;Z.currentTarget.setPointerCapture(Z.pointerId),v(Date.now()),w(!1);const V=setTimeout(()=>{w(!0),f(e)},250);Z.currentTarget.dataset.timer=String(V)},[e,a,f]),O=(0,n.useCallback)(Z=>{const V=Number(Z.currentTarget.dataset.timer);V&&clearTimeout(V),Z.currentTarget.dataset.timer="",b?h():g!==null&&d(e),v(null),w(!1)},[b,e,d,h,g]),E=(0,n.useCallback)(Z=>{const V=Number(Z.currentTarget.dataset.timer);V&&clearTimeout(V),Z.currentTarget.dataset.timer="",b&&h(),v(null),w(!1)},[b,h]),A=l==="panel"?"h-9 w-9":"h-7 w-7",R=l==="panel"?"h-4 w-4":"h-3.5 w-3.5";return(0,r.jsx)("button",{type:"button",disabled:a,onPointerDown:k,onPointerUp:O,onPointerCancel:E,className:P("flex items-center justify-center rounded transition-colors disabled:opacity-40",l==="panel"?"text-foreground hover:bg-surface-hover active:bg-surface-hover/80":"text-white hover:bg-white/15 active:bg-white/25",A,o),title:e,children:(0,r.jsx)(i,{className:R})})}function gf({controls:e,mode:i="overlay",showPresets:a,showZoom:o=!0,showHome:l=!0,className:d}){const{move:f,startContinuous:h,stopContinuous:g,zoom:v,goHome:b,goToPreset:w,savePreset:k,deletePreset:O,presets:E,options:A,busy:R,error:Z}=e,V=Bi(),[G,H]=(0,n.useState)(!1),[J,X]=(0,n.useState)(""),me=(a??E.length>0)&&E.length>0,ae=i==="panel",Ae=ae&&(A?.supportsPresets??!1),De=A?.maxPresets!==void 0&&E.length>=A.maxPresets,qe=(0,n.useCallback)(async()=>{const Re=J.trim();!Re||R||De||await k(Re)!==void 0&&X("")},[J,R,De,k]),ot=(0,n.useCallback)(async(Re,we)=>{await V({title:"Delete preset",message:`Delete PTZ preset "${we}"? This removes it from the camera.`,confirmLabel:"Delete",variant:"danger"})&&await O(Re)},[V,O]),Ve=ae?"flex flex-col items-stretch gap-2 w-full h-full p-3":"pointer-events-auto absolute top-3 right-3 z-10 flex flex-col items-end gap-2",We=P(ae?"flex items-center gap-3 rounded-lg p-2":"flex items-center gap-2 rounded-lg border border-white/30 bg-zinc-900/90 backdrop-blur-md p-2 shadow-lg shadow-black/40",R&&"ring-1 ring-primary/40"),Qe=ae?"h-9 w-9":"h-7 w-7",Le=ae?"h-4 w-4":"h-3.5 w-3.5",Te=ae?"text-foreground hover:bg-surface-hover":"text-white hover:bg-white/15",st=ae?"h-12 w-px bg-border mx-1":"h-12 w-px bg-white/15 mx-1";return(0,r.jsxs)("div",{className:P(Ve,d),children:[Z&&(0,r.jsxs)("div",{className:"rounded bg-danger/90 px-2 py-1 text-[10px] font-medium text-white shadow-lg max-w-[200px] self-center",children:["PTZ: ",Z]}),(0,r.jsxs)("div",{className:P(We,ae&&"justify-center"),children:[(0,r.jsxs)("div",{className:"grid grid-cols-3 gap-0.5",children:[(0,r.jsx)("span",{"aria-hidden":!0,className:ae?"h-9 w-9":"h-7 w-7"}),(0,r.jsx)(Ra,{direction:"up",icon:ih,variant:i,onMove:f,onStart:h,onStop:g}),(0,r.jsx)("span",{"aria-hidden":!0,className:ae?"h-9 w-9":"h-7 w-7"}),(0,r.jsx)(Ra,{direction:"left",icon:rh,variant:i,onMove:f,onStart:h,onStop:g}),(0,r.jsx)("span",{"aria-hidden":!0,className:ae?"h-9 w-9":"h-7 w-7"}),(0,r.jsx)(Ra,{direction:"right",icon:nh,variant:i,onMove:f,onStart:h,onStop:g}),(0,r.jsx)("span",{"aria-hidden":!0,className:ae?"h-9 w-9":"h-7 w-7"}),(0,r.jsx)(Ra,{direction:"down",icon:th,variant:i,onMove:f,onStart:h,onStop:g}),(0,r.jsx)("span",{"aria-hidden":!0,className:ae?"h-9 w-9":"h-7 w-7"})]}),(o||l)&&(0,r.jsx)("div",{className:st}),(0,r.jsxs)("div",{className:"flex flex-col gap-0.5",children:[o&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{type:"button",onClick:()=>v("in"),disabled:R,title:"Zoom in",className:P("flex items-center justify-center rounded disabled:opacity-40",Qe,Te),children:(0,r.jsx)(Hh,{className:Le})}),(0,r.jsx)("button",{type:"button",onClick:()=>v("out"),disabled:R,title:"Zoom out",className:P("flex items-center justify-center rounded disabled:opacity-40",Qe,Te),children:(0,r.jsx)(Jh,{className:Le})})]}),l&&(0,r.jsx)("button",{type:"button",onClick:()=>b(),disabled:R,title:"Go home",className:P("flex items-center justify-center rounded disabled:opacity-40",Qe,Te),children:(0,r.jsx)(qc,{className:Le})})]}),me&&(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>H(Re=>!Re),disabled:R,className:P("flex items-center gap-1 rounded px-2 text-[10px] disabled:opacity-40",ae?"h-9 text-foreground hover:bg-surface-hover":"h-7 text-white hover:bg-white/15"),title:"Presets",children:["Presets",(0,r.jsx)(Wr,{className:P("h-3 w-3 transition-transform",G&&"rotate-180")})]}),G&&(0,r.jsx)("div",{className:P("absolute right-0 top-full mt-1 min-w-[140px] rounded-lg shadow-xl py-1 z-20",ae?"bg-surface border border-border":"border border-white/30 bg-zinc-900/95 backdrop-blur-md"),children:E.map(Re=>(0,r.jsxs)("div",{className:P("group flex items-center",ae?"hover:bg-surface-hover":"hover:bg-white/15"),children:[(0,r.jsx)("button",{type:"button",onClick:()=>{w(Re.id),H(!1)},disabled:R,className:P("flex-1 px-3 py-1.5 text-left text-[10px] disabled:opacity-40",ae?"text-foreground":"text-white"),children:Re.name||Re.id}),Ae&&(0,r.jsx)("button",{type:"button",onClick:()=>void ot(Re.id,Re.name||Re.id),disabled:R,title:`Delete preset ${Re.name||Re.id}`,className:P("mr-1 flex h-5 w-5 shrink-0 items-center justify-center rounded","text-foreground-subtle hover:bg-danger/15 hover:text-danger disabled:opacity-40"),children:(0,r.jsx)(It,{className:"h-3 w-3"})})]},Re.id))})]})]}),Ae&&(0,r.jsxs)("div",{className:"flex flex-col gap-1 rounded-lg border border-border p-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"text",value:J,onChange:Re=>X(Re.target.value),onKeyDown:Re=>{Re.key==="Enter"&&qe()},disabled:R||De,placeholder:"New preset name",maxLength:64,className:P("min-w-0 flex-1 rounded border border-border bg-surface px-2 py-1 text-[11px] text-foreground","placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary/50","disabled:opacity-40")}),(0,r.jsxs)("button",{type:"button",onClick:()=>void qe(),disabled:R||De||J.trim().length===0,title:De?`Camera preset limit reached (${A?.maxPresets})`:"Save current position as a new preset",className:P("flex h-7 shrink-0 items-center gap-1 rounded px-2 text-[10px] font-medium","bg-primary/15 text-primary hover:bg-primary/25 disabled:opacity-40"),children:[(0,r.jsx)(hn,{className:"h-3 w-3"}),"Save current position"]})]}),De&&(0,r.jsxs)("span",{className:"text-[10px] text-foreground-subtle",children:["Camera preset limit reached (",A?.maxPresets,"). Delete a preset to add a new one."]})]})]})}function qP({deviceId:e}){const i=Hr(mr().trpcClient,e),[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!i)return;let h=!1;return(async()=>{try{const g=await i.ptz?.getStatus({});if(h||!g)return;o(g.autofocus)}catch{}})(),()=>{h=!0}},[i]);const f=(0,n.useCallback)(async()=>{if(!(!i?.ptz||a===null)){d(!0);try{const h=!a;await i.ptz.setAutofocus({enabled:h}),o(h)}catch(h){console.error("ptz.setAutofocus failed",h)}finally{d(!1)}}},[i,a]);return a===null?null:(0,r.jsxs)("div",{className:"flex items-center justify-between border-t border-border/40 mt-2 pt-2",children:[(0,r.jsx)("span",{className:"text-[10.5px] font-semibold text-foreground",children:"Autofocus"}),(0,r.jsxs)("button",{type:"button",onClick:()=>void f(),disabled:l,"aria-pressed":a,className:`flex items-center gap-1.5 rounded-md px-2 py-1 text-[10px] font-medium transition-colors ${a?"bg-success/15 text-success hover:bg-success/25":"bg-surface-elevated/40 text-foreground-subtle hover:bg-surface-hover hover:text-foreground"} disabled:opacity-50`,children:[(0,r.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${a?"bg-success":"bg-foreground-subtle/40"}`}),a?"On":"Off"]})]})}function pf({deviceId:e}){const i=mr(),a=Number.isFinite(e),o=mf(i.trpcClient,a?e:0,{enabled:a});if(!a)return(0,r.jsxs)("div",{className:"flex items-center justify-center h-full text-[11px] text-foreground-subtle italic",children:["Device #",e," not loaded."]});const l=o.options?.hasAutofocus===!0;return(0,r.jsxs)("div",{className:"flex flex-col h-full overflow-y-auto",children:[(0,r.jsx)("h3",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wider mb-2",children:"PTZ"}),(0,r.jsx)(gf,{controls:o,mode:"panel"}),l&&(0,r.jsx)(qP,{deviceId:e})]})}function hf(e){const i=(0,ee.useQueryClient)(),a=af({deviceId:e??0},{enabled:e!==null&&Number.isFinite(e),refetchInterval:5e3,retry:1}),o=of({onSuccess:()=>{i.invalidateQueries({queryKey:[["ptzAutotrack"]]})}}),l=sf({onSuccess:()=>{i.invalidateQueries({queryKey:[["ptzAutotrack"]]})}}),d=(0,n.useCallback)(async g=>{e!==null&&await o.mutateAsync({deviceId:e,enabled:g})},[e,o]),f=(0,n.useCallback)(async g=>{e!==null&&await l.mutateAsync({deviceId:e,settings:g})},[e,l]),h=a.error?a.error.message:o.error?o.error.message:l.error?l.error.message:null;return{status:a.data??null,isLoading:a.isLoading,isPending:o.isPending||l.isPending,error:h,setEnabled:d,setSettings:f}}function vf({deviceId:e}){const{status:i,isLoading:a,isPending:o,error:l,setEnabled:d,setSettings:f}=hf(Number.isFinite(e)?e:null),[h,g]=(0,n.useState)({targetType:"",stopDelaySeconds:30,disappearDelaySeconds:15}),[v,b]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{if(v)return;const w=i?.currentSettings;w&&g({targetType:w.targetType,stopDelaySeconds:w.stopDelaySeconds,disappearDelaySeconds:w.disappearDelaySeconds})},[i,v]),a&&!i?(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 text-[10.5px] text-foreground-subtle",children:[(0,r.jsx)(Gt,{className:"h-3 w-3 animate-spin"}),"Loading autotrack…"]}):(0,r.jsxs)("div",{className:"border-t border-border/40 mt-2 pt-2 px-1 space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-2",children:[(0,r.jsxs)("h3",{className:"flex items-center gap-1.5 text-[11px] font-semibold text-foreground-subtle uppercase tracking-wider",children:[(0,r.jsx)(zs,{className:"h-3 w-3 text-primary"}),"Autotrack"]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{d(!(i?.enabled??!1))},disabled:o,className:`flex items-center gap-1.5 rounded-md px-2 py-1 text-[10px] font-medium transition-colors ${i?.enabled?"bg-success/15 text-success hover:bg-success/25":"bg-surface-elevated/40 text-foreground-subtle hover:bg-surface-hover hover:text-foreground"} disabled:opacity-50`,"aria-pressed":i?.enabled??!1,children:[(0,r.jsx)("span",{className:`h-1.5 w-1.5 rounded-full ${i?.enabled?"bg-success":"bg-foreground-subtle/40"}`}),i?.enabled?"Enabled":"Disabled"]})]}),l&&(0,r.jsxs)("div",{className:"flex items-start gap-1.5 rounded-md border border-danger/30 bg-danger/5 px-2 py-1.5 text-[10px] text-danger",children:[(0,r.jsx)(gn,{className:"h-3 w-3 flex-shrink-0 mt-0.5"}),(0,r.jsx)("span",{className:"leading-snug break-words",children:l})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-2",children:[(i?.supportedTargetTypes?.length??0)>0&&(0,r.jsxs)("label",{className:"col-span-2 flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-[10px] font-medium text-foreground-subtle",children:"Target type"}),(0,r.jsx)("select",{value:h.targetType,onFocus:()=>b(!0),onChange:w=>g(k=>({...k,targetType:w.target.value})),onBlur:()=>{b(!1);const w=i?.currentSettings?.targetType??"";h.targetType!==w&&f({targetType:h.targetType})},disabled:o,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:border-primary focus:outline-none disabled:opacity-50",children:(i?.supportedTargetTypes??[]).map(w=>(0,r.jsx)("option",{value:w.value,children:w.label},w.value))})]}),(0,r.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-[10px] font-medium text-foreground-subtle",children:"Stop delay (s)"}),(0,r.jsx)("input",{type:"number",min:0,max:300,value:h.stopDelaySeconds,onFocus:()=>b(!0),onChange:w=>g(k=>({...k,stopDelaySeconds:Number(w.target.value)||0})),onBlur:()=>{b(!1);const w=i?.currentSettings?.stopDelaySeconds??30;h.stopDelaySeconds!==w&&f({stopDelaySeconds:h.stopDelaySeconds})},disabled:o,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:border-primary focus:outline-none disabled:opacity-50"})]}),(0,r.jsxs)("label",{className:"flex flex-col gap-1",children:[(0,r.jsx)("span",{className:"text-[10px] font-medium text-foreground-subtle",children:"Disappear delay (s)"}),(0,r.jsx)("input",{type:"number",min:0,max:300,value:h.disappearDelaySeconds,onFocus:()=>b(!0),onChange:w=>g(k=>({...k,disappearDelaySeconds:Number(w.target.value)||0})),onBlur:()=>{b(!1);const w=i?.currentSettings?.disappearDelaySeconds??15;h.disappearDelaySeconds!==w&&f({disappearDelaySeconds:h.disappearDelaySeconds})},disabled:o,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:border-primary focus:outline-none disabled:opacity-50"})]})]}),(0,r.jsx)("p",{className:"px-2 text-[9.5px] text-foreground-subtle leading-snug italic",children:"Settings save on blur. Vendor support varies — Reolink honours all three; Hikvision honours target type + stop delay only (disappear delay is accepted but ignored at firmware push)."})]})}var jl=_r("camstack:player-overlays-state",null),$l=_r("camstack:player-overlays-actions",null);function HP({children:e}){const[i,a]=(0,n.useState)(()=>new Map),[o,l]=(0,n.useState)(()=>new Map),d=(0,n.useCallback)(w=>{a(k=>{const O=new Map(k);return O.set(w.id,w),O})},[]),f=(0,n.useCallback)(w=>{a(k=>{if(!k.has(w))return k;const O=new Map(k);return O.delete(w),O})},[]),h=(0,n.useCallback)(w=>{l(k=>{const O=new Map(k);return O.set(w.id,w),O})},[]),g=(0,n.useCallback)(w=>{l(k=>{if(!k.has(w))return k;const O=new Map(k);return O.delete(w),O})},[]),v=(0,n.useMemo)(()=>({layers:i,buttons:o}),[i,o]),b=(0,n.useMemo)(()=>({setLayer:d,removeLayer:f,setButton:h,removeButton:g}),[d,f,h,g]);return(0,r.jsx)(jl.Provider,{value:v,children:(0,r.jsx)($l.Provider,{value:b,children:e})})}function JP(){const e=(0,n.useContext)(jl);return(0,n.useMemo)(()=>e?[...e.layers.values()].sort((i,a)=>i.order-a.order):[],[e])}function bf(){const e=(0,n.useContext)(jl);return(0,n.useMemo)(()=>e?[...e.buttons.values()].sort((i,a)=>i.order-a.order):[],[e])}function yf(e){const i=(0,n.useContext)($l);(0,n.useEffect)(()=>{if(!(!i||!e))return i.setLayer(e),()=>i.removeLayer(e.id)},[i,e])}function KP(e){const i=(0,n.useContext)($l);(0,n.useEffect)(()=>{if(!(!i||!e))return i.setButton(e),()=>i.removeButton(e.id)},[i,e])}function XP({options:e,cells:i,onCellsChange:a}){const{gridWidth:o,gridHeight:l}=e,d=o*l,f=(0,n.useRef)(!1),h=(0,n.useRef)(!0),g=(0,n.useRef)(new Set),[,v]=(0,n.useState)(0),b=(0,n.useCallback)((E,A)=>{if(E<0||E>=d||i[E]===A)return;const R=[...i];for(;R.length<d;)R.push(!1);R.length=d,R[E]=A,a(R)},[i,d,a]),w=(0,n.useCallback)(E=>A=>{A.preventDefault();const R=!i[E];f.current=!0,h.current=R,g.current=new Set([E]),b(E,R),v(Z=>Z+1)},[i,b]),k=(0,n.useCallback)(E=>()=>{f.current&&(g.current.has(E)||(g.current.add(E),b(E,h.current)))},[b]),O=(0,n.useCallback)(()=>{f.current&&(f.current=!1,g.current=new Set)},[]);return(0,r.jsx)("div",{className:"absolute inset-0 select-none grid",style:{gridTemplateColumns:`repeat(${String(o)}, 1fr)`,gridTemplateRows:`repeat(${String(l)}, 1fr)`},onPointerUp:O,onPointerLeave:O,children:Array.from({length:d},(E,A)=>{const R=i[A]===!0;return(0,r.jsx)("button",{type:"button","aria-label":`motion cell ${String(A)}`,"aria-pressed":R,onPointerDown:w(A),onPointerEnter:k(A),className:R?"border border-primary/70 bg-primary/55 hover:bg-primary/65 transition-colors":"border border-white/25 bg-white/10 hover:bg-white/20 transition-colors"},A)})})}function YP(e){const i=e instanceof Error?e.message:String(e);return i.includes("provider not available")||i.includes("motion-zones")}function xf(e,i){const a=i.gridWidth*i.gridHeight,o=new Array(a);for(let l=0;l<a;l+=1)o[l]=e[l]===!0;return o}function eN(e,i){if(e.length!==i.length)return!1;for(let a=0;a<e.length;a+=1)if(e[a]!==i[a])return!1;return!0}function _f({deviceId:e}){const i=Hr(mr().trpcClient,e),[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(!1),[f,h]=(0,n.useState)(null),[g,v]=(0,n.useState)(null),[b,w]=(0,n.useState)(!1),[k,O]=(0,n.useState)(!1),E=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(!i)return;let X=!1;return(async()=>{try{const me=await i.motionZones?.getOptions({});if(X||!me||(o(me),E.current))return;const ae=await i.motionZones?.getStatus({});if(X||!ae)return;E.current=!0;const Ae=xf(ae.cells,me);v(Ae),h(Ae)}catch(me){if(X)return;YP(me)?d(!0):console.error("motion-zones load failed",me)}})(),()=>{X=!0}},[i]);const A=(0,n.useMemo)(()=>f!==null&&g!==null&&!eN(f,g),[f,g]),R=(0,n.useMemo)(()=>f?f.reduce((X,me)=>me?X+1:X,0):0,[f]),Z=a?a.gridWidth*a.gridHeight:0,V=(0,n.useCallback)(X=>{Z>0&&h(new Array(Z).fill(X))},[Z]),G=(0,n.useCallback)(()=>{h(X=>X&&X.map(me=>!me))},[]),H=(0,n.useCallback)(()=>{g&&h([...g])},[g]),J=(0,n.useCallback)(async()=>{if(!(!f||!i?.motionZones||!a)){w(!0);try{await i.motionZones.setZone({patch:{cells:[...f]}});const X=await i.motionZones.getStatus({});if(X){const me=xf(X.cells,a);v(me),h(me)}}catch(X){console.error("motion-zones.setZone failed",X)}finally{w(!1)}}},[f,i,a]);return yf((0,n.useMemo)(()=>k&&!l&&a&&f?{id:"motion-zones",order:110,node:(0,r.jsx)(XP,{options:a,cells:f,onCellsChange:h})}:null,[k,l,a,f])),(0,r.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,r.jsx)("h3",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wider",children:"Motion Zones"}),l?(0,r.jsx)("p",{className:`${Ci} leading-relaxed`,children:"This camera doesn't expose an on-board motion-detection grid."}):!l&&a!==null&&f!==null?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("p",{className:`${Ci} leading-relaxed`,children:["Toggle"," ",(0,r.jsx)("strong",{className:"text-foreground",children:"Edit grid"})," to paint the region the camera watches for motion directly on the live frame, then ",(0,r.jsx)("strong",{className:"text-foreground",children:"Save"})," to push the mask to the camera. Detection on/off and sensitivity are set in the"," ",(0,r.jsx)("strong",{className:"text-foreground",children:"On-camera motion"})," section."]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("button",{type:"button",onClick:()=>O(X=>!X),disabled:b,"aria-pressed":k,className:k?"rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors":"rounded-md border border-border bg-surface px-2.5 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",children:k?"Done editing":"Edit grid"}),(0,r.jsx)("button",{type:"button",onClick:()=>V(!0),disabled:b,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",children:"All on"}),(0,r.jsx)("button",{type:"button",onClick:()=>V(!1),disabled:b,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",children:"All off"}),(0,r.jsx)("button",{type:"button",onClick:G,disabled:b,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] font-medium text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",children:"Invert"}),(0,r.jsxs)("span",{className:`${Ci} ml-1 tabular-nums`,children:[R," / ",Z," cells · ",a.gridWidth,"×",a.gridHeight]}),(0,r.jsx)("span",{className:"flex-1"}),(0,r.jsx)("button",{type:"button",onClick:H,disabled:b||!A,className:"rounded-md border border-border bg-surface px-2 py-1 text-[11px] text-foreground-subtle hover:bg-surface-hover disabled:opacity-40 transition-colors",children:"Revert"}),(0,r.jsx)("button",{type:"button",onClick:()=>void J(),disabled:b||!A,className:"rounded-md border border-primary/50 bg-primary/15 px-2.5 py-1 text-[11px] font-medium text-primary hover:bg-primary/25 disabled:opacity-40 transition-colors",children:b?"Saving…":"Save"})]})]}):(0,r.jsx)("p",{className:`${Ci} leading-relaxed`,children:"Loading the camera's motion grid…"})]})}var wf={"host/motion-zones-grid":_f,"host/ptz-panel":pf,"host/ptz-autotrack":vf};function Sf(e){const{widgetId:i,deviceId:a}=e,o=wf[i];return o!==void 0?a===void 0?(0,r.jsx)(qi,{widgetId:i,reason:"missing-device-context"}):(0,r.jsx)(o,{deviceId:a}):(0,r.jsx)(tN,{...e})}function tN(e){const{widgetId:i}=e,a=uf(i);return a===void 0?(0,r.jsx)(qi,{widgetId:i,reason:"unknown"}):(0,r.jsx)(rN,{...e,metadata:a})}function rN(e){const{widgetId:i,host:a="device-tab",config:o,deviceId:l,integrationId:d,instanceId:f,size:h,columns:g,rows:v,metadata:b}=e,w=df(b.remote,b.bundleUrl),k=(0,n.useMemo)(()=>f??i,[f,i]);return w===null?(0,r.jsx)(nN,{}):w===void 0?(0,r.jsx)(qi,{widgetId:i,reason:"missing-export"}):b.requires.deviceContext&&l===void 0?(0,r.jsx)(qi,{widgetId:i,reason:"missing-device-context"}):b.requires.integrationContext&&d===void 0?(0,r.jsx)(qi,{widgetId:i,reason:"missing-integration-context"}):(0,r.jsx)(w,{instanceId:k,host:a,config:o,deviceId:l,integrationId:d,size:h,columns:g,rows:v})}function nN(){return(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-surface/40 p-4 animate-pulse",children:[(0,r.jsx)("div",{className:"h-3 w-24 bg-foreground-subtle/20 rounded mb-2"}),(0,r.jsx)("div",{className:"h-2 w-full bg-foreground-subtle/10 rounded mb-1"}),(0,r.jsx)("div",{className:"h-2 w-3/4 bg-foreground-subtle/10 rounded"})]})}function qi({widgetId:e,reason:i}){return(0,r.jsx)("div",{className:"rounded-lg border border-warning/30 bg-warning/10 px-3 py-2 text-xs text-warning",children:i==="unknown"?`Widget "${e}" not registered`:i==="missing-export"?`Widget "${e}" bundle does not export this stableId`:i==="missing-device-context"?`Widget "${e}" requires a deviceId`:`Widget "${e}" requires an integrationId`})}var Jr="w-full rounded-md border border-border bg-background px-2.5 py-1.5 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none disabled:opacity-50 disabled:cursor-not-allowed",Za="block text-[11px] font-medium text-foreground mb-1",iN="text-[10px] text-foreground-subtle mt-0.5";function Ot({label:e,description:i,required:a,span:o,children:l,translationFn:d}){const f=o===2?"col-span-2":o===3?"col-span-3":o===4?"col-span-4":"col-span-1",h=cr(e,d),g=cr(i,d),v=h!==void 0&&h!=="";return(0,r.jsxs)("div",{className:`${f} min-w-0`,children:[v&&(0,r.jsxs)("label",{className:Za,children:[h,a&&(0,r.jsx)("span",{className:"text-danger ml-0.5",children:"*"})]}),l,g&&(0,r.jsx)("p",{className:iN,children:g})]})}function aN({field:e,value:i,onChange:a,disabled:o,translationFn:l}){return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsx)("input",{type:e.inputType??"text",className:Jr,value:i==null?"":String(i),placeholder:e.placeholder,maxLength:e.maxLength,pattern:e.pattern,disabled:o||e.disabled,onChange:d=>a(d.target.value)})})}function oN({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const[d,f]=(0,n.useState)(i==null?"":String(i)),h=(0,n.useRef)(!1);(0,n.useEffect)(()=>{h.current||f(i==null?"":String(i))},[i]);const g=v=>{if(f(v),v===""||v==="-"){a(void 0);return}const b=Number(v);Number.isNaN(b)||a(b)};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)("input",{type:"number",className:Jr,value:d,placeholder:e.placeholder,min:e.min,max:e.max,step:e.step,disabled:o||e.disabled,onFocus:()=>{h.current=!0},onBlur:()=>{h.current=!1},onChange:v=>g(v.target.value)}),e.unit&&(0,r.jsx)("span",{className:"text-xs text-foreground-subtle whitespace-nowrap",children:e.unit})]})})}function sN({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=!!i,f=o||e.disabled;return e.style==="checkbox"?(0,r.jsx)(Ot,{label:void 0,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[(0,r.jsx)("input",{type:"checkbox",className:"h-3.5 w-3.5 rounded border-border accent-primary",checked:d,disabled:f,onChange:h=>a(h.target.checked)}),(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:cr(e.label,l)}),e.required&&(0,r.jsx)("span",{className:"text-danger",children:"*"})]})}):(0,r.jsx)(Ot,{label:void 0,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("span",{className:Za+" mb-0",children:[cr(e.label,l),e.required&&(0,r.jsx)("span",{className:"text-danger ml-0.5",children:"*"})]}),(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":d,disabled:f,onClick:()=>!f&&a(!d),className:["relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150",d?"bg-primary":"bg-foreground-subtle/30",f?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),children:(0,r.jsx)("span",{className:["inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150",d?"translate-x-4":"translate-x-0.5"].join(" ")})})]})})}function lN({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=e.options.some(f=>f.value==="");return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("select",{className:Jr,value:i==null?"":String(i),disabled:o||e.disabled,onChange:f=>a(f.target.value),children:[!e.required&&!d&&(0,r.jsx)("option",{value:"",children:"— Select —"}),e.options.map(f=>(0,r.jsx)("option",{value:f.value,children:f.label},f.value))]})})}function cN({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=Array.isArray(i)?i:[],f=h=>{if(d.includes(h))a(d.filter(g=>g!==h));else{if(e.maxItems!==void 0&&d.length>=e.maxItems)return;a([...d,h])}};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:e.options.map(h=>{const g=d.includes(h.value);return(0,r.jsxs)("label",{className:["flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs cursor-pointer select-none transition-colors",g?"border-primary bg-primary/10 text-primary":"border-border bg-background text-foreground hover:bg-surface",o||e.disabled?"opacity-50 cursor-not-allowed":""].join(" "),children:[(0,r.jsx)("input",{type:"checkbox",className:"sr-only",checked:g,disabled:o||e.disabled,onChange:()=>f(h.value)}),h.label]},h.value)})})})}function uN({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const[d,f]=(0,n.useState)(!1),h=e.showToggle!==!1;return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:d?"text":"password",className:Jr+(h?" pr-9":""),value:i==null?"":String(i),placeholder:e.placeholder,disabled:o||e.disabled,onChange:g=>a(g.target.value)}),h&&(0,r.jsx)("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",tabIndex:-1,onClick:()=>f(g=>!g),children:d?(0,r.jsx)(Zs,{className:"h-3.5 w-3.5"}):(0,r.jsx)(pn,{className:"h-3.5 w-3.5"})})]})})}function dN({field:e,value:i,onChange:a,disabled:o,translationFn:l}){return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsx)("textarea",{className:Jr+" resize-y min-h-[60px]",value:i==null?"":String(i),placeholder:e.placeholder,rows:e.rows??3,maxLength:e.maxLength,disabled:o||e.disabled,onChange:d=>a(d.target.value)})})}function fN({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=i==null,f=e.nullable===!0,h=d?e.default??e.min:Number(i),g=e.showValue!==!1,v=e.nullLabel??"Auto",b=o||e.disabled,w=e.displayScale??1,k=e.min/w,O=e.max/w,E=h/w,A=(e.step??1)/w;if(f&&d)return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("button",{className:"w-full rounded-lg border border-dashed border-border px-3 py-2 text-xs text-foreground-subtle hover:border-primary/40 hover:text-primary transition-colors text-left",disabled:b,onClick:()=>a(e.default??e.min),children:[v," — click to set manually"]})});const R=e.showStepper===!0&&g,Z=G=>{const H=h+G*(e.step??1),J=Math.min(e.max,Math.max(e.min,H));J!==h&&a(J)},V="flex h-6 w-6 shrink-0 items-center justify-center rounded border border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:cursor-not-allowed disabled:opacity-40";return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-2",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 basis-[160px] items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle tabular-nums shrink-0",children:k}),(0,r.jsx)("input",{type:"range",className:"min-w-0 flex-1 h-1 accent-primary cursor-pointer disabled:opacity-50",min:k,max:O,step:A,value:E,disabled:b,onChange:G=>a(Number(G.target.value)*w)}),(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle tabular-nums shrink-0",children:O})]}),(g||f||e.unit)&&(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[R&&(0,r.jsx)("button",{type:"button",className:V,disabled:b||h<=e.min,onClick:()=>Z(-1),title:`Decrease by ${e.step??1}`,"aria-label":"Decrement",children:(0,r.jsx)(Yc,{className:"h-3 w-3"})}),g&&(0,r.jsx)("input",{type:"number",className:"w-16 rounded border border-border bg-surface px-1.5 py-0.5 text-xs text-center text-foreground tabular-nums focus:outline-none focus:ring-1 focus:ring-primary",min:k,max:O,step:A,value:E,disabled:b,onChange:G=>{if(G.target.value===""){a(f?null:e.min);return}const H=Number(G.target.value)*w,J=e.step??1,X=H-e.min,me=e.min+Math.round(X/J)*J;a(Math.min(e.max,Math.max(e.min,me)))}}),R&&(0,r.jsx)("button",{type:"button",className:V,disabled:b||h>=e.max,onClick:()=>Z(1),title:`Increase by ${e.step??1}`,"aria-label":"Increment",children:(0,r.jsx)(hn,{className:"h-3 w-3"})}),e.unit&&(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle",children:e.unit}),f&&(0,r.jsx)("button",{className:"text-[10px] text-foreground-subtle hover:text-primary transition-colors",title:`Reset to ${v}`,disabled:b,onClick:()=>a(null),children:v})]})]})})}function mN({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=Array.isArray(i)?i:[],[f,h]=(0,n.useState)(""),g=(0,n.useRef)(null),v=(0,n.useCallback)(O=>{const E=O.trim();!E||d.includes(E)||e.maxTags!==void 0&&d.length>=e.maxTags||(a([...d,E]),h(""))},[d,e.maxTags,a]),b=O=>a(d.filter(E=>E!==O)),w=O=>{O.key==="Enter"||O.key===","?(O.preventDefault(),v(f)):O.key==="Backspace"&&f===""&&d.length>0&&b(d[d.length-1])},k=o||e.disabled;return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:["flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px] cursor-text","focus-within:border-primary focus-within:ring-1 focus-within:ring-primary/30",k?"opacity-50 cursor-not-allowed":""].join(" "),onClick:()=>!k&&g.current?.focus(),children:[d.map(O=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:[O,!k&&(0,r.jsx)("button",{type:"button",onClick:()=>b(O),className:"hover:text-danger",children:(0,r.jsx)(It,{className:"h-2.5 w-2.5"})})]},O)),(0,r.jsx)("input",{ref:g,type:"text",className:"flex-1 min-w-[80px] bg-transparent text-sm text-foreground outline-none placeholder:text-foreground-disabled",value:f,placeholder:d.length===0?e.placeholder??"Add tags…":"",disabled:k,list:`tags-suggestions-${e.key}`,onChange:O=>h(O.target.value),onKeyDown:w,onBlur:()=>{f.trim()&&v(f)}}),e.suggestions&&(0,r.jsx)("datalist",{id:`tags-suggestions-${e.key}`,children:e.suggestions.map(O=>(0,r.jsx)("option",{value:O},O))})]})})}function jf({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const{nodes:d}=Oa(),f=typeof i=="string"?i:"",h=e.showOffline?d:d.filter(g=>g.isOnline);return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsxs)("select",{className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground focus:outline-none focus:border-primary/50 disabled:opacity-50",value:f,onChange:g=>a(g.target.value),disabled:o,children:[(0,r.jsx)("option",{value:"",children:"Select node…"}),h.map(g=>(0,r.jsxs)("option",{value:g.id,disabled:!g.isOnline,children:[g.shortName,g.isOnline?"":" (offline)"]},g.id))]})})}function $f({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const{nodes:d}=Oa(),f=new Set(Array.isArray(i)?i.map(String):[]),h=e.showOffline?d:d.filter(v=>v.isOnline),g=v=>{const b=new Set(f);b.has(v)?b.delete(v):b.add(v),a([...b])};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:h.map(v=>{const b=f.has(v.id);return(0,r.jsx)("button",{type:"button",onClick:()=>g(v.id),disabled:o||!v.isOnline,className:`px-2.5 py-1 text-xs font-medium rounded-md border transition-colors ${b?"border-primary bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:bg-surface-hover"} ${v.isOnline?"":"opacity-50 cursor-not-allowed"}`,children:v.shortName},v.id)})})})}function gN({field:e,value:i,onChange:a,disabled:o,translationFn:l}){const d=i==null?"#000000":String(i);return(0,r.jsxs)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"color",className:"h-9 w-9 rounded-md border border-border bg-background cursor-pointer p-0.5 disabled:opacity-50",value:d,disabled:o||e.disabled,onChange:f=>a(f.target.value)}),(0,r.jsx)("input",{type:"text",className:Jr+" flex-1 font-mono",value:d,placeholder:"#000000",disabled:o||e.disabled,onChange:f=>a(f.target.value)})]}),e.presets&&e.presets.length>0&&(0,r.jsx)("div",{className:"flex gap-1.5 mt-1.5",children:e.presets.map(f=>(0,r.jsx)("button",{type:"button",className:"h-5 w-5 rounded-md border border-border hover:scale-110 transition-transform disabled:opacity-50",style:{backgroundColor:f},disabled:o||e.disabled,title:f,onClick:()=>a(f)},f))})]})}function pN({field:e,value:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:f,externalProbe:h}){const[g,v]=(0,n.useState)("idle"),[b,w]=(0,n.useState)(null),k=h?.status??g,O=h?.result??b,E=!!d||!!f,A=(0,n.useCallback)(async()=>{if(E){v("probing"),w(null);try{const V=d?await d(e.key,i):await f("test-probe",e.key,i),G=V&&typeof V=="object"?V:{status:"error",error:"Probe handler returned no result"};w(G),v(G.status==="ok"?"ok":"error")}catch(V){w({status:"error",error:V instanceof Error?V.message:String(V)}),v("error")}}},[d,f,e.key,i,E]),R=k==="probing"?"border-primary/40 bg-primary/10 text-primary":k==="ok"?"border-success/40 bg-success/10 text-success hover:bg-success/15":k==="error"?"border-danger/40 bg-danger/10 text-danger hover:bg-danger/15":"border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover",Z=k==="probing"?(0,r.jsx)(Gt,{className:"h-3 w-3 animate-spin"}):k==="ok"?(0,r.jsx)(fh,{className:"h-3 w-3"}):k==="error"?(0,r.jsx)(gn,{className:"h-3 w-3"}):(0,r.jsx)(lu,{className:"h-3 w-3"});return(0,r.jsxs)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,translationFn:l,children:[(0,r.jsxs)("div",{className:"@container flex items-center gap-2",style:{containerType:"inline-size"},children:[(0,r.jsxs)("button",{type:"button",onClick:A,title:"Test",disabled:e.disabled||k==="probing"||!E||!i,className:`flex-shrink-0 inline-flex items-center gap-1.5 rounded-md border px-2 py-2 text-xs font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed @[280px]:px-3 ${R}`,children:[Z,(0,r.jsx)("span",{className:"hidden @[280px]:inline",children:"Test"})]}),(0,r.jsx)("input",{type:e.inputType??"url",className:Jr+" flex-1 min-w-0",value:i==null?"":String(i),placeholder:e.placeholder,disabled:o||e.disabled,onChange:V=>{a(V.target.value),g!=="idle"&&(v("idle"),w(null))}})]}),k==="ok"&&O?.labels&&O.labels.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-1 mt-1.5",children:O.labels.map((V,G)=>(0,r.jsx)("span",{className:"text-xs bg-success/10 text-success rounded px-2 py-0.5 font-mono",children:V},G))}),k==="error"&&O?.error&&(0,r.jsx)("p",{className:"text-xs text-danger mt-1 truncate",title:O.error,children:O.error})]})}function hN({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d}){const[f,h]=(0,n.useState)(e.defaultCollapsed??!1),g=e.style==="accordion";return(0,r.jsx)("div",{className:e.span===2?"col-span-2":e.span===3?"col-span-3":e.span===4?"col-span-4":"col-span-1",children:(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-surface/50 overflow-hidden",children:[(0,r.jsxs)("div",{className:["px-3 py-2 flex items-center justify-between",g?"cursor-pointer hover:bg-surface":""].join(" "),onClick:g?()=>h(v=>!v):void 0,children:[(0,r.jsx)("span",{className:"text-xs font-semibold text-foreground",children:cr(e.label,l)}),g&&(0,r.jsx)("span",{className:"text-foreground-subtle text-xs",children:f?"▸":"▾"})]}),!f&&(0,r.jsx)("div",{className:"px-3 pb-3 grid grid-cols-2 gap-x-4 gap-y-3",children:e.fields.map(v=>(0,r.jsx)(_n,{field:v,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d},v.key))})]})})}function vN({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:f}){const[h,g]=(0,n.useState)(e.tabs[0]?.id??""),v=e.span===2?"col-span-2":e.span===3?"col-span-3":e.span===4?"col-span-4":"col-span-1";return e.tabs.length===0?null:(0,r.jsxs)("div",{className:v,children:[e.label&&(0,r.jsx)("div",{className:Za,children:cr(e.label,l)}),(0,r.jsxs)("div",{className:"rounded-lg border border-border-subtle bg-surface-hover/40 overflow-hidden",children:[(0,r.jsx)("div",{className:"flex flex-wrap gap-1 p-1.5 border-b border-border-subtle bg-surface/40",role:"tablist",children:e.tabs.map(b=>{const w=b.id===h;return(0,r.jsxs)("button",{type:"button",role:"tab","aria-selected":w,onClick:()=>g(b.id),className:`inline-flex items-center gap-1.5 whitespace-nowrap rounded-md px-2.5 py-1 text-[11px] transition-colors ${w?"bg-primary text-primary-foreground font-medium shadow-sm":"bg-transparent text-foreground-subtle hover:bg-surface hover:text-foreground"}`,children:[(0,r.jsx)("span",{children:cr(b.label,l)}),b.badge&&(0,r.jsx)("span",{className:`text-[9px] px-1 py-0.5 rounded-full font-medium ${w?"bg-primary-foreground/20 text-primary-foreground":"bg-primary/10 text-primary"}`,children:b.badge})]},b.id)})}),e.tabs.map(b=>b.id!==h?null:(0,r.jsx)("div",{role:"tabpanel",className:"px-3 pb-3 pt-2 grid grid-cols-2 gap-x-4 gap-y-3",children:b.fields.map((w,k)=>{const O="key"in w&&typeof w.key=="string"?w.key:`__${b.id}__${k}`;return(0,r.jsx)(_n,{field:w,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:f},O)})},b.id))]})]})}function bN({span:e}){return(0,r.jsx)("div",{className:e===2?"col-span-2":e===3?"col-span-3":e===4?"col-span-4":"col-span-full",children:(0,r.jsx)("hr",{className:"border-border"})})}var kf={info:{border:"border-info",bg:"bg-info/5",text:"text-info"},warning:{border:"border-warning",bg:"bg-warning/5",text:"text-warning"},success:{border:"border-success",bg:"bg-success/5",text:"text-success"},danger:{border:"border-danger",bg:"bg-danger/5",text:"text-danger"}};function yN(e){if(typeof window>"u"||typeof DOMParser>"u")return"";const i=new Set(["A","UL","OL","LI","STRONG","EM","CODE","BR","P","SPAN"]),a=new DOMParser().parseFromString(`<div>${e}</div>`,"text/html"),o=a.body.firstElementChild;if(!o)return"";const l=d=>{const f=Array.from(d.children);for(const h of f){if(!i.has(h.tagName)){const v=a.createTextNode(h.textContent??"");h.replaceWith(v);continue}const g=h.tagName==="A"?new Set(["href"]):new Set;for(const v of Array.from(h.attributes))g.has(v.name)||h.removeAttribute(v.name);if(h.tagName==="A"){const v=h.getAttribute("href")??"";!/^https?:\/\//i.test(v)&&!v.startsWith("mailto:")?h.removeAttribute("href"):(h.setAttribute("target","_blank"),h.setAttribute("rel","noopener noreferrer"))}l(h)}};return l(o),o.innerHTML}function xN({field:e}){const i=kf[e.variant??"info"]??kf.info,a=e.format==="html";return(0,r.jsx)("div",{className:"col-span-full",children:(0,r.jsxs)("div",{className:`rounded-md border-l-4 px-3 py-2.5 ${i.border} ${i.bg}`,children:[e.label&&(0,r.jsx)("p",{className:`text-xs font-semibold mb-0.5 ${i.text}`,children:e.label}),a?(0,r.jsx)("div",{className:"text-xs text-foreground-subtle leading-relaxed info-html-content",dangerouslySetInnerHTML:{__html:yN(e.content)}}):(0,r.jsx)("p",{className:"text-xs text-foreground-subtle leading-relaxed whitespace-pre-line",children:e.content})]})})}var Pf={ok:"bg-success",warn:"bg-amber-500",danger:"bg-danger",idle:"bg-foreground-subtle/40",unknown:"bg-foreground-subtle/40"};function _N(e){if(!Number.isFinite(e)||e<0)return"—";if(e<1e3)return`${e}ms`;const i=Math.round(e/1e3);if(i<60)return`${i}s`;const a=Math.floor(i/60),o=i%60;return o===0?`${a}m`:`${a}m ${o}s`}function wN(e){return!Number.isFinite(e)||e<=0?"—":new Date(e).toLocaleTimeString()}function SN({kind:e,value:i}){return i==null||i===""?(0,r.jsx)("span",{className:"text-foreground-subtle/60",children:"—"}):e==="monospace"?(0,r.jsx)("span",{className:"font-mono text-[11px]",children:String(i)}):e==="status"?(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${Pf[String(i).toLowerCase()]??Pf.unknown}`}),(0,r.jsx)("span",{children:String(i)})]}):e==="duration"&&typeof i=="number"?(0,r.jsx)("span",{className:"font-mono text-[11px]",children:_N(i)}):e==="timestamp"&&typeof i=="number"?(0,r.jsx)("span",{className:"font-mono text-[11px]",children:wN(i)}):(0,r.jsx)("span",{children:String(i)})}function jN({field:e}){const i=e.value??[],a=e.description;return(0,r.jsxs)("div",{className:"col-span-full",children:[e.label&&(0,r.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-foreground-subtle mb-1",children:e.label}),a&&(0,r.jsx)("p",{className:"text-xs text-foreground-subtle mb-2",children:a}),i.length===0?(0,r.jsx)("div",{className:"rounded-md border border-border bg-surface-subtle px-3 py-2 text-xs text-foreground-subtle",children:e.emptyMessage??"No entries"}):(0,r.jsx)("div",{className:"rounded-md border border-border overflow-hidden",children:(0,r.jsxs)("table",{className:"w-full text-xs",children:[(0,r.jsx)("thead",{className:"bg-surface-subtle border-b border-border",children:(0,r.jsx)("tr",{children:e.columns.map(o=>(0,r.jsx)("th",{className:"px-3 py-1.5 text-left font-medium text-foreground-subtle",style:o.width?{width:o.width}:void 0,children:o.label},o.key))})}),(0,r.jsx)("tbody",{className:"divide-y divide-border",children:i.map((o,l)=>(0,r.jsx)("tr",{className:"hover:bg-surface-hover/40",children:e.columns.map(d=>(0,r.jsx)("td",{className:"px-3 py-1.5 align-top text-foreground",children:(0,r.jsx)(SN,{kind:d.kind,value:o[d.key]})},d.key))},l))})]})})]})}function $N({field:e,value:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:f}){const h=Array.isArray(i)?i:[],g=e.minRows??0,v=e.maxRows??Number.POSITIVE_INFINITY,b=(R,Z,V)=>{const G=h.slice();G[R]={...G[R]??{},[Z]:V},a(G)},w=R=>{h.length<=g||a(h.filter((Z,V)=>V!==R))},k=()=>{if(h.length>=v)return;const R=e.defaultItem??{};a([...h,{...R}])},O=(R,Z)=>e.rowTitleTemplate?e.rowTitleTemplate.replace(/\{(\w+)\}/g,(V,G)=>{const H=R[G];return H==null||H===""?"—":String(H)}):`Row ${Z+1}`,E=h.length>g,A=h.length<v;return(0,r.jsxs)("div",{className:"col-span-full space-y-2",children:[(0,r.jsxs)("div",{className:"space-y-0.5",children:[e.label&&(0,r.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-foreground-subtle",children:cr(e.label,l)}),e.description&&(0,r.jsx)("p",{className:"text-[11px] text-foreground-subtle",children:cr(e.description,l)})]}),h.length===0?(0,r.jsx)("div",{className:"rounded-md border border-dashed border-border bg-background px-3 py-3 text-center text-[11px] text-foreground-subtle",children:e.emptyMessage??"No entries"}):(0,r.jsx)("div",{className:"space-y-2",children:h.map((R,Z)=>(0,r.jsxs)("div",{className:"rounded-md border border-border bg-background",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:O(R,Z)}),(0,r.jsxs)("button",{type:"button",onClick:()=>w(Z),disabled:o||!E,className:"inline-flex items-center gap-1 rounded px-2 py-0.5 text-[10px] text-danger hover:bg-danger/10 disabled:opacity-30 disabled:cursor-not-allowed",title:E?"Remove this row":`At least ${g} row(s) required`,children:[(0,r.jsx)(Yc,{className:"h-3 w-3"}),"Remove"]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 @[420px]:grid-cols-2 gap-x-3 gap-y-2 p-3",children:e.itemFields.map(V=>(0,r.jsx)(_n,{field:V,values:R,onChange:(G,H)=>b(Z,G,H),disabled:o,translationFn:l,onTestField:d,allFields:e.itemFields,onAction:f},V.key))})]},Z))}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("button",{type:"button",onClick:k,disabled:o||!A,className:"inline-flex items-center gap-1 rounded border border-border bg-surface px-3 py-1 text-[11px] font-medium text-foreground hover:border-primary/40 hover:bg-primary/5 disabled:opacity-30 disabled:cursor-not-allowed",children:[(0,r.jsx)(hn,{className:"h-3 w-3"}),e.addLabel??"Add"]}),!A&&Number.isFinite(v)&&(0,r.jsxs)("span",{className:"ml-2 text-[10px] text-foreground-subtle",children:["(limit: ",v,")"]})]})]})}function kN({field:e,disabled:i,onAction:a}){const[o,l]=(0,n.useState)(!1),d=Bi(),f=async()=>{if(!(e.confirmMessage&&!await d({title:e.label,message:e.confirmMessage,confirmLabel:e.buttonLabel,variant:e.variant==="danger"?"danger":"default"}))&&a){l(!0);try{await a(e.action,e.key)}finally{l(!1)}}},h={default:"border border-border text-foreground hover:bg-surface-hover",primary:"bg-primary text-primary-foreground hover:bg-primary/90",danger:"bg-danger text-white hover:bg-danger/90"};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,children:(0,r.jsx)("button",{onClick:f,disabled:i||o,className:`inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors disabled:opacity-50 ${h[e.variant??"default"]??h.default}`,children:o?"Processing...":e.buttonLabel})})}function Nf(e,i){const a={...e.paramsStatic??{}};if(e.paramsFromForm)for(const[o,l]of Object.entries(e.paramsFromForm)){const d=i[l];d!=null&&d!==""&&(a[o]=d)}return a}function PN({field:e,value:i,values:a,onChange:o,disabled:l,onAction:d}){const[f,h]=(0,n.useState)(!1),[g,v]=(0,n.useState)(null),[b,w]=(0,n.useState)(null),k=Nf(e,a),O=Object.keys(e.paramsFromForm??{}).some(Z=>k[Z]===void 0);(0,n.useEffect)(()=>{if(!d||O){w(null),v(null);return}let Z=!1;return h(!0),v(null),d(e.action,e.key,k).then(V=>{if(Z)return;const G=V;let H=[];if(Array.isArray(G))H=G;else if(G&&typeof G=="object")for(const J of Object.keys(G)){const X=G[J];if(Array.isArray(X)){H=X;break}}w(H)}).catch(V=>{Z||(v(V instanceof Error?V.message:String(V)),w([]))}).finally(()=>{Z||h(!1)}),()=>{Z=!0}},[(e.refreshOn??Object.values(e.paramsFromForm??{})).map(Z=>`${Z}=${JSON.stringify(a[Z])}`).join("|"),d,e.action,e.key]);const E=e.mapOption.value,A=e.mapOption.label,R=e.mapOption.description;return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,children:O?(0,r.jsx)("div",{className:"text-[11px] text-foreground-subtle italic",children:e.emptyParamsMessage??"Fill the prerequisite fields above first."}):f?(0,r.jsxs)("div",{className:"flex items-center gap-2 text-[11px] text-foreground-subtle",children:[(0,r.jsx)(Gt,{className:"h-3 w-3 animate-spin"})," Loading options…"]}):g?(0,r.jsx)("div",{className:"text-[11px] text-danger",children:g}):b&&b.length===0?(0,r.jsx)("div",{className:"text-[11px] text-foreground-subtle italic",children:e.emptyResultsMessage??"No options returned."}):(()=>{const Z=(b??[]).some(V=>{const G=V[E];return G===""||G===void 0});return(0,r.jsxs)("select",{className:"w-full rounded-md border border-border bg-surface px-2 py-1.5 text-xs text-foreground",value:typeof i=="string"?i:"",disabled:l,onChange:V=>o(V.target.value),children:[!Z&&(0,r.jsx)("option",{value:"",children:"— Select —"}),(b??[]).map((V,G)=>{const H=V[E],J=V[A],X=R?V[R]:void 0,me=typeof H=="string"&&H!==""?H:`row-${G}`;return(0,r.jsxs)("option",{value:typeof H=="string"?H:String(H??""),children:[typeof J=="string"?J:String(J??me),X!==void 0?` (${String(X)})`:""]},me)})]})})()})}function NN({field:e,values:i,disabled:a,onAction:o}){const[l,d]=(0,n.useState)(!1),[f,h]=(0,n.useState)(null),g=Bi(),v=async()=>{if(e.confirmMessage&&!await g({title:e.label,message:e.confirmMessage,confirmLabel:e.buttonLabel,variant:e.variant==="danger"?"danger":"default"})||!o)return;const w=Nf(e,i);d(!0),h(null);try{const k=await o(e.action,e.key,w),O=typeof k=="object"&&k!==null?k:null;h({kind:"ok",text:e.successMessage?e.successMessage.replace(/\{(\w+)\}/g,(E,A)=>{const R=O?.[A];return R===void 0?"":String(R)}):"Done."})}catch(k){h({kind:"error",text:k instanceof Error?k.message:String(k)})}finally{d(!1)}},b={default:"border border-border text-foreground hover:bg-surface-hover",primary:"bg-primary text-primary-foreground hover:bg-primary/90",danger:"bg-danger text-white hover:bg-danger/90"};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:e.required,span:e.span,children:(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsx)("button",{onClick:v,disabled:a||l,className:`inline-flex w-fit items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors disabled:opacity-50 ${b[e.variant??"default"]??b.default}`,children:l?"Working…":e.buttonLabel}),f&&(0,r.jsx)("div",{className:`text-[11px] ${f.kind==="ok"?"text-emerald-700 dark:text-emerald-300":"text-danger"}`,children:f.text})]})})}function CN({field:e}){const i=Jd();return(0,r.jsx)(Sf,{widgetId:e.widgetId,host:"device-tab",config:e.widgetConfig,deviceId:i??void 0,instanceId:e.key})}function ON(e,i){if(e==null)return"—";if(typeof e=="boolean")return e?"yes":"no";if(typeof e=="number"){const a=Number.isInteger(e)?String(e):e.toFixed(2);return i?`${a} ${i}`:a}return typeof e=="string"?e:JSON.stringify(e)}function IN({field:e,values:i,onAction:a,translationFn:o}){const l="key"in e?e.key:void 0;if(!l)return null;const d=i[l],f=d!==void 0?d:"default"in e?e.default:void 0,h=ON(f,"unit"in e?e.unit:void 0),g="label"in e?e.label:void 0,v="description"in e?e.description:void 0,b="span"in e?e.span:void 0,w="actions"in e?e.actions??[]:[];return(0,r.jsx)(Ot,{label:g,description:v,span:b,translationFn:o,children:(0,r.jsxs)("div",{className:"flex items-stretch gap-1",children:[(0,r.jsx)("div",{className:"flex-1 rounded-md border border-border bg-surface-alt px-2.5 py-1.5 text-xs text-foreground font-mono break-all",children:h}),w.length>0&&(0,r.jsx)("div",{className:"flex items-center gap-1",children:w.map(k=>(0,r.jsx)(MN,{action:k,fieldKey:l,value:f,onAction:a},k.action))})]})})}function EN({name:e}){const i="h-3.5 w-3.5";switch(e){case"copy":return(0,r.jsx)(Ar,{className:i});case"refresh-cw":return(0,r.jsx)(ka,{className:i});case"external-link":return(0,r.jsx)(Rs,{className:i});case"trash-2":return(0,r.jsx)(wr,{className:i});case"download":return(0,r.jsx)(Ts,{className:i});case"upload":return(0,r.jsx)(su,{className:i});default:return(0,r.jsx)(Fs,{className:i})}}function MN({action:e,fieldKey:i,value:a,onAction:o}){const l=Bi(),[d,f]=(0,n.useState)(!1),h=e.variant==="danger"?"text-danger hover:bg-danger/10 border-danger/30":e.variant==="primary"?"text-primary hover:bg-primary/10 border-primary/30":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover border-border",g=async()=>{if(!(e.confirmMessage&&!await l({title:e.tooltip,message:e.confirmMessage,variant:e.variant==="danger"?"danger":"default"}))){if(e.action==="copy-value"){try{await navigator.clipboard.writeText(typeof a=="string"?a:String(a))}catch{}return}if(o){f(!0);try{await o(e.action,i)}finally{f(!1)}}}};return(0,r.jsx)("button",{type:"button",onClick:g,disabled:d,title:e.tooltip,className:`inline-flex items-center justify-center rounded-md border px-2 py-1.5 transition-colors disabled:opacity-50 ${h}`,children:(0,r.jsx)(EN,{name:e.icon})})}function DN(e){return"multiple"in e&&e.multiple!=null}function AN({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:f,allFields:h,onAction:g}){const v=e.multiple,b=v.min,w=v.max,k=i[e.key],O=[...Array.isArray(k)?k:k!=null?[k]:[]],E=v.itemDefault!==void 0?v.itemDefault:"default"in e&&e.default!==void 0?e.default:"";for(;O.length<b;)O.push(E);const A=H=>a(e.key,[...H]),R=(H,J)=>{const X=[...O];X[H]=J,A(X)},Z=()=>{O.length>=w||A([...O,E])},V=H=>{O.length<=b||A(O.filter((J,X)=>X!==H))},G=()=>{const{multiple:H,...J}=e;return{...J,...{label:void 0,description:void 0,required:!1}}};return(0,r.jsx)(Ot,{label:e.label,description:e.description,required:b>0?e.required:!1,span:e.span,translationFn:l,children:(0,r.jsxs)("div",{className:"space-y-2",children:[O.map((H,J)=>{const X=v.itemLabel?.replace("${n}",String(J+1));return(0,r.jsxs)("div",{className:"space-y-1",children:[X&&(0,r.jsx)("div",{className:Za,children:X}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"flex-1 min-w-0",children:(0,r.jsx)(_n,{field:G(),values:{...i,[e.key]:H},onChange:(me,ae)=>R(J,ae),disabled:o,translationFn:l,onTestField:d,onAction:g,allFields:h})}),O.length>b&&(0,r.jsx)("button",{type:"button",onClick:()=>V(J),disabled:o,title:"Remove",className:"flex-shrink-0 inline-flex items-center justify-center rounded-md border border-border p-1.5 text-foreground-subtle hover:text-danger hover:border-danger/50 transition-colors disabled:opacity-40",children:(0,r.jsx)(wr,{className:"h-3.5 w-3.5"})})]})]},J)}),(0,r.jsxs)("div",{className:"flex items-center justify-between pt-1",children:[O.length<w?(0,r.jsxs)("button",{type:"button",onClick:Z,disabled:o,className:"inline-flex items-center gap-1.5 rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-40",children:[(0,r.jsx)(hn,{className:"h-3 w-3"}),v.addLabel??"Add"]}):(0,r.jsx)("span",{}),(0,r.jsxs)("span",{className:"text-[10px] text-foreground-subtle tabular-nums",children:[O.length,"/",w]})]})]})})}function Cf(e,i,a){if(!("showWhen"in e)||!e.showWhen)return!0;const o=e.showWhen,l=i[o.field],d=a?.find(g=>"key"in g&&g.key===o.field),f=d&&"default"in d?d.default:void 0,h=l!==void 0?l:f;return o.equals!==void 0?h===o.equals:o.notEquals!==void 0?h!==o.notEquals:o.in!==void 0?o.in.includes(h):o.notIn!==void 0?!o.notIn.includes(h):o.includes!==void 0?Array.isArray(h)&&h.includes(o.includes):o.notIncludes!==void 0?!Array.isArray(h)||!h.includes(o.notIncludes):!0}function _n({field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:f,allFields:h,onAction:g}){if(DN(e))return(0,r.jsx)(AN,{field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:f,allFields:h,onAction:g});if("readonlyField"in e&&e.readonlyField===!0)return(0,r.jsx)(IN,{field:e,values:i,onAction:g,translationFn:l});if(!Cf(e,i,h))return null;const v=i[e.key],b=v!==void 0?v:"default"in e?e.default:void 0,w=O=>a(e.key,O),k=Hd(e.type);switch(e.type){case"text":return(0,r.jsx)(aN,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"number":return(0,r.jsx)(oN,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"boolean":return(0,r.jsx)(sN,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"select":return(0,r.jsx)(lN,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"multiselect":return(0,r.jsx)(cN,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"password":return(0,r.jsx)(uN,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"textarea":return(0,r.jsx)(dN,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"slider":return(0,r.jsx)(fN,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"tags":return(0,r.jsx)(mN,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"color":return(0,r.jsx)(gN,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"node-select":return(0,r.jsx)(jf,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"node-multiselect":return(0,r.jsx)($f,{field:e,value:b,onChange:w,disabled:o,translationFn:l});case"probe":return(0,r.jsx)(pN,{field:e,value:b,onChange:w,disabled:o,translationFn:l,onTestField:d,onAction:g,externalProbe:f});case"group":return(0,r.jsx)(hN,{field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d});case"sub-tabs":return(0,r.jsx)(vN,{field:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,onAction:g});case"separator":return(0,r.jsx)(bN,{});case"info":return(0,r.jsx)(xN,{field:e});case"object-array":return(0,r.jsx)(jN,{field:e});case"editable-array":return(0,r.jsx)($N,{field:e,value:b,onChange:w,disabled:o,translationFn:l,onTestField:d,onAction:g});case"button":return(0,r.jsx)(kN,{field:e,disabled:o,onAction:g});case"addon-action-select":return(0,r.jsx)(PN,{field:e,value:b,values:i,onChange:w,disabled:o,onAction:g});case"addon-action-button":return(0,r.jsx)(NN,{field:e,values:i,disabled:o,onAction:g});case"widget":return(0,r.jsx)(CN,{field:e});default:return k?(0,r.jsx)(k,{field:e,value:b,onChange:w,disabled:o}):null}}function zN(e){return/^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)+$/.test(e)}function cr(e,i){if(e!==void 0)return i&&zN(e)?i(e):e}function TN({section:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,probeResults:f}){const[h,g]=(0,n.useState)(e.defaultCollapsed??!1),v=e.style==="accordion",b=e.columns??2,w=b===1?"grid-cols-1":b===3?"grid-cols-1 @[480px]:grid-cols-2 @[880px]:grid-cols-3":b===4?"grid-cols-1 @[480px]:grid-cols-2 @[1140px]:grid-cols-4":"grid-cols-1 @[640px]:grid-cols-2";return(0,r.jsxs)("div",{className:"@container rounded-lg border border-border bg-surface p-3",style:{containerType:"inline-size"},children:[(0,r.jsxs)("div",{className:["flex items-center justify-between mb-2",v?"cursor-pointer":""].join(" "),onClick:v?()=>g(k=>!k):void 0,children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wider",children:cr(e.title,l)}),e.description&&(0,r.jsx)("p",{className:"text-[10px] text-foreground-subtle mt-0.5",children:cr(e.description,l)})]}),v&&(0,r.jsx)("span",{className:"text-foreground-subtle text-xs ml-2",children:h?"▸":"▾"})]}),!h&&(0,r.jsx)("div",{className:`grid ${w} gap-x-3 gap-y-2.5`,children:e.fields.map(k=>(0,r.jsx)(_n,{field:k,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,externalProbe:f?.[k.key]},k.key))})]})}function Of({schema:e,values:i,onChange:a,disabled:o,translationFn:l,onTestField:d,probeResults:f,onClearProbe:h}){const g=(v,b)=>{a({...i,[v]:b}),h?.(v)};return(0,r.jsx)("div",{className:"space-y-4",children:e.sections.map(v=>(0,r.jsx)(TN,{section:v,values:i,onChange:g,disabled:o,translationFn:l,onTestField:d,probeResults:f},v.id))})}var RN=({open:e})=>(0,r.jsx)("svg",{className:`h-3 w-3 transition-transform ${e?"rotate-90":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0,children:(0,r.jsx)("polyline",{points:"9 18 15 12 9 6"})});function If(e){const i={};if(!e)return i;for(const a of e.sections)for(const o of a.fields){if(o.type==="separator"||o.type==="info"||o.type==="button"||o.type==="group")continue;const l=o.key;i[l]=o.value}return i}function ZN(e){return{...e,sections:e.sections.map(i=>({...i,fields:i.fields.map(a=>{if(a.type==="separator"||a.type==="info"||a.type==="button"||a.type==="group")return a;const{value:o,...l}=a;return l})}))}}function LN({trpc:e,addonId:i,nodeId:a,title:o,disabled:l,onAfterChange:d,refreshToken:f,collapsible:h,defaultOpen:g,mode:v,onOverrideChange:b}){const w=v??"persist",[k,O]=(0,n.useState)(null),[E,A]=(0,n.useState)(!0),[R,Z]=(0,n.useState)(null),[V,G]=(0,n.useState)(!1),[H,J]=(0,n.useState)(g??!1),[X,me]=(0,n.useState)({}),[ae,Ae]=(0,n.useState)(null);(0,n.useEffect)(()=>{Ae(null),me({})},[e,i,a,f,w]),(0,n.useEffect)(()=>{let Qe=!1;A(!0),Z(null);const Le=w==="override"&&Object.keys(X).length>0?X:void 0;return e.addonSettings.getGlobalSettings.query({addonId:i,nodeId:a,...Le?{overlay:Le}:{}}).then(Te=>{Qe||(O(Te),Le||Ae(If(Te)),A(!1))}).catch(Te=>{Qe||(Z(Te instanceof Error?Te.message:String(Te)),A(!1))}),()=>{Qe=!0}},[e,i,a,f,w,JSON.stringify(X)]);const De=(0,n.useMemo)(()=>If(k),[k]),qe=(0,n.useMemo)(()=>k?ZN(k):null,[k]),ot=async Qe=>{if(w==="override"){const Te=ae??De,st={};for(const we of Object.keys(Qe))Qe[we]!==Te[we]&&(st[we]=Qe[we]);const Re={...Te,...st};me(st),b?.(st,Re);return}const Le={};for(const Te of Object.keys(Qe))Qe[Te]!==De[Te]&&(Le[Te]=Qe[Te]);if(Object.keys(Le).length!==0){G(!0);try{await e.addonSettings.updateGlobalSettings.mutate({addonId:i,nodeId:a,patch:Le}),O(await e.addonSettings.getGlobalSettings.query({addonId:i,nodeId:a})),d?.()}catch(Te){Z(Te instanceof Error?Te.message:String(Te))}finally{G(!1)}}};if(E)return(0,r.jsxs)("div",{className:"text-xs text-foreground-subtle animate-pulse",children:["Loading ",o??i,"…"]});if(R)return(0,r.jsxs)("div",{className:"text-xs text-red-400",children:[o??i,": ",R]});if(!k||!qe)return(0,r.jsxs)("div",{className:"text-xs text-foreground-subtle",children:[o??i," not available on ",a,"."]});const Ve=w==="override"?{...De,...X}:De,We=(0,r.jsxs)(r.Fragment,{children:[w==="override"?(0,r.jsx)("div",{className:"mb-2 text-[11px] text-foreground-subtle",children:"Benchmark override — applies to this run only. The addon's saved settings are not changed."}):null,(0,r.jsx)(Of,{schema:qe,values:Ve,onChange:ot,disabled:l===!0||V})]});return h===!0?(0,r.jsxs)("section",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[(0,r.jsxs)("button",{type:"button",onClick:()=>J(Qe=>!Qe),className:"w-full px-4 py-2 flex items-center gap-2 hover:bg-surface-hover text-left","aria-expanded":H,children:[(0,r.jsx)(RN,{open:H}),(0,r.jsx)("h3",{className:"text-xs font-semibold text-foreground uppercase tracking-wide flex-1",children:o??i}),(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle",children:H?"hide":"edit"})]}),H?(0,r.jsx)("div",{className:"border-t border-border px-4 py-3",children:We}):null]}):o?(0,r.jsxs)("section",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[(0,r.jsx)("div",{className:"border-b border-border px-4 py-2",children:(0,r.jsx)("h3",{className:"text-xs font-semibold text-foreground uppercase tracking-wide",children:o})}),(0,r.jsx)("div",{className:"px-4 py-3",children:We})]}):(0,r.jsx)("div",{children:We})}function Ef({detections:{motion:e,motionRaw:i,detection:a,phase:o},showMotionZones:l=!0,showMotionRaw:d=!0,showDetections:f=!0,showPhaseIndicator:h=!0}){const g=l&&e&&e.zones.length>0,v=d&&i&&i.boxes.length>0,b=f&&a&&a.detections.length>0;return!g&&!v&&!b&&!h?null:(0,r.jsxs)("div",{className:"absolute inset-0 pointer-events-none z-10",children:[h&&(0,r.jsx)(UN,{phase:o}),v&&(0,r.jsx)(BN,{raw:i}),g&&(0,r.jsx)(FN,{motion:e}),b&&(0,r.jsx)(GN,{detections:a.detections,frameWidth:a.frameWidth,frameHeight:a.frameHeight})]})}function UN({phase:e}){const i=hs(e);return(0,r.jsxs)("div",{className:"absolute top-2 left-2 flex items-center gap-1.5 px-2 py-1 rounded-md bg-black/60 backdrop-blur-sm",children:[(0,r.jsx)("span",{className:`w-2 h-2 rounded-full ${i.dotClass}`}),(0,r.jsx)("span",{className:"text-[10px] font-semibold text-white uppercase tracking-wider",children:i.label})]})}function BN({raw:e}){return e.frameWidth===0||e.frameHeight===0?null:(0,r.jsx)(r.Fragment,{children:e.boxes.map((i,a)=>{const[o,l,d,f]=i.bbox,h=o/e.frameWidth*100,g=l/e.frameHeight*100,v=(d-o)/e.frameWidth*100,b=(f-l)/e.frameHeight*100,w=Math.max(.05,Math.min(.25,i.changeScore*.3));return(0,r.jsx)("div",{className:"absolute rounded-sm",style:{left:`${h}%`,top:`${g}%`,width:`${v}%`,height:`${b}%`,backgroundColor:`rgba(239, 68, 68, ${w})`}},`mr-${a}`)})})}function FN({motion:e}){return e.frameWidth===0||e.frameHeight===0?null:(0,r.jsx)(r.Fragment,{children:e.zones.filter(i=>i.w*i.h/(e.frameWidth*e.frameHeight)<.9).map((i,a)=>{const o=Math.max(.15,Math.min(.5,i.intensity/255));return(0,r.jsx)("div",{className:"absolute rounded-sm",style:{left:`${i.x/e.frameWidth*100}%`,top:`${i.y/e.frameHeight*100}%`,width:`${i.w/e.frameWidth*100}%`,height:`${i.h/e.frameHeight*100}%`,border:`1px solid rgba(250, 204, 21, ${o})`,backgroundColor:`rgba(250, 204, 21, ${o*.15})`}},`mz-${a}`)})})}function GN({detections:e,frameWidth:i,frameHeight:a}){return i===0||a===0?null:(0,r.jsx)(r.Fragment,{children:e.map(o=>{const{x:l,y:d,width:f,height:h}=o.bbox,g=l/i*100,v=d/a*100,b=f/i*100,w=h/a*100,k=Vt(o.macroClass),O=[`${o.macroClass} ${(o.score*100).toFixed(0)}%`];for(const E of o.labels)O.push(E.label);return(0,r.jsx)("div",{className:"absolute border-2 rounded-sm",style:{left:`${g}%`,top:`${v}%`,width:`${b}%`,height:`${w}%`,borderColor:k},children:(0,r.jsx)("div",{className:"absolute -top-4 left-0 px-1 py-0.5 text-[9px] font-bold text-white rounded-sm whitespace-nowrap",style:{backgroundColor:k},children:O.join(" | ")})},`det-${o.id}`)})})}function VN(e){const i={};if(typeof window<"u"){if(e){const o=e.getBoundingClientRect();o.width>0&&o.height>0&&(i.viewportWidth=Math.round(o.width),i.viewportHeight=Math.round(o.height))}i.viewportWidth===void 0&&(i.viewportWidth=window.innerWidth,i.viewportHeight=window.innerHeight),i.devicePixelRatio=window.devicePixelRatio||1;const a=navigator.connection;a?.downlink&&a.downlink>0&&(i.downlinkMbps=a.downlink)}return i}var QN=3e3,WN=5;function Mf({serverUrl:e,streamKey:i,label:a,autoPlay:o=!0,muted:l=!0,showControls:d=!0,className:f="",onStateChange:h,onError:g,overlay:v,createSession:b,sendAnswer:w,closeSession:k,hintsOverride:O}){const E=(0,n.useRef)(null),A=(0,n.useRef)(null),R=(0,n.useRef)(null),Z=(0,n.useRef)(new Set),V=(0,n.useRef)(null),G=(0,n.useRef)(null),H=(0,n.useRef)(0),J=(0,n.useRef)(!0),[X,me]=(0,n.useState)("idle"),[ae,Ae]=(0,n.useState)(""),[De,qe]=(0,n.useState)(l),[ot,Ve]=(0,n.useState)(!1),[We,Qe]=(0,n.useState)(!1),Le=(0,n.useRef)(null),Te=(0,n.useRef)(!1);(w||b)&&(Te.current=!0);const st=Te.current,Re=(0,n.useCallback)(Ue=>{me(Ue),h?.(Ue)},[h]),we=(0,n.useCallback)(()=>{if(V.current?.abort(),V.current=null,G.current&&(clearTimeout(G.current),G.current=null),R.current&&(R.current.close(),R.current=null),k&&Z.current.size>0){for(const Ue of Z.current)k(Ue).catch(()=>{});Z.current.clear()}E.current&&(E.current.srcObject=null)},[k]),Oe=(0,n.useCallback)(async()=>{if(!J.current||!b||!w)return;we(),Re("connecting");const Ue=new AbortController;V.current=Ue;try{const{sessionId:ut,sdpOffer:_t}=await b({...VN(A.current),...O});if(Z.current.add(ut),!J.current||Ue.signal.aborted){k?.(ut).catch(()=>{}),Z.current.delete(ut);return}const wt=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});R.current=wt;const Rt=new MediaStream;wt.ontrack=Ne=>{console.debug("[WebRTC] ontrack",Ne.track.kind,Ne.track.readyState),Rt.addTrack(Ne.track),E.current&&(E.current.srcObject=Rt,E.current.play().catch(()=>{}))},wt.oniceconnectionstatechange=()=>{if(!J.current)return;const Ne=wt.iceConnectionState;console.debug("[WebRTC] ICE state:",Ne),Ne==="connected"||Ne==="completed"?(H.current=0,Re("playing"),E.current?.paused&&(console.debug("[WebRTC] video was paused at ICE connected — calling play()"),E.current.play().catch(()=>{}))):(Ne==="failed"||Ne==="disconnected"||Ne==="closed")&&(Re("disconnected"),Se())},wt.onicecandidateerror=Ne=>{console.debug("[WebRTC] ICE candidate error:",Ne)},console.debug("[WebRTC] Setting remote description (server offer)..."),await wt.setRemoteDescription({type:"offer",sdp:_t});const _e=await wt.createAnswer();if(await wt.setLocalDescription(_e),console.debug("[WebRTC] Local description set, waiting for ICE gathering..."),await Df(wt),!J.current)return;const Xe=(wt.localDescription?.sdp??"").split(`
141
- `).filter(Ne=>Ne.startsWith("a=candidate:")).length;console.debug("[WebRTC] Sending answer to server",{localCandidates:Xe,sessionId:ut.slice(0,8)}),await w(ut,wt.localDescription?.sdp??""),console.debug("[WebRTC] Answer sent successfully");const dt=wt,pt=()=>{const Ne=dt.connectionState;if(Ne==="closed"||Ne==="failed")return;const Fe=E.current;Fe&&Fe.readyState===0&&console.log(`[WebRTC] no video data yet (ice=${dt.iceConnectionState})`)};setTimeout(pt,3e3),setTimeout(pt,8e3)}catch(ut){if(!J.current)return;const _t=ut instanceof Error?ut.message:String(ut);Ae(_t),Re("error"),g?.(_t),Se()}},[e,i,b,w,we,Re,g,O]),$e=(0,n.useCallback)(async()=>{if(J.current){we(),Re("connecting");try{const Ue=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]});R.current=Ue,Ue.addTransceiver("video",{direction:"recvonly"}),Ue.addTransceiver("audio",{direction:"recvonly"});const ut=new MediaStream;Ue.ontrack=Xe=>{ut.addTrack(Xe.track),E.current&&(E.current.srcObject=ut,E.current.play().catch(()=>{}))},Ue.oniceconnectionstatechange=()=>{if(!J.current)return;const Xe=Ue.iceConnectionState;Xe==="connected"||Xe==="completed"?(H.current=0,Re("playing"),E.current?.paused&&E.current.play().catch(()=>{})):(Xe==="failed"||Xe==="disconnected"||Xe==="closed")&&(Re("disconnected"),Se())};const _t=await Ue.createOffer();if(await Ue.setLocalDescription(_t),await Df(Ue),!J.current)return;const wt=`${e}/api/webrtc?src=${encodeURIComponent(i)}`,Rt=await fetch(wt,{method:"POST",headers:{"Content-Type":"application/sdp"},body:Ue.localDescription?.sdp??""});if(!Rt.ok)throw new Error(`WHEP ${Rt.status}: ${Rt.statusText}`);const _e=await Rt.text();await Ue.setRemoteDescription({type:"answer",sdp:_e})}catch(Ue){if(!J.current)return;const ut=Ue instanceof Error?Ue.message:String(Ue);Ae(ut),Re("error"),g?.(ut),Se()}}},[e,i,we,Re,g]),He=st?Oe:$e,he=(0,n.useRef)(()=>{});he.current=He;const Se=(0,n.useCallback)(()=>{J.current&&(H.current>=WN||(H.current+=1,G.current=setTimeout(()=>{J.current&&he.current()},QN)))},[]);(0,n.useEffect)(()=>(J.current=!0,H.current=0,o&&He(),()=>{J.current=!1,we()}),[e,i]);const Ie=(0,n.useRef)(!1);(0,n.useEffect)(()=>{!o||!st||!b||!w||Ie.current||R.current||(Ie.current=!0,He())},[o,st,b,w,He]);const Pe=()=>{H.current=0,He()},Be=()=>{E.current&&(E.current.muted=!E.current.muted,qe(E.current.muted))},Ze=async()=>{if(A.current)try{document.fullscreenElement?await document.exitFullscreen():await A.current.requestFullscreen()}catch(Ue){console.warn(`Fullscreen toggle failed: ${Ue instanceof Error?Ue.message:Ue}`)}},Qt=()=>{if(!E.current)return;const Ue=document.createElement("canvas");Ue.width=E.current.videoWidth||1280,Ue.height=E.current.videoHeight||720;const ut=Ue.getContext("2d");if(!ut)return;ut.drawImage(E.current,0,0);const _t=document.createElement("a");_t.download=`${i.replace(/[/:]/g,"-")}-${Date.now()}.jpg`,_t.href=Ue.toDataURL("image/jpeg",.92),_t.click()};(0,n.useEffect)(()=>{const Ue=()=>Ve(!!document.fullscreenElement);return document.addEventListener("fullscreenchange",Ue),()=>document.removeEventListener("fullscreenchange",Ue)},[]);const Wt=()=>{Qe(!0),Le.current&&clearTimeout(Le.current),Le.current=setTimeout(()=>Qe(!1),3e3)};return(0,r.jsxs)("div",{ref:A,className:`relative bg-black overflow-hidden group ${f}`,onMouseMove:Wt,onMouseEnter:Wt,children:[(0,r.jsx)("video",{ref:E,autoPlay:o,muted:De,playsInline:!0,className:"w-full h-full object-contain"}),a&&X==="playing"&&(0,r.jsx)("div",{className:"absolute top-2 left-2 px-2 py-0.5 rounded bg-black/60 text-[10px] text-white font-medium",children:a}),v,X==="connecting"&&(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-black/70 gap-2",children:[(0,r.jsx)("svg",{className:"h-6 w-6 text-white/60 animate-spin",viewBox:"0 0 24 24",fill:"none",children:(0,r.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"32",className:"animate-[dash_1.5s_ease-in-out_infinite]"})}),(0,r.jsx)("span",{className:"text-xs text-white/60",children:"Connecting…"})]}),(X==="error"||X==="disconnected")&&(0,r.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-black/70 gap-2",children:[(0,r.jsx)("svg",{className:"h-6 w-6 text-red-400",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:(0,r.jsx)("path",{d:"M1 1l5.5 5.5M23 23l-5.5-5.5M8.11 15.89a8 8 0 0110.78-10.78M3.64 3.64A12 12 0 0020.36 20.36",strokeLinecap:"round"})}),(0,r.jsx)("span",{className:"text-xs text-red-400 text-center px-4",children:X==="error"?ae||"Connection failed":"Disconnected"}),(0,r.jsx)("button",{onClick:Pe,className:"mt-1 inline-flex items-center gap-1.5 rounded px-3 py-1 text-xs bg-white/10 text-white hover:bg-white/20 transition-colors",children:"Reconnect"})]}),d&&X==="playing"&&(0,r.jsxs)("div",{className:`absolute bottom-0 inset-x-0 flex items-center justify-between px-3 py-1.5 bg-gradient-to-t from-black/80 to-transparent transition-opacity duration-200 ${We?"opacity-100":"opacity-0"}`,children:[(0,r.jsx)("div",{className:"flex items-center gap-1",children:(0,r.jsx)(kl,{onClick:Be,title:De?"Unmute":"Mute",children:De?(0,r.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,r.jsx)("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),(0,r.jsx)("line",{x1:"23",y1:"9",x2:"17",y2:"15"}),(0,r.jsx)("line",{x1:"17",y1:"9",x2:"23",y2:"15"})]}):(0,r.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,r.jsx)("polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5"}),(0,r.jsx)("path",{d:"M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"})]})})}),(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(kl,{onClick:Qt,title:"Take snapshot",children:(0,r.jsxs)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[(0,r.jsx)("path",{d:"M23 19a2 2 0 01-2 2H3a2 2 0 01-2-2V8a2 2 0 012-2h4l2-3h6l2 3h4a2 2 0 012 2z"}),(0,r.jsx)("circle",{cx:"12",cy:"13",r:"4"})]})}),(0,r.jsx)(kl,{onClick:Ze,title:ot?"Exit fullscreen":"Fullscreen",children:ot?(0,r.jsx)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,r.jsx)("path",{d:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3"})}):(0,r.jsx)("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:(0,r.jsx)("path",{d:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3"})})})]})]})]})}function kl({onClick:e,title:i,children:a}){return(0,r.jsx)("button",{onClick:e,title:i,className:"rounded-full p-1.5 text-white/80 hover:text-white hover:bg-white/20 transition-colors",children:a})}async function Df(e){if(e.iceGatheringState!=="complete")return new Promise(i=>{const a=()=>{e.iceGatheringState==="complete"&&(e.removeEventListener("icegatheringstatechange",a),i())};e.addEventListener("icegatheringstatechange",a),setTimeout(i,5e3)})}function qN(e){return e==="streaming"?"bg-emerald-500":e==="connecting"?"bg-amber-500":e==="error"?"bg-rose-500":"bg-zinc-500"}function HN(e){const i=Math.floor(e/1e3);return i<60?`${i}s`:i<3600?`${Math.floor(i/60)}m`:`${Math.floor(i/3600)}h${Math.floor(i%3600/60)}m`}function Pl({className:e}){return(0,r.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polygon",{points:"5 3 19 12 5 21 5 3"})})}function JN({className:e}){return(0,r.jsx)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1"})})}function KN({className:e}){return(0,r.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3z"}),(0,r.jsx)("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),(0,r.jsx)("line",{x1:"12",y1:"19",x2:"12",y2:"23"}),(0,r.jsx)("line",{x1:"8",y1:"23",x2:"16",y2:"23"})]})}function XN({className:e}){return(0,r.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor",children:[(0,r.jsx)("circle",{cx:"5",cy:"12",r:"2"}),(0,r.jsx)("circle",{cx:"12",cy:"12",r:"2"}),(0,r.jsx)("circle",{cx:"19",cy:"12",r:"2"})]})}function Nl({label:e,active:i,onClick:a}){return(0,r.jsxs)("button",{type:"button",onClick:a,className:"w-full flex items-center justify-between gap-3 px-3 py-1.5 text-[11px] text-foreground hover:bg-surface-hover transition-colors",children:[(0,r.jsx)("span",{children:e}),(0,r.jsx)("span",{className:`inline-block h-3 w-5 rounded-full transition-colors ${i?"bg-primary":"bg-foreground-subtle/30"} relative`,children:(0,r.jsx)("span",{className:`absolute top-0.5 h-2 w-2 rounded-full bg-white transition-all ${i?"left-2.5":"left-0.5"}`})})]})}function Af({className:e}){return(0,r.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("polyline",{points:"23 4 23 10 17 10"}),(0,r.jsx)("polyline",{points:"1 20 1 14 7 14"}),(0,r.jsx)("path",{d:"M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15"})]})}function YN({className:e}){return(0,r.jsxs)("svg",{className:e,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,r.jsx)("line",{x1:"2",y1:"2",x2:"22",y2:"22"}),(0,r.jsx)("path",{d:"M10.41 10.41a2 2 0 11-2.83-2.83"}),(0,r.jsx)("line",{x1:"13.5",y1:"13.5",x2:"6",y2:"21"}),(0,r.jsx)("path",{d:"M18 12l-1.5-1.5"}),(0,r.jsx)("path",{d:"M21 15V5a2 2 0 00-2-2H5"}),(0,r.jsx)("path",{d:"M21 21H5a2 2 0 01-2-2V11"})]})}function eC({serverUrl:e,createSession:i,sendAnswer:a,closeSession:o,streams:l,activeStreamId:d,onStreamChange:f,deviceName:h,phase:g,pipelineMetrics:v,detections:b,defaultShowDetections:w=!0,defaultShowMotion:k=!1,streamStats:O,autoPlay:E=!1,showPlayStop:A=!1,snapshotSrc:R,snapshotLoading:Z=!1,onRefreshSnapshot:V,showStreamStats:G=!1,children:H,extraOverlay:J,ptzAvailable:X=!1,ptzShown:me=!1,ptzOverlay:ae,onPtzToggle:Ae,intercomAvailable:De=!1,intercomShown:qe=!1,onIntercomToggle:ot,chromeless:Ve=!1,className:We}){const Qe=bf(),[Le,Te]=(0,n.useState)(E),[st,Re]=(0,n.useState)(w),[we,Oe]=(0,n.useState)(k),[$e,He]=(0,n.useState)(null),[he,Se]=(0,n.useState)(!1),Ie=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!he)return;function Ne(Fe){Ie.current&&!Ie.current.contains(Fe.target)&&Se(!1)}return document.addEventListener("mousedown",Ne),()=>document.removeEventListener("mousedown",Ne)},[he]);const Pe=d??$e??l?.[0]?.id??"",Be=l?.find(Ne=>Ne.id===Pe)??l?.[0],Ze=Be?.inputFps!=null?{status:Be.status??"unknown",inputFps:Be.inputFps,bitrateKbps:Be.bitrateKbps??0}:null,Qt=Ne=>{He(Ne),f?.(Ne),Le&&A&&(Te(!1),setTimeout(()=>Te(!0),50))},Wt=(0,n.useMemo)(()=>{const Ne=Be?.target;if(Ne)return Fe=>i(Ne,Fe)},[i,Be]),Ue=l,ut=()=>Te(!0),_t=()=>Te(!1),wt=v?.phase??g,Rt=wt==="active",_e=!!b,Xe=_e&&(st||we),dt=X&&me&&!!ae,pt=A?Le:!0;return(0,r.jsxs)("div",{className:`overflow-hidden ${Ve?"":"rounded-xl border border-border bg-surface"} ${We??""}`,children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(O??Ze)&&(0,r.jsx)("span",{className:`w-2 h-2 rounded-full ${qN((O??Ze).status)}`}),h&&(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:h}),Ue&&Ue.length>1&&(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("select",{"data-testid":"stream-profile-select",value:Pe,onChange:Ne=>Qt(Ne.target.value),className:"appearance-none cursor-pointer rounded-md border border-border bg-surface-hover hover:bg-surface text-foreground text-[11px] font-medium pl-2 pr-6 py-1 focus:outline-none focus:ring-1 focus:ring-primary transition-colors",children:Ue.map(Ne=>(0,r.jsx)("option",{value:Ne.id,children:Ne.label},Ne.id))}),(0,r.jsx)("span",{className:"pointer-events-none absolute right-1.5 top-1/2 -translate-y-1/2 text-foreground-subtle",children:(0,r.jsx)("svg",{className:"h-2.5 w-2.5",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,r.jsx)("polyline",{points:"3 4.5 6 7.5 9 4.5"})})})]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[De&&(0,r.jsxs)("button",{"data-testid":"stream-intercom-toggle","data-intercom-shown":qe?"true":"false",onClick:ot,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors ${qe?"bg-primary/15 text-primary":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover"}`,title:qe?"Close intercom":"Open intercom",children:[(0,r.jsx)(KN,{className:"h-3 w-3"}),(0,r.jsx)("span",{className:"hidden xl:inline",children:"Intercom"})]}),Qe.map(Ne=>{const Fe=Ne.tone==="primary"?"bg-primary text-primary-foreground":"bg-primary/15 text-primary";return(0,r.jsxs)("button",{type:"button","data-toolbar-button-id":Ne.id,"data-toolbar-button-active":Ne.active?"true":"false",onClick:Ne.onClick,disabled:Ne.disabled,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors disabled:opacity-50 ${Ne.active?Fe:"text-foreground-subtle hover:text-foreground hover:bg-surface-hover"}`,title:Ne.title??Ne.label,children:[Ne.icon,(0,r.jsx)("span",{className:"hidden xl:inline",children:Ne.label})]},Ne.id)}),A&&(0,r.jsxs)("button",{"data-testid":"stream-play-toggle","data-stream-playing":pt?"true":"false",onClick:pt?_t:ut,className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium transition-colors ${pt?"bg-danger/10 text-danger hover:bg-danger/20":"bg-primary/10 text-primary hover:bg-primary/20"}`,title:pt?"Stop stream":"Start stream",children:[pt?(0,r.jsx)(JN,{className:"h-3 w-3"}):(0,r.jsx)(Pl,{className:"h-3 w-3"}),(0,r.jsx)("span",{className:"hidden xl:inline",children:pt?"Stop":"Play"})]}),V&&(0,r.jsxs)("button",{"data-testid":"stream-snapshot-refresh",onClick:V,disabled:Z,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50",title:"Force snapshot refresh",children:[(0,r.jsx)(Af,{className:`h-3 w-3 ${Z?"animate-spin":""}`}),(0,r.jsx)("span",{className:"hidden xl:inline",children:"Snapshot"})]}),(_e||X||v||wt||O||Ze&&Ze.inputFps>0)&&(0,r.jsxs)("div",{ref:Ie,className:"relative",children:[(0,r.jsx)("button",{onClick:()=>Se(Ne=>!Ne),title:"More controls",className:"inline-flex items-center justify-center rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:(0,r.jsx)(XN,{className:"h-3.5 w-3.5"})}),he&&(0,r.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-30 min-w-[200px] rounded-lg border border-border bg-surface shadow-xl py-1.5",children:[G&&O&&(0,r.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Input"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[O.inputFps.toFixed(1)," fps"]})]}),(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Decode"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[O.decodeFps.toFixed(1)," fps"]})]}),(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Uptime"}),(0,r.jsx)("span",{className:"tabular-nums text-foreground",children:HN(O.uptimeMs)})]})]}),!G&&Ze&&Ze.inputFps>0&&(0,r.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Input"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[Ze.inputFps.toFixed(1)," fps"]})]}),Ze.bitrateKbps>0&&(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Bitrate"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[Ze.bitrateKbps," kbps"]})]})]}),(v||_e&&wt)&&(0,r.jsxs)("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle border-b border-border-subtle",children:[(0,r.jsxs)("div",{className:"flex justify-between gap-3 items-center",children:[(0,r.jsx)("span",{children:"Phase"}),(0,r.jsxs)("span",{className:`flex items-center gap-1 font-semibold uppercase tracking-wider ${Rt?"text-red-400":"text-emerald-400"}`,children:[(0,r.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${Rt?"bg-red-500 animate-pulse":"bg-emerald-500"}`}),Rt?"Active":"Watching"]})]}),v&&v.detectionFps>0&&(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Detection"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[v.detectionFps.toFixed(1)," det/s"]})]}),v&&v.avgInferenceMs>0&&(0,r.jsxs)("div",{className:"flex justify-between gap-3",children:[(0,r.jsx)("span",{children:"Inference"}),(0,r.jsxs)("span",{className:"tabular-nums text-foreground",children:[v.avgInferenceMs.toFixed(0)," ms"]})]})]}),_e&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Nl,{label:"Show detections",active:st,onClick:()=>Re(Ne=>!Ne)}),(0,r.jsx)(Nl,{label:"Show motion",active:we,onClick:()=>Oe(Ne=>!Ne)})]}),X&&(0,r.jsx)(Nl,{label:"PTZ controls",active:me,onClick:()=>{Ae?.(),Se(!1)}})]})]})]})]}),pt?(0,r.jsx)("div",{className:"aspect-video relative",children:(0,r.jsx)(Mf,{serverUrl:e,streamKey:Pe,autoPlay:!0,className:"w-full h-full",createSession:Wt,sendAnswer:a,closeSession:o,overlay:Xe||J||dt?(0,r.jsxs)(r.Fragment,{children:[Xe&&(0,r.jsx)(Ef,{detections:b,showPhaseIndicator:!1,showMotionZones:we,showMotionRaw:we,showDetections:st}),J,dt&&ae]}):void 0},Pe)}):(0,r.jsx)(tC,{src:R??null,isLoading:Z,onPlay:ut,onRetry:V,extraOverlay:J||dt?(0,r.jsxs)(r.Fragment,{children:[J,dt&&ae]}):null,suppressPlayHover:!!J||dt}),H]})}function tC({src:e,isLoading:i,onPlay:a,onRetry:o,extraOverlay:l,suppressPlayHover:d=!1}){return e?(0,r.jsxs)("div",{className:"relative w-full aspect-video bg-black/90 flex items-center justify-center",children:[(0,r.jsx)("img",{src:e,alt:"Camera snapshot",className:"w-full h-full object-contain"}),!d&&(0,r.jsx)("button",{onClick:a,className:"absolute inset-0 flex items-center justify-center bg-black/30 opacity-0 hover:opacity-100 transition-opacity cursor-pointer",children:(0,r.jsx)("div",{className:"h-14 w-14 rounded-full bg-white/20 backdrop-blur-sm flex items-center justify-center",children:(0,r.jsx)(Pl,{className:"h-7 w-7 text-white ml-0.5"})})}),l]}):i?(0,r.jsx)("div",{className:"relative w-full aspect-video bg-black/90 flex items-center justify-center",children:(0,r.jsx)("div",{className:"h-8 w-8 border-2 border-white/20 border-t-white/60 rounded-full animate-spin"})}):(0,r.jsx)("div",{className:"relative w-full aspect-video bg-black/90 flex items-center justify-center",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 text-white/40",children:[(0,r.jsx)(YN,{className:"h-8 w-8"}),(0,r.jsx)("span",{className:"text-xs",children:"No snapshot available"}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[o&&(0,r.jsxs)("button",{onClick:o,className:"inline-flex items-center gap-1.5 rounded-md border border-white/20 px-3 py-1.5 text-xs font-medium text-white/60 hover:text-white hover:border-white/40 transition-colors",children:[(0,r.jsx)(Af,{className:"h-3 w-3"}),"Retry"]}),(0,r.jsxs)("button",{onClick:a,className:"inline-flex items-center gap-1.5 rounded-md bg-primary/80 px-3 py-1.5 text-xs font-medium text-white hover:bg-primary transition-colors",children:[(0,r.jsx)(Pl,{className:"h-3 w-3"}),"Play Live"]})]})]})})}var zf={value:"auto",label:"Auto (best available)"};function rC(e){return e.charAt(0).toUpperCase()+e.slice(1)}function nC({deviceId:e,value:i,onChange:a,disabled:o,label:l,className:d}){const f=(0,n.useId)(),h=Yd({deviceId:e},{refetchOnWindowFocus:!1}),[g,v]=(0,n.useState)([zf]);(0,n.useEffect)(()=>{if(!h.data)return;const k=`${e}/`,O=[zf];for(const E of h.data){if(!E.enabled)continue;const A=E.brokerId.startsWith(k)?E.brokerId.slice(k.length):E.brokerId;O.push({value:A,label:rC(A)})}v(O)},[h.data,e]);const b=l??"Preferred stream",w=h.isLoading?"Loading available streams…":h.isError?"Could not load streams — only Auto available.":g.length===1?"No enabled streams found — only Auto available.":null;return(0,r.jsxs)("div",{className:d,children:[(0,r.jsx)("label",{id:f,className:"text-xs font-medium text-foreground-muted block mb-1",children:b}),(0,r.jsx)(Zi,{"aria-labelledby":f,options:g,value:i,disabled:o,onChange:k=>a(k.target.value)}),w!==null&&(0,r.jsx)("p",{className:"text-foreground-subtle text-[10px] mt-1",children:w})]})}var iC=Object.defineProperty,La=Object.getOwnPropertySymbols,Tf=Object.prototype.hasOwnProperty,Rf=Object.prototype.propertyIsEnumerable,Zf=(e,i,a)=>i in e?iC(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a,Cl=(e,i)=>{for(var a in i||(i={}))Tf.call(i,a)&&Zf(e,a,i[a]);if(La)for(var a of La(i))Rf.call(i,a)&&Zf(e,a,i[a]);return e},Ol=(e,i)=>{var a={};for(var o in e)Tf.call(e,o)&&i.indexOf(o)<0&&(a[o]=e[o]);if(e!=null&&La)for(var o of La(e))i.indexOf(o)<0&&Rf.call(e,o)&&(a[o]=e[o]);return a};/**
142
- * @license QR Code generator library (TypeScript)
143
- * Copyright (c) Project Nayuki.
144
- * SPDX-License-Identifier: MIT
145
- */var Kr;(e=>{const i=class nt{constructor(g,v,b,w){if(this.version=g,this.errorCorrectionLevel=v,this.modules=[],this.isFunction=[],g<nt.MIN_VERSION||g>nt.MAX_VERSION)throw new RangeError("Version value out of range");if(w<-1||w>7)throw new RangeError("Mask value out of range");this.size=g*4+17;let k=[];for(let E=0;E<this.size;E++)k.push(!1);for(let E=0;E<this.size;E++)this.modules.push(k.slice()),this.isFunction.push(k.slice());this.drawFunctionPatterns();const O=this.addEccAndInterleave(b);if(this.drawCodewords(O),w==-1){let E=1e9;for(let A=0;A<8;A++){this.applyMask(A),this.drawFormatBits(A);const R=this.getPenaltyScore();R<E&&(w=A,E=R),this.applyMask(A)}}l(0<=w&&w<=7),this.mask=w,this.applyMask(w),this.drawFormatBits(w),this.isFunction=[]}static encodeText(g,v){const b=e.QrSegment.makeSegments(g);return nt.encodeSegments(b,v)}static encodeBinary(g,v){const b=e.QrSegment.makeBytes(g);return nt.encodeSegments([b],v)}static encodeSegments(g,v,b=1,w=40,k=-1,O=!0){if(!(nt.MIN_VERSION<=b&&b<=w&&w<=nt.MAX_VERSION)||k<-1||k>7)throw new RangeError("Invalid value");let E,A;for(E=b;;E++){const G=nt.getNumDataCodewords(E,v)*8,H=f.getTotalBits(g,E);if(H<=G){A=H;break}if(E>=w)throw new RangeError("Data too long")}for(const G of[nt.Ecc.MEDIUM,nt.Ecc.QUARTILE,nt.Ecc.HIGH])O&&A<=nt.getNumDataCodewords(E,G)*8&&(v=G);let R=[];for(const G of g){a(G.mode.modeBits,4,R),a(G.numChars,G.mode.numCharCountBits(E),R);for(const H of G.getData())R.push(H)}l(R.length==A);const Z=nt.getNumDataCodewords(E,v)*8;l(R.length<=Z),a(0,Math.min(4,Z-R.length),R),a(0,(8-R.length%8)%8,R),l(R.length%8==0);for(let G=236;R.length<Z;G^=253)a(G,8,R);let V=[];for(;V.length*8<R.length;)V.push(0);return R.forEach((G,H)=>V[H>>>3]|=G<<7-(H&7)),new nt(E,v,V,k)}getModule(g,v){return 0<=g&&g<this.size&&0<=v&&v<this.size&&this.modules[v][g]}getModules(){return this.modules}drawFunctionPatterns(){for(let b=0;b<this.size;b++)this.setFunctionModule(6,b,b%2==0),this.setFunctionModule(b,6,b%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const g=this.getAlignmentPatternPositions(),v=g.length;for(let b=0;b<v;b++)for(let w=0;w<v;w++)b==0&&w==0||b==0&&w==v-1||b==v-1&&w==0||this.drawAlignmentPattern(g[b],g[w]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(g){const v=this.errorCorrectionLevel.formatBits<<3|g;let b=v;for(let k=0;k<10;k++)b=b<<1^(b>>>9)*1335;const w=(v<<10|b)^21522;l(w>>>15==0);for(let k=0;k<=5;k++)this.setFunctionModule(8,k,o(w,k));this.setFunctionModule(8,7,o(w,6)),this.setFunctionModule(8,8,o(w,7)),this.setFunctionModule(7,8,o(w,8));for(let k=9;k<15;k++)this.setFunctionModule(14-k,8,o(w,k));for(let k=0;k<8;k++)this.setFunctionModule(this.size-1-k,8,o(w,k));for(let k=8;k<15;k++)this.setFunctionModule(8,this.size-15+k,o(w,k));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let g=this.version;for(let b=0;b<12;b++)g=g<<1^(g>>>11)*7973;const v=this.version<<12|g;l(v>>>18==0);for(let b=0;b<18;b++){const w=o(v,b),k=this.size-11+b%3,O=Math.floor(b/3);this.setFunctionModule(k,O,w),this.setFunctionModule(O,k,w)}}drawFinderPattern(g,v){for(let b=-4;b<=4;b++)for(let w=-4;w<=4;w++){const k=Math.max(Math.abs(w),Math.abs(b)),O=g+w,E=v+b;0<=O&&O<this.size&&0<=E&&E<this.size&&this.setFunctionModule(O,E,k!=2&&k!=4)}}drawAlignmentPattern(g,v){for(let b=-2;b<=2;b++)for(let w=-2;w<=2;w++)this.setFunctionModule(g+w,v+b,Math.max(Math.abs(w),Math.abs(b))!=1)}setFunctionModule(g,v,b){this.modules[v][g]=b,this.isFunction[v][g]=!0}addEccAndInterleave(g){const v=this.version,b=this.errorCorrectionLevel;if(g.length!=nt.getNumDataCodewords(v,b))throw new RangeError("Invalid argument");const w=nt.NUM_ERROR_CORRECTION_BLOCKS[b.ordinal][v],k=nt.ECC_CODEWORDS_PER_BLOCK[b.ordinal][v],O=Math.floor(nt.getNumRawDataModules(v)/8),E=w-O%w,A=Math.floor(O/w);let R=[];const Z=nt.reedSolomonComputeDivisor(k);for(let G=0,H=0;G<w;G++){let J=g.slice(H,H+A-k+(G<E?0:1));H+=J.length;const X=nt.reedSolomonComputeRemainder(J,Z);G<E&&J.push(0),R.push(J.concat(X))}let V=[];for(let G=0;G<R[0].length;G++)R.forEach((H,J)=>{(G!=A-k||J>=E)&&V.push(H[G])});return l(V.length==O),V}drawCodewords(g){if(g.length!=Math.floor(nt.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let v=0;for(let b=this.size-1;b>=1;b-=2){b==6&&(b=5);for(let w=0;w<this.size;w++)for(let k=0;k<2;k++){const O=b-k,E=(b+1&2)==0?this.size-1-w:w;!this.isFunction[E][O]&&v<g.length*8&&(this.modules[E][O]=o(g[v>>>3],7-(v&7)),v++)}}l(v==g.length*8)}applyMask(g){if(g<0||g>7)throw new RangeError("Mask value out of range");for(let v=0;v<this.size;v++)for(let b=0;b<this.size;b++){let w;switch(g){case 0:w=(b+v)%2==0;break;case 1:w=v%2==0;break;case 2:w=b%3==0;break;case 3:w=(b+v)%3==0;break;case 4:w=(Math.floor(b/3)+Math.floor(v/2))%2==0;break;case 5:w=b*v%2+b*v%3==0;break;case 6:w=(b*v%2+b*v%3)%2==0;break;case 7:w=((b+v)%2+b*v%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[v][b]&&w&&(this.modules[v][b]=!this.modules[v][b])}}getPenaltyScore(){let g=0;for(let k=0;k<this.size;k++){let O=!1,E=0,A=[0,0,0,0,0,0,0];for(let R=0;R<this.size;R++)this.modules[k][R]==O?(E++,E==5?g+=nt.PENALTY_N1:E>5&&g++):(this.finderPenaltyAddHistory(E,A),O||(g+=this.finderPenaltyCountPatterns(A)*nt.PENALTY_N3),O=this.modules[k][R],E=1);g+=this.finderPenaltyTerminateAndCount(O,E,A)*nt.PENALTY_N3}for(let k=0;k<this.size;k++){let O=!1,E=0,A=[0,0,0,0,0,0,0];for(let R=0;R<this.size;R++)this.modules[R][k]==O?(E++,E==5?g+=nt.PENALTY_N1:E>5&&g++):(this.finderPenaltyAddHistory(E,A),O||(g+=this.finderPenaltyCountPatterns(A)*nt.PENALTY_N3),O=this.modules[R][k],E=1);g+=this.finderPenaltyTerminateAndCount(O,E,A)*nt.PENALTY_N3}for(let k=0;k<this.size-1;k++)for(let O=0;O<this.size-1;O++){const E=this.modules[k][O];E==this.modules[k][O+1]&&E==this.modules[k+1][O]&&E==this.modules[k+1][O+1]&&(g+=nt.PENALTY_N2)}let v=0;for(const k of this.modules)v=k.reduce((O,E)=>O+(E?1:0),v);const b=this.size*this.size,w=Math.ceil(Math.abs(v*20-b*10)/b)-1;return l(0<=w&&w<=9),g+=w*nt.PENALTY_N4,l(0<=g&&g<=2568888),g}getAlignmentPatternPositions(){if(this.version==1)return[];{const g=Math.floor(this.version/7)+2,v=this.version==32?26:Math.ceil((this.version*4+4)/(g*2-2))*2;let b=[6];for(let w=this.size-7;b.length<g;w-=v)b.splice(1,0,w);return b}}static getNumRawDataModules(g){if(g<nt.MIN_VERSION||g>nt.MAX_VERSION)throw new RangeError("Version number out of range");let v=(16*g+128)*g+64;if(g>=2){const b=Math.floor(g/7)+2;v-=(25*b-10)*b-55,g>=7&&(v-=36)}return l(208<=v&&v<=29648),v}static getNumDataCodewords(g,v){return Math.floor(nt.getNumRawDataModules(g)/8)-nt.ECC_CODEWORDS_PER_BLOCK[v.ordinal][g]*nt.NUM_ERROR_CORRECTION_BLOCKS[v.ordinal][g]}static reedSolomonComputeDivisor(g){if(g<1||g>255)throw new RangeError("Degree out of range");let v=[];for(let w=0;w<g-1;w++)v.push(0);v.push(1);let b=1;for(let w=0;w<g;w++){for(let k=0;k<v.length;k++)v[k]=nt.reedSolomonMultiply(v[k],b),k+1<v.length&&(v[k]^=v[k+1]);b=nt.reedSolomonMultiply(b,2)}return v}static reedSolomonComputeRemainder(g,v){let b=v.map(w=>0);for(const w of g){const k=w^b.shift();b.push(0),v.forEach((O,E)=>b[E]^=nt.reedSolomonMultiply(O,k))}return b}static reedSolomonMultiply(g,v){if(g>>>8||v>>>8)throw new RangeError("Byte out of range");let b=0;for(let w=7;w>=0;w--)b=b<<1^(b>>>7)*285,b^=(v>>>w&1)*g;return l(b>>>8==0),b}finderPenaltyCountPatterns(g){const v=g[1];l(v<=this.size*3);const b=v>0&&g[2]==v&&g[3]==v*3&&g[4]==v&&g[5]==v;return(b&&g[0]>=v*4&&g[6]>=v?1:0)+(b&&g[6]>=v*4&&g[0]>=v?1:0)}finderPenaltyTerminateAndCount(g,v,b){return g&&(this.finderPenaltyAddHistory(v,b),v=0),v+=this.size,this.finderPenaltyAddHistory(v,b),this.finderPenaltyCountPatterns(b)}finderPenaltyAddHistory(g,v){v[0]==0&&(g+=this.size),v.pop(),v.unshift(g)}};i.MIN_VERSION=1,i.MAX_VERSION=40,i.PENALTY_N1=3,i.PENALTY_N2=3,i.PENALTY_N3=40,i.PENALTY_N4=10,i.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],i.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=i;function a(h,g,v){if(g<0||g>31||h>>>g)throw new RangeError("Value out of range");for(let b=g-1;b>=0;b--)v.push(h>>>b&1)}function o(h,g){return(h>>>g&1)!=0}function l(h){if(!h)throw new Error("Assertion error")}const d=class kt{constructor(g,v,b){if(this.mode=g,this.numChars=v,this.bitData=b,v<0)throw new RangeError("Invalid argument");this.bitData=b.slice()}static makeBytes(g){let v=[];for(const b of g)a(b,8,v);return new kt(kt.Mode.BYTE,g.length,v)}static makeNumeric(g){if(!kt.isNumeric(g))throw new RangeError("String contains non-numeric characters");let v=[];for(let b=0;b<g.length;){const w=Math.min(g.length-b,3);a(parseInt(g.substring(b,b+w),10),w*3+1,v),b+=w}return new kt(kt.Mode.NUMERIC,g.length,v)}static makeAlphanumeric(g){if(!kt.isAlphanumeric(g))throw new RangeError("String contains unencodable characters in alphanumeric mode");let v=[],b;for(b=0;b+2<=g.length;b+=2){let w=kt.ALPHANUMERIC_CHARSET.indexOf(g.charAt(b))*45;w+=kt.ALPHANUMERIC_CHARSET.indexOf(g.charAt(b+1)),a(w,11,v)}return b<g.length&&a(kt.ALPHANUMERIC_CHARSET.indexOf(g.charAt(b)),6,v),new kt(kt.Mode.ALPHANUMERIC,g.length,v)}static makeSegments(g){return g==""?[]:kt.isNumeric(g)?[kt.makeNumeric(g)]:kt.isAlphanumeric(g)?[kt.makeAlphanumeric(g)]:[kt.makeBytes(kt.toUtf8ByteArray(g))]}static makeEci(g){let v=[];if(g<0)throw new RangeError("ECI assignment value out of range");if(g<128)a(g,8,v);else if(g<16384)a(2,2,v),a(g,14,v);else if(g<1e6)a(6,3,v),a(g,21,v);else throw new RangeError("ECI assignment value out of range");return new kt(kt.Mode.ECI,0,v)}static isNumeric(g){return kt.NUMERIC_REGEX.test(g)}static isAlphanumeric(g){return kt.ALPHANUMERIC_REGEX.test(g)}getData(){return this.bitData.slice()}static getTotalBits(g,v){let b=0;for(const w of g){const k=w.mode.numCharCountBits(v);if(w.numChars>=1<<k)return 1/0;b+=4+k+w.bitData.length}return b}static toUtf8ByteArray(g){g=encodeURI(g);let v=[];for(let b=0;b<g.length;b++)g.charAt(b)!="%"?v.push(g.charCodeAt(b)):(v.push(parseInt(g.substring(b+1,b+3),16)),b+=2);return v}};d.NUMERIC_REGEX=/^[0-9]*$/,d.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,d.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let f=d;e.QrSegment=d})(Kr||(Kr={})),(e=>{(i=>{const a=class{constructor(l,d){this.ordinal=l,this.formatBits=d}};a.LOW=new a(0,1),a.MEDIUM=new a(1,0),a.QUARTILE=new a(2,3),a.HIGH=new a(3,2),i.Ecc=a})(e.QrCode||(e.QrCode={}))})(Kr||(Kr={})),(e=>{(i=>{const a=class{constructor(l,d){this.modeBits=l,this.numBitsCharCount=d}numCharCountBits(l){return this.numBitsCharCount[Math.floor((l+7)/17)]}};a.NUMERIC=new a(1,[10,12,14]),a.ALPHANUMERIC=new a(2,[9,11,13]),a.BYTE=new a(4,[8,16,16]),a.KANJI=new a(8,[8,10,12]),a.ECI=new a(7,[0,0,0]),i.Mode=a})(e.QrSegment||(e.QrSegment={}))})(Kr||(Kr={}));var wn=Kr;/**
146
- * @license qrcode.react
147
- * Copyright (c) Paul O'Shannessy
148
- * SPDX-License-Identifier: ISC
149
- */var aC={L:wn.QrCode.Ecc.LOW,M:wn.QrCode.Ecc.MEDIUM,Q:wn.QrCode.Ecc.QUARTILE,H:wn.QrCode.Ecc.HIGH},Lf=128,Uf="L",Bf="#FFFFFF",Ff="#000000",Gf=!1,Vf=1,oC=4,sC=0,lC=.1;function Qf(e,i=0){const a=[];return e.forEach(function(o,l){let d=null;o.forEach(function(f,h){if(!f&&d!==null){a.push(`M${d+i} ${l+i}h${h-d}v1H${d+i}z`),d=null;return}if(h===o.length-1){if(!f)return;d===null?a.push(`M${h+i},${l+i} h1v1H${h+i}z`):a.push(`M${d+i},${l+i} h${h+1-d}v1H${d+i}z`);return}f&&d===null&&(d=h)})}),a.join("")}function Wf(e,i){return e.slice().map((a,o)=>o<i.y||o>=i.y+i.h?a:a.map((l,d)=>d<i.x||d>=i.x+i.w?l:!1))}function cC(e,i,a,o){if(o==null)return null;const l=e.length+a*2,d=Math.floor(i*lC),f=l/i,h=(o.width||d)*f,g=(o.height||d)*f,v=o.x==null?e.length/2-h/2:o.x*f,b=o.y==null?e.length/2-g/2:o.y*f,w=o.opacity==null?1:o.opacity;let k=null;if(o.excavate){let E=Math.floor(v),A=Math.floor(b);k={x:E,y:A,w:Math.ceil(h+v-E),h:Math.ceil(g+b-A)}}const O=o.crossOrigin;return{x:v,y:b,h:g,w:h,excavation:k,opacity:w,crossOrigin:O}}function uC(e,i){return i!=null?Math.max(Math.floor(i),0):e?oC:sC}function qf({value:e,level:i,minVersion:a,includeMargin:o,marginSize:l,imageSettings:d,size:f,boostLevel:h}){let g=p.default.useMemo(()=>{const O=(Array.isArray(e)?e:[e]).reduce((E,A)=>(E.push(...wn.QrSegment.makeSegments(A)),E),[]);return wn.QrCode.encodeSegments(O,aC[i],a,void 0,void 0,h)},[e,i,a,h]);const{cells:v,margin:b,numCells:w,calculatedImageSettings:k}=p.default.useMemo(()=>{let O=g.getModules();const E=uC(o,l);return{cells:O,margin:E,numCells:O.length+E*2,calculatedImageSettings:cC(O,f,E,d)}},[g,f,d,o,l]);return{qrcode:g,margin:b,cells:v,numCells:w,calculatedImageSettings:k}}var dC=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),fC=p.default.forwardRef(function(i,a){const o=i,{value:l,size:d=Lf,level:f=Uf,bgColor:h=Bf,fgColor:g=Ff,includeMargin:v=Gf,minVersion:b=Vf,boostLevel:w,marginSize:k,imageSettings:O}=o,E=Ol(o,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:A}=E,R=Ol(E,["style"]),Z=O?.src,V=p.default.useRef(null),G=p.default.useRef(null),H=p.default.useCallback(Ve=>{V.current=Ve,typeof a=="function"?a(Ve):a&&(a.current=Ve)},[a]),[J,X]=p.default.useState(!1),{margin:me,cells:ae,numCells:Ae,calculatedImageSettings:De}=qf({value:l,level:f,minVersion:b,boostLevel:w,includeMargin:v,marginSize:k,imageSettings:O,size:d});p.default.useEffect(()=>{if(V.current!=null){const Ve=V.current,We=Ve.getContext("2d");if(!We)return;let Qe=ae;const Le=G.current,Te=De!=null&&Le!==null&&Le.complete&&Le.naturalHeight!==0&&Le.naturalWidth!==0;Te&&De.excavation!=null&&(Qe=Wf(ae,De.excavation));const st=window.devicePixelRatio||1;Ve.height=Ve.width=d*st;const Re=d/Ae*st;We.scale(Re,Re),We.fillStyle=h,We.fillRect(0,0,Ae,Ae),We.fillStyle=g,dC?We.fill(new Path2D(Qf(Qe,me))):ae.forEach(function(we,Oe){we.forEach(function($e,He){$e&&We.fillRect(He+me,Oe+me,1,1)})}),De&&(We.globalAlpha=De.opacity),Te&&We.drawImage(Le,De.x+me,De.y+me,De.w,De.h)}}),p.default.useEffect(()=>{X(!1)},[Z]);const qe=Cl({height:d,width:d},A);let ot=null;return Z!=null&&(ot=p.default.createElement("img",{src:Z,key:Z,style:{display:"none"},onLoad:()=>{X(!0)},ref:G,crossOrigin:De?.crossOrigin})),p.default.createElement(p.default.Fragment,null,p.default.createElement("canvas",Cl({style:qe,height:d,width:d,ref:H,role:"img"},R)),ot)});fC.displayName="QRCodeCanvas";var Hf=p.default.forwardRef(function(i,a){const o=i,{value:l,size:d=Lf,level:f=Uf,bgColor:h=Bf,fgColor:g=Ff,includeMargin:v=Gf,minVersion:b=Vf,boostLevel:w,title:k,marginSize:O,imageSettings:E}=o,A=Ol(o,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:R,cells:Z,numCells:V,calculatedImageSettings:G}=qf({value:l,level:f,minVersion:b,boostLevel:w,includeMargin:v,marginSize:O,imageSettings:E,size:d});let H=Z,J=null;E!=null&&G!=null&&(G.excavation!=null&&(H=Wf(Z,G.excavation)),J=p.default.createElement("image",{href:E.src,height:G.h,width:G.w,x:G.x+R,y:G.y+R,preserveAspectRatio:"none",opacity:G.opacity,crossOrigin:G.crossOrigin}));const X=Qf(H,R);return p.default.createElement("svg",Cl({height:d,width:d,viewBox:`0 0 ${V} ${V}`,ref:a,role:"img"},A),!!k&&p.default.createElement("title",null,k),p.default.createElement("path",{fill:h,d:`M0,0 h${V}v${V}H0z`,shapeRendering:"crispEdges"}),p.default.createElement("path",{fill:g,d:X,shapeRendering:"crispEdges"}),J)});Hf.displayName="QRCodeSVG";var mC=192;function Jf({value:e,size:i=mC,className:a,alt:o}){const l=e.trim();return l.length===0?null:(0,r.jsx)("div",{className:P("inline-flex rounded-md bg-white p-2",a),children:(0,r.jsx)(Hf,{value:l,size:i,marginSize:1,title:o??"QR code"})})}var gC=2e3;function Kf({value:e,label:i,className:a,disabled:o}){const[l,d]=(0,n.useState)(!1),f=(0,n.useCallback)(()=>{e&&navigator.clipboard.writeText(e).then(()=>{d(!0),setTimeout(()=>d(!1),gC)})},[e]);return(0,r.jsxs)(Sr,{size:"sm",variant:"ghost",type:"button",disabled:o||e.length===0,onClick:f,className:P(a),"aria-label":l?"Copied":`Copy ${i??"value"}`,children:[l?(0,r.jsx)(Ti,{className:"h-3.5 w-3.5 text-success"}):(0,r.jsx)(Ar,{className:"h-3.5 w-3.5"}),i?(0,r.jsx)("span",{className:"ml-1",children:l?"Copied":i}):null]})}var pC=ye.z.array(ie.ExposedDeviceSchema),Xf=1e4;function Yf(e){return e==="linked"?"success":e==="error"?"danger":"warning"}function em(e){return e==="linked"?"Linked":e==="unlinked"?"Unlinked":e==="error"?"Error":e}function hC({field:e}){const[i,a]=(0,n.useState)(!1),o=e.secret===!0,l=o&&!i?"•".repeat(Math.min(e.value.length,24)):e.value;return(0,r.jsxs)("div",{className:"flex items-center gap-2 py-1.5",children:[(0,r.jsx)("span",{className:"text-[11px] text-foreground-subtle w-32 shrink-0",children:e.label}),(0,r.jsx)("span",{className:"flex-1 min-w-0 truncate font-mono text-xs text-foreground",children:l||"—"}),o&&(0,r.jsx)(Sr,{size:"sm",variant:"ghost",type:"button","aria-label":i?"Hide value":"Reveal value",onClick:()=>a(d=>!d),children:i?(0,r.jsx)(Zs,{className:"h-3.5 w-3.5"}):(0,r.jsx)(pn,{className:"h-3.5 w-3.5"})}),(0,r.jsx)(Kf,{value:e.value,label:e.label})]})}function vC({setup:e}){const i=e.fields??[];return(0,r.jsxs)("div",{className:"border-b border-border bg-surface-hover/10",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border",children:[(0,r.jsx)(Eh,{className:"h-3.5 w-3.5 text-foreground-subtle shrink-0"}),(0,r.jsx)("span",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wide",children:"Setup"})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 p-4 sm:flex-row sm:items-start",children:[e.qr&&(0,r.jsx)("div",{className:"shrink-0",children:(0,r.jsx)(Jf,{value:e.qr,alt:"Pairing QR code"})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[e.note&&(0,r.jsx)("p",{className:"text-xs text-foreground-muted whitespace-pre-line mb-2",children:e.note}),i.length>0&&(0,r.jsx)("div",{className:"divide-y divide-border-subtle",children:i.map(a=>(0,r.jsx)(hC,{field:a},a.label))})]})]})]})}function bC({addonId:e,onOpenDevice:i}){const a=(0,ee.useQueryClient)(),o=ef({nodeId:"hub",addonId:e},{refetchInterval:Xf,retry:!1}),l=tf({nodeId:"hub",addonId:e},{refetchInterval:Xf,retry:!1}),d=rf({onSuccess:()=>{a.invalidateQueries({queryKey:[["deviceExport"]]})}}),f=(0,n.useMemo)(()=>{const O=ie.DeviceExportStatusSchema.safeParse(o.data);return O.success?O.data:null},[o.data]),h=(0,n.useMemo)(()=>{const O=pC.safeParse(l.data);return O.success?O.data:[]},[l.data]),g=f?.linkState??"unlinked",v=(0,n.useMemo)(()=>h.map(O=>({deviceId:O.deviceId,displayName:O.exposedAs??`Device ${O.deviceId}`,streamPreference:"auto",linkState:g})),[h,g]),b=o.isLoading||l.isLoading,w=f?.exposedDeviceCount??v.length,k=(0,n.useMemo)(()=>[{key:"device",header:"Device",render:O=>(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)("span",{className:"text-foreground font-medium",children:O.displayName}),(0,r.jsxs)("span",{className:"text-foreground-subtle text-xs font-mono",children:["#",O.deviceId]})]})},{key:"status",header:"Status",render:O=>(0,r.jsx)(zr,{variant:Yf(O.linkState),children:em(O.linkState)})},{key:"stream",header:"Stream",render:O=>(0,r.jsx)("span",{className:"text-xs text-foreground-subtle font-mono",children:O.streamPreference==="auto"?"Auto":O.streamPreference})},{key:"actions",header:"",align:"right",render:O=>(0,r.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[i&&(0,r.jsxs)(Sr,{size:"sm",variant:"ghost",onClick:()=>i(O.deviceId),children:[(0,r.jsx)(Rs,{className:"h-3.5 w-3.5 mr-1"}),"Open"]}),(0,r.jsxs)(Sr,{size:"sm",variant:"ghost",disabled:d.isPending,onClick:()=>d.mutate({deviceId:O.deviceId,nodeId:"hub",addonId:e}),children:[(0,r.jsx)(Wh,{className:"h-3.5 w-3.5 mr-1"}),"Unexpose"]})]})}],[i,d,e]);return(0,r.jsxs)("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-3 px-4 py-2.5 border-b border-border bg-surface-hover/20",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)(nu,{className:"h-3.5 w-3.5 text-foreground-subtle shrink-0"}),(0,r.jsx)("span",{className:"text-[11px] font-semibold text-foreground-subtle uppercase tracking-wide",children:"Exported devices"}),(0,r.jsx)(zr,{variant:Yf(g),children:em(g)}),(0,r.jsxs)("span",{className:"text-[11px] text-foreground-subtle",children:[w," exposed"]})]}),b&&(0,r.jsx)(Gt,{className:"h-3.5 w-3.5 animate-spin text-foreground-subtle"})]}),f?.error&&(0,r.jsx)("div",{className:"px-4 py-3 border-b border-border",children:(0,r.jsx)(Ju,{message:f.error})}),f?.setup&&(0,r.jsx)(vC,{setup:f.setup}),v.length===0?(0,r.jsx)(Hu,{icon:nu,title:"No devices exposed",description:`Expose a camera to "${e}" from its device-details page to surface it in the connected ecosystem.`}):(0,r.jsx)("div",{className:"p-3",children:(0,r.jsx)(Uu,{columns:k,rows:v,rowKey:O=>O.deviceId})})]})}function yC({samples:e,sampleRate:i=16e3,height:a=96,className:o="",color:l="#3b82f6",bgColor:d="transparent"}){const f=(0,n.useRef)(null),h=(0,n.useRef)(null),g=(0,n.useCallback)(()=>{const b=f.current,w=h.current;if(!b||!w||!e||e.length===0)return;const k=w.clientWidth;if(k===0)return;const O=window.devicePixelRatio||1;b.width=k*O,b.height=a*O,b.style.width=`${k}px`,b.style.height=`${a}px`;const E=b.getContext("2d");if(!E)return;E.scale(O,O),d!=="transparent"?(E.fillStyle=d,E.fillRect(0,0,k,a)):E.clearRect(0,0,k,a);const A=e.length/k,R=a/2;E.fillStyle=l,E.globalAlpha=.7;for(let Z=0;Z<k;Z++){const V=Math.floor(Z*A),G=Math.min(Math.floor((Z+1)*A),e.length);let H=0,J=0;for(let Ae=V;Ae<G;Ae++){const De=e[Ae];De<H&&(H=De),De>J&&(J=De)}const X=R-J*R,me=R-H*R,ae=Math.max(1,me-X);E.fillRect(Z,X,1,ae)}E.globalAlpha=1,E.strokeStyle=l,E.globalAlpha=.2,E.lineWidth=1,E.beginPath(),E.moveTo(0,R),E.lineTo(k,R),E.stroke(),E.globalAlpha=1},[e,a,l,d]);(0,n.useEffect)(()=>{g()},[g]),(0,n.useEffect)(()=>{const b=new ResizeObserver(()=>g()),w=h.current;return w&&b.observe(w),()=>b.disconnect()},[g]);const v=((e&&i?Math.round(e.length/i*1e3):0)/1e3).toFixed(1);return(0,r.jsxs)("div",{ref:h,className:`relative ${o}`,children:[(0,r.jsx)("canvas",{ref:f,className:"w-full rounded-md"}),e&&e.length>0&&(0,r.jsxs)("div",{className:"absolute bottom-1 right-2 text-[10px] text-foreground-subtle/60 font-mono",children:[v,"s · ",i/1e3,"kHz · ",e.length.toLocaleString()," samples"]})]})}function xC({currentDbfs:e,durationSec:i=30,maxSamples:a=120,height:o=64,className:l="",color:d="#10b981",clipColor:f="#ef4444",clipThreshold:h=-6,minDbfs:g=-96}){const v=(0,n.useRef)(null),b=(0,n.useRef)(null),[w,k]=(0,n.useState)([]);(0,n.useEffect)(()=>{e!==null&&k(A=>{const R=[...A,{dbfs:e,timestamp:Date.now()}];return R.length>a?R.slice(-a):R})},[e,a]);const O=(0,n.useCallback)(()=>{const A=v.current,R=b.current;if(!A||!R)return;const Z=R.clientWidth;if(Z===0)return;const V=window.devicePixelRatio||1;A.width=Z*V,A.height=o*V,A.style.width=`${Z}px`,A.style.height=`${o}px`;const G=A.getContext("2d");if(!G||(G.scale(V,V),G.clearRect(0,0,Z,o),w.length===0))return;const H=w[w.length-1].timestamp,J=i*1e3,X=H-J,me=w.filter(qe=>qe.timestamp>=X);if(me.length===0)return;const ae=Math.max(1,Math.floor(Z/(i*2))),Ae=Math.abs(g);for(const qe of me){const ot=qe.timestamp-X,Ve=Math.floor(ot/J*Z),We=(Math.max(g,Math.min(0,qe.dbfs))-g)/Ae,Qe=Math.max(1,We*o);G.fillStyle=qe.dbfs>=h?f:d,G.globalAlpha=.8,G.fillRect(Ve,o-Qe,ae,Qe)}G.globalAlpha=1;const De=o-(h-g)/Ae*o;G.strokeStyle=f,G.globalAlpha=.25,G.lineWidth=1,G.setLineDash([4,4]),G.beginPath(),G.moveTo(0,De),G.lineTo(Z,De),G.stroke(),G.setLineDash([]),G.globalAlpha=1},[w,i,o,d,f,h,g]);(0,n.useEffect)(()=>{O()},[O]),(0,n.useEffect)(()=>{const A=new ResizeObserver(()=>O()),R=b.current;return R&&A.observe(R),()=>A.disconnect()},[O]);const E=w.length>0?w[w.length-1].dbfs:null;return(0,r.jsxs)("div",{ref:b,className:`relative ${l}`,children:[(0,r.jsx)("canvas",{ref:v,className:"w-full rounded-md"}),(0,r.jsxs)("div",{className:"absolute top-1 left-2 text-[9px] text-foreground-subtle/50 font-mono",children:[i,"s"]}),E!==null&&(0,r.jsxs)("div",{className:"absolute bottom-1 right-2 text-[9px] text-foreground-subtle/50 font-mono",children:[E.toFixed(1)," dBFS · ",w.length," samples"]})]})}function _C(e){return e>=.8?"bg-emerald-500":e>=.5?"bg-amber-500":e>=.3?"bg-orange-500":"bg-zinc-500"}function wC(e){return e>=.8?"text-emerald-400":e>=.5?"text-amber-400":e>=.3?"text-orange-400":"text-zinc-400"}function SC({classifications:e,processing:i=!1,inferenceMs:a,maxItems:o=10,className:l=""}){const d=e.slice(0,o),f=d.length>0?d[0].score:1;return i?(0,r.jsx)("div",{className:`rounded-xl border border-border bg-surface p-4 text-center ${l}`,children:(0,r.jsx)("div",{className:"text-sm text-foreground-subtle animate-pulse",children:"Classifying audio..."})}):d.length===0?(0,r.jsx)("div",{className:`rounded-xl border border-border bg-surface p-4 text-center ${l}`,children:(0,r.jsx)("div",{className:"text-xs text-foreground-subtle",children:"No classifications yet"})}):(0,r.jsxs)("div",{className:`rounded-xl border border-border bg-surface overflow-hidden ${l}`,children:[(0,r.jsxs)("div",{className:"px-3 py-2 border-b border-border flex items-center justify-between",children:[(0,r.jsx)("h3",{className:"text-xs font-medium text-foreground",children:"Audio Classifications"}),(0,r.jsxs)("div",{className:"flex items-center gap-3 text-[10px] text-foreground-subtle",children:[d.length<e.length&&(0,r.jsxs)("span",{children:["showing ",d.length," of ",e.length]}),a!==void 0&&(0,r.jsxs)("span",{className:"font-mono",children:[a.toFixed(1),"ms"]})]})]}),(0,r.jsx)("div",{className:"divide-y divide-border/50",children:d.map((h,g)=>{const v=f>0?h.score/f*100:0;return(0,r.jsxs)("div",{className:"px-3 py-1.5 flex items-center gap-3 hover:bg-surface-hover/30",children:[(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle w-5 text-right font-mono",children:g+1}),(0,r.jsx)("span",{className:"text-xs font-medium text-foreground min-w-[120px]",children:h.className}),(0,r.jsx)("div",{className:"flex-1 h-2 rounded-full bg-zinc-800 overflow-hidden",children:(0,r.jsx)("div",{className:`h-full rounded-full transition-all duration-300 ${_C(h.score)}`,style:{width:`${v}%`}})}),(0,r.jsxs)("span",{className:`text-xs font-mono font-semibold w-14 text-right ${wC(h.score)}`,children:[(h.score*100).toFixed(1),"%"]})]},`${h.className}-${g}`)})})]})}function jC({data:e,label:i="Response",className:a=""}){const[o,l]=(0,n.useState)(!1);if(!e)return null;const d=JSON.stringify(e,null,2);return(0,r.jsxs)("div",{className:`rounded-xl border border-border bg-surface overflow-hidden ${a}`,children:[(0,r.jsxs)("div",{className:"px-3 py-2 border-b border-border flex items-center justify-between cursor-pointer select-none hover:bg-surface-hover/30",onClick:()=>l(f=>!f),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle",children:o?"▼":"▶"}),(0,r.jsx)("h3",{className:"text-xs font-medium text-foreground",children:i})]}),(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle font-mono",children:d.length>1e3?`${(d.length/1024).toFixed(1)} KB`:`${d.length} bytes`})]}),o&&(0,r.jsx)("div",{className:"max-h-80 overflow-y-auto overflow-x-auto",children:(0,r.jsx)("pre",{className:"p-3 text-[10px] leading-4 font-mono text-foreground-subtle whitespace-pre",children:d})})]})}var $C={Activity:Mr,Eye:pn,AlertTriangle:vn,PauseCircle:ph,PowerOff:Ih};function kC({phase:e,...i}){const a=$C[hs(e).icon];return(0,r.jsx)(a,{...i})}function Sn(e){const[i,a]=(0,n.useState)([]),o=(0,n.useCallback)(d=>{a(f=>{const h=[...f,d];return h.length>e?h.slice(-e):h})},[e]),l=(0,n.useCallback)(()=>{a([])},[]);return(0,n.useMemo)(()=>({entries:i,append:o,reset:l}),[i,o,l])}function tm(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}var rm={error:{icon:gn,color:"text-red-400"},warn:{icon:vn,color:"text-amber-400"},info:{icon:jh,color:"text-blue-400"},debug:{icon:ch,color:"text-gray-500"}},nm={debug:0,info:1,warn:2,error:3},PC=["all","debug","info","warn","error"],NC=500;function CC(e,i){return i?(nm[e]??0)>=(nm[i]??0):!0}function Il({agentId:e,addonId:i,deviceId:a,integrationId:o,requestId:l,level:d,maxHeight:f="max-h-96",showScope:h=!1,showFilters:g=!0,limit:v=100,liveBuffer:b,onClose:w,className:k}){const[O,E]=(0,n.useState)(""),[A,R]=(0,n.useState)(""),[Z,V]=(0,n.useState)(d),G=e,H=i??(O||void 0),J=a??(A?Number(A):void 0),X=o,me=l,ae=(0,n.useMemo)(()=>{const _e={};return G&&(_e.agentId=G),H&&(_e.addonId=H),J!==void 0&&Number.isFinite(J)&&(_e.deviceId=J),X&&(_e.integrationId=X),me&&(_e.requestId=me),Object.keys(_e).length>0?_e:void 0},[G,H,J,X,me]),Ae=Sn(NC),De=b??Ae,qe=De.entries,[ot,Ve]=(0,n.useState)(0),[We,Qe]=(0,n.useState)(!1),[Le,Te]=(0,n.useState)(!1),[st,Re]=(0,n.useState)(new Set),[we,Oe]=(0,n.useState)(""),$e=(0,n.useRef)(null),He=`${G??""}:${H??""}:${String(J??"")}:${X??""}:${me??""}`,he=(0,n.useRef)(He);(0,n.useEffect)(()=>{he.current!==He&&(he.current=He,De.reset(),Ve(0),Re(new Set))},[He,De]);const{data:Se,isLoading:Ie}=j.logs.query.useQuery({...ae?{tags:ae}:{},limit:v},{staleTime:3e4});j.logs.subscribe.useSubscription({...ae?{tags:ae}:{}},{onData:_e=>{De.append(_e)}});const Pe=(0,n.useRef)(qe.length);(0,n.useEffect)(()=>{const _e=$e.current;if(!_e){Pe.current=qe.length;return}const Xe=Pe.current;if(Pe.current=qe.length,!(qe.length<=Xe)){if(We&&_e.scrollTop<=8)_e.scrollTo({top:0});else if(!We&&_e.scrollTop>0){const dt=_e.querySelector("tbody tr"),pt=dt instanceof HTMLElement?dt.offsetHeight:24;_e.scrollTop+=pt*(qe.length-Xe)}}},[qe.length,We]);const Be=(0,n.useMemo)(()=>{const _e=(Se??[]).map(Fe=>({timestamp:Fe.timestamp,level:Fe.level,message:Fe.message,scope:Fe.scope,tags:Fe.tags,meta:Fe.meta})),Xe=new Set,dt=[];for(const Fe of[...qe].reverse()){const yt=`${Fe.timestamp}|${Fe.level}|${Fe.scope??""}|${Fe.message}`;Xe.has(yt)||(Xe.add(yt),dt.push(Fe))}for(const Fe of _e){const yt=`${Fe.timestamp}|${Fe.level}|${Fe.scope??""}|${Fe.message}`;Xe.has(yt)||(Xe.add(yt),dt.push(Fe))}const pt=(ot>0?dt.filter(Fe=>new Date(Fe.timestamp).getTime()>ot):dt).filter(Fe=>CC(Fe.level,Z)),Ne=we.trim().toLowerCase();return Ne?pt.filter(Fe=>{if(Fe.message.toLowerCase().includes(Ne)||Fe.scope&&Fe.scope.toLowerCase().includes(Ne))return!0;if(Fe.tags){for(const yt of Object.values(Fe.tags))if(yt!==void 0&&String(yt).toLowerCase().includes(Ne))return!0}if(Fe.meta){for(const yt of Object.values(Fe.meta))if(yt!=null&&tm(yt).toLowerCase().includes(Ne))return!0}return!1}):pt},[Se,qe,Z,ot,we]),Ze=(0,n.useCallback)(()=>{const _e=Be.map(Xe=>{const dt=new Date(Xe.timestamp).toLocaleTimeString(),pt=Xe.tags?" "+Object.entries(Xe.tags).filter(([,Ne])=>Ne).map(([Ne,Fe])=>`${Ne}=${Fe}`).join(" "):"";return`${dt} [${Xe.level.toUpperCase()}]${Xe.scope?` [${Xe.scope}]`:""}${pt} ${Xe.message}`});navigator.clipboard.writeText(_e.join(`
150
- `)).then(()=>{Te(!0),setTimeout(()=>Te(!1),1500)})},[Be]),Qt=j.logs.clear.useMutation(),Wt=(0,n.useCallback)(()=>{Ve(Date.now()),De.reset(),Qt.mutate({...ae?{tags:ae}:{}})},[De,Qt,ae]),Ue=(0,n.useCallback)(_e=>{Re(Xe=>{const dt=new Set(Xe);return dt.has(_e)?dt.delete(_e):dt.add(_e),dt})},[]),[ut,_t]=(0,n.useState)(null),wt=(0,n.useCallback)((_e,Xe)=>{const dt=new Date(_e.timestamp).toISOString(),pt=_e.tags?" "+Object.entries(_e.tags).filter(([,yt])=>yt).map(([yt,jr])=>`${yt}=${jr}`).join(" "):"",Ne=_e.meta&&Object.keys(_e.meta).length>0?` meta=${JSON.stringify(_e.meta)}`:"",Fe=`${dt} [${_e.level.toUpperCase()}]${_e.scope?` [${_e.scope}]`:""}${pt} ${_e.message}${Ne}`;navigator.clipboard.writeText(Fe).then(()=>{_t(Xe),setTimeout(()=>_t(yt=>yt===Xe?null:yt),1200)})},[]),Rt=(0,n.useCallback)(_e=>`${_e.timestamp}|${_e.level}|${_e.scope??""}|${_e.message}`,[]);return(0,r.jsxs)("div",{className:P("h-full min-h-0 flex flex-col",k),onClick:_e=>_e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-hover/30 gap-2 shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"Logs"}),G&&(0,r.jsx)(El,{label:"agent",value:G}),H&&(0,r.jsx)(El,{label:"addon",value:H}),J!==void 0&&(0,r.jsx)(El,{label:"device",value:`#${J}`}),(0,r.jsx)("div",{className:"flex rounded border border-border overflow-hidden text-[9px]",children:PC.map(_e=>(0,r.jsxs)("button",{type:"button",onClick:()=>V(_e==="all"?void 0:_e),className:P("px-1.5 py-0.5 capitalize transition-colors",_e==="all"&&!Z||Z===_e?"bg-primary/10 text-primary":"text-foreground-subtle hover:bg-surface-hover",_e!=="all"&&"border-l border-border"),children:[_e,_e!=="all"?"+":""]},_e))}),(0,r.jsx)(Ml,{icon:Bc,label:We?"Auto":"Paused",active:!We,onClick:()=>{Qe(_e=>!_e),!We&&$e.current&&$e.current.scrollTo({top:0,behavior:"smooth"})}}),(0,r.jsx)(Ml,{icon:Ar,label:Le?"Copied!":"Copy",onClick:Ze,disabled:Be.length===0}),(0,r.jsx)(Ml,{icon:wr,label:"Clear",onClick:Wt}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:"text",value:we,onChange:_e=>Oe(_e.target.value),placeholder:"Search…",className:"w-32 pl-1.5 pr-5 py-0.5 rounded border border-border bg-background text-foreground text-[10px] focus:outline-none focus:border-primary/50"}),we&&(0,r.jsx)("button",{type:"button",onClick:()=>Oe(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",title:"Clear search",children:(0,r.jsx)(It,{className:"h-2.5 w-2.5"})})]}),qe.length>0&&(0,r.jsxs)("span",{className:"text-[9px] text-emerald-400 font-medium",children:["+",qe.length," live"]})]}),w&&(0,r.jsx)("button",{type:"button",onClick:w,className:"text-foreground-subtle hover:text-foreground",children:(0,r.jsx)(It,{className:"h-3.5 w-3.5"})})]}),g&&(!i||!a)&&(0,r.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1 border-b border-border/50 bg-surface/50 text-[10px]",children:[!i&&(0,r.jsxs)("label",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"text-foreground-subtle",children:"Addon:"}),(0,r.jsx)("input",{type:"text",value:O,onChange:_e=>E(_e.target.value),placeholder:"all",className:"w-28 px-1.5 py-0.5 rounded border border-border bg-background text-foreground text-[10px] focus:outline-none focus:border-primary/50"})]}),!a&&(0,r.jsxs)("label",{className:"flex items-center gap-1",children:[(0,r.jsx)("span",{className:"text-foreground-subtle",children:"Device:"}),(0,r.jsx)("input",{type:"text",inputMode:"numeric",value:A,onChange:_e=>R(_e.target.value),placeholder:"all",className:"w-16 px-1.5 py-0.5 rounded border border-border bg-background text-foreground text-[10px] focus:outline-none focus:border-primary/50"})]})]}),(0,r.jsxs)("div",{ref:$e,className:P("flex-1 min-h-0 overflow-auto font-mono text-[10px]",f),children:[Ie&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle",children:[(0,r.jsx)(Gt,{className:"h-3.5 w-3.5 animate-spin"}),"Loading logs..."]}),!Ie&&Be.length===0&&(0,r.jsx)("div",{className:"py-4 text-center text-foreground-subtle",children:"No logs found"}),Be.length>0&&(0,r.jsx)("table",{className:"w-full",children:(0,r.jsx)("tbody",{children:Be.map(_e=>{const Xe=rm[_e.level]??rm.info,dt=Xe.icon,pt=Rt(_e),Ne=st.has(pt),Fe=_e.tags&&Object.keys(_e.tags).length>0,yt=_e.meta&&Object.keys(_e.meta).length>0,jr=Fe||yt;return(0,r.jsxs)("tr",{className:P("hover:bg-surface-hover/30 border-b border-border/30",jr&&"cursor-pointer"),onClick:jr?()=>Ue(pt):void 0,children:[(0,r.jsx)("td",{className:"px-2 py-1 text-foreground-subtle whitespace-nowrap align-top w-[70px]",children:new Date(_e.timestamp).toLocaleTimeString()}),(0,r.jsx)("td",{className:P("px-1 py-1 align-top w-5",Xe.color),children:(0,r.jsx)(dt,{className:"h-3 w-3"})}),h&&(0,r.jsx)("td",{className:"px-2 py-1 text-foreground-subtle align-top truncate max-w-[120px]",title:_e.scope,children:_e.scope?.replace(/^addon:/,"")??""}),(0,r.jsx)("td",{className:"px-2 py-1 text-foreground break-all",children:(0,r.jsxs)("div",{className:"flex items-start gap-1",children:[jr&&(Ne?(0,r.jsx)(Wr,{className:"h-3 w-3 text-foreground-subtle shrink-0 mt-0.5"}):(0,r.jsx)(Dr,{className:"h-3 w-3 text-foreground-subtle shrink-0 mt-0.5"})),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[_e.message,Ne&&jr&&(0,r.jsxs)("div",{className:"mt-1 text-[9px] text-foreground-subtle bg-surface rounded px-2 py-1 space-y-0.5",children:[yt&&Object.entries(_e.meta).filter(([,qt])=>qt!==void 0&&qt!=="").map(([qt,$n])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-amber-400/80 font-medium",children:qt}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,r.jsx)("span",{className:"text-foreground break-all",children:tm($n)})]},`m-${qt}`)),Fe&&Object.entries(_e.tags).filter(([,qt])=>qt!==void 0).map(([qt,$n])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-primary/70 font-medium",children:qt}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,r.jsx)("span",{className:"text-foreground",children:$n})]},`t-${qt}`))]})]})]})}),(0,r.jsx)("td",{className:"px-1 py-1 align-top w-5",children:(0,r.jsx)(IC,{copied:ut===pt,onCopy:()=>wt(_e,pt)})})]},pt)})})})]})]})}function OC({position:e="bottom",className:i,...a}){return(0,r.jsx)("div",{className:P(e==="bottom"?"absolute bottom-0 left-0 right-0 z-10 border-t border-border bg-surface/95 backdrop-blur-sm":"absolute inset-x-2 bottom-2 z-10 rounded-lg border border-border bg-surface/95 backdrop-blur-sm shadow-xl",i),children:(0,r.jsx)(Il,{maxHeight:"max-h-48",...a})})}function El({label:e,value:i}){return(0,r.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:[e,": ",i]})}function IC({copied:e,onCopy:i}){return(0,r.jsx)("button",{type:"button",title:"Copy this row",onClick:a=>{a.stopPropagation(),i()},className:P("rounded p-0.5 transition-colors",e?"text-emerald-400":"text-foreground-subtle/60 hover:text-foreground hover:bg-surface-hover"),children:e?(0,r.jsx)(Ti,{className:"h-3 w-3"}):(0,r.jsx)(Ar,{className:"h-3 w-3"})})}function Ml({icon:e,label:i,onClick:a,disabled:o,active:l}){return(0,r.jsxs)("button",{type:"button",onClick:a,disabled:o,className:P("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",l?"border-amber-500/30 bg-amber-500/10 text-amber-400":"border-border text-foreground-subtle hover:text-foreground",o&&"opacity-40 cursor-not-allowed"),children:[(0,r.jsx)(e,{className:"h-2.5 w-2.5"}),i]})}function EC(e,i,a,o){if(o!==void 0&&(e.source.deviceId??(e.source.type==="device"&&typeof e.source.id=="number"?e.source.id:void 0))!==o||a!==void 0&&(e.source.addonId??(e.source.type==="addon"&&typeof e.source.id=="string"?e.source.id:void 0))!==a)return!1;if(i!==void 0){const l=e.source.nodeId;if(!l||l!==i&&!l.startsWith(`${i}/`))return!1}return!0}var MC={[ie.EventCategory.AddonStarted]:{icon:Bs,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Started"},[ie.EventCategory.AddonInstalled]:{icon:Ts,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Installed"},[ie.EventCategory.AddonRestarted]:{icon:ka,color:"bg-blue-500/15 text-blue-400 border-blue-500/30",label:"Restarted"},[ie.EventCategory.AddonUpdated]:{icon:su,color:"bg-blue-500/15 text-blue-400 border-blue-500/30",label:"Updated"},[ie.EventCategory.AddonStopped]:{icon:iu,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:"Stopped"},[ie.EventCategory.AddonUninstalled]:{icon:wr,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:"Uninstalled"},[ie.EventCategory.AddonCrashed]:{icon:gn,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Crashed"},[ie.EventCategory.AddonError]:{icon:vn,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Error"},[ie.EventCategory.DetectionPhaseTransition]:{icon:Mr,color:"bg-violet-500/15 text-violet-400 border-violet-500/30",label:"Phase"},[ie.EventCategory.DetectionResult]:{icon:Ah,color:"bg-purple-500/15 text-purple-400 border-purple-500/30",label:"Detection"},[ie.EventCategory.DetectionEvent]:{icon:pn,color:"bg-blue-500/15 text-blue-400 border-blue-500/30",label:"Event"},[ie.EventCategory.DetectionCameraNative]:{icon:ou,color:"bg-cyan-500/15 text-cyan-400 border-cyan-500/30",label:"Camera AI"},[ie.EventCategory.ProviderMotion]:{icon:cu,color:"bg-orange-500/15 text-orange-400 border-orange-500/30",label:"Motion"},[ie.EventCategory.MotionOnMotionChanged]:{icon:cu,color:"bg-orange-500/15 text-orange-400 border-orange-500/30",label:"Motion"},[ie.EventCategory.MotionAnalysis]:{icon:Mr,color:"bg-orange-500/10 text-orange-300 border-orange-500/20",label:"Motion analysis"},[ie.EventCategory.MotionZonesRaw]:{icon:Mr,color:"bg-orange-500/10 text-orange-300 border-orange-500/20",label:"Motion zones"},[ie.EventCategory.ProviderDetection]:{icon:ou,color:"bg-cyan-500/15 text-cyan-400 border-cyan-500/30",label:"Provider Det"},[ie.EventCategory.PipelineAudioInferenceResult]:{icon:Kc,color:"bg-pink-500/15 text-pink-400 border-pink-500/30",label:"Audio"},[ie.EventCategory.AgentOnline]:{icon:Bs,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Agent Online"},[ie.EventCategory.AgentOffline]:{icon:iu,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Agent Offline"},[ie.EventCategory.DeviceRegistered]:{icon:Ts,color:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",label:"Registered"},[ie.EventCategory.DeviceUnregistered]:{icon:wr,color:"bg-red-500/15 text-red-400 border-red-500/30",label:"Unregistered"},[ie.EventCategory.DeviceStateChanged]:{icon:Mr,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:"State"}};function Dl(e,i){const a=MC[e]??{icon:Bs,color:"bg-foreground-subtle/10 text-foreground-subtle border-border",label:e.split(".").pop()??e};if(e===ie.EventCategory.DeviceStateChanged&&i&&typeof i.capName=="string"){const o=i.capName;return{...a,label:o}}return a}var jn=Object.freeze([...new Set(Object.values(ie.EventCategory))].sort()),DC=Object.freeze([ie.EventCategory.PipelineCameraMetricsSnapshot,ie.EventCategory.PipelineRunnerLoadSnapshot,ie.EventCategory.PipelineEngineMetricsSnapshot,ie.EventCategory.PipelineInferenceResult,ie.EventCategory.PipelineTrace,ie.EventCategory.PipelineProgress,ie.EventCategory.StreamBrokerMetricsSnapshot,ie.EventCategory.MetricsNodeResourcesSnapshot,ie.EventCategory.MetricsNodeProcessesSnapshot,ie.EventCategory.ClusterTopologySnapshot,ie.EventCategory.MotionAnalysis,ie.EventCategory.MotionZonesRaw,ie.EventCategory.DetectionResult,ie.EventCategory.PipelineAudioInferenceResult,ie.EventCategory.PlatformProbePhase,ie.EventCategory.BenchmarkProgress,ie.EventCategory.ModelDownloadProgress]),AC=new Set(DC),zC=Object.freeze(jn.filter(e=>!AC.has(e)));function Ua(e,i){if(e===ie.EventCategory.DetectionPhaseTransition){const l=i.to,d=i.from,f=typeof i.source=="string"?i.source:null,h=typeof i.cooldownMs=="number"?i.cooldownMs:null,g=f?` (${f}${h?`, ${Math.round(h/1e3)}s cooldown`:""})`:"";return l==="active"?`Motion detected — phase active${g}`:l==="watching"?`Cooldown expired — phase watching${g}`:`Phase: ${String(d)} → ${String(l)}${g}`}if(e===ie.EventCategory.DetectionResult){const l=i.frame?.detections??[];if(l.length===0)return null;const d=new Map;for(const f of l){const h=f,g=h.class??h.macroClass,v=typeof g=="string"?g:"";v&&d.set(v,(d.get(v)??0)+1)}return[...d.entries()].map(([f,h])=>h>1?`${f} ×${h}`:f).join(", ")}if(e===ie.EventCategory.PipelineAudioInferenceResult){const l=i.frame?.detections??[];return l.length===0?null:l.map(d=>{const f=d,h=f.macroClass??f.class??f.label,g=typeof h=="string"?h:"",v=f.score;return v?`${g} (${Math.round(v*100)}%)`:g}).filter(Boolean).join(", ")}if(e===ie.EventCategory.DetectionEvent){const l=i.label??i.class,d=i.score??i.confidence,f=[];return typeof l=="string"&&f.push(l),typeof d=="number"&&f.push(`${Math.round(d*100)}%`),f.length>0?f.join(" — "):null}if(e===ie.EventCategory.ProviderMotion)return i.active===!0?"motion start":"motion stop";if(e===ie.EventCategory.DeviceStateChanged){const l=i.slice;if(l&&typeof l=="object"){const d=Object.keys(l).filter(f=>f!=="lastFetchedAt"&&f!=="ts");if(d.length>0)return d.slice(0,4).join(", ")+(d.length>4?"…":"")}return null}if(e===ie.EventCategory.MotionOnMotionChanged){const l=i.detected,d=typeof i.source=="string"?i.source:null,f=l===!0?"motion start":l===!1?"motion stop":"motion";return d?`${f} (${d})`:f}if(e===ie.EventCategory.ProviderDetection||e===ie.EventCategory.DetectionCameraNative){const l=i.detections??[];if(!Array.isArray(l)||l.length===0)return(typeof i.class=="string"?i.class:null)??null;const d=new Map;for(const f of l){const h=f,g=h.class??h.macroClass,v=typeof g=="string"?g:"";v&&d.set(v,(d.get(v)??0)+1)}return[...d.entries()].map(([f,h])=>h>1?`${f} ×${h}`:f).join(", ")}const a=i.addonId,o=i.error;return o||(a?`addon: ${a}`:null)}function TC(e){const i=e.category;return i===ie.EventCategory.DetectionResult||i===ie.EventCategory.PipelineAudioInferenceResult?Ua(i,e.data)!==null:!0}var RC=300;function Al({agentId:e,addonId:i,deviceId:a,defaultCategories:o,categories:l,category:d,maxHeight:f="max-h-96",limit:h=50,showCategoryFilter:g=!0,showFilters:v=!1,liveBuffer:b,onClose:w,className:k}){const O=(0,n.useMemo)(()=>o??l??zC,[o,l]),E=(0,n.useMemo)(()=>[...O].sort().join(","),[O]),[A,R]=(0,n.useState)(()=>new Set(O)),Z=(0,n.useRef)(E);(0,n.useEffect)(()=>{Z.current!==E&&(Z.current=E,R(new Set(O)))},[E,O]);const V=Sn(RC),G=b??V,H=G.entries,[J,X]=(0,n.useState)(!0),[me,ae]=(0,n.useState)(new Set),[Ae,De]=(0,n.useState)(""),[qe,ot]=(0,n.useState)(!1),[Ve,We]=(0,n.useState)(""),[Qe,Le]=(0,n.useState)(0),Te=(0,n.useRef)(null),st=(0,n.useRef)(null),Re=`${e??""}:${i??""}:${String(a??"")}:${d??""}`,we=(0,n.useRef)(Re);(0,n.useEffect)(()=>{we.current!==Re&&(we.current=Re,G.reset(),ae(new Set),Le(0))},[Re,G]),(0,n.useEffect)(()=>{if(!qe)return;const ke=lt=>{const mt=st.current;mt&&lt.target instanceof Node&&!mt.contains(lt.target)&&ot(!1)};return document.addEventListener("mousedown",ke),()=>{document.removeEventListener("mousedown",ke)}},[qe]);const Oe=(0,n.useMemo)(()=>{const ke={};return e&&(ke.agentId=e),i&&(ke.addonId=i),a!==void 0&&(ke.deviceId=a),d&&(ke.category=d),ke},[e,i,a,d]),$e=(0,n.useMemo)(()=>[...A].sort(),[A]),He=(0,n.useMemo)(()=>{const ke={...Oe,limit:h};return $e.length>0&&$e.length<jn.length&&(ke.category=$e),ke},[Oe,h,(0,n.useMemo)(()=>$e.join(","),[$e]),$e]),{data:he,isLoading:Se}=j.systemEvents.getRecent.useQuery(He,{staleTime:3e4}),Ie=(0,n.useRef)(A);(0,n.useEffect)(()=>{Ie.current=A},[A]);const Pe=Oe;j.systemEvents.subscribe.useSubscription(Pe,{onData:ke=>{const lt=ke;lt?.id&&EC(lt,e,i,a)&&Ie.current.has(lt.category)&&G.append(lt)}});const Be=(0,n.useRef)(H.length);(0,n.useEffect)(()=>{const ke=Te.current;if(!ke){Be.current=H.length;return}const lt=Be.current;if(Be.current=H.length,!(H.length<=lt)){if(J&&ke.scrollTop<=8)ke.scrollTo({top:0});else if(!J&&ke.scrollTop>0){const mt=ke.firstElementChild?.firstElementChild,ht=mt instanceof HTMLElement?mt.offsetHeight:28;ke.scrollTop+=ht*(H.length-lt)}}},[H.length,J]);const Ze=(0,n.useMemo)(()=>{const ke=new Map;for(const ht of he??[])ke.set(ht.id,ht);for(const ht of H)ke.set(ht.id,ht);let lt=[...ke.values()].filter(ht=>A.has(ht.category)).filter(TC);Qe>0&&(lt=lt.filter(ht=>new Date(ht.timestamp).getTime()>Qe));const mt=Ae.trim().toLowerCase();return mt&&(lt=lt.filter(ht=>{if(ht.category.toLowerCase().includes(mt)||Dl(ht.category,ht.data).label.toLowerCase().includes(mt))return!0;const Xr=Ua(ht.category,ht.data);if(Xr&&Xr.toLowerCase().includes(mt))return!0;try{if(new Date(ht.timestamp).toLocaleTimeString().toLowerCase().includes(mt))return!0}catch{}try{if(JSON.stringify(ht.data).toLowerCase().includes(mt)||JSON.stringify(ht.source).toLowerCase().includes(mt))return!0}catch{}return!1})),lt.sort((ht,Xr)=>new Date(Xr.timestamp).getTime()-new Date(ht.timestamp).getTime())},[he,H,A,Ae,Qe]),Qt=(0,n.useCallback)(ke=>{ae(lt=>{const mt=new Set(lt);return mt.has(ke)?mt.delete(ke):mt.add(ke),mt})},[]),Wt=(0,n.useCallback)(ke=>{R(lt=>{const mt=new Set(lt);return mt.has(ke)?mt.delete(ke):mt.add(ke),mt})},[]),Ue=(0,n.useCallback)(()=>{R(new Set(O)),De(""),Le(0)},[O]),ut=(0,n.useCallback)(()=>{Le(Date.now()),G.reset()},[G]),[_t,wt]=(0,n.useState)(!1),[Rt,_e]=(0,n.useState)(null),Xe=(0,n.useCallback)(ke=>{const lt=new Date(ke.timestamp).toISOString(),mt=Ua(ke.category,ke.data)??"",ht=mt?` ${mt}`:"";return`${lt} [${ke.category}]${ht} data=${JSON.stringify(ke.data)}`},[]),dt=(0,n.useCallback)(()=>{const ke=Ze.map(Xe);navigator.clipboard.writeText(ke.join(`
151
- `)).then(()=>{wt(!0),setTimeout(()=>wt(!1),1500)})},[Ze,Xe]),pt=(0,n.useCallback)(ke=>{navigator.clipboard.writeText(Xe(ke)).then(()=>{_e(ke.id),setTimeout(()=>_e(lt=>lt===ke.id?null:lt),1200)})},[Xe]),Ne=(0,n.useCallback)(()=>{R(new Set(jn))},[]),Fe=(0,n.useCallback)(()=>{R(new Set)},[]),yt=(0,n.useMemo)(()=>{const ke=Ve.trim().toLowerCase();return ke?jn.filter(lt=>lt.toLowerCase().includes(ke)):jn},[Ve]),jr=jn.length,qt=A.size,$n=qt===jr,NO=$n?"All":`${qt}/${jr}`;return(0,r.jsxs)("div",{className:P("h-full min-h-0 flex flex-col",k),onClick:ke=>ke.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-hover/30 gap-2 shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"Events"}),e&&(0,r.jsx)(Ba,{label:"agent",value:e}),i&&(0,r.jsx)(Ba,{label:"addon",value:i}),a!==void 0&&(0,r.jsx)(Ba,{label:"device",value:`#${a}`}),d&&(0,r.jsx)(Ba,{label:"category",value:d}),(0,r.jsxs)("button",{type:"button",onClick:()=>{X(ke=>!ke),!J&&Te.current&&Te.current.scrollTo({top:0,behavior:"smooth"})},className:P("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",J?"border-border text-foreground-subtle hover:text-foreground":"border-amber-500/30 bg-amber-500/10 text-amber-400"),children:[(0,r.jsx)(Bc,{className:"h-2.5 w-2.5"}),J?"Auto":"Paused"]}),g&&(0,r.jsxs)("div",{className:"relative",ref:st,children:[(0,r.jsxs)("button",{type:"button",onClick:()=>ot(ke=>!ke),className:P("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",$n?"border-border text-foreground-subtle hover:text-foreground":"border-violet-500/30 bg-violet-500/10 text-violet-400"),title:"Pick events to track",children:[(0,r.jsx)(Wc,{className:"h-2.5 w-2.5"}),"Filter (",NO,")"]}),qe&&(0,r.jsx)(ZC,{search:Ve,onSearchChange:We,categories:yt,active:A,onToggle:Wt,onSelectAll:Ne,onSelectNone:Fe,onResetDefaults:Ue})]}),(0,r.jsxs)("button",{type:"button",onClick:Ue,className:"inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground transition-colors",title:"Reset filters to defaults",children:[(0,r.jsx)(tu,{className:"h-2.5 w-2.5"}),"Reset"]}),(0,r.jsxs)("button",{type:"button",onClick:ut,className:"inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground transition-colors",title:"Clear visible entries",children:[(0,r.jsx)(wr,{className:"h-2.5 w-2.5"}),"Clear"]}),(0,r.jsxs)("button",{type:"button",onClick:dt,disabled:Ze.length===0,className:P("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",_t?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":"border-border text-foreground-subtle hover:text-foreground",Ze.length===0&&"opacity-40 cursor-not-allowed"),title:"Copy all visible events",children:[(0,r.jsx)(Ar,{className:"h-2.5 w-2.5"}),_t?"Copied!":"Copy"]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:"text",value:Ae,onChange:ke=>De(ke.target.value),placeholder:"Search…",className:"w-32 pl-1.5 pr-5 py-0.5 rounded border border-border bg-background text-foreground text-[10px] focus:outline-none focus:border-primary/50"}),Ae&&(0,r.jsx)("button",{type:"button",onClick:()=>De(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",title:"Clear search",children:(0,r.jsx)(It,{className:"h-2.5 w-2.5"})})]}),H.length>0&&(0,r.jsxs)("span",{className:"text-[9px] text-emerald-400 font-medium",children:["+",H.length," live"]})]}),w&&(0,r.jsx)("button",{type:"button",onClick:w,className:"text-foreground-subtle hover:text-foreground",children:(0,r.jsx)(It,{className:"h-3.5 w-3.5"})})]}),(0,r.jsxs)("div",{ref:Te,className:P("flex-1 min-h-0 overflow-auto text-[10px]",f),children:[Se&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle",children:[(0,r.jsx)(Gt,{className:"h-3.5 w-3.5 animate-spin"}),"Loading events..."]}),!Se&&Ze.length===0&&(0,r.jsx)("div",{className:"py-4 text-center text-foreground-subtle",children:"No events found"}),Ze.length>0&&(0,r.jsx)("div",{className:"divide-y divide-border/30",children:Ze.map(ke=>{const lt=Dl(ke.category,ke.data),mt=lt.icon,ht=Ua(ke.category,ke.data),Xr=me.has(ke.id);return(0,r.jsxs)("div",{className:"flex items-start gap-2 px-3 py-1.5 hover:bg-surface-hover/30 cursor-pointer",onClick:()=>Qt(ke.id),children:[(0,r.jsx)("span",{className:"text-foreground-subtle whitespace-nowrap w-[70px] shrink-0 pt-0.5",children:new Date(ke.timestamp).toLocaleTimeString()}),(0,r.jsx)(UC,{copied:Rt===ke.id,onCopy:()=>pt(ke)}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[Xr?(0,r.jsx)(Wr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}):(0,r.jsx)(Dr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}),(0,r.jsxs)("span",{className:P("inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[9px] font-medium",lt.color),children:[(0,r.jsx)(mt,{className:"h-2.5 w-2.5"}),lt.label]}),ke.source.nodeId&&ke.source.nodeId!=="hub"&&(0,r.jsx)("span",{className:"text-[9px] px-1 py-0.5 rounded bg-foreground-subtle/10 text-foreground-subtle font-mono",children:ke.source.nodeId})]}),ht&&(0,r.jsx)("p",{className:"text-foreground-subtle text-[10px] mt-0.5 ml-5",children:ht}),Xr&&(0,r.jsxs)("div",{className:"mt-1 ml-5 text-[9px] bg-surface rounded px-2 py-1.5 space-y-0.5 font-mono overflow-x-auto",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-primary/70",children:"source"}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,r.jsx)("span",{className:"text-foreground",children:JSON.stringify(ke.source)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-primary/70",children:"category"}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,r.jsx)("span",{className:"text-foreground",children:ke.category})]}),Object.entries(ke.data).map(([fm,Ll])=>(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-primary/70",children:fm}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:": "}),(0,r.jsx)("span",{className:"text-foreground break-all",children:typeof Ll=="object"?JSON.stringify(Ll):String(Ll)})]},fm))]})]})]},ke.id)})})]})]})}function ZC({search:e,onSearchChange:i,categories:a,active:o,onToggle:l,onSelectAll:d,onSelectNone:f,onResetDefaults:h}){return(0,r.jsxs)("div",{className:"absolute z-20 top-full mt-1 left-0 w-72 max-h-80 rounded-md border border-border bg-surface shadow-lg flex flex-col",onClick:g=>g.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border/50",children:[(0,r.jsx)(Ri,{className:"h-3 w-3 text-foreground-subtle"}),(0,r.jsx)("input",{type:"text",value:e,onChange:g=>i(g.target.value),placeholder:"Filter categories…",className:"flex-1 bg-transparent text-[10px] focus:outline-none text-foreground placeholder:text-foreground-subtle",autoFocus:!0}),e&&(0,r.jsx)("button",{type:"button",onClick:()=>i(""),className:"text-foreground-subtle hover:text-foreground",children:(0,r.jsx)(It,{className:"h-2.5 w-2.5"})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 border-b border-border/50 text-[9px]",children:[(0,r.jsx)("button",{type:"button",onClick:d,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"All"}),(0,r.jsx)("button",{type:"button",onClick:f,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"None"}),(0,r.jsx)("button",{type:"button",onClick:h,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"Defaults"})]}),(0,r.jsxs)("div",{className:"overflow-y-auto flex-1",children:[a.length===0&&(0,r.jsx)("div",{className:"text-[10px] text-foreground-subtle italic px-2 py-3 text-center",children:"No matches"}),a.map(g=>{const v=o.has(g),b=Dl(g),w=b.icon;return(0,r.jsxs)("button",{type:"button",onClick:()=>l(g),className:"w-full flex items-center gap-2 px-2 py-1 text-left hover:bg-surface-hover/40 text-[10px]",children:[(0,r.jsx)("input",{type:"checkbox",readOnly:!0,checked:v,className:"accent-violet-500"}),(0,r.jsxs)("span",{className:P("inline-flex items-center gap-1 rounded-full border px-1.5 py-0.5 text-[9px] font-medium shrink-0",b.color),children:[(0,r.jsx)(w,{className:"h-2.5 w-2.5"}),b.label]}),(0,r.jsx)("span",{className:"text-foreground-subtle font-mono truncate",children:g})]},g)})]})]})}function LC({position:e="bottom",className:i,...a}){return(0,r.jsx)("div",{className:P(e==="bottom"?"absolute bottom-0 left-0 right-0 z-10 border-t border-border bg-surface/95 backdrop-blur-sm":"absolute inset-x-2 bottom-2 z-10 rounded-lg border border-border bg-surface/95 backdrop-blur-sm shadow-xl",i),children:(0,r.jsx)(Al,{maxHeight:"max-h-48",...a})})}function Ba({label:e,value:i}){return(0,r.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium",children:[e,": ",i]})}function UC({copied:e,onCopy:i}){return(0,r.jsx)("button",{type:"button",title:"Copy this event",onClick:a=>{a.stopPropagation(),i()},className:P("rounded p-0.5 transition-colors mt-0.5",e?"text-emerald-400":"text-foreground-subtle/60 hover:text-foreground hover:bg-surface-hover"),children:e?(0,r.jsx)(Ti,{className:"h-3 w-3"}):(0,r.jsx)(Ar,{className:"h-3 w-3"})})}function BC({deviceId:e,className:i="",onOpenChild:a}){const o=j.useUtils(),l=j.deviceDiscovery.listDiscovered.useQuery({deviceId:e},{refetchInterval:1e4,retry:!1}),d=j.deviceDiscovery.getStatus.useQuery({deviceId:e},{refetchInterval:1e4,retry:!1}),f=j.deviceDiscovery.refreshDiscovery.useMutation({onSuccess:()=>{o.deviceDiscovery.listDiscovered.invalidate({deviceId:e}),o.deviceDiscovery.getStatus.invalidate({deviceId:e})}}),h=j.deviceDiscovery.adoptDevice.useMutation({onSuccess:()=>{o.deviceDiscovery.listDiscovered.invalidate({deviceId:e})}}),g=j.deviceDiscovery.releaseDevice.useMutation({onSuccess:()=>{o.deviceDiscovery.listDiscovered.invalidate({deviceId:e})}}),[v,b]=(0,n.useState)(null),{available:w,adopted:k}=(0,n.useMemo)(()=>{const G=l.data??[],H=X=>typeof X.metadata.rtspChannel=="number"?X.metadata.rtspChannel:Number.POSITIVE_INFINITY,J=(X,me)=>{const ae=H(X),Ae=H(me);return ae!==Ae?ae-Ae:X.name.localeCompare(me.name)};return{available:G.filter(X=>!X.alreadyAdopted).sort(J),adopted:G.filter(X=>X.alreadyAdopted).sort(J)}},[l.data]),O=d.data,E=O?.lastError??null,A=O?.lastDiscoveryAt??null;async function R(){await f.mutateAsync({deviceId:e}).catch(()=>{})}async function Z(G){b(G.childNativeId);try{await h.mutateAsync({deviceId:e,childNativeId:G.childNativeId})}finally{b(null)}}async function V(G){if(G.adoptedDeviceId!=null){b(G.childNativeId);try{await g.mutateAsync({deviceId:e,childDeviceId:G.adoptedDeviceId})}finally{b(null)}}}return(0,r.jsxs)("div",{className:`rounded-xl border border-border bg-surface ${i}`,children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2 border-b border-border px-3 py-2 sm:px-5 sm:py-3",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:"Discovered devices"}),(0,r.jsxs)("p",{className:"text-[11px] text-foreground-subtle",children:["Channels behind this hub. Click ",(0,r.jsx)("span",{className:"font-medium",children:"Add"})," to promote a channel to a managed device, or ",(0,r.jsx)("span",{className:"font-medium",children:"Remove"})," to detach."]})]}),(0,r.jsxs)("button",{type:"button",onClick:R,disabled:f.isPending,className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-2 py-1.5 sm:px-3 text-xs font-medium text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50 shrink-0",children:[f.isPending?(0,r.jsx)(Gt,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(ka,{className:"h-3.5 w-3.5"}),(0,r.jsx)("span",{className:"hidden sm:inline",children:"Refresh"})]})]}),E?(0,r.jsxs)("div",{className:"flex items-start gap-2 border-b border-border bg-destructive/10 px-5 py-2 text-[11px] text-destructive",children:[(0,r.jsx)(vn,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),(0,r.jsxs)("span",{children:["Last refresh failed: ",E]})]}):null,l.isLoading?(0,r.jsx)("div",{className:"flex items-center justify-center py-8 text-foreground-subtle",children:(0,r.jsx)(Gt,{className:"h-5 w-5 animate-spin"})}):w.length===0&&k.length===0?(0,r.jsx)("div",{className:"px-5 py-8 text-center text-xs text-foreground-subtle",children:"No channels reported by the hub yet. Click Refresh to enumerate."}):(0,r.jsxs)(r.Fragment,{children:[w.length>0?(0,r.jsx)(im,{title:"Available to add",count:w.length,tone:"primary",children:w.map(G=>(0,r.jsx)(am,{child:G,busy:v===G.childNativeId,onAdopt:Z,onRelease:V,onOpenChild:a},G.childNativeId))}):null,k.length>0?(0,r.jsx)(im,{title:"Already adopted",count:k.length,tone:"muted",children:k.map(G=>(0,r.jsx)(am,{child:G,busy:v===G.childNativeId,onAdopt:Z,onRelease:V,onOpenChild:a},G.childNativeId))}):null]}),A!=null?(0,r.jsxs)("div",{className:"border-t border-border px-5 py-2 text-[10px] text-foreground-subtle",children:["Last refreshed ",new Date(A).toLocaleString()]}):null]})}function im({title:e,count:i,tone:a,children:o}){return(0,r.jsxs)("div",{className:"border-t border-border",children:[(0,r.jsxs)("div",{className:`flex items-center justify-between border-b px-3 sm:px-5 py-1.5 text-[10px] uppercase tracking-wider ${a==="primary"?"bg-primary/5 text-primary border-primary/30":"bg-surface text-foreground-subtle border-border"}`,children:[(0,r.jsx)("span",{className:"font-semibold",children:e}),(0,r.jsx)("span",{className:"font-mono",children:i})]}),(0,r.jsx)("div",{className:"divide-y divide-border",children:o})]})}function am({child:e,busy:i,onAdopt:a,onRelease:o,onOpenChild:l}){return(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2 px-3 py-2 sm:px-5 sm:py-3 sm:flex-nowrap sm:gap-3",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1",children:[(0,r.jsx)(FC,{status:e.status}),(0,r.jsx)("span",{className:"truncate text-sm font-medium text-foreground",children:e.name}),e.metadata.isDoorbell?(0,r.jsx)("span",{className:"rounded bg-surface-hover px-1.5 py-0.5 text-[9px] uppercase tracking-wide text-foreground-subtle",children:"Doorbell"}):null,e.metadata.isBattery?(0,r.jsx)("span",{className:"rounded bg-surface-hover px-1.5 py-0.5 text-[9px] uppercase tracking-wide text-foreground-subtle",children:"Battery"}):null,e.metadata.isMultifocal?(0,r.jsx)("span",{className:"rounded bg-surface-hover px-1.5 py-0.5 text-[9px] uppercase tracking-wide text-foreground-subtle",children:"Multifocal"}):null]}),(0,r.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-x-3 gap-y-0.5 text-[11px] text-foreground-subtle",children:[typeof e.metadata.rtspChannel=="number"?(0,r.jsxs)("span",{children:["ch ",(0,r.jsx)("span",{className:"font-mono",children:e.metadata.rtspChannel})]}):null,e.metadata.model?(0,r.jsx)("span",{className:"truncate max-w-[160px]",children:e.metadata.model}):null,e.metadata.uid?(0,r.jsxs)("span",{className:"font-mono truncate max-w-[140px]",children:[e.metadata.uid.slice(0,12),"…"]}):null]})]}),e.alreadyAdopted?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[l&&e.adoptedDeviceId!==null?(0,r.jsxs)("button",{type:"button",onClick:()=>l(e.adoptedDeviceId),className:"inline-flex items-center gap-1.5 rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",title:"Open device detail",children:[(0,r.jsx)(Rs,{className:"h-3.5 w-3.5"}),"Open"]}):null,(0,r.jsxs)("button",{type:"button",onClick:()=>{o(e)},disabled:i,className:"inline-flex items-center gap-1.5 rounded-lg border border-destructive/30 px-3 py-1.5 text-xs text-destructive hover:bg-destructive/10 transition-colors disabled:opacity-50",children:[i?(0,r.jsx)(Gt,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(wr,{className:"h-3.5 w-3.5"}),"Remove"]})]}):(0,r.jsxs)("button",{type:"button",onClick:()=>{a(e)},disabled:i,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50",children:[i?(0,r.jsx)(Gt,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(hn,{className:"h-3.5 w-3.5"}),"Add"]})]})}function FC({status:e}){switch(e){case"online":return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-emerald-500/40 bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-500",children:[(0,r.jsx)(lu,{className:"h-2.5 w-2.5"})," online"]});case"sleeping":return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-amber-500/40 bg-amber-500/10 px-2 py-0.5 text-[10px] font-medium text-amber-500",children:[(0,r.jsx)(Ls,{className:"h-2.5 w-2.5"})," sleeping"]});case"offline":return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-destructive/40 bg-destructive/10 px-2 py-0.5 text-[10px] font-medium text-destructive",children:[(0,r.jsx)(qh,{className:"h-2.5 w-2.5"})," offline"]});default:return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-border bg-surface px-2 py-0.5 text-[10px] font-medium text-foreground-subtle",children:[(0,r.jsx)(Gc,{className:"h-2.5 w-2.5"})," unknown"]})}}function GC(e,i){if(!e||typeof e!="object")return null;const a=e;if(a.category!==ie.EventCategory.DeviceStateChanged)return null;const o=a.data;return!o||typeof o!="object"||o.deviceId!==i||typeof o.capName!="string"||!o.slice||typeof o.slice!="object"?null:{capName:o.capName,slice:o.slice}}function VC(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}var QC=Object.freeze([...new Set(ie.ALL_CAPABILITY_DEFINITIONS.filter(e=>e.scope==="device").map(e=>e.name))].sort()),WC=1;function om({deviceId:e,defaultCaps:i,maxHeight:a="max-h-96",onClose:o,className:l}){const[d,f]=(0,n.useState)((0,n.useMemo)(()=>new Set(i??[]),[i])),[h,g]=(0,n.useState)(""),[v,b]=(0,n.useState)(!1),[w,k]=(0,n.useState)(""),O=(0,n.useRef)(null),[E,A]=(0,n.useState)(new Map),[R,Z]=(0,n.useState)(new Map),[,V]=(0,n.useState)(0),G=(0,n.useRef)(e);(0,n.useEffect)(()=>{G.current!==e&&(G.current=e,A(new Map),Z(new Map))},[e]);const{data:H,isLoading:J}=j.deviceState.getAllSnapshots.useQuery({},{staleTime:3e4}),X=(0,n.useRef)(!1);(0,n.useEffect)(()=>{if(X.current||!VC(H))return;const he=H[String(e)];if(X.current=!0,!he)return;const Se=Date.now();A(Ie=>{const Pe=new Map(Ie);for(const[Be,Ze]of Object.entries(he))Pe.has(Be)||Pe.set(Be,{slice:Ze,updatedAt:Se});return Pe})},[H,e]),(0,n.useEffect)(()=>{X.current=!1},[e]),j.systemEvents.subscribe.useSubscription({deviceId:e,category:ie.EventCategory.DeviceStateChanged},{onData:he=>{const Se=GC(he,e);Se&&A(Ie=>{const Pe=new Map(Ie);return Pe.set(Se.capName,{slice:Se.slice,updatedAt:Date.now()}),Pe})}}),(0,n.useEffect)(()=>{const he=setInterval(()=>V(Se=>Se+1),5e3);return()=>clearInterval(he)},[]);const me=(0,n.useMemo)(()=>{const he=new Set(QC);for(const Se of E.keys())he.add(Se);return[...he].sort()},[E]),ae=(0,n.useMemo)(()=>{const he=h.trim().toLowerCase();return[...E.keys()].sort().filter(Se=>d.size>0&&!d.has(Se)?!1:!he||Se.toLowerCase().includes(he)?!0:Rl(E.get(Se)?.slice??{},he))},[E,d,h]),Ae=(0,n.useCallback)(he=>{f(Se=>{const Ie=new Set(Se);return Ie.has(he)?Ie.delete(he):Ie.add(he),Ie})},[]),De=(0,n.useCallback)(()=>{f(new Set(i??[])),g("")},[i]),qe=(0,n.useCallback)(()=>{f(new Set(me))},[me]),ot=(0,n.useCallback)(()=>{f(new Set)},[]),Ve=(0,n.useCallback)((he,Se)=>{Z(Ie=>{const Pe=new Map(Ie);return Pe.set(he,!Se),Pe})},[]),We=(0,n.useCallback)((he,Se)=>{const Ie=R.get(he);return Ie!==void 0?Ie:Se<WC},[R]),[Qe,Le]=(0,n.useState)(!1),Te=(0,n.useCallback)(()=>{const he={};for(const Se of ae){const Ie=E.get(Se);Ie&&(he[Se]=Ie.slice)}navigator.clipboard.writeText(JSON.stringify(he,null,2)).then(()=>{Le(!0),setTimeout(()=>Le(!1),1500)})},[ae,E]),st=(0,n.useMemo)(()=>{const he=w.trim().toLowerCase();return he?me.filter(Se=>Se.toLowerCase().includes(he)):me},[w,me]),Re=me.length,we=d.size,Oe=we===0||we===Re,$e=Oe?"All":`${we}/${Re}`;(0,n.useEffect)(()=>{if(!v)return;const he=Se=>{const Ie=O.current;Ie&&!Ie.contains(Se.target)&&b(!1)};return document.addEventListener("mousedown",he),()=>document.removeEventListener("mousedown",he)},[v]);const He=h.trim().toLowerCase();return(0,r.jsxs)("div",{className:P("h-full min-h-0 flex flex-col",l),onClick:he=>he.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 bg-surface-hover/30 gap-2 shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,r.jsx)("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"State"}),(0,r.jsx)(XC,{label:"device",value:`#${e}`}),(0,r.jsxs)("div",{className:"relative",ref:O,children:[(0,r.jsxs)("button",{type:"button",onClick:()=>b(he=>!he),className:P("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",Oe?"border-border text-foreground-subtle hover:text-foreground":"border-violet-500/30 bg-violet-500/10 text-violet-400"),title:"Pick caps to show",children:[(0,r.jsx)(Wc,{className:"h-2.5 w-2.5"}),"Filter (",$e,")"]}),v&&(0,r.jsx)(YC,{search:w,onSearchChange:k,caps:st,active:d,onToggle:Ae,onSelectAll:qe,onSelectNone:ot,onResetDefaults:De})]}),(0,r.jsxs)("button",{type:"button",onClick:De,className:"inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground transition-colors",title:"Reset filters",children:[(0,r.jsx)(tu,{className:"h-2.5 w-2.5"}),"Reset"]}),(0,r.jsxs)("button",{type:"button",onClick:Te,disabled:ae.length===0,className:P("inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors",Qe?"border-emerald-500/30 bg-emerald-500/10 text-emerald-400":"border-border text-foreground-subtle hover:text-foreground",ae.length===0&&"opacity-40 cursor-not-allowed"),title:"Copy visible state as JSON",children:[(0,r.jsx)(Ar,{className:"h-2.5 w-2.5"}),Qe?"Copied!":"Copy"]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("input",{type:"text",value:h,onChange:he=>g(he.target.value),placeholder:"Search…",className:"w-32 pl-1.5 pr-5 py-0.5 rounded border border-border bg-background text-foreground text-[10px] focus:outline-none focus:border-primary/50"}),h&&(0,r.jsx)("button",{type:"button",onClick:()=>g(""),className:"absolute right-1 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",title:"Clear search",children:(0,r.jsx)(It,{className:"h-2.5 w-2.5"})})]}),(0,r.jsxs)("span",{className:"text-[9px] text-emerald-400 font-medium inline-flex items-center gap-1",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),"live"]})]}),o&&(0,r.jsx)("button",{type:"button",onClick:o,className:"text-foreground-subtle hover:text-foreground",children:(0,r.jsx)(It,{className:"h-3.5 w-3.5"})})]}),(0,r.jsxs)("div",{className:P("flex-1 min-h-0 overflow-auto text-[10px] font-mono",a),children:[J&&E.size===0&&(0,r.jsxs)("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle font-sans",children:[(0,r.jsx)(Gt,{className:"h-3.5 w-3.5 animate-spin"}),"Loading device state..."]}),!J&&E.size===0&&(0,r.jsx)("div",{className:"py-4 text-center text-foreground-subtle font-sans",children:"No runtime state"}),!J&&E.size>0&&ae.length===0&&(0,r.jsx)("div",{className:"py-4 text-center text-foreground-subtle font-sans",children:"No caps match the filter"}),ae.length>0&&(0,r.jsx)("div",{className:"py-1",children:ae.map(he=>{const Se=E.get(he);return Se?(0,r.jsx)(qC,{capName:he,slice:Se.slice,updatedAt:Se.updatedAt,searchNeedle:He,isPathOpen:We,onToggle:Ve},he):null})})]})]})}function qC({capName:e,slice:i,updatedAt:a,searchNeedle:o,isPathOpen:l,onToggle:d}){const f=e,h=l(f,0),g=Object.entries(i);return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1 hover:bg-surface-hover/30 cursor-pointer select-none",onClick:()=>d(f,h),children:[(0,r.jsx)(cm,{open:h,hasChildren:g.length>0}),(0,r.jsx)("span",{className:"inline-flex items-center gap-1 rounded-full border border-violet-500/30 bg-violet-500/15 text-violet-400 px-2 py-0.5 text-[9px] font-medium font-sans",children:e}),(0,r.jsxs)("span",{className:"text-[9px] text-foreground-subtle font-sans",children:[g.length," ",g.length===1?"key":"keys"]}),(0,r.jsxs)("span",{className:"ml-auto text-[9px] text-foreground-subtle/70 font-sans tabular-nums",children:["updated ",KC(a)]})]}),h&&(0,r.jsx)("div",{children:g.length===0?(0,r.jsx)(lm,{depth:1,label:"empty slice"}):g.map(([v,b])=>(0,r.jsx)(sm,{path:`${f}.${v}`,nodeKey:v,value:b,depth:1,searchNeedle:o,isPathOpen:l,onToggle:d},v))})]})}function sm({path:e,nodeKey:i,value:a,depth:o,searchNeedle:l,isPathOpen:d,onToggle:f}){const h=HC(a),g={paddingLeft:`${12+o*14}px`};if(!h)return(0,r.jsxs)("div",{className:"flex items-start gap-1 px-3 py-0.5",style:g,children:[(0,r.jsx)("span",{className:P("shrink-0",Tl(i,l,"text-primary/70")),children:i}),(0,r.jsx)("span",{className:"text-foreground-subtle",children:":"}),(0,r.jsx)("span",{className:P("break-all",Tl(zl(a),l,JC(a))),children:zl(a)})]});const v=d(e,o);return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 px-3 py-0.5 hover:bg-surface-hover/30 cursor-pointer select-none",style:g,onClick:()=>f(e,v),children:[(0,r.jsx)(cm,{open:v,hasChildren:h.entries.length>0}),(0,r.jsx)("span",{className:Tl(i,l,"text-primary/70"),children:i}),(0,r.jsx)("span",{className:"text-foreground-subtle/70 text-[9px]",children:h.summary})]}),v&&(h.entries.length===0?(0,r.jsx)(lm,{depth:o+1,label:h.kind==="array"?"empty array":"empty object"}):h.entries.map(([b,w])=>(0,r.jsx)(sm,{path:`${e}.${b}`,nodeKey:b,value:w,depth:o+1,searchNeedle:l,isPathOpen:d,onToggle:f},b)))]})}function lm({depth:e,label:i}){return(0,r.jsx)("div",{className:"px-3 py-0.5 text-foreground-subtle/60 italic",style:{paddingLeft:`${12+e*14}px`},children:i})}function cm({open:e,hasChildren:i}){return i?e?(0,r.jsx)(Wr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}):(0,r.jsx)(Dr,{className:"h-3 w-3 text-foreground-subtle shrink-0"}):(0,r.jsx)("span",{className:"inline-block w-3 shrink-0"})}function HC(e){if(Array.isArray(e))return{kind:"array",entries:e.map((i,a)=>[String(a),i]),summary:`[${e.length}]`};if(e&&typeof e=="object"){const i=Object.entries(e);return{kind:"object",entries:i,summary:`{${i.length}}`}}return null}function zl(e){if(e===null)return"null";if(e===void 0)return"undefined";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);try{return JSON.stringify(e)}catch{return String(e)}}function JC(e){return e==null?"text-foreground-subtle/60":typeof e=="number"?"text-amber-400":typeof e=="boolean"?e?"text-emerald-400":"text-rose-400":"text-foreground"}function Tl(e,i,a){return i&&e.toLowerCase().includes(i)?P(a,"bg-violet-500/20 rounded px-0.5"):a}function Rl(e,i){if(Array.isArray(e))return e.some(a=>Rl(a,i));if(e&&typeof e=="object"){for(const[a,o]of Object.entries(e))if(a.toLowerCase().includes(i)||Rl(o,i))return!0;return!1}return zl(e).toLowerCase().includes(i)}function KC(e){const i=Date.now()-e;if(i<5e3)return"just now";const a=Math.floor(i/1e3);if(a<60)return`${a}s ago`;const o=Math.floor(a/60);return o<60?`${o}m ago`:`${Math.floor(o/60)}h ago`}function XC({label:e,value:i}){return(0,r.jsxs)("span",{className:"text-[9px] px-1.5 py-0.5 rounded-full bg-primary/10 text-primary font-medium font-sans",children:[e,": ",i]})}function YC({search:e,onSearchChange:i,caps:a,active:o,onToggle:l,onSelectAll:d,onSelectNone:f,onResetDefaults:h}){return(0,r.jsxs)("div",{className:"absolute z-20 top-full mt-1 left-0 w-72 max-h-80 rounded-md border border-border bg-surface shadow-lg flex flex-col font-sans",onClick:g=>g.stopPropagation(),children:[(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1.5 border-b border-border/50",children:[(0,r.jsx)(Ri,{className:"h-3 w-3 text-foreground-subtle"}),(0,r.jsx)("input",{type:"text",value:e,onChange:g=>i(g.target.value),placeholder:"Filter caps…",className:"flex-1 bg-transparent text-[10px] focus:outline-none text-foreground placeholder:text-foreground-subtle",autoFocus:!0}),e&&(0,r.jsx)("button",{type:"button",onClick:()=>i(""),className:"text-foreground-subtle hover:text-foreground",children:(0,r.jsx)(It,{className:"h-2.5 w-2.5"})})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1 px-2 py-1 border-b border-border/50 text-[9px]",children:[(0,r.jsx)("button",{type:"button",onClick:d,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"All"}),(0,r.jsx)("button",{type:"button",onClick:f,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"None"}),(0,r.jsx)("button",{type:"button",onClick:h,className:"px-1.5 py-0.5 rounded border border-border text-foreground-subtle hover:text-foreground",children:"Defaults"})]}),(0,r.jsxs)("div",{className:"overflow-y-auto flex-1",children:[a.length===0&&(0,r.jsx)("div",{className:"text-[10px] text-foreground-subtle italic px-2 py-3 text-center",children:"No matches"}),a.map(g=>(0,r.jsxs)("button",{type:"button",onClick:()=>l(g),className:"w-full flex items-center gap-2 px-2 py-1 text-left hover:bg-surface-hover/40 text-[10px]",children:[(0,r.jsx)("input",{type:"checkbox",readOnly:!0,checked:o.has(g),className:"accent-violet-500"}),(0,r.jsx)("span",{className:"inline-flex items-center gap-1 rounded-full border border-violet-500/30 bg-violet-500/15 text-violet-400 px-1.5 py-0.5 text-[9px] font-medium shrink-0",children:g})]},g))]})]})}var Zl=500,eO=[{id:"logs",label:"Logs",icon:zh},{id:"events",label:"Events",icon:$a},{id:"state",label:"State",icon:xh}];function tO({deviceId:e,defaultEventCategories:i,defaultStateCaps:a,initialTab:o="events",className:l,maxHeight:d="max-h-96"}){const[f,h]=(0,n.useState)(o),g=Sn(Zl),v=Sn(Zl),b=Sn(Zl),w=g.reset,k=v.reset,O=b.reset;return(0,n.useEffect)(()=>{w(),k(),O()},[e,w,k,O]),(0,r.jsxs)("div",{className:P("flex flex-col h-full min-h-0",l),children:[(0,r.jsx)("div",{className:"flex items-center gap-1 mb-2 shrink-0",children:eO.map(({id:E,label:A,icon:R})=>(0,r.jsxs)("button",{type:"button",onClick:()=>h(E),className:P("inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-[11px] font-medium transition-colors",f===E?"bg-primary/15 text-primary border border-primary/30":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover border border-transparent"),children:[(0,r.jsx)(R,{className:"h-3.5 w-3.5"}),A]},E))}),(0,r.jsxs)("div",{className:"flex-1 min-h-0 overflow-hidden",children:[f==="logs"&&(0,r.jsx)(Il,{deviceId:e,maxHeight:d,showFilters:!1,liveBuffer:g}),f==="events"&&(0,r.jsx)(Al,{deviceId:e,defaultCategories:i,maxHeight:d,showCategoryFilter:!0,liveBuffer:v}),f==="state"&&(0,r.jsx)(om,{deviceId:e,defaultCaps:a,maxHeight:d,liveBuffer:b})]})]})}function rO({label:e,icon:i,title:a="Confirm action",description:o,confirmLabel:l,triggerVariant:d="outline",confirmVariant:f="danger",size:h="sm",disabled:g,className:v,action:b,onSuccess:w}){const[k,O]=(0,n.useState)(!1),[E,A]=(0,n.useState)(!1),[R,Z]=(0,n.useState)(null),V=async()=>{Z(null),A(!0);try{const G=await b();w?.(G),O(!1)}catch(G){Z(G instanceof Error?G.message:String(G))}finally{A(!1)}};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(Sr,{type:"button",variant:d,size:h,disabled:g,onClick:()=>{Z(null),O(!0)},className:v,children:[i&&(0,r.jsx)(i,{className:"h-3.5 w-3.5"}),e]}),(0,r.jsx)(yu,{open:k,onOpenChange:G=>!E&&O(G),children:(0,r.jsxs)(qs,{children:[(0,r.jsxs)(xu,{children:[(0,r.jsxs)(wu,{className:"flex items-center gap-2",children:[(0,r.jsx)(vn,{className:"h-4 w-4 text-amber-400"}),a]}),typeof o=="string"?(0,r.jsx)(Su,{children:o}):o]}),R&&(0,r.jsx)("div",{className:P("mt-2 px-3 py-2 rounded border border-danger/40 bg-danger/10","text-xs text-danger"),children:R}),(0,r.jsxs)(_u,{children:[(0,r.jsx)(Sr,{type:"button",variant:"ghost",size:h,disabled:E,onClick:()=>O(!1),children:"Cancel"}),(0,r.jsxs)(Sr,{type:"button",variant:f,size:h,disabled:E,onClick:()=>{V()},children:[E&&(0,r.jsx)(Gt,{className:"h-3.5 w-3.5 animate-spin"}),l??e]})]})]})})]})}function nO(e,i){const a=document.createElement("a");a.href=i,a.download=e,document.body.appendChild(a),a.click(),document.body.removeChild(a)}function iO({trpc:e,deviceId:i,deviceName:a,size:o="sm",className:l}){const[d,f]=(0,n.useState)(!1),[h,g]=(0,n.useState)(!1),[v,b]=(0,n.useState)(null),w=a.replace(/[^a-zA-Z0-9_.-]+/g,"_"),k=(0,n.useCallback)(async J=>{f(!0),b(null),g(!1);try{const X=await e.snapshot.getSnapshot.query({deviceId:i,force:!0});if(!X)throw new Error("No snapshot available");const me=`data:${X.contentType};base64,${X.base64}`;if(J==="copy")try{await navigator.clipboard.writeText(me)}catch{throw new Error("Clipboard unavailable")}else{const ae=X.contentType.includes("png")?"png":"jpg";nO(`${w}-${new Date().toISOString().replace(/[:.]/g,"-")}.${ae}`,me)}g(!0),setTimeout(()=>g(!1),1500)}catch(X){b(X instanceof Error?X.message:String(X))}finally{f(!1)}},[e,i,w]),O=o==="md"?"h-9 px-3 text-sm gap-2":"h-7 px-2.5 text-[11px] gap-1.5",[E,A]=(0,n.useState)(null),[R,Z]=(0,n.useState)(!1),V=()=>{Z(!1),A(setTimeout(()=>{Z(!0),k("copy")},600))},G=()=>{E&&(clearTimeout(E),A(null)),R||k("download")},H=()=>{E&&(clearTimeout(E),A(null))};return(0,r.jsxs)("button",{type:"button",title:"Click to download · long-press to copy",disabled:d,onPointerDown:V,onPointerUp:G,onPointerLeave:H,onPointerCancel:H,className:P("inline-flex items-center justify-center rounded-lg font-medium border border-border","text-foreground-subtle hover:text-foreground hover:bg-surface-hover","disabled:opacity-50 transition-colors",O,v&&"border-danger/40 text-danger",l),children:[d?(0,r.jsx)(Gt,{className:"h-3.5 w-3.5 animate-spin"}):h?(0,r.jsx)(Ti,{className:"h-3.5 w-3.5 text-success"}):(0,r.jsx)(As,{className:"h-3.5 w-3.5"}),"Snapshot"]})}function aO(e){const i=Date.now()-e;return i<6e4?"just now":i<36e5?`${Math.floor(i/6e4)}m ago`:i<864e5?`${Math.floor(i/36e5)}h ago`:`${Math.floor(i/864e5)}d ago`}function oO({history:e,limit:i=5,latestIsFresh:a,className:o}){if(e.length===0)return null;const l=a?lh:$a,d=e.slice(0,i);return(0,r.jsxs)("div",{className:P("rounded-lg border border-border bg-surface px-3 py-2",o),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)(l,{className:P("h-4 w-4 text-amber-400",a&&"animate-pulse")}),(0,r.jsx)("span",{className:"text-[11px] font-semibold uppercase tracking-wider text-foreground-subtle",children:"Recent presses"}),(0,r.jsx)("span",{className:"ml-auto rounded-full bg-foreground-subtle/10 px-1.5 py-0.5 text-[10px] font-medium text-foreground-subtle border border-border",children:e.length})]}),(0,r.jsx)("ul",{className:"space-y-1",children:d.map(f=>(0,r.jsxs)("li",{className:"flex items-center justify-between text-[11px]",title:new Date(f.timestamp).toLocaleString(),children:[(0,r.jsx)("span",{className:"text-foreground",children:aO(f.timestamp)}),(0,r.jsx)("span",{className:"text-foreground-subtle font-mono text-[10px]",children:new Date(f.timestamp).toLocaleTimeString()})]},`${f.deviceId}-${f.timestamp}`))})]})}function sO({items:e,header:i,triggerClassName:a,title:o="More actions"}){const[l,d]=(0,n.useState)(!1),f=e.filter(h=>!h.hidden);return f.length===0?null:(0,r.jsxs)(Du,{open:l,onOpenChange:d,children:[(0,r.jsx)(Au,{title:o,className:P("inline-flex items-center justify-center rounded-lg p-2","text-foreground-subtle hover:text-foreground hover:bg-surface-hover","border border-transparent transition-colors",a),children:(0,r.jsx)(Qc,{className:"h-4 w-4"})}),(0,r.jsxs)(zu,{className:"left-auto right-0 mt-1 min-w-[200px] p-1",children:[i&&(0,r.jsx)("div",{className:"px-2 py-1 text-[10px] uppercase tracking-wider text-foreground-subtle",children:i}),(0,r.jsx)("ul",{className:"space-y-0.5",children:f.map((h,g)=>(0,r.jsxs)("li",{children:[h.separatorBefore&&g>0&&(0,r.jsx)("div",{className:"my-1 h-px bg-border"}),(0,r.jsxs)("button",{type:"button",disabled:h.disabled,onClick:()=>{h.disabled||(h.onClick(),d(!1))},className:P("flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left text-[12px]","transition-colors disabled:opacity-40 disabled:cursor-not-allowed",h.danger?"text-foreground hover:bg-danger/10 hover:text-danger":"text-foreground hover:bg-surface-hover"),children:[h.icon&&(0,r.jsx)(h.icon,{className:P("h-3.5 w-3.5 shrink-0 mt-0.5",h.danger&&"text-danger/80")}),(0,r.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,r.jsx)("span",{className:"block leading-tight",children:h.label}),h.description&&(0,r.jsx)("span",{className:"block mt-0.5 text-[10px] text-foreground-subtle leading-tight",children:h.description})]})]})]},h.id))})]})]})}var lO=[{value:"view",label:"View",icon:pn,hint:"Read-only — queries + subscriptions"},{value:"create",label:"Create",icon:Ch,hint:"Mutations that create or update"},{value:"delete",label:"Delete",icon:wr,hint:"Destructive ops (delete/revoke/reset/…)"}],cO=["device","system"];function uO(){return{type:"capability",target:"",access:["view"]}}function dO(e){if(e==null)return[];const i=new Set;for(const a of e)if(a.type==="device")for(const o of a.targets)i.add(o);return[...i]}function fO(e,i,a,o){let l;switch(e){case"addon":l=a;break;case"capability":l=o;break;case"category":l=cO.map(f=>({value:f,label:f}));break}if(i==null)return l;const d=new Set(i.filter(f=>f.type!=="device"&&f.type===e).map(f=>f.target));return l.filter(f=>d.has(f.value))}function mO(e,i){if(i==null)return["view","create","delete"];const a=i.filter(l=>l.type!==e.type?!1:l.type==="device"&&e.type==="device"?l.targets.some(d=>e.targets.includes(d)):l.type!=="device"&&e.type!=="device"?l.target===e.target:!1);if(a.length===0)return[];const o=new Set;for(const l of a)for(const d of l.access)o.add(d);return[...o]}function gO({value:e,onChange:i,clampToParent:a,emptyHint:o}){const{data:l}=Kd(),{data:d}=nf({}),f=(0,n.useMemo)(()=>(l??[]).map(E=>({value:E.manifest.id,label:E.manifest.id})).sort((E,A)=>E.label.localeCompare(A.label)),[l]),h=(0,n.useMemo)(()=>[...ie.KNOWN_CAP_NAMES].sort().map(E=>({value:E,label:E})),[]),g=(0,n.useMemo)(()=>(d??[]).map(E=>({value:String(E.id),label:`${E.name} (#${E.id} · ${E.addonId})`})).sort((E,A)=>E.label.localeCompare(A.label)),[d]),v=(0,n.useMemo)(()=>a==null?null:dO(a),[a]),b=(E,A)=>{const R=[...A];switch(E){case"category":return{type:"category",target:"device",access:R};case"capability":return{type:"capability",target:"",access:R};case"addon":return{type:"addon",target:"",access:R};case"device":return{type:"device",targets:[],access:R}}},w=(E,A)=>{i(e.map((R,Z)=>{if(Z!==E)return R;if(A.type!==void 0&&A.type!==R.type)return b(A.type,A.access??R.access);const V=[...A.access??R.access];return R.type==="device"?{type:"device",targets:[...A.targets??R.targets],access:V}:R.type==="category"?{type:"category",target:A.target??R.target,access:V}:R.type==="capability"?{type:"capability",target:A.target??R.target,access:V}:{type:"addon",target:A.target??R.target,access:V}}))},k=E=>{i(e.filter((A,R)=>R!==E))},O=()=>{i([...e,uO()])};return(0,r.jsxs)("div",{className:"space-y-2",children:[e.length===0&&o&&(0,r.jsx)("div",{className:"text-[10px] text-foreground-subtle italic px-2 py-2",children:o}),e.map((E,A)=>{const R=mO(E,a);return(0,r.jsxs)("div",{className:"flex flex-wrap items-start gap-1.5 rounded border border-border bg-surface px-2 py-1.5",children:[(0,r.jsxs)("select",{value:E.type,onChange:Z=>w(A,{type:Z.target.value}),className:"rounded border border-border bg-background px-2 py-1 text-[11px] focus:outline-none focus:ring-1 focus:ring-primary",children:[(0,r.jsx)("option",{value:"category",children:"category"}),(0,r.jsx)("option",{value:"capability",children:"capability"}),(0,r.jsx)("option",{value:"addon",children:"addon"}),(0,r.jsx)("option",{value:"device",children:"device"})]}),E.type==="device"?(0,r.jsx)(pO,{value:E.targets,choices:g,clampToParent:v,onChange:Z=>w(A,{targets:Z})}):(0,r.jsxs)("select",{value:E.target,onChange:Z=>w(A,{target:Z.target.value}),className:"flex-1 min-w-[160px] rounded border border-border bg-background px-2 py-1 text-[11px] font-mono focus:outline-none focus:ring-1 focus:ring-primary",children:[(0,r.jsxs)("option",{value:"",children:["— pick ",E.type," —"]}),fO(E.type,a,f,h).map(Z=>(0,r.jsx)("option",{value:Z.value,children:Z.label},Z.value))]}),(0,r.jsx)("div",{className:"flex items-center gap-1",children:lO.map(({value:Z,label:V,icon:G,hint:H})=>{const J=E.access.includes(Z),X=a!=null&&!R.includes(Z)&&!J;return(0,r.jsxs)("label",{title:X?`${H} — not granted by your scope`:H,className:`inline-flex items-center gap-1 rounded px-1.5 py-1 text-[10px] cursor-pointer transition-colors ${J?"bg-primary/15 text-primary font-medium":"text-foreground-subtle hover:bg-foreground-subtle/10"} ${X?"opacity-40 cursor-not-allowed":""}`,children:[(0,r.jsx)("input",{type:"checkbox",checked:J,disabled:X,onChange:me=>{const ae=new Set(E.access);me.target.checked?ae.add(Z):ae.delete(Z),w(A,{access:[...ae]})},className:"sr-only"}),(0,r.jsx)(G,{className:"h-3 w-3"}),V]},Z)})}),(0,r.jsx)("button",{type:"button",onClick:()=>k(A),className:"rounded p-1 text-foreground-subtle hover:bg-danger/10 hover:text-danger transition-colors",title:"Remove scope",children:(0,r.jsx)(It,{className:"h-3 w-3"})})]},A)}),(0,r.jsxs)("button",{type:"button",onClick:O,className:"inline-flex items-center gap-1 rounded px-2 py-1 text-[10px] text-foreground-subtle hover:text-foreground hover:bg-foreground-subtle/10 transition-colors",children:[(0,r.jsx)(hn,{className:"h-3 w-3"}),"Add scope"]})]})}function pO({value:e,choices:i,clampToParent:a,onChange:o}){const[l,d]=(0,n.useState)(""),f=(0,n.useMemo)(()=>{const b=a==null?i:i.filter(k=>a.includes(k.value)),w=new Set(e);return b.filter(k=>!w.has(k.value))},[i,a,e]),h=b=>i.find(w=>w.value===b)?.label??`#${b}`,g=b=>{b&&(o([...e,b]),d(""))},v=b=>{o(e.filter(w=>w!==b))};return(0,r.jsxs)("div",{className:"flex-1 min-w-[160px] flex flex-wrap items-center gap-1",children:[e.length===0&&(0,r.jsx)("span",{className:"text-[10px] text-foreground-subtle italic px-1",children:"no devices selected"}),e.map(b=>(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] font-mono text-primary",children:[h(b),(0,r.jsx)("button",{type:"button",onClick:()=>v(b),className:"hover:text-danger transition-colors",title:"Remove device",children:(0,r.jsx)(It,{className:"h-2.5 w-2.5"})})]},b)),f.length>0&&(0,r.jsxs)("select",{value:l,onChange:b=>g(b.target.value),className:"rounded border border-border bg-background px-1.5 py-0.5 text-[10px] focus:outline-none focus:ring-1 focus:ring-primary",children:[(0,r.jsx)("option",{value:"",children:"+ add device…"}),f.map(b=>(0,r.jsx)("option",{value:b.value,children:b.label},b.value))]})]})}function hO(e){for(const i of e){if(i.type==="device"){if(i.targets.length===0)return"Scope device: pick at least one device"}else if(i.target.trim().length===0)return`Scope ${i.type}: pick a target`;if(i.access.length===0){const a=i.type==="device"?`[${i.targets.join(",")}]`:i.target;return`Scope ${i.type}:${a}: pick at least one access`}}return null}var um=_r("camstack:zone-editing",null);function vO({children:e}){const[i,a]=(0,n.useState)(!1),[o,l]=(0,n.useState)(null),[d,f]=(0,n.useState)(null),[h,g]=(0,n.useState)(null),v=(0,n.useCallback)(V=>{a(V),V||(l(null),f(null),g(null))},[]),b=(0,n.useCallback)(V=>{l(V)},[]),w=(0,n.useCallback)(V=>{f(V)},[]),k=(0,n.useCallback)(V=>{a(!0),f(null),l(V),g(null)},[]),O=(0,n.useCallback)(()=>{a(!1),l(null),f(null),g(null)},[]),E=(0,n.useCallback)(V=>{f(V.id),g(V)},[]),A=(0,n.useCallback)(V=>{g(G=>G===null?G:{...G,...V})},[]),R=(0,n.useCallback)(()=>{g(null)},[]),Z=(0,n.useMemo)(()=>({editing:i,drawingKind:o,selectedZoneId:d,editingDraft:h,setEditing:v,setDrawingKind:b,setSelectedZoneId:w,startDrawing:k,exitEditing:O,enterDraft:E,updateDraft:A,discardDraft:R}),[i,o,d,h,v,b,w,k,O,E,A,R]);return(0,r.jsx)(um.Provider,{value:Z,children:e})}function bO(){return(0,n.useContext)(um)}var dm=500,yO=800;function Fa(e,i,a){try{const o=e.live;if(!o)return null;const l=o.onEvent;return!l||typeof l.subscribe!="function"?null:l.subscribe({category:i},{onData:a})}catch{return null}}function Ga(e,i){return e?.id===i}function xO(e,i){const[a,o]=(0,n.useState)(null),[l,d]=(0,n.useState)(null),[f,h]=(0,n.useState)(null),[g,v]=(0,n.useState)("watching"),b=(0,n.useRef)(void 0),w=(0,n.useRef)(void 0),k=(0,n.useRef)(void 0);return(0,n.useEffect)(()=>{if(i===null)return;const O=Fa(e,"detection.motion-analysis",E=>{const A=E;if(!Ga(A?.source,i))return;const R=A.data;!R?.regions||R.regions.length===0||(o({zones:R.regions.map(Z=>({...Z.bbox,intensity:Z.intensity})),frameWidth:R.frameWidth,frameHeight:R.frameHeight}),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>o(null),dm))});return()=>{O?.unsubscribe(),b.current&&clearTimeout(b.current)}},[e,i]),(0,n.useEffect)(()=>{if(i===null)return;const O=Fa(e,"detection.motion-zones-raw",E=>{const A=E;if(!Ga(A?.source,i))return;const R=A.data;R?.zones&&(d({boxes:R.zones.map(Z=>({bbox:Z.bbox,changeScore:Z.changeScore})),frameWidth:R.frameSize?.width??0,frameHeight:R.frameSize?.height??0,motionScore:R.zones.length>0?R.zones.reduce((Z,V)=>Z+V.changeScore,0)/R.zones.length:0}),w.current&&clearTimeout(w.current),w.current=setTimeout(()=>d(null),dm))});return()=>{O?.unsubscribe(),w.current&&clearTimeout(w.current)}},[e,i]),(0,n.useEffect)(()=>{if(i===null)return;const O=Fa(e,"detection.result",E=>{const A=E;if(!Ga(A?.source,i))return;const R=A.data?.frame;R?.detections?.length&&(h({detections:R.detections,frameWidth:R.width,frameHeight:R.height}),k.current&&clearTimeout(k.current),k.current=setTimeout(()=>h(null),yO))});return()=>{O?.unsubscribe(),k.current&&clearTimeout(k.current)}},[e,i]),(0,n.useEffect)(()=>{if(i===null)return;const O=Fa(e,"detection.phase-transition",E=>{const A=E;Ga(A?.source,i)&&A.data?.to&&v(A.data.to)});return()=>{O?.unsubscribe()}},[e,i]),{motion:a,motionRaw:l,detection:f,phase:g}}function _O(e,i,a=5e3){const[o,l]=(0,n.useState)([]);(0,n.useEffect)(()=>{if(i===null)return;let v=!1;const b=()=>{e.webrtcSession.listStreams.query({deviceId:i}).then(k=>{v||l(k)}).catch(()=>{})};b();const w=setInterval(b,a);return()=>{v=!0,clearInterval(w)}},[e,i,a]);const[d,f]=(0,n.useState)(null);(0,n.useEffect)(()=>{if(i===null)return;let v=!1;return e.pipelineOrchestrator&&e.pipelineOrchestrator.getCameraMetrics.query({deviceId:i}).then(b=>{v||!b||f({phase:b.phase,detectionFps:b.actualFps,avgInferenceMs:b.avgInferenceTimeMs,droppedFrames:b.droppedFrames})}).catch(()=>{}),()=>{v=!0}},[e,i]),Ui("pipeline.camera-metrics-snapshot",v=>{if(i===null)return;const b=v.data;b.deviceId!==i||!b.metrics||f({phase:b.metrics.phase,detectionFps:b.metrics.actualFps,avgInferenceMs:b.metrics.avgInferenceTimeMs,droppedFrames:b.metrics.droppedFrames})});const{streams:h,hasWebrtc:g}=(0,n.useMemo)(()=>i===null||o.length===0?{streams:[],hasWebrtc:!1}:{streams:o.map(v=>({id:v.id,label:v.label,target:v.target,status:v.status,inputFps:v.inputFps,decodeFps:v.decodeFps,bitrateKbps:v.bitrateKbps})),hasWebrtc:!0},[i,o]);return{streams:h,hasWebrtc:g,pipelineMetrics:d,createSession:(0,n.useCallback)(async(v,b)=>{if(i===null)throw new Error("No device selected");const w=await e.webrtcSession.createSession.mutate({deviceId:i,target:v,hints:b});return{sessionId:w.sessionId,sdpOffer:w.sdpOffer}},[e,i]),sendAnswer:(0,n.useCallback)(async(v,b)=>{if(i===null)throw new Error("No device selected");await e.webrtcSession.handleAnswer.mutate({deviceId:i,sessionId:v,sdpAnswer:b})},[e,i]),closeSession:(0,n.useCallback)(async v=>{i!==null&&await e.webrtcSession.closeSession.mutate({deviceId:i,sessionId:v}).catch(()=>{})},[e,i])}}function wO(e){const i=e?.deviceId??null,a=e?.historyLimit??20,o=rl("doorbell.onPressed",i!==null?f=>f.deviceId===i:void 0),[l,d]=(0,n.useState)([]);return(0,n.useEffect)(()=>{o&&d(f=>{if(f.length>0&&f[0].deviceId===o.deviceId&&f[0].timestamp===o.timestamp)return f;const h=[o,...f];return h.length>a?h.slice(0,a):h})},[o,a]),{latest:o??null,history:l}}function SO(e){const i=mr(),a=(0,n.useMemo)(()=>e?JSON.stringify(e):"",[e]),[o,l]=(0,n.useState)(()=>i.listDevices(e));return(0,n.useEffect)(()=>{const d=()=>{l(i.listDevices(e))};d();let f=null,h=null;try{f=i.onDeviceAdded(d),h=i.onDeviceRemoved(d)}catch{}const g=i.subscribeConnectionEvents(v=>{v==="connected"&&d()});return()=>{f?.(),h?.(),g()}},[i,e,a]),o}function jO(e){const i=mr(),[a,o]=(0,n.useState)(()=>e===null?null:i.getDevice(e));return(0,n.useEffect)(()=>{if(e===null){o(null);return}const l=()=>{o(i.getDevice(e))};l();let d=null,f=null;try{d=i.onDeviceAdded(l),f=i.onDeviceRemoved(l)}catch{}const h=i.subscribeConnectionEvents(g=>{g==="connected"&&l()});return()=>{d?.(),f?.(),h()}},[i,e]),a}function $O(e,i,a){const o=mr();return(0,ee.useQuery)({queryKey:e,queryFn:()=>i(o)(),...a})}function kO(e,i){const a=mr();return(0,ee.useMutation)({mutationFn:o=>e(a)(o),...i})}function PO(e,i){const a=mr(),o=(0,ee.useQueryClient)(),[l,d]=(0,n.useState)(a.connectionVersion);(0,n.useEffect)(()=>a.subscribeConnectionEvents((g,v)=>{g==="connected"&&d(v)}),[a]);const f=i.join("|"),h=JSON.stringify(e);(0,n.useEffect)(()=>{const g=[],v=()=>{const b=JSON.parse(h),w=b.length===1&&Array.isArray(b[0])?b:[b];o.invalidateQueries({queryKey:w})};v();for(const b of f.split("|"))if(b)try{g.push(a.subscribeEvent(b,v))}catch{}return()=>{for(const b of g)b()}},[a,o,f,h,l])}t.AddonGlobalSettingsForm=LN,t.AgentStepEditor=Ov,t.AppShell=tb,t.AudioClassificationList=SC,t.AudioLevelWaveform=xC,t.AudioWaveform=yC,t.AutotrackSection=vf,t.BTN_COMPACT=eg,t.BTN_COMPACT_DANGER=rg,t.BTN_COMPACT_PRIMARY=tg,t.BTN_COMPACT_WARNING=ng,t.Badge=zr,t.BatteryBadge=gd,t.BottomSheet=Js,t.Breadcrumb=yv,t.Button=Sr,t.CHIP_ACTIVE=og,t.CHIP_BASE=ag,t.CHIP_INACTIVE=sg,t.CLASS_COLORS=Fi,t.CameraStreamPlayer=Mf,t.Card=Vs,t.Checkbox=pu,t.CodeBlock=Yv,t.CollapsibleCard=fu,t.ConfigFormBuilder=Of,t.ConfigFormField=_n,t.ConfigSchemaField=Ca,t.ConfirmActionButton=rO,t.ConfirmDialogProvider=Jv,t.CopyButton=Kf,t.CustomFieldRenderersProvider=e0,t.DEFAULT_COLOR=ay,t.DataTable=Uu,t.DetectionCanvas=oy,t.DetectionOverlay=Ef,t.DetectionResultTree=uy,t.DevShell=Wd,t.DeviceActivityPanel=tO,t.DeviceCard=nb,t.DeviceContextProvider=t0,t.DeviceExportPanel=bC,t.DeviceGrid=ib,t.DeviceItem=Ia,t.DeviceList=qb,t.Dialog=yu,t.DialogContent=qs,t.DialogDescription=Su,t.DialogFooter=_u,t.DialogHeader=xu,t.DialogTitle=wu,t.DialogTrigger=iv,t.DiscoveryPanel=BC,t.DoorbellRecentPanel=oO,t.Dropdown=ov,t.DropdownContent=lv,t.DropdownItem=cv,t.DropdownTrigger=sv,t.EmptyState=Hu,t.ErrorBox=Ju,t.EventStream=Al,t.FilterBar=eb,t.FloatingEventStream=LC,t.FloatingLogStream=OC,t.FloatingPanel=bv,t.FormField=Wv,t.GRID_GAP=jt,t.GRID_PAIRED=Wm,t.GRID_QUICK_STATS=Qm,t.HOST_WIDGETS=wf,t.INPUT_COMPACT=ig,t.IconButton=Gs,t.ImageSelector=py,t.InferenceConfigSelector=hy,t.Input=Pa,t.KebabMenu=sO,t.KeyValueList=Xv,t.LIST_ROW=nn,t.Label=Qs,t.LogStream=Il,t.LoginForm=Vd,t.MobileDrawer=Zu,t.MotionZonesSettings=_f,t.NodeMultiSelectField=$f,t.NodePicker=Lv,t.NodeSelectField=jf,t.PHASE_CONFIG=ps,t.PTZOverlay=gf,t.PageHeader=qv,t.PhaseIcon=kC,t.PipelineBuilder=iy,t.PipelineRuntimeSelector=ty,t.PipelineStep=Na,t.PipelineTreeMatrix=Tv,t.PlayerOverlaysProvider=HP,t.Popover=Du,t.PopoverContent=zu,t.PopoverTrigger=Au,t.ProviderBadge=Gv,t.PtzPanel=pf,t.QrCode=Jf,t.ResponseLog=jC,t.SECTION_BODY=te,t.SECTION_CARD=T,t.SECTION_HEADER=B,t.SPLIT_PANEL_OUTER=qm,t.SPLIT_PANEL_SIDE=Hm,t.STACK_GAP=ct,t.ScopePicker=gO,t.ScrollArea=Ks,t.Select=Zi,t.SemanticBadge=qu,t.Separator=Ws,t.Sidebar=il,t.SidebarItem=nl,t.Skeleton=mu,t.SlideOverPanel=xv,t.SnapshotButton=iO,t.StatCard=Kv,t.StateValuesStream=om,t.StatusBadge=Bv,t.StepTimings=gy,t.StepTreeMaster=wv,t.StreamBrokerSelector=nC,t.StreamPanel=eC,t.Switch=hu,t.SystemProvider=Wu,t.TEXT_FIELD_LABEL=Km,t.TEXT_HINT=Ci,t.TEXT_METRIC=Ym,t.TEXT_SECTION_LABEL=Jm,t.TEXT_VALUE=Xm,t.Tabs=gv,t.TabsContent=vv,t.TabsList=pv,t.TabsTrigger=hv,t.ThemeProvider=u.ThemeProvider$1,t.Tooltip=uv,t.TooltipContent=fv,t.TooltipTrigger=dv,t.VersionBadge=Qv,t.WidgetRegistryProvider=GP,t.WidgetSlot=Sf,t.ZoneEditingProvider=vO,t.__toESM=s,t.buildStepTreeFromSchema=Sv,t.cn=P,t.createSharedContext=_r,t.createTheme=u.createTheme$1,t.darkColors=u.darkColors$1,t.defaultTheme=u.defaultTheme$1,t.deriveDeviceKind=ob,t.ensureMfHostInit=Zc,t.getClassColor=Vt,t.getPhaseVisual=hs,t.isFieldVisible=Cf,t.lightColors=u.lightColors$1,t.loadRemoteBundle=_l,t.mirror=fg,t.mountAddonPage=Yy,t.providerIcons=Kh,t.statusIcons=Xh,t.themeToCss=u.themeToCss$1,t.trpc=j,t.useAccessoriesGetStatus=n0,t.useAddonPagesListPages=i0,t.useAddonSettingsGetDeviceSettings=z0,t.useAddonSettingsGetGlobalSettings=D0,t.useAddonSettingsUpdateDeviceSettings=T0,t.useAddonSettingsUpdateGlobalSettings=A0,t.useAddonWidgetsListWidgets=Xd,t.useAddonsApplyAutoUpdateToAll=I0,t.useAddonsCustom=E0,t.useAddonsForceRefresh=v0,t.useAddonsGetAddonAutoUpdate=C0,t.useAddonsGetAutoUpdateSettings=P0,t.useAddonsGetLastRestart=y0,t.useAddonsGetLogs=a0,t.useAddonsGetVersions=j0,t.useAddonsInstallFromWorkspace=l0,t.useAddonsInstallPackage=s0,t.useAddonsIsWorkspaceAvailable=c0,t.useAddonsList=Kd,t.useAddonsListCapabilityProviders=_0,t.useAddonsListFrameworkPackages=x0,t.useAddonsListPackages=o0,t.useAddonsListUpdates=g0,t.useAddonsListWorkspacePackages=u0,t.useAddonsOnAddonLogs=M0,t.useAddonsReloadPackages=f0,t.useAddonsRestartAddon=$0,t.useAddonsRestartServer=b0,t.useAddonsRetryLoad=k0,t.useAddonsRollbackPackage=h0,t.useAddonsSearchAvailable=m0,t.useAddonsSetAddonAutoUpdate=O0,t.useAddonsSetAutoUpdateSettings=N0,t.useAddonsSetCapabilityProviderEnabled=w0,t.useAddonsUninstallPackage=d0,t.useAddonsUpdateFrameworkPackage=S0,t.useAddonsUpdatePackage=p0,t.useAlertsDismiss=G0,t.useAlertsEmit=R0,t.useAlertsGetUnreadCount=U0,t.useAlertsList=L0,t.useAlertsMarkAllRead=F0,t.useAlertsMarkRead=B0,t.useAlertsUpdate=Z0,t.useAllWidgets=QP,t.useAudioAnalysisApplyDeviceSettingsPatch=q0,t.useAudioAnalysisGetDeviceLiveContribution=W0,t.useAudioAnalysisGetDeviceSettingsContribution=Q0,t.useAudioAnalysisResolveDeviceSettings=V0,t.useAudioAnalyzerAnalyseChunk=H0,t.useAudioAnalyzerClassify=J0,t.useAudioAnalyzerDispose=X0,t.useAudioAnalyzerIsReady=K0,t.useAudioAnalyzerReprobeAudioEngine=Y0,t.useAudioCodecCanHandle=tx,t.useAudioCodecCloseSession=ix,t.useAudioCodecCreateDecodeSession=rx,t.useAudioCodecCreateEncodeSession=nx,t.useAudioCodecFlushEncode=cx,t.useAudioCodecListActiveSessions=ux,t.useAudioCodecListSupportedCodecs=ex,t.useAudioCodecPullEncoded=lx,t.useAudioCodecPullPcm=ox,t.useAudioCodecPushEncodedFrame=ax,t.useAudioCodecPushPcm=sx,t.useAudioMetricsGetCurrentSnapshot=dx,t.useAudioMetricsGetHistory=fx,t.useBackupDelete=yx,t.useBackupGetEntries=vx,t.useBackupList=px,t.useBackupListArchives=xx,t.useBackupListDestinations=mx,t.useBackupListLocations=hx,t.useBackupPreviewSchedule=wx,t.useBackupRestore=bx,t.useBackupTrigger=gx,t.useBackupUpsertDestinationPolicy=_x,t.useBatteryGetStatus=Sx,t.useBrightnessGetStatus=$x,t.useBrightnessSetBrightness=jx,t.useCameraCredentialsGetCredentials=kx,t.useCameraCredentialsGetStatus=Px,t.useCameraStreamsGetBrokerStreams=Cx,t.useCameraStreamsGetCameraStreams=Nx,t.useCameraStreamsGetRtspEntries=Yd,t.useClusterNodes=Oa,t.useConfirm=Bi,t.useCustomFieldRenderer=Hd,t.useDebouncedString=bd,t.useDecoderCreateSession=Ex,t.useDecoderDestroySession=Mx,t.useDecoderGetFrame=Rx,t.useDecoderGetInfo=Ix,t.useDecoderGetShmStats=Zx,t.useDecoderGetStats=Ux,t.useDecoderListActiveSessions=Bx,t.useDecoderOpenStream=Ax,t.useDecoderPullFrames=zx,t.useDecoderPullHandles=Tx,t.useDecoderPushPacket=Dx,t.useDecoderReprobeHwaccel=Fx,t.useDecoderSupportsCodec=Ox,t.useDecoderUpdateConfig=Lx,t.useDetectionPipelineApplyDeviceSettingsPatch=Qx,t.useDetectionPipelineGetDeviceLiveContribution=Vx,t.useDetectionPipelineGetDeviceSettingsContribution=Gx,t.useDevShell=qy,t.useDevice=jO,t.useDeviceAutotrack=hf,t.useDeviceBattery=fd,t.useDeviceCapability=bn,t.useDeviceDetections=xO,t.useDeviceDiscoveryAdoptDevice=Hx,t.useDeviceDiscoveryGetStatus=Kx,t.useDeviceDiscoveryListDiscovered=Wx,t.useDeviceDiscoveryRefreshDiscovery=qx,t.useDeviceDiscoveryReleaseDevice=Jx,t.useDeviceExportApplyDeviceSettingsPatch=r_,t.useDeviceExportExposeDevice=Yx,t.useDeviceExportGetDeviceLiveContribution=t_,t.useDeviceExportGetDeviceSettingsContribution=e_,t.useDeviceExportGetStatus=ef,t.useDeviceExportListExposedDevices=tf,t.useDeviceExportListSupportedDeviceKinds=Xx,t.useDeviceExportUnexposeDevice=rf,t.useDeviceId=Jd,t.useDeviceManagerAddLocation=g_,t.useDeviceManagerAdoptDevice=U_,t.useDeviceManagerAllocateDeviceId=n_,t.useDeviceManagerCreateDevice=F_,t.useDeviceManagerDisable=$_,t.useDeviceManagerDiscoverDevices=L_,t.useDeviceManagerEnable=j_,t.useDeviceManagerGetAllBindings=I_,t.useDeviceManagerGetBindings=O_,t.useDeviceManagerGetChildren=y_,t.useDeviceManagerGetConfigSchema=__,t.useDeviceManagerGetCreationSchema=B_,t.useDeviceManagerGetDevice=b_,t.useDeviceManagerGetDeviceAggregate=T_,t.useDeviceManagerGetDeviceLiveInfoAggregate=z_,t.useDeviceManagerGetDeviceSettingsAggregate=A_,t.useDeviceManagerGetDeviceStatusAggregate=Q_,t.useDeviceManagerGetSettingsSchema=w_,t.useDeviceManagerGetStreamProfileMap=P_,t.useDeviceManagerGetStreamSources=x_,t.useDeviceManagerListAll=nf,t.useDeviceManagerListBindableCapsForDeviceType=D_,t.useDeviceManagerListLocations=m_,t.useDeviceManagerListPersistedByAddon=v_,t.useDeviceManagerListWrappersForCap=M_,t.useDeviceManagerLoadConfig=s_,t.useDeviceManagerLoadMeta=c_,t.useDeviceManagerLoadRuntimeState=l_,t.useDeviceManagerPersistConfig=o_,t.useDeviceManagerProbeStreams=C_,t.useDeviceManagerRegisterDevice=i_,t.useDeviceManagerRemove=k_,t.useDeviceManagerRemoveDevice=a_,t.useDeviceManagerRemoveLocation=p_,t.useDeviceManagerSetDisabled=h_,t.useDeviceManagerSetLocation=d_,t.useDeviceManagerSetMetadata=f_,t.useDeviceManagerSetName=u_,t.useDeviceManagerSetStreamProfileMap=N_,t.useDeviceManagerSetWrapperActive=E_,t.useDeviceManagerTestCreationField=G_,t.useDeviceManagerTestField=V_,t.useDeviceManagerUpdateConfig=S_,t.useDeviceManagerUpdateDeviceField=R_,t.useDeviceManagerUpdateDeviceFieldsBatch=Z_,t.useDeviceOpsGetConfigEntries=q_,t.useDeviceOpsGetSettingsSchema=K_,t.useDeviceOpsGetStreamSources=W_,t.useDeviceOpsRemoveDevice=J_,t.useDeviceOpsSetConfig=H_,t.useDeviceProviderAdoptDiscoveredDevice=i1,t.useDeviceProviderCreateDevice=s1,t.useDeviceProviderDiscoverDevices=n1,t.useDeviceProviderGetChildCreationSchema=o1,t.useDeviceProviderGetDevices=t1,t.useDeviceProviderGetStatus=e1,t.useDeviceProviderStart=X_,t.useDeviceProviderStop=Y_,t.useDeviceProviderSupportsDiscovery=r1,t.useDeviceProviderSupportsManualCreation=a1,t.useDeviceProviderTestCreationField=l1,t.useDeviceProxy=Hr,t.useDeviceSnapshot=r0,t.useDeviceSnapshotImage=md,t.useDeviceState=Xu,t.useDeviceStateGetAllSnapshots=d1,t.useDeviceStateGetCapSlice=u1,t.useDeviceStateGetSnapshot=c1,t.useDeviceStateSetCapSlice=f1,t.useDeviceStateSlice=al,t.useDeviceStatusGetStatus=m1,t.useDeviceWebrtc=_O,t.useDevices=SO,t.useDoorbellEvents=wO,t.useDoorbellGetStatus=g1,t.useEventInvalidation=PO,t.useEventStreamLatest=rl,t.useEventStreamMap=Zv,t.useEventsGetEventClipUrl=v1,t.useEventsGetEventThumbnail=h1,t.useEventsGetEvents=p1,t.useFeatureProbeGetStatus=b1,t.useIntegrationsCreate=w1,t.useIntegrationsDelete=j1,t.useIntegrationsGet=x1,t.useIntegrationsGetAvailableTypes=P1,t.useIntegrationsGetByAddonId=_1,t.useIntegrationsGetSettings=$1,t.useIntegrationsList=y1,t.useIntegrationsSetSettings=k1,t.useIntegrationsTestConnection=N1,t.useIntegrationsUpdate=S1,t.useIntercomEndTalkSession=D1,t.useIntercomGetStatus=A1,t.useIntercomHandleAnswer=O1,t.useIntercomPushTalkPcm=M1,t.useIntercomStartSession=C1,t.useIntercomStartTalkSession=E1,t.useIntercomStopSession=I1,t.useIsMidWidth=mv,t.useIsMobile=Li,t.useLiveBuffer=Sn,t.useLiveEvent=Ui,t.useLocalNetworkGetAllowedAddresses=Z1,t.useLocalNetworkGetConnectionEndpoints=R1,t.useLocalNetworkGetPreferred=T1,t.useLocalNetworkList=z1,t.useLocalNetworkResetAllowlistToBestMatch=U1,t.useLocalNetworkSetAllowedAddresses=L1,t.useMeshNetworkGetStatus=B1,t.useMeshNetworkJoin=F1,t.useMeshNetworkLeave=V1,t.useMeshNetworkListPeers=W1,t.useMeshNetworkLogout=Q1,t.useMeshNetworkStartLogin=G1,t.useMeshNetworkTestConnection=q1,t.useMetricsProviderCollectSnapshot=H1,t.useMetricsProviderGetAddonStats=nw,t.useMetricsProviderGetCached=J1,t.useMetricsProviderGetCpuTemperature=ew,t.useMetricsProviderGetCurrent=K1,t.useMetricsProviderGetDiskSpace=X1,t.useMetricsProviderGetGpuInfo=Y1,t.useMetricsProviderGetProcessStats=tw,t.useMetricsProviderKillProcess=aw,t.useMetricsProviderListAddonInstances=rw,t.useMetricsProviderListNodeProcesses=iw,t.useMotionDetectionAnalyze=lw,t.useMotionDetectionApplyDeviceSettingsPatch=mw,t.useMotionDetectionGetDeviceLiveContribution=fw,t.useMotionDetectionGetDeviceSettingsContribution=dw,t.useMotionDetectionRemoveCamera=cw,t.useMotionDetectionReset=uw,t.useMotionGetStatus=sw,t.useMotionIsDetected=ow,t.useMotionTriggerGetStatus=pw,t.useMotionTriggerSetMotionTrigger=gw,t.useMotionZonesGetOptions=hw,t.useMotionZonesGetStatus=bw,t.useMotionZonesSetZone=vw,t.useMqttBrokerAddBroker=_w,t.useMqttBrokerGetBrokerConfig=xw,t.useMqttBrokerGetStatus=kw,t.useMqttBrokerListBrokers=yw,t.useMqttBrokerRemoveBroker=ww,t.useMqttBrokerStartEmbeddedBroker=jw,t.useMqttBrokerStopEmbeddedBroker=$w,t.useMqttBrokerTestConnection=Sw,t.useNativeObjectDetectionGetStatus=Pw,t.useNetworkAccessGetEndpoint=Ow,t.useNetworkAccessGetStatus=Iw,t.useNetworkAccessListEndpoints=Ew,t.useNetworkAccessStart=Nw,t.useNetworkAccessStop=Cw,t.useNetworkQualityGetAllStats=Dw,t.useNetworkQualityGetDeviceStats=Mw,t.useNetworkQualityReportClientStats=Aw,t.useNodesClusterAddonStatus=Gw,t.useNodesDeployAddon=Tw,t.useNodesExecuteQuery=qw,t.useNodesGetCapUsageGraph=Vw,t.useNodesGetNodeAddons=Qw,t.useNodesRenameNode=Fw,t.useNodesRestartAddon=Zw,t.useNodesRestartNode=Uw,t.useNodesRestartProcess=Lw,t.useNodesSetProcessLogLevel=Ww,t.useNodesShutdownNode=Bw,t.useNodesTopology=zw,t.useNodesUndeployAddon=Rw,t.useNotificationOutputSend=Hw,t.useNotificationOutputSendTest=Jw,t.useOptionalSystem=Rv,t.useOptionalWidgetRegistry=Sl,t.useOsdGetStatus=Xw,t.useOsdSetOverlay=Kw,t.usePTZ=mf,t.usePipelineAnalyticsApplyDeviceSettingsPatch=uS,t.usePipelineAnalyticsClearTracks=rS,t.usePipelineAnalyticsGetActiveTracks=Yw,t.usePipelineAnalyticsGetAudioEvents=aS,t.usePipelineAnalyticsGetDeviceLiveContribution=cS,t.usePipelineAnalyticsGetDeviceSettingsContribution=lS,t.usePipelineAnalyticsGetEventMedia=oS,t.usePipelineAnalyticsGetMotionEvents=nS,t.usePipelineAnalyticsGetObjectEvents=iS,t.usePipelineAnalyticsGetTrack=eS,t.usePipelineAnalyticsGetTrackMedia=sS,t.usePipelineAnalyticsListTracks=tS,t.usePipelineExecutorCacheFrameInPool=ES,t.usePipelineExecutorDeleteModel=NS,t.usePipelineExecutorDeleteTemplate=jS,t.usePipelineExecutorDetect=CS,t.usePipelineExecutorDownloadModel=PS,t.usePipelineExecutorGetAddonModels=kS,t.usePipelineExecutorGetAudioCapabilities=FS,t.usePipelineExecutorGetAvailableEngines=dS,t.usePipelineExecutorGetCapabilities=$S,t.usePipelineExecutorGetDefaultSteps=mS,t.usePipelineExecutorGetDetectionConfigSchema=VS,t.usePipelineExecutorGetEffectiveTuning=AS,t.usePipelineExecutorGetGlobalPipelineConfig=yS,t.usePipelineExecutorGetGlobalSteps=bS,t.usePipelineExecutorGetOrchestratorConfigSchema=xS,t.usePipelineExecutorGetReferenceAudio=BS,t.usePipelineExecutorGetReferenceAudioFiles=US,t.usePipelineExecutorGetReferenceImage=LS,t.usePipelineExecutorGetSchema=vS,t.usePipelineExecutorGetSelectedEngine=fS,t.usePipelineExecutorGetVideoPipelineSteps=pS,t.usePipelineExecutorInferCached=MS,t.usePipelineExecutorKillEngine=RS,t.usePipelineExecutorListLoadedEngines=zS,t.usePipelineExecutorListReferenceImages=ZS,t.usePipelineExecutorListTemplates=_S,t.usePipelineExecutorReprobeEngine=gS,t.usePipelineExecutorRunAudioTest=GS,t.usePipelineExecutorRunPipeline=OS,t.usePipelineExecutorRunPipelineBatch=IS,t.usePipelineExecutorSaveTemplate=wS,t.usePipelineExecutorSetVideoPipelineSteps=hS,t.usePipelineExecutorSpinEngine=TS,t.usePipelineExecutorUncacheFrame=DS,t.usePipelineExecutorUpdateTemplate=SS,t.usePipelineOrchestratorApplyDeviceSettingsPatch=Pj,t.usePipelineOrchestratorAssignAudio=aj,t.usePipelineOrchestratorAssignDecoder=rj,t.usePipelineOrchestratorAssignPipeline=QS,t.usePipelineOrchestratorDeleteTemplate=jj,t.usePipelineOrchestratorGetAgentLoad=KS,t.usePipelineOrchestratorGetAgentSettings=dj,t.usePipelineOrchestratorGetAudioAssignment=sj,t.usePipelineOrchestratorGetAudioAssignments=cj,t.usePipelineOrchestratorGetAudioNodeLoad=lj,t.usePipelineOrchestratorGetCameraMetrics=YS,t.usePipelineOrchestratorGetCameraSettings=pj,t.usePipelineOrchestratorGetCameraStepOverrides=vj,t.usePipelineOrchestratorGetCapabilityBindings=ej,t.usePipelineOrchestratorGetDecoderAssignment=uj,t.usePipelineOrchestratorGetDecoderAssignments=ij,t.usePipelineOrchestratorGetDeviceLiveContribution=kj,t.usePipelineOrchestratorGetDeviceSettingsContribution=$j,t.usePipelineOrchestratorGetGlobalMetrics=XS,t.usePipelineOrchestratorGetPipelineAssignment=JS,t.usePipelineOrchestratorGetPipelineAssignments=HS,t.usePipelineOrchestratorListAgentSettings=fj,t.usePipelineOrchestratorListTemplates=_j,t.usePipelineOrchestratorRebalance=qS,t.usePipelineOrchestratorRemoveAgentSettings=gj,t.usePipelineOrchestratorResolvePipeline=xj,t.usePipelineOrchestratorSaveTemplate=wj,t.usePipelineOrchestratorSetAgentAddonDefaults=mj,t.usePipelineOrchestratorSetCameraPipelineForAgent=yj,t.usePipelineOrchestratorSetCameraStepOverride=bj,t.usePipelineOrchestratorSetCameraStepToggle=hj,t.usePipelineOrchestratorSetCapabilityBinding=tj,t.usePipelineOrchestratorUnassignAudio=oj,t.usePipelineOrchestratorUnassignDecoder=nj,t.usePipelineOrchestratorUnassignPipeline=WS,t.usePipelineOrchestratorUpdateTemplate=Sj,t.usePipelineRunnerAttachCamera=Nj,t.usePipelineRunnerDetachCamera=Cj,t.usePipelineRunnerGetAllCameraMetrics=Dj,t.usePipelineRunnerGetCameraMetrics=Mj,t.usePipelineRunnerGetLocalCameras=Aj,t.usePipelineRunnerGetLocalLoad=Ij,t.usePipelineRunnerGetLocalMetrics=Ej,t.usePipelineRunnerReportMotion=Oj,t.usePlatformProbeGetCapabilities=zj,t.usePlatformProbeGetHardware=Tj,t.usePlatformProbeGetHardwareEncoders=Lj,t.usePlatformProbeRefreshHardwareEncoders=Uj,t.usePlatformProbeResolveHwAccel=Zj,t.usePlatformProbeResolveInferenceConfig=Rj,t.usePlayerOverlayLayer=yf,t.usePlayerOverlayLayers=JP,t.usePlayerToolbarButton=KP,t.usePlayerToolbarButtons=bf,t.usePtzAutotrackGetSettings=e$,t.usePtzAutotrackGetStatus=af,t.usePtzAutotrackSetEnabled=of,t.usePtzAutotrackSetSettings=sf,t.usePtzContinuousMove=Fj,t.usePtzDeletePreset=qj,t.usePtzGetOptions=Hj,t.usePtzGetPosition=Kj,t.usePtzGetPresets=Vj,t.usePtzGetStatus=Yj,t.usePtzGoHome=Jj,t.usePtzGoToPreset=Qj,t.usePtzMove=Bj,t.usePtzSavePreset=Wj,t.usePtzSetAutofocus=Xj,t.usePtzStop=Gj,t.useRebootReboot=t$,t.useRecordingEngineDisable=s$,t.useRecordingEngineEnable=o$,t.useRecordingEngineEstimateGlobalStorage=p$,t.useRecordingEngineEstimateStorage=g$,t.useRecordingEngineGetAvailability=m$,t.useRecordingEngineGetConfig=l$,t.useRecordingEngineGetMotionStats=w$,t.useRecordingEngineGetPlaylist=u$,t.useRecordingEngineGetPolicy=b$,t.useRecordingEngineGetPolicyStatus=y$,t.useRecordingEngineGetRetentionConfig=x$,t.useRecordingEngineGetSegments=f$,t.useRecordingEngineGetStatus=a$,t.useRecordingEngineGetStorageUsage=h$,t.useRecordingEngineGetThumbnail=d$,t.useRecordingEngineSetPolicy=v$,t.useRecordingEngineUpdateConfig=c$,t.useRecordingEngineUpdateRetentionConfig=_$,t.useRecordingGetPlaybackUrl=n$,t.useRecordingGetSegments=r$,t.useRecordingGetThumbnailAt=i$,t.useRemoteComponent=df,t.useSettingsStoreCount=C$,t.useSettingsStoreDeclareCollection=I$,t.useSettingsStoreDelete=N$,t.useSettingsStoreGet=S$,t.useSettingsStoreInsert=k$,t.useSettingsStoreIsEmpty=O$,t.useSettingsStoreQuery=$$,t.useSettingsStoreSet=j$,t.useSettingsStoreUpdate=P$,t.useSnapshotApplyDeviceSettingsPatch=T$,t.useSnapshotGetDeviceLiveContribution=z$,t.useSnapshotGetDeviceSettingsContribution=A$,t.useSnapshotGetSnapshot=E$,t.useSnapshotGetStatus=D$,t.useSnapshotInvalidateCache=M$,t.useSnapshotProviderGetSnapshot=Z$,t.useSnapshotProviderSupportsDevice=R$,t.useStorageAbortUpload=J$,t.useStorageBeginDownload=K$,t.useStorageBeginUpload=W$,t.useStorageDelete=V$,t.useStorageDeleteLocation=nk,t.useStorageEndDownload=Y$,t.useStorageExists=F$,t.useStorageFinalizeUpload=H$,t.useStorageGetAvailableSpace=Q$,t.useStorageGetDefaultLocation=tk,t.useStorageList=G$,t.useStorageListLocations=ek,t.useStorageListProviders=ak,t.useStorageRead=B$,t.useStorageReadChunk=X$,t.useStorageResolve=L$,t.useStorageTestConfig=ok,t.useStorageTestLocation=ik,t.useStorageUpsertLocation=rk,t.useStorageWrite=U$,t.useStorageWriteChunk=q$,t.useStreamBrokerApplyDeviceSettingsPatch=zk,t.useStreamBrokerAssignProfile=ck,t.useStreamBrokerGetAllRtspEntries=Ck,t.useStreamBrokerGetBrokerStats=mk,t.useStreamBrokerGetDeviceLiveContribution=Ak,t.useStreamBrokerGetDeviceSettingsContribution=Dk,t.useStreamBrokerGetPreBufferInfo=Pk,t.useStreamBrokerGetRtspEntry=Ok,t.useStreamBrokerGetRtspPort=Nk,t.useStreamBrokerGetStreamUrl=vk,t.useStreamBrokerGetStreamWithCodec=bk,t.useStreamBrokerIsRtspEnabled=Mk,t.useStreamBrokerKillClient=pk,t.useStreamBrokerListAllCameraStreams=dk,t.useStreamBrokerListAllProfileSlots=fk,t.useStreamBrokerListClients=gk,t.useStreamBrokerPublishCameraStream=sk,t.useStreamBrokerPullAudioChunks=_k,t.useStreamBrokerPullFrameHandles=jk,t.useStreamBrokerRegenerateRtspToken=Ik,t.useStreamBrokerReleaseStreamWithCodec=yk,t.useStreamBrokerRestartProfile=hk,t.useStreamBrokerRetractCameraStream=lk,t.useStreamBrokerSetPreBufferDuration=kk,t.useStreamBrokerSetRtspEnabled=Ek,t.useStreamBrokerSubscribeAudioChunks=xk,t.useStreamBrokerSubscribeFrames=Sk,t.useStreamBrokerUnassignProfile=uk,t.useStreamBrokerUnsubscribeAudioChunks=wk,t.useStreamBrokerUnsubscribeFrames=$k,t.useStreamParamsGetConfigSchema=Zk,t.useStreamParamsGetOptions=Tk,t.useStreamParamsGetStatus=Lk,t.useStreamParamsSetProfile=Rk,t.useSwitchGetStatus=Bk,t.useSwitchSetState=Uk,t.useSystem=mr,t.useSystemFeatureFlags=Vk,t.useSystemForceRetentionCleanup=Hk,t.useSystemGetRetentionConfig=Wk,t.useSystemHealth=Gk,t.useSystemInfo=Fk,t.useSystemMutation=kO,t.useSystemNetworkAddresses=Qk,t.useSystemQuery=$O,t.useSystemSetRetentionConfig=qk,t.useThemeMode=u.useThemeMode$1,t.useToastOnToast=Jk,t.useTurnProviderGetTurnServers=Kk,t.useUserManagementConfirmTotp=gP,t.useUserManagementCreateApiKey=oP,t.useUserManagementCreateScopedToken=cP,t.useUserManagementCreateUser=Yk,t.useUserManagementDeleteUser=tP,t.useUserManagementDisableTotp=pP,t.useUserManagementGetTotpStatus=hP,t.useUserManagementListApiKeys=aP,t.useUserManagementListOauthSessions=wP,t.useUserManagementListScopedTokens=fP,t.useUserManagementListUsers=Xk,t.useUserManagementOauthExchangeCode=yP,t.useUserManagementOauthIssueCode=bP,t.useUserManagementOauthRefresh=xP,t.useUserManagementOauthVerifyAccessToken=_P,t.useUserManagementResetPassword=rP,t.useUserManagementRevokeApiKey=sP,t.useUserManagementRevokeOauthSession=SP,t.useUserManagementRevokeScopedToken=uP,t.useUserManagementSetUserScopes=nP,t.useUserManagementSetupTotp=mP,t.useUserManagementUpdateUser=eP,t.useUserManagementValidateApiKey=lP,t.useUserManagementValidateCredentials=iP,t.useUserManagementValidateScopedToken=dP,t.useUserManagementVerifyTotp=vP,t.useWebrtcSessionCloseSession=NP,t.useWebrtcSessionCreateSession=$P,t.useWebrtcSessionHandleAnswer=PP,t.useWebrtcSessionHandleOffer=kP,t.useWebrtcSessionHasAdaptiveBitrate=CP,t.useWebrtcSessionListStreams=jP,t.useWidget=VP,t.useWidgetMetadata=uf,t.useWidgetRegistry=Ta,t.useZoneAnalyticsGetCameraHistory=EP,t.useZoneAnalyticsGetCurrentSnapshot=OP,t.useZoneAnalyticsGetUnzonedHistory=MP,t.useZoneAnalyticsGetZoneHistory=IP,t.useZoneEditing=bO,t.useZoneRulesListRules=DP,t.useZoneRulesSetRules=AP,t.useZonesAddZone=TP,t.useZonesListZones=zP,t.useZonesRemoveZone=RP,t.useZonesUpdateZone=ZP,t.validateScopes=hO})(Ul)),Ul}var Vm=Gm();const gD=OO(Vm),CD=LO({__proto__:null,default:gD},[Vm]);export{CD as i};