@monotykamary/localterm 1.11.2 → 1.11.3
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.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monotykamary/localterm",
|
|
3
|
-
"version": "1.11.
|
|
3
|
+
"version": "1.11.3",
|
|
4
4
|
"description": "A browser-based terminal: one browser tab is one PTY session. Friendly URL, persistent xterm.js front-end, hono + node-pty back-end.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"browser-terminal",
|
|
@@ -43,12 +43,19 @@
|
|
|
43
43
|
"publishConfig": {
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"build": "tsc -p tsconfig.build.json",
|
|
48
|
+
"dev": "tsc -p tsconfig.build.json --watch",
|
|
49
|
+
"test": "vp test --run",
|
|
50
|
+
"typecheck": "tsc --noEmit",
|
|
51
|
+
"prepack": "node ../../scripts/prepare-cli-publish.mjs"
|
|
52
|
+
},
|
|
46
53
|
"dependencies": {
|
|
54
|
+
"@monotykamary/localterm-server": "workspace:*",
|
|
47
55
|
"commander": "^12.1.0",
|
|
48
56
|
"kleur": "^4.1.5",
|
|
49
57
|
"open": "^10.1.0",
|
|
50
|
-
"zod": "^4.3.6"
|
|
51
|
-
"@monotykamary/localterm-server": "1.11.2"
|
|
58
|
+
"zod": "^4.3.6"
|
|
52
59
|
},
|
|
53
60
|
"devDependencies": {
|
|
54
61
|
"@types/node": "^25.5.0",
|
|
@@ -57,11 +64,5 @@
|
|
|
57
64
|
},
|
|
58
65
|
"engines": {
|
|
59
66
|
"node": ">=22"
|
|
60
|
-
},
|
|
61
|
-
"scripts": {
|
|
62
|
-
"build": "tsc -p tsconfig.build.json",
|
|
63
|
-
"dev": "tsc -p tsconfig.build.json --watch",
|
|
64
|
-
"test": "vp test --run",
|
|
65
|
-
"typecheck": "tsc --noEmit"
|
|
66
67
|
}
|
|
67
|
-
}
|
|
68
|
+
}
|
|
@@ -110,6 +110,6 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
|
|
|
110
110
|
|
|
111
111
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=zD,s=!wD.jitless,c=s&&BD.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?oA([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function lA(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!nO(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>aO(e,r,TD())))}),t)}var uA=$(`$ZodUnion`,(e,t)=>{Sk.init(e,t),ND(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),ND(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),ND(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),ND(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>AD(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>lA(t,i,e,a)):lA(s,i,e,a)}}),dA=$(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,uA.init(e,t);let n=e._zod.parse;ND(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=OD(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!zD(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,input:o,path:[t.discriminator],inst:e}),i)}}),fA=$(`$ZodIntersection`,(e,t)=>{Sk.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>mA(e,t,n)):mA(e,i,a)}});function pA(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(VD(e)&&VD(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=pA(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=pA(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function mA(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),nO(e))return e;let o=pA(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var hA=$(`$ZodEnum`,(e,t)=>{Sk.init(e,t);let n=ED(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>UD.has(typeof e)).map(e=>typeof e==`string`?WD(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),gA=$(`$ZodLiteral`,(e,t)=>{if(Sk.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?WD(e):e?WD(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),_A=$(`$ZodTransform`,(e,t)=>{Sk.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new CD(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new SD;return n.value=i,n}});function vA(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var yA=$(`$ZodOptional`,(e,t)=>{Sk.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,ND(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ND(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${AD(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>vA(t,e.value)):vA(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),bA=$(`$ZodExactOptional`,(e,t)=>{yA.init(e,t),ND(e._zod,`values`,()=>t.innerType._zod.values),ND(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),xA=$(`$ZodNullable`,(e,t)=>{Sk.init(e,t),ND(e._zod,`optin`,()=>t.innerType._zod.optin),ND(e._zod,`optout`,()=>t.innerType._zod.optout),ND(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${AD(e.source)}|null)$`):void 0}),ND(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),SA=$(`$ZodDefault`,(e,t)=>{Sk.init(e,t),e._zod.optin=`optional`,ND(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>CA(e,t)):CA(r,t)}});function CA(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var wA=$(`$ZodPrefault`,(e,t)=>{Sk.init(e,t),e._zod.optin=`optional`,ND(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),TA=$(`$ZodNonOptional`,(e,t)=>{Sk.init(e,t),ND(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>EA(t,e)):EA(i,e)}});function EA(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var DA=$(`$ZodCatch`,(e,t)=>{Sk.init(e,t),ND(e._zod,`optin`,()=>t.innerType._zod.optin),ND(e._zod,`optout`,()=>t.innerType._zod.optout),ND(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>aO(e,n,TD()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>aO(e,n,TD()))},input:e.value}),e.issues=[]),e)}}),OA=$(`$ZodPipe`,(e,t)=>{Sk.init(e,t),ND(e._zod,`values`,()=>t.in._zod.values),ND(e._zod,`optin`,()=>t.in._zod.optin),ND(e._zod,`optout`,()=>t.out._zod.optout),ND(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>kA(e,t.in,n)):kA(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>kA(e,t.out,n)):kA(r,t.out,n)}});function kA(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var AA=$(`$ZodReadonly`,(e,t)=>{Sk.init(e,t),ND(e._zod,`propValues`,()=>t.innerType._zod.propValues),ND(e._zod,`values`,()=>t.innerType._zod.values),ND(e._zod,`optin`,()=>t.innerType?._zod?.optin),ND(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(jA):jA(r)}});function jA(e){return e.value=Object.freeze(e.value),e}var MA=$(`$ZodCustom`,(e,t)=>{rk.init(e,t),Sk.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>NA(t,n,r,e));NA(i,n,r,e)}});function NA(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(sO(e))}}var PA,FA=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function IA(){return new FA}(PA=globalThis).__zod_globalRegistry??(PA.__zod_globalRegistry=IA());var LA=globalThis.__zod_globalRegistry;function RA(e,t){return new e({type:`string`,...KD(t)})}function zA(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...KD(t)})}function BA(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...KD(t)})}function VA(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...KD(t)})}function HA(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...KD(t)})}function UA(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...KD(t)})}function WA(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...KD(t)})}function GA(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...KD(t)})}function KA(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...KD(t)})}function qA(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...KD(t)})}function JA(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...KD(t)})}function YA(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...KD(t)})}function XA(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...KD(t)})}function ZA(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...KD(t)})}function QA(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...KD(t)})}function $A(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...KD(t)})}function ej(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...KD(t)})}function tj(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...KD(t)})}function nj(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...KD(t)})}function rj(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...KD(t)})}function ij(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...KD(t)})}function aj(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...KD(t)})}function oj(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...KD(t)})}function sj(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...KD(t)})}function cj(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...KD(t)})}function lj(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...KD(t)})}function uj(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...KD(t)})}function dj(e,t){return new e({type:`number`,checks:[],...KD(t)})}function fj(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...KD(t)})}function pj(e,t){return new e({type:`boolean`,...KD(t)})}function mj(e){return new e({type:`unknown`})}function hj(e,t){return new e({type:`never`,...KD(t)})}function gj(e,t){return new ak({check:`less_than`,...KD(t),value:e,inclusive:!1})}function _j(e,t){return new ak({check:`less_than`,...KD(t),value:e,inclusive:!0})}function vj(e,t){return new ok({check:`greater_than`,...KD(t),value:e,inclusive:!1})}function yj(e,t){return new ok({check:`greater_than`,...KD(t),value:e,inclusive:!0})}function bj(e,t){return new sk({check:`multiple_of`,...KD(t),value:e})}function xj(e,t){return new lk({check:`max_length`,...KD(t),maximum:e})}function Sj(e,t){return new uk({check:`min_length`,...KD(t),minimum:e})}function Cj(e,t){return new dk({check:`length_equals`,...KD(t),length:e})}function wj(e,t){return new pk({check:`string_format`,format:`regex`,...KD(t),pattern:e})}function Tj(e){return new mk({check:`string_format`,format:`lowercase`,...KD(e)})}function Ej(e){return new hk({check:`string_format`,format:`uppercase`,...KD(e)})}function Dj(e,t){return new gk({check:`string_format`,format:`includes`,...KD(t),includes:e})}function Oj(e,t){return new _k({check:`string_format`,format:`starts_with`,...KD(t),prefix:e})}function kj(e,t){return new vk({check:`string_format`,format:`ends_with`,...KD(t),suffix:e})}function Aj(e){return new yk({check:`overwrite`,tx:e})}function jj(e){return Aj(t=>t.normalize(e))}function Mj(){return Aj(e=>e.trim())}function Nj(){return Aj(e=>e.toLowerCase())}function Pj(){return Aj(e=>e.toUpperCase())}function Fj(){return Aj(e=>LD(e))}function Ij(e,t,n){return new e({type:`array`,element:t,...KD(n)})}function Lj(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...KD(n)})}function Rj(e){let t=zj(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(sO(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(sO(r))}},e(n.value,n)));return t}function zj(e,t){let n=new rk({check:`custom`,...KD(t)});return n._zod.check=e,n}function Bj(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??LA,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function Vj(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Vj(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&Wj(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Hj(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
112
112
|
|
|
113
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Uj(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Kj(t,`input`,e.processors),output:Kj(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Wj(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Wj(r.element,n);if(r.type===`set`)return Wj(r.valueType,n);if(r.type===`lazy`)return Wj(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Wj(r.innerType,n);if(r.type===`intersection`)return Wj(r.left,n)||Wj(r.right,n);if(r.type===`record`||r.type===`map`)return Wj(r.keyType,n)||Wj(r.valueType,n);if(r.type===`pipe`)return Wj(r.in,n)||Wj(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Wj(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Wj(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Wj(e,n))return!0;return!!(r.rest&&Wj(r.rest,n))}return!1}var Gj=(e,t={})=>n=>{let r=Bj({...n,processors:t});return Vj(e,r),Hj(r,e),Uj(r,e)},Kj=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Bj({...i??{},target:a,io:t,processors:n});return Vj(e,o),Hj(o,e),Uj(o,e)},qj={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Jj=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=qj[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Yj=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},Xj=(e,t,n,r)=>{n.type=`boolean`},Zj=(e,t,n,r)=>{n.not={}},Qj=(e,t,n,r)=>{let i=e._zod.def,a=ED(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},$j=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},eM=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},tM=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},nM=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Vj(a.element,t,{...r,path:[...r.path,`items`]})},rM=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=Vj(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Vj(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},iM=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Vj(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},aM=(e,t,n,r)=>{let i=e._zod.def,a=Vj(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Vj(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},oM=(e,t,n,r)=>{let i=e._zod.def,a=Vj(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},sM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},cM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},lM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},uM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},dM=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;Vj(a,t,r);let o=t.seen.get(e);o.ref=a},fM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},pM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},mM=$(`ZodISODateTime`,(e,t)=>{Ik.init(e,t),BM.init(e,t)});function hM(e){return sj(mM,e)}var gM=$(`ZodISODate`,(e,t)=>{Lk.init(e,t),BM.init(e,t)});function _M(e){return cj(gM,e)}var vM=$(`ZodISOTime`,(e,t)=>{Rk.init(e,t),BM.init(e,t)});function yM(e){return lj(vM,e)}var bM=$(`ZodISODuration`,(e,t)=>{zk.init(e,t),BM.init(e,t)});function xM(e){return uj(bM,e)}var SM=(e,t)=>{lO.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>fO(e,t)},flatten:{value:t=>dO(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,DD,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,DD,2)}},isEmpty:{get(){return e.issues.length===0}}})};$(`ZodError`,SM);var CM=$(`ZodError`,SM,{Parent:Error}),wM=pO(CM),TM=mO(CM),EM=hO(CM),DM=_O(CM),OM=yO(CM),kM=bO(CM),AM=xO(CM),jM=SO(CM),MM=CO(CM),NM=wO(CM),PM=TO(CM),FM=EO(CM),IM=$(`ZodType`,(e,t)=>(Sk.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Kj(e,`input`),output:Kj(e,`output`)}}),e.toJSONSchema=Gj(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(FD(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>GD(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>wM(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>EM(e,t,n),e.parseAsync=async(t,n)=>TM(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>DM(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>OM(e,t,n),e.decode=(t,n)=>kM(e,t,n),e.encodeAsync=async(t,n)=>AM(e,t,n),e.decodeAsync=async(t,n)=>jM(e,t,n),e.safeEncode=(t,n)=>MM(e,t,n),e.safeDecode=(t,n)=>NM(e,t,n),e.safeEncodeAsync=async(t,n)=>PM(e,t,n),e.safeDecodeAsync=async(t,n)=>FM(e,t,n),e.refine=(t,n)=>e.check(ZN(t,n)),e.superRefine=t=>e.check(QN(t)),e.overwrite=t=>e.check(Aj(t)),e.optional=()=>NN(e),e.exactOptional=()=>FN(e),e.nullable=()=>LN(e),e.nullish=()=>NN(LN(e)),e.nonoptional=t=>UN(e,t),e.array=()=>_N(e),e.or=t=>xN([e,t]),e.and=t=>TN(e,t),e.transform=t=>qN(e,jN(t)),e.default=t=>zN(e,t),e.prefault=t=>VN(e,t),e.catch=t=>GN(e,t),e.pipe=t=>qN(e,t),e.readonly=()=>YN(e),e.describe=t=>{let n=e.clone();return LA.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return LA.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return LA.get(e);let n=e.clone();return LA.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),LM=$(`_ZodString`,(e,t)=>{Ck.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jj(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(wj(...t)),e.includes=(...t)=>e.check(Dj(...t)),e.startsWith=(...t)=>e.check(Oj(...t)),e.endsWith=(...t)=>e.check(kj(...t)),e.min=(...t)=>e.check(Sj(...t)),e.max=(...t)=>e.check(xj(...t)),e.length=(...t)=>e.check(Cj(...t)),e.nonempty=(...t)=>e.check(Sj(1,...t)),e.lowercase=t=>e.check(Tj(t)),e.uppercase=t=>e.check(Ej(t)),e.trim=()=>e.check(Mj()),e.normalize=(...t)=>e.check(jj(...t)),e.toLowerCase=()=>e.check(Nj()),e.toUpperCase=()=>e.check(Pj()),e.slugify=()=>e.check(Fj())}),RM=$(`ZodString`,(e,t)=>{Ck.init(e,t),LM.init(e,t),e.email=t=>e.check(zA(VM,t)),e.url=t=>e.check(GA(WM,t)),e.jwt=t=>e.check(oj(aN,t)),e.emoji=t=>e.check(KA(GM,t)),e.guid=t=>e.check(BA(HM,t)),e.uuid=t=>e.check(VA(UM,t)),e.uuidv4=t=>e.check(HA(UM,t)),e.uuidv6=t=>e.check(UA(UM,t)),e.uuidv7=t=>e.check(WA(UM,t)),e.nanoid=t=>e.check(qA(KM,t)),e.guid=t=>e.check(BA(HM,t)),e.cuid=t=>e.check(JA(qM,t)),e.cuid2=t=>e.check(YA(JM,t)),e.ulid=t=>e.check(XA(YM,t)),e.base64=t=>e.check(rj(nN,t)),e.base64url=t=>e.check(ij(rN,t)),e.xid=t=>e.check(ZA(XM,t)),e.ksuid=t=>e.check(QA(ZM,t)),e.ipv4=t=>e.check($A(QM,t)),e.ipv6=t=>e.check(ej($M,t)),e.cidrv4=t=>e.check(tj(eN,t)),e.cidrv6=t=>e.check(nj(tN,t)),e.e164=t=>e.check(aj(iN,t)),e.datetime=t=>e.check(hM(t)),e.date=t=>e.check(_M(t)),e.time=t=>e.check(yM(t)),e.duration=t=>e.check(xM(t))});function zM(e){return RA(RM,e)}var BM=$(`ZodStringFormat`,(e,t)=>{wk.init(e,t),LM.init(e,t)}),VM=$(`ZodEmail`,(e,t)=>{Dk.init(e,t),BM.init(e,t)}),HM=$(`ZodGUID`,(e,t)=>{Tk.init(e,t),BM.init(e,t)}),UM=$(`ZodUUID`,(e,t)=>{Ek.init(e,t),BM.init(e,t)}),WM=$(`ZodURL`,(e,t)=>{Ok.init(e,t),BM.init(e,t)}),GM=$(`ZodEmoji`,(e,t)=>{kk.init(e,t),BM.init(e,t)}),KM=$(`ZodNanoID`,(e,t)=>{Ak.init(e,t),BM.init(e,t)}),qM=$(`ZodCUID`,(e,t)=>{jk.init(e,t),BM.init(e,t)}),JM=$(`ZodCUID2`,(e,t)=>{Mk.init(e,t),BM.init(e,t)}),YM=$(`ZodULID`,(e,t)=>{Nk.init(e,t),BM.init(e,t)}),XM=$(`ZodXID`,(e,t)=>{Pk.init(e,t),BM.init(e,t)}),ZM=$(`ZodKSUID`,(e,t)=>{Fk.init(e,t),BM.init(e,t)}),QM=$(`ZodIPv4`,(e,t)=>{Bk.init(e,t),BM.init(e,t)}),$M=$(`ZodIPv6`,(e,t)=>{Vk.init(e,t),BM.init(e,t)}),eN=$(`ZodCIDRv4`,(e,t)=>{Hk.init(e,t),BM.init(e,t)}),tN=$(`ZodCIDRv6`,(e,t)=>{Uk.init(e,t),BM.init(e,t)}),nN=$(`ZodBase64`,(e,t)=>{Gk.init(e,t),BM.init(e,t)}),rN=$(`ZodBase64URL`,(e,t)=>{qk.init(e,t),BM.init(e,t)}),iN=$(`ZodE164`,(e,t)=>{Jk.init(e,t),BM.init(e,t)}),aN=$(`ZodJWT`,(e,t)=>{Xk.init(e,t),BM.init(e,t)}),oN=$(`ZodNumber`,(e,t)=>{Zk.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yj(e,t,n,r),e.gt=(t,n)=>e.check(vj(t,n)),e.gte=(t,n)=>e.check(yj(t,n)),e.min=(t,n)=>e.check(yj(t,n)),e.lt=(t,n)=>e.check(gj(t,n)),e.lte=(t,n)=>e.check(_j(t,n)),e.max=(t,n)=>e.check(_j(t,n)),e.int=t=>e.check(lN(t)),e.safe=t=>e.check(lN(t)),e.positive=t=>e.check(vj(0,t)),e.nonnegative=t=>e.check(yj(0,t)),e.negative=t=>e.check(gj(0,t)),e.nonpositive=t=>e.check(_j(0,t)),e.multipleOf=(t,n)=>e.check(bj(t,n)),e.step=(t,n)=>e.check(bj(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function sN(e){return dj(oN,e)}var cN=$(`ZodNumberFormat`,(e,t)=>{Qk.init(e,t),oN.init(e,t)});function lN(e){return fj(cN,e)}var uN=$(`ZodBoolean`,(e,t)=>{$k.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xj(e,t,n,r)});function dN(e){return pj(uN,e)}var fN=$(`ZodUnknown`,(e,t)=>{eA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function pN(){return mj(fN)}var mN=$(`ZodNever`,(e,t)=>{tA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zj(e,t,n,r)});function hN(e){return hj(mN,e)}var gN=$(`ZodArray`,(e,t)=>{rA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nM(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Sj(t,n)),e.nonempty=t=>e.check(Sj(1,t)),e.max=(t,n)=>e.check(xj(t,n)),e.length=(t,n)=>e.check(Cj(t,n)),e.unwrap=()=>e.element});function _N(e,t){return Ij(gN,e,t)}var vN=$(`ZodObject`,(e,t)=>{cA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rM(e,t,n,r),ND(e,`shape`,()=>t.shape),e.keyof=()=>DN(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:pN()}),e.loose=()=>e.clone({...e._zod.def,catchall:pN()}),e.strict=()=>e.clone({...e._zod.def,catchall:hN()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>ZD(e,t),e.safeExtend=t=>QD(e,t),e.merge=t=>$D(e,t),e.pick=t=>YD(e,t),e.omit=t=>XD(e,t),e.partial=(...t)=>eO(MN,e,t[0]),e.required=(...t)=>tO(HN,e,t[0])});function yN(e,t){return new vN({type:`object`,shape:e??{},...KD(t)})}var bN=$(`ZodUnion`,(e,t)=>{uA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iM(e,t,n,r),e.options=t.options});function xN(e,t){return new bN({type:`union`,options:e,...KD(t)})}var SN=$(`ZodDiscriminatedUnion`,(e,t)=>{bN.init(e,t),dA.init(e,t)});function CN(e,t,n){return new SN({type:`union`,options:t,discriminator:e,...KD(n)})}var wN=$(`ZodIntersection`,(e,t)=>{fA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aM(e,t,n,r)});function TN(e,t){return new wN({type:`intersection`,left:e,right:t})}var EN=$(`ZodEnum`,(e,t)=>{hA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qj(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new EN({...t,checks:[],...KD(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new EN({...t,checks:[],...KD(r),entries:i})}});function DN(e,t){return new EN({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...KD(t)})}var ON=$(`ZodLiteral`,(e,t)=>{gA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$j(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function kN(e,t){return new ON({type:`literal`,values:Array.isArray(e)?e:[e],...KD(t)})}var AN=$(`ZodTransform`,(e,t)=>{_A.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tM(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new CD(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(sO(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(sO(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function jN(e){return new AN({type:`transform`,transform:e})}var MN=$(`ZodOptional`,(e,t)=>{yA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function NN(e){return new MN({type:`optional`,innerType:e})}var PN=$(`ZodExactOptional`,(e,t)=>{bA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function FN(e){return new PN({type:`optional`,innerType:e})}var IN=$(`ZodNullable`,(e,t)=>{xA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function LN(e){return new IN({type:`nullable`,innerType:e})}var RN=$(`ZodDefault`,(e,t)=>{SA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zN(e,t){return new RN({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():HD(t)}})}var BN=$(`ZodPrefault`,(e,t)=>{wA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function VN(e,t){return new BN({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():HD(t)}})}var HN=$(`ZodNonOptional`,(e,t)=>{TA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function UN(e,t){return new HN({type:`nonoptional`,innerType:e,...KD(t)})}var WN=$(`ZodCatch`,(e,t)=>{DA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function GN(e,t){return new WN({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var KN=$(`ZodPipe`,(e,t)=>{OA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dM(e,t,n,r),e.in=t.in,e.out=t.out});function qN(e,t){return new KN({type:`pipe`,in:e,out:t})}var JN=$(`ZodReadonly`,(e,t)=>{AA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function YN(e){return new JN({type:`readonly`,innerType:e})}var XN=$(`ZodCustom`,(e,t)=>{MA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eM(e,t,n,r)});function ZN(e,t={}){return Lj(XN,e,t)}function QN(e){return Rj(e)}yN({ok:dN(),sessions:sN().int().nonnegative()}).strict(),CN(`type`,[yN({type:kN(`input`),data:zM().max(gD)}).strict(),yN({type:kN(`resize`),cols:sN().int().positive().max(bD),rows:sN().int().positive().max(xD),pixelWidth:sN().int().nonnegative().optional(),pixelHeight:sN().int().nonnegative().optional()}).strict()]);var $N=CN(`type`,[yN({type:kN(`output`),data:zM().max(_D)}).strict(),yN({type:kN(`exit`),code:sN().int().nullable()}).strict(),yN({type:kN(`title`),title:zM().max(vD)}).strict(),yN({type:kN(`session`),shell:zM().min(1),shellName:zM().min(1),pid:sN().int().nonnegative(),cwd:zM().min(1),title:zM().max(vD)}).strict(),yN({type:kN(`cwd`),cwd:zM().min(1)}).strict(),yN({type:kN(`foreground`),process:zM().max(256).nullable()}).strict(),yN({type:kN(`notification`),body:zM().min(1).max(yD)}).strict()]),eP=2.4,tP=.04045,nP=12.92,rP=.055,iP=1.055,aP=.0031308,oP=24389/27,sP=216/24389,cP=.95047,lP=1,uP=1.08883,dP=.008856,fP=7.787,pP=e=>{let t=e/255;return t<=tP?t/nP:((t+rP)/iP)**+eP},mP=e=>e<=0?0:e>=1?255:Math.round(e<=aP?nP*e*255:(iP*e**(1/eP)-rP)*255),hP=e=>e>dP?Math.cbrt(e):fP*e+16/116,gP=e=>{let t=pP(e.r),n=pP(e.g),r=pP(e.b);return{x:.4124564*t+.3575761*n+.1804375*r,y:.2126729*t+.7151522*n+.072175*r,z:.0193339*t+.119192*n+.9503041*r}},_P=e=>{let t=3.2404542*e.x-1.5371385*e.y-.4985314*e.z,n=-.969266*e.x+1.8760108*e.y+.041556*e.z,r=.0556434*e.x-.2040259*e.y+1.0572252*e.z;return{r:mP(t),g:mP(n),b:mP(r)}},vP=e=>{let t=e.x/cP,n=e.y/lP,r=e.z/uP,i=hP(t),a=hP(n),o=hP(r);return{l:116*a-16,a:500*(i-a),b:200*(a-o)}},yP=(e,t)=>{let n=e*e*e;return n>sP?t*n:t*((116*e-16)/oP)},bP=e=>{let t=(e.l+16)/116,n=e.a/500+t,r=t-e.b/200;return{x:yP(n,cP),y:yP(t,lP),z:yP(r,uP)}},xP=e=>vP(gP(e)),SP=e=>_P(bP(e)),CP=e=>{let t=e.replace(/^#/,``);return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}},wP=e=>{let t=Math.max(0,Math.min(255,Math.round(e.r))),n=Math.max(0,Math.min(255,Math.round(e.g))),r=Math.max(0,Math.min(255,Math.round(e.b)));return`#${t.toString(16).padStart(2,`0`)}${n.toString(16).padStart(2,`0`)}${r.toString(16).padStart(2,`0`)}`},TP=e=>xP(CP(e)),EP=e=>wP(SP(e)),DP=6,OP=5,kP=24,AP=25,jP=(e,t,n)=>({l:t.l+e*(n.l-t.l),a:t.a+e*(n.a-t.a),b:t.b+e*(n.b-t.b)}),MP=(e,t=!1)=>{let n=e.background??`#000000`,r=e.foreground??`#ffffff`,i=[TP(n),TP(e.red??`#ff0000`),TP(e.green??`#00ff00`),TP(e.yellow??`#ffff00`),TP(e.blue??`#0000ff`),TP(e.magenta??`#ff00ff`),TP(e.cyan??`#00ffff`),TP(r)];if(i[7].l<i[0].l&&!t){let e=i[0];i[0]=i[7],i[7]=e}let a=[];for(let e=0;e<DP;e++){let t=jP(e/OP,i[0],i[1]),n=jP(e/OP,i[2],i[3]),r=jP(e/OP,i[4],i[5]),o=jP(e/OP,i[6],i[7]);for(let e=0;e<DP;e++){let i=jP(e/OP,t,n),s=jP(e/OP,r,o);for(let e=0;e<DP;e++){let t=jP(e/OP,i,s);a.push(EP(t))}}}for(let e=0;e<kP;e++){let t=(e+1)/AP;a.push(EP(jP(t,i[0],i[7])))}return a},NP=`Symbols Nerd Font`,PP=``,FP=async e=>{if(!(typeof document>`u`)&&e.name)try{await document.fonts.ready;let t=[document.fonts.load(`16px "${e.name}"`),document.fonts.load(`bold 16px "${e.name}"`),document.fonts.load(`16px "${NP}"`,PP),document.fonts.load(`bold 16px "${NP}"`,PP)];await Promise.all(t)}catch{}},IP=(e,t)=>`\x1b[${e};${t+1}u`,LP=e=>{let t=e.buffer.active,n=Math.max(0,t.baseY-t.viewportY);return{distanceFromBottom:n,wasAtBottom:n===0}},RP=e=>!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0),zP=(e,t)=>{let n=e.buffer.active,r=Math.max(0,n.baseY-n.viewportY),i=r===0;try{t.fit()}catch{return!1}try{if(i)return e.scrollToBottom(),!0;let t=e.buffer.active;if(r>t.baseY)return e.scrollToBottom(),!0;let n=t.baseY-r-t.viewportY;n!==0&&e.scrollLines(n)}catch{}return!0},BP=(e,t)=>`\r\n\r\n\x1b[2;31m[connection lost · code ${e}${t?` · ${t}`:``}]\x1b[0m\r\n`,VP={block:{blink:`\x1B[1 q`,steady:`\x1B[2 q`},underline:{blink:`\x1B[3 q`,steady:`\x1B[4 q`},bar:{blink:`\x1B[5 q`,steady:`\x1B[6 q`}},HP=(e,t)=>{let n=t?`blink`:`steady`;return`\x1b[?25h${VP[e][n]}`},UP=(e,t)=>`${HP(e,t)}\r\n\x1b[2;32m[reconnected]\x1b[0m\r\n\r\n`,WP=e=>`\r\n\x1b[2;31m[${e===null?`shell exited`:`shell exited with code ${e}`}]\x1b[0m\r\n`,GP=55296,KP=56319,qP=(e,t)=>{if(e.length<=t)return[e];let n=[],r=0;for(;r<e.length;){let i=Math.min(r+t,e.length);if(i<e.length){let t=e.charCodeAt(i-1);t>=GP&&t<=KP&&--i}i===r&&(i=r+t),n.push(e.slice(r,i)),r=i}return n},JP=(e,t)=>{if(t.wasAtBottom){e.scrollToBottom();return}let n=e.buffer.active;if(t.distanceFromBottom>n.baseY){e.scrollToBottom();return}let r=n.baseY-t.distanceFromBottom-n.viewportY;r!==0&&e.scrollLines(r)},YP=new class{terminal=null;chunks=[];scheduled=!1;afterFlush=null;attach(e){this.terminal=e}setAfterFlush(e){this.afterFlush=e}detach(){this.flush(),this.terminal=null,this.afterFlush=null}push(e){this.chunks.push(e),this.scheduled||(this.scheduled=!0,queueMicrotask(()=>this.flush()))}flush(){this.scheduled=!1;let e=this.chunks,t=this.terminal;this.chunks=[],!(!t||e.length===0)&&(e.length===1?t.write(e[0]):t.write(e.join(``)),this.afterFlush?.())}},XP=e=>e[0]===3,ZP=e=>{if(!Number.isFinite(e))return 13;let t=Math.round(e);return t<9?9:t>24?24:t},QP=1/kS,$P=e=>Math.round(e*QP)/QP,eF=e=>{if(!Number.isFinite(e))return OS;let t=$P(e);return t<1?1:t>2?2:t},tF=1/1,nF=e=>Math.round(e*tF)/tF,rF=e=>{if(!Number.isFinite(e))return 0;let t=nF(e);return t<0?0:t>48?48:t},iF=e=>{if(!Number.isFinite(e))return 0;let t=nF(e);return t<0?0:t>48?48:t},aF=()=>{if(typeof navigator>`u`)return!1;let e=navigator.platform||navigator.userAgent||``;return/Mac|iPhone|iPad|iPod/i.test(e)},oF=(e,t,n)=>e.key!==t&&e.key!==t.toUpperCase()?!1:n?e.metaKey&&!e.ctrlKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.altKey,sF=(e,t)=>oF(e,`k`,t),cF=(e,t)=>oF(e,`f`,t),lF=(e,t)=>e.code===`Backslash`?e.altKey&&!e.metaKey&&!e.ctrlKey?!0:t?e.metaKey&&!e.ctrlKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.altKey:!1,uF=e=>{if(typeof window>`u`)return null;try{let t=window.localStorage.getItem(e);return t===null||t.trim()===``?null:t}catch{return null}},dF=(e,t)=>{if(!(typeof window>`u`))try{window.localStorage.setItem(e,t)}catch{}},fF=(e,t,n)=>({load:()=>{let r=uF(e);if(r===null)return t;let i=Number(r);return Number.isFinite(i)?n(i):t},store:t=>dF(e,String(t))}),pF=(e,t)=>({load:()=>{let n=uF(e);return n===`true`?!0:n===`false`?!1:t},store:t=>dF(e,String(t))}),mF=(e,t,n)=>({load:()=>{let r=uF(e);return r!==null&&n(r)?r:t},store:t=>dF(e,t)}),hF=(e,t,n)=>({load:()=>t(uF(e)),store:t=>dF(e,n(t))}),gF=pF(WS,!0),_F=gF.load,vF=gF.store,yF=mF(US,jE,NE),bF=yF.load,xF=yF.store,SF=hF(BS,e=>XE(e).id,e=>e),CF=SF.load,wF=SF.store,TF=fF(VS,13,ZP),EF=TF.load,DF=TF.store,OF=fF(HS,OS,eF),kF=OF.load,AF=OF.store,jF=fF(GS,eD,e=>nD(e)?e:eD),MF=jF.load,NF=jF.store,PF=pF(KS,!0),FF=PF.load,IF=PF.store,LF=hF(zS,e=>aD(e).id,e=>e),RF=LF.load,zF=LF.store,BF=fF(qS,0,rF),VF=BF.load,HF=BF.store,UF=fF(JS,0,iF),WF=UF.load,GF=UF.store,KF=pF(XS,!1),qF=KF.load,JF=KF.store,YF=`<path d='m6 8 4 4-4 4M12 16h6'/>`,XF=[`<circle cx='7' cy='12' r='1.5' fill='currentColor' stroke='none'/>`,`<circle cx='12' cy='12' r='1.5' fill='currentColor' stroke='none'/>`,`<circle cx='17' cy='12' r='1.5' fill='currentColor' stroke='none'/>`].join(``),ZF={ready:`hsl(220 8% 46%)`,running:`hsl(142 72% 45%)`,"alive-quiet":`hsl(210 65% 50%)`,dead:`hsl(0 72% 50%)`},QF={ready:`hsl(220 10% 16%)`,running:`hsl(142 85% 12%)`,"alive-quiet":`hsl(210 70% 14%)`,dead:`hsl(0 80% 12%)`},$F={ready:YF,running:XF,"alive-quiet":YF,dead:YF},eI=`<circle cx='19' cy='7' r='3.5' fill='hsl(0 72% 50%)' stroke='white' stroke-width='1.5'/>`,tI=(e,t=!1)=>{let n=ZF[e],r=QF[e],i=$F[e],a=t?eI:``;return[`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' color='${r}' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='${e===`dead`?FS:1}'>`,`<rect x='2' y='4' width='20' height='16' rx='2' fill='${n}'/>`,i,a,`</svg>`].join(``)},nI=`ready`,rI=null,iI=!1,aI=(e,t)=>rI===null||e!==nI||t!==iI,oI=(e,t)=>{nI=e,rI=e,iI=t},sI=()=>{nI=`ready`,rI=null,iI=!1},cI=(e,t=!1)=>{if(typeof document>`u`||!aI(e,t))return;oI(e,t);let n=`data:image/svg+xml,${encodeURIComponent(tI(e,t))}`,r=document.querySelector(`link[rel="icon"]`);r||(r=document.createElement(`link`),r.rel=`icon`,document.head.appendChild(r)),r.type=`image/svg+xml`,r.href=n},lI=`/api/health`,uI=async()=>{try{return(await fetch(lI)).ok}catch{return!1}},dI=(e,t)=>t.buffer.active.type!==`alternate`||t.modes.mouseTrackingMode!==`none`?!1:e.deltaMode===WheelEvent.DOM_DELTA_PIXEL,fI=e=>e||`localterm`,pI=e=>`${jS}${e||`localterm`}`,mI={matchBackground:IS,activeMatchBackground:LS,activeMatchBorder:RS,matchOverviewRuler:LS,activeMatchColorOverviewRuler:RS},hI=`cwd`,gI=e=>{let t=new URL(`/ws`,window.location.href);t.protocol=t.protocol===`https:`?`wss:`:`ws:`;let n=e??new URLSearchParams(window.location.search).get(hI);return n&&t.searchParams.set(hI,n),t.toString()},_I=e=>{let t=new URL(window.location.origin);return e&&t.searchParams.set(hI,e),t.toString()},vI=({onModalOpenChange:e,onForegroundProcessChange:t}={})=>{let n=(0,b.useRef)(null),r=(0,b.useRef)(null),i=(0,b.useRef)(!1),a=(0,b.useRef)(null),o=(0,b.useRef)(null),s=(0,b.useRef)(null),c=(0,b.useRef)(null),l=(0,b.useRef)(null),u=(0,b.useRef)(null),d=(0,b.useRef)(null),f=(0,b.useRef)(RF()),p=(0,b.useRef)(CF()),m=(0,b.useRef)(EF()),h=(0,b.useRef)(kF()),g=(0,b.useRef)(bF()),_=(0,b.useRef)(_F()),v=(0,b.useRef)(MF()),x=(0,b.useRef)(FF()),C=(0,b.useRef)(VF()),w=(0,b.useRef)(WF()),T=(0,b.useRef)(qF()),E=(0,b.useRef)(null),O=(0,b.useRef)(null),k=(0,b.useRef)(null),A=(0,b.useRef)(null),[j,M]=(0,b.useState)(null),[N,P]=(0,b.useState)(0),[F,I]=(0,b.useState)(!1),[L,ee]=(0,b.useState)(!1),[R,te]=(0,b.useState)(!1),[z,B]=(0,b.useState)(!1),V=(0,b.useRef)(null),[H,ne]=(0,b.useState)(0),[U,re]=(0,b.useState)(!1),[ie,ae]=(0,b.useState)(!1),oe=(0,b.useRef)(null),se=(0,b.useRef)(!1),ce=U||ie;se.current=ie;let[le,ue]=(0,b.useState)(``),[de,fe]=(0,b.useState)({resultIndex:-1,resultCount:0}),[pe,me]=(0,b.useState)(f.current),[he,ge]=(0,b.useState)(null),_e=he??pe,ve=(0,b.useMemo)(()=>aD(_e),[_e]),ye=(0,b.useMemo)(()=>({...ve.colors,extendedAnsi:MP(ve.colors)}),[ve]),[be,xe]=(0,b.useState)(p.current),[Se,Ce]=(0,b.useState)(null),we=Se??be,[Te,Ee]=(0,b.useState)(T.current),De=(0,b.useMemo)(()=>XE(we),[we]),[Oe,ke]=(0,b.useState)(m.current),[Ae,je]=(0,b.useState)(h.current),[Me,Ne]=(0,b.useState)(g.current),[Pe,Fe]=(0,b.useState)(null),Ie=Pe??Me,[Le,Re]=(0,b.useState)(_.current),[ze,Be]=(0,b.useState)(v.current),[Ve,He]=(0,b.useState)(x.current),[Ue,We]=(0,b.useState)(C.current),[Ge,Ke]=(0,b.useState)(w.current),[Je,Xe]=(0,b.useState)(null),[Ze,Qe]=(0,b.useState)(`Notification`in window?Notification.permission:`unsupported`),[$e,et]=(0,b.useState)(null),tt=(0,b.useRef)(null),nt=(0,b.useRef)(!1),rt=(0,b.useMemo)(aF,[]);(0,b.useEffect)(()=>{let e=n.current;if(!e)return;let c=!1,l=!1,u=!1,y=``,b=null,C=null,w=null,j=null,N=null,F=0,I=`ready`,L=!1,ee=!1,R=[0],te=()=>R[R.length-1]??0,z=()=>{let e=performance.now()-F;if(e<750){N=window.setTimeout(z,750-e);return}N=null,j!==null&&(window.clearTimeout(j),j=null),I===`running`&&(document.hidden&&(L=!0),ee?(I=`alive-quiet`,cI(`alive-quiet`,L)):(I=`ready`,cI(`ready`,L)))},B=()=>{I!==`running`&&j===null&&(j=window.setTimeout(()=>{j=null,!(c||l)&&(I=`running`,L=!1,cI(`running`))},250)),F=performance.now(),N===null&&(N=window.setTimeout(z,750))},H=()=>{j!==null&&(window.clearTimeout(j),j=null),N!==null&&(window.clearTimeout(N),N=null),(I!==`ready`||L)&&(I=`ready`,L=!1,cI(`ready`))},ne=XE(p.current);FP(ne).then(()=>{if(c)return;let e=r.current;e&&e.clearTextureAtlas(),U._core._charSizeService.measure(),Ae()});let U=new $u({allowProposedApi:!0,cursorBlink:_.current,cursorStyle:g.current,fontFamily:ZE(ne,T.current),fontSize:m.current,lineHeight:h.current,scrollback:v.current,theme:{...aD(f.current).colors,extendedAnsi:MP(aD(f.current).colors)},macOptionIsMeta:!0,scrollOnUserInput:x.current,windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0},scrollbar:{showScrollbar:!1}});r.current=U,YP.attach(U);let re=new D;E.current=re,U.loadAddon(re),U.loadAddon(new Nn),U.loadAddon(new S),U.loadAddon(new qe),U.loadAddon(new Ye);let ie=new Dn;U.loadAddon(ie),U.unicode.activeVersion=`15`;let ae=new ut;U.loadAddon(ae),o.current=ae;let oe=ae.onDidChangeResults(fe);U.open(e),re.proposeDimensions&&=()=>{if(!U||!U.element||!U.element.parentElement)return;let e=U,t=e._core._renderService.dimensions.css.cell.width,n=e._core._renderService.dimensions.css.cell.height;if(t===0||n===0)return;let r=window.getComputedStyle(U.element.parentElement),i=window.getComputedStyle(U.element),a=Math.max(0,parseInt(r.getPropertyValue(`width`)))-(parseInt(i.getPropertyValue(`padding-right`))+parseInt(i.getPropertyValue(`padding-left`))),o=parseInt(r.getPropertyValue(`height`))-(parseInt(i.getPropertyValue(`padding-top`))+parseInt(i.getPropertyValue(`padding-bottom`)));return{cols:Math.max(2,Math.floor(a/t)),rows:Math.max(1,Math.floor(o/n))}};let se=()=>{let e=U.buffer.active,t=e.length,n=U.rows,r=e.viewportY+n>=t,i=t>n,a=k.current,o=A.current;if(!(!a||!o)&&(a.classList.toggle(`xterm-scrollbar-visible`,!r&&i),i)){let r=n/t,i=e.viewportY/t;o.style.height=`${r*100}%`,o.style.top=`${i*100}%`}};se();let ce=U.onScroll(se);YP.setAfterFlush(se);let le=!1,ue=0,de=0,pe=e=>{if(e.button===0){le=!0,ue=e.clientY,de=U.buffer.active.viewportY;try{e.target.setPointerCapture(e.pointerId)}catch{}e.preventDefault()}},me=e=>{if(!le)return;let t=k.current;if(!t)return;let n=t.clientHeight,r=U.buffer.active.length-U.rows;if(r<=0||n<=0)return;let i=n/r,a=e.clientY-ue,o=Math.max(0,Math.min(r,de+Math.round(a/i)));o!==U.buffer.active.viewportY&&U.scrollLines(o-U.buffer.active.viewportY)},he=()=>{le=!1},ge=e=>{if(e.button!==0||e.target===A.current)return;let t=k.current;if(!t)return;let n=t.getBoundingClientRect(),r=(e.clientY-n.top)/n.height,i=U.buffer.active,a=i.length,o=Math.max(0,Math.min(a-U.rows,Math.round(r*a)-Math.floor(U.rows/2)));U.scrollLines(o-i.viewportY)},_e=A.current,ve=k.current;_e&&(_e.addEventListener(`pointerdown`,pe),_e.addEventListener(`pointermove`,me),_e.addEventListener(`pointerup`,he),_e.addEventListener(`pointercancel`,he)),ve&&ve.addEventListener(`pointerdown`,ge);try{let e=new ia;e.onContextLoss(()=>e.dispose()),U.loadAddon(e)}catch{}let ye=U.parser.registerCsiHandler({prefix:`>`,final:`u`},e=>{let t=e[0],n=typeof t==`number`?t:1;return R.push(n),!0}),be=U.parser.registerCsiHandler({prefix:`<`,final:`u`},e=>{let t=e[0],n=typeof t==`number`&&t>0?t:1;for(let e=0;e<n&&R.length>1;e+=1)R.pop();return!0}),xe=U.parser.registerCsiHandler({prefix:`=`,final:`u`},e=>{let t=e[0],n=e[1];if(typeof t!=`number`)return!0;let r=t,i=typeof n==`number`&&n>0?n:1,a=R.length-1,o=R[a]??0;return i===1?R[a]=r:i===2?R[a]=o|r:i===3&&(R[a]=o&~r),!0}),Se=U.parser.registerCsiHandler({final:`J`},XP),Ce=U.parser.registerCsiHandler({prefix:`?`,final:`J`},XP),we=e=>{b?.readyState===WebSocket.OPEN&&b.send(JSON.stringify(e))},Te=()=>{let e=d.current;e&&cancelAnimationFrame(e.frameId),d.current=null},Ee=()=>{let e=d.current;e&&JP(U,e.anchor)},De=e=>{Te(),d.current={anchor:e,frameId:requestAnimationFrame(()=>{Ee(),d.current=null})}};U.attachCustomWheelEventHandler(e=>dI(e,U)?(e.preventDefault(),!1):!0),U.attachCustomKeyEventHandler(e=>{if(e.key===`Tab`&&(e.metaKey||e.ctrlKey))return!1;if(lF(e,rt)){if(e.type===`keydown`){e.preventDefault();let t=document.getElementById(`new-shell-link`);t instanceof HTMLAnchorElement&&t.click()}return!1}if(sF(e,rt))return e.type===`keydown`&&(e.preventDefault(),V.current?.()),!1;if(cF(e,rt))return e.type===`keydown`&&(e.preventDefault(),O.current?.()),!1;if(e.type===`keydown`&&e.key===`Enter`){let t=RP(e),n=(te()&1)!=0;if(t!==0&&n)return e.preventDefault(),we({type:`input`,data:IP(13,t)}),!1;if(t===1)return e.preventDefault(),we({type:`input`,data:`
|
|
114
|
-
`}),!1}return!0});let Oe=e=>{if(l)return;let t=e.trim();t&&(y=t,document.title=fI(t))};s.current=()=>U.focus();let ke=(e,t)=>{let n=U,r=n._core._renderService?.dimensions?.css?.canvas?.width,i=n._core._renderService?.dimensions?.css?.canvas?.height;we({type:`resize`,cols:e,rows:t,...r!=null&&i!=null?{pixelWidth:Math.round(r),pixelHeight:Math.round(i)}:{}})},Ae=()=>{let e=LP(U);zP(U,re)&&(De(e),ke(U.cols,U.rows))},je=()=>{w!==null&&window.clearTimeout(w),w=window.setTimeout(()=>{w=null,Ae()},80)};U.onData(e=>{for(let t of qP(e,gD))we({type:`input`,data:t})}),U.onResize(({cols:e,rows:t})=>{ke(e,t),se()});let Me=new ResizeObserver(je),Ne=()=>{!document.hidden&&L&&(L=!1,cI(I))};document.addEventListener(`visibilitychange`,Ne),Me.observe(e),Ae(),requestAnimationFrame(()=>U.focus());let Pe=e=>{if(!l){if(l=!0,e===null||e===0){window.close(),setTimeout(()=>{c||(H(),cI(`dead`),U.write(WP(e)),document.title=pI(y),M({reason:`shell-exited`,exitCode:e}),Xe(null))},100);return}H(),cI(`dead`),U.write(WP(e)),document.title=pI(y),M({reason:`shell-exited`,exitCode:e}),Xe(null)}},Fe=(e,t,n)=>{l||(l=!0,H(),cI(`dead`),U.write(BP(e,t)),document.title=pI(y),M({reason:`connection-lost`,closeCode:e,closeReason:t,wasClean:n}),Xe(null))},Ie=()=>{if(c)return;let e=new WebSocket(gI(tt.current));b=e,e.addEventListener(`open`,()=>{c||b!==e||(u=!0,nt.current=!0,P(0),ke(U.cols,U.rows))}),e.addEventListener(`message`,n=>{if(c||b!==e)return;let r;try{r=JSON.parse(typeof n.data==`string`?n.data:String(n.data))}catch{return}if(typeof r==`object`&&r&&r.type===`output`&&typeof r.data==`string`){let e=r.data;YP.push(e),B();return}let i=$N.safeParse(r);if(!i.success)return;let a=i.data;if(a.type===`title`)Oe(a.title);else if(a.type===`session`)Xe({shell:a.shell,shellName:a.shellName,pid:a.pid,cwd:a.cwd,title:a.title}),et(a.cwd),Oe(a.title);else if(a.type===`cwd`)et(a.cwd);else if(a.type===`foreground`){let e=a.process!==null;t?.(e),!e&&I===`alive-quiet`&&(I=`ready`,cI(`ready`,L)),ee=e}else a.type===`notification`?`Notification`in window&&Notification.permission===`granted`&&new Notification(a.body):a.type===`exit`&&(H(),Pe(a.code))}),e.addEventListener(`close`,t=>{if(b===e&&(b=null,nt.current=!1,!c&&!l)){if(u){console.warn(`[localterm] websocket closed: code=${t.code} reason=${JSON.stringify(t.reason)} wasClean=${t.wasClean}`),Fe(t.code,t.reason,t.wasClean);return}P(e=>e+1),C=window.setTimeout(Ie,DS)}}),e.addEventListener(`error`,t=>{console.warn(`[localterm] websocket error`,t);try{e.close()}catch{}})};return a.current=()=>{if(!c){l=!1,u=!1,nt.current=!1,M(null),Xe(null),P(0),cI(`ready`),t?.(!1),C!==null&&(window.clearTimeout(C),C=null);try{b?.close()}catch{}b=null,Ie()}},Ie(),i.current=!0,()=>{c=!0,i.current=!1,_e&&(_e.removeEventListener(`pointerdown`,pe),_e.removeEventListener(`pointermove`,me),_e.removeEventListener(`pointerup`,he),_e.removeEventListener(`pointercancel`,he)),ve&&ve.removeEventListener(`pointerdown`,ge),oe.dispose(),ce.dispose(),ye.dispose(),be.dispose(),xe.dispose(),Se.dispose(),Ce.dispose(),C!==null&&window.clearTimeout(C),w!==null&&window.clearTimeout(w),Te(),H(),document.removeEventListener(`visibilitychange`,Ne),Me.disconnect();try{b?.close()}catch{}b=null,YP.detach(),U.dispose(),document.title=AS}},[]),(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;e&&(e.options.theme=ye)},[ye]),(0,b.useEffect)(()=>{if(!i.current||!r.current)return;let e=!1;return FP(De).then(()=>{if(e)return;let t=r.current;if(!t)return;t.options.fontFamily=ZE(De,Te),t.clearTextureAtlas();let n=E.current;n&&zP(t,n)}),()=>{e=!0}},[De,Te]);let it=(0,b.useCallback)(e=>{me(e),ge(null),zF(e)},[]),at=(0,b.useCallback)(e=>{xe(e),Ce(null),wF(e)},[]),ot=(0,b.useCallback)(e=>{Ee(e),JF(e)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;if(!e)return;e.options.fontSize=Oe;let t=E.current;t&&zP(e,t)},[Oe]);let st=(0,b.useCallback)(e=>{let t=ZP(e);ke(t),DF(t)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;if(!e)return;e.options.lineHeight=Ae;let t=E.current;t&&zP(e,t)},[Ae]);let ct=(0,b.useCallback)(e=>{let t=eF(e);je(t),AF(t)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;e&&(e.options.cursorStyle=Ie)},[Ie]);let lt=(0,b.useCallback)(e=>{Ne(e),Fe(null),xF(e)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;e&&(e.options.cursorBlink=Le)},[Le]);let dt=(0,b.useCallback)(e=>{Re(e),vF(e)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;e&&(e.options.scrollback=ze)},[ze]);let ft=(0,b.useCallback)(e=>{Be(e),NF(e)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;e&&(e.options.scrollOnUserInput=Ve)},[Ve]);let pt=(0,b.useCallback)(e=>{He(e),IF(e)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;if(!e)return;let t=E.current;t&&zP(e,t)},[Ue,Ge]);let mt=(0,b.useCallback)(e=>{let t=rF(e);We(t),HF(t)},[]),ht=(0,b.useCallback)(e=>{let t=iF(e);Ke(t),GF(t)},[]),gt=(0,b.useCallback)(()=>{`Notification`in window&&Notification.requestPermission().then(e=>{Qe(e)})},[]);(0,b.useEffect)(()=>{if(!R)return;let e=c.current;e&&(e.focus(),e.select())},[R,H]);let _t=(0,b.useCallback)(e=>{if(!e){o.current?.clearDecorations(),fe({resultIndex:-1,resultCount:0});return}o.current?.findNext(e,{decorations:mI})},[]),vt=(0,b.useCallback)(e=>{e&&o.current?.findPrevious(e,{decorations:mI})},[]),yt=(0,b.useCallback)(()=>{te(!1),ue(``),fe({resultIndex:-1,resultCount:0}),o.current?.clearDecorations(),s.current?.()},[]),bt=(0,b.useCallback)(()=>{oe.current!==null&&(window.clearTimeout(oe.current),oe.current=null),re(!0)},[]),xt=(0,b.useCallback)(()=>{oe.current=window.setTimeout(()=>{oe.current=null,se.current||re(!1)},200)},[]),St=(0,b.useCallback)(e=>{ae(e),e||(oe.current!==null&&window.clearTimeout(oe.current),oe.current=window.setTimeout(()=>{oe.current=null,re(!1)},200))},[]);V.current=(0,b.useCallback)(()=>{B(e=>!e)},[]);let Ct=(0,b.useCallback)(()=>{B(!1),s.current?.()},[]),wt=(0,b.useCallback)(()=>{te(!0),B(!1),ne(e=>e+1)},[]);O.current=wt;let Tt=(0,b.useCallback)(e=>{let t=e.target.value;ue(t),_t(t)},[_t]),Et=(0,b.useCallback)(e=>{if(cF(e.nativeEvent,rt)){e.preventDefault(),e.currentTarget.select();return}if(e.key===`Escape`){e.preventDefault(),yt();return}e.key===`Enter`&&(e.preventDefault(),e.shiftKey?vt(le):_t(le))},[yt,_t,vt,rt,le]),Dt=(0,b.useCallback)(()=>{ee(!0),a.current?.(),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{l.current=null,ee(!1)},800)},[]),Ot=(0,b.useCallback)(()=>{navigator.clipboard.writeText(MS).then(()=>{I(!0),u.current!==null&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>{u.current=null,I(!1)},NS)}).catch(()=>{})},[]);(0,b.useEffect)(()=>()=>{oe.current!==null&&(window.clearTimeout(oe.current),oe.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null)},[]),(0,b.useEffect)(()=>{if(tt.current=$e,!$e)return;let e=new URL(window.location.href);if(e.searchParams.get(hI)!==$e){e.searchParams.set(hI,$e);try{window.history.replaceState(null,``,e)}catch{}}},[$e]);let kt=_I($e),At=j!==null,jt=!At&&N>=2,Mt=At||jt,Nt=j!==null&&j.reason!==`shell-exited`||jt;(0,b.useEffect)(()=>{if(!Nt)return;let e=Date.now(),t=!1,n=null,i=i=>{if(t||nt.current)return;if(i){let e=r.current;e&&(e.write(UP(Ie,Le)),e.refresh(0,e.rows-1),e.focus()),a.current?.();return}let s=Date.now()-e<5e3?250:PS;n=window.setTimeout(o,s)},o=()=>{uI().then(i)};return o(),()=>{t=!0,n!==null&&window.clearTimeout(n)}},[Nt,Ie,Le]),(0,b.useEffect)(()=>{e?.(Mt),Mt&&B(!1)},[Mt,e]);let Pt=de.resultCount===0?`0/0`:`${de.resultIndex+1}/${de.resultCount}`,Ft=ve.colors.background??`#101010`,It=(0,b.useMemo)(()=>{let e=rt?`⌘`:`Ctrl+`,t=iD.map(e=>({id:`theme:${e.id}`,label:`Theme: ${e.name}`,category:`Theme`,action:()=>it(e.id)})),n=YE.map(e=>({id:`font:${e.id}`,label:`Font: ${e.name}`,category:`Font`,action:()=>at(e.id)}));return[...t,...n,{id:`find`,label:`Find in terminal`,category:`Search`,shortcut:`${e}F`,icon:(0,y.jsx)(vd,{className:`size-3.5`}),action:wt},{id:`new-shell`,label:`Open new shell`,category:`Tab`,shortcut:`Alt+T`,icon:(0,y.jsx)(_d,{className:`size-3.5`}),action:()=>{let e=document.getElementById(`new-shell-link`);e instanceof HTMLAnchorElement&&e.click()}},...AE.map(e=>({id:`cursor:${e.id}`,label:`Cursor: ${e.name}`,category:`Cursor`,action:()=>lt(e.id)})),{id:`cursor-blink`,label:`Cursor blink: ${Le?`On`:`Off`}`,category:`Cursor`,action:()=>dt(!Le)},{id:`font-size-up`,label:`Increase font size`,category:`Font`,shortcut:`${e}+`,icon:(0,y.jsx)(gd,{className:`size-3.5`}),action:()=>st(Oe+1)},{id:`font-size-down`,label:`Decrease font size`,category:`Font`,shortcut:`${e}-`,icon:(0,y.jsx)(gd,{className:`size-3.5`}),action:()=>st(Oe-1)},{id:`scroll-on-input`,label:`Pin to bottom on input: ${Ve?`On`:`Off`}`,category:`Scrollback`,action:()=>pt(!Ve)}]},[rt,it,at,wt,lt,Le,dt,Oe,st,Ve,pt]);return(0,y.jsxs)(`div`,{className:`h-dvh w-dvw`,style:{background:Ft},children:[(0,y.jsxs)(`div`,{className:`relative h-full w-full`,children:[(0,y.jsx)(`div`,{ref:n,"aria-label":`terminal session`,className:`absolute`,style:{top:Ge,right:Ue,bottom:Ge,left:Ue}}),(0,y.jsx)(`div`,{ref:k,className:`xterm-scrollbar-track`,style:{top:Ge,right:Ue,bottom:Ge},children:(0,y.jsx)(`div`,{ref:A,className:`xterm-scrollbar-thumb`})}),j===null?null:(0,y.jsx)(Qx,{variant:`destructive`,role:`status`,"aria-live":`polite`,className:`absolute top-2 left-3 z-10`,children:j.reason===`shell-exited`?j.exitCode===null?`exited`:`exited · code ${j.exitCode}`:`disconnected · code ${j.closeCode}`}),(0,y.jsxs)(`div`,{className:qf(`absolute right-0 top-0 z-10 flex flex-col items-end pr-3 pt-1`,ce?`pointer-events-auto`:`pointer-events-none`),onMouseEnter:bt,onMouseLeave:xt,children:[(0,y.jsx)(`div`,{"aria-hidden":`true`,className:qf(`pointer-events-auto mr-0.5 h-[2px] w-5 rounded-full bg-muted-foreground/25 transition-opacity duration-150`,ce||R?`opacity-0`:`opacity-100`)}),!R&&(0,y.jsxs)(`div`,{role:`toolbar`,"aria-label":`terminal actions`,className:qf(`mt-1 flex items-center gap-0.5 rounded-md border border-border/60 bg-background/70 p-0.5 text-muted-foreground shadow-xs backdrop-blur-md`,`transition-[opacity,transform] duration-200 ease-snappy`,ce?`translate-y-0 opacity-100`:`pointer-events-none -translate-y-1 opacity-0`),onMouseDown:e=>e.preventDefault(),onKeyDown:()=>s.current?.(),children:[(0,y.jsx)(hD,{themeId:pe,onThemeChange:it,onThemePreview:ge,fontId:be,onFontChange:at,onFontPreview:Ce,nerdFontEnabled:Te,onNerdFontEnabledChange:ot,fontSize:Oe,onFontSizeChange:st,lineHeight:Ae,onLineHeightChange:ct,cursorStyle:Me,onCursorStyleChange:lt,onCursorStylePreview:Fe,cursorBlink:Le,onCursorBlinkChange:dt,scrollback:ze,onScrollbackChange:ft,scrollOnUserInput:Ve,onScrollOnUserInputChange:pt,paddingX:Ue,onPaddingXChange:mt,paddingY:Ge,onPaddingYChange:ht,notificationsPermission:Ze,onNotificationsPermissionRequest:gt,sessionInfo:Je,onPopoverOpenChange:St,onClose:s.current??void 0}),(0,y.jsx)(Bx,{variant:`ghost`,size:`icon-sm`,onClick:wt,"aria-label":`find in terminal`,className:`hover:text-foreground`,children:(0,y.jsx)(vd,{})}),(0,y.jsx)(Bx,{variant:`ghost`,size:`icon-sm`,nativeButton:!1,"aria-label":`open a new shell in a new browser tab`,render:(0,y.jsx)(`a`,{id:`new-shell-link`,href:kt,target:`_blank`,rel:`noopener noreferrer`}),className:`hover:text-foreground`,children:(0,y.jsx)(_d,{})})]}),R&&(0,y.jsxs)(yS,{role:`search`,"aria-label":`find in terminal`,className:`mt-1 w-80 border-border/60 bg-background/70 text-muted-foreground shadow-xs backdrop-blur-md dark:bg-background/70`,children:[(0,y.jsx)(TS,{ref:c,type:`search`,value:le,onChange:Tt,onKeyDown:Et,placeholder:`Find`,"aria-label":`find query`,className:`text-xs`}),(0,y.jsxs)(xS,{align:`inline-end`,children:[(0,y.jsx)(wS,{role:`status`,"aria-label":`match count`,className:`text-xs tabular-nums`,children:Pt}),(0,y.jsx)(CS,{size:`icon-xs`,onClick:()=>vt(le),disabled:de.resultCount===0,"aria-label":`previous match`,children:(0,y.jsx)(fd,{})}),(0,y.jsx)(CS,{size:`icon-xs`,onClick:()=>_t(le),disabled:de.resultCount===0,"aria-label":`next match`,children:(0,y.jsx)(dd,{})})]})]})]})]}),(0,y.jsx)(tC,{open:z,onClose:Ct,commands:It}),(0,y.jsx)(Vx,{open:Mt,children:(0,y.jsx)(Wx,{children:j===null?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(Gx,{children:[(0,y.jsxs)(qx,{className:`flex items-center gap-2`,children:[(0,y.jsx)(ES,{"aria-hidden":`true`,role:`presentation`,"aria-label":void 0}),`Lost connection`]}),(0,y.jsx)(Jx,{children:`The localterm server isn't responding. Start it again from your terminal, then retry.`})]}),(0,y.jsxs)(yS,{children:[(0,y.jsx)(TS,{readOnly:!0,value:MS,"aria-label":`restart command`,className:`font-mono`}),(0,y.jsx)(xS,{align:`inline-end`,children:(0,y.jsx)(CS,{size:`icon-xs`,onClick:Ot,"aria-label":F?`Copied`:`Copy restart command`,children:F?(0,y.jsx)(ud,{}):(0,y.jsx)(pd,{})})})]}),(0,y.jsx)(Kx,{children:(0,y.jsxs)(Yx,{onClick:Dt,disabled:L,children:[L?(0,y.jsx)(ES,{"data-icon":`inline-start`}):null,`Retry`]})})]}):j.reason===`shell-exited`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(Gx,{children:[(0,y.jsx)(qx,{children:`Shell ended`}),(0,y.jsx)(Jx,{children:j.exitCode===null||j.exitCode===0?`Open a new shell to keep going, or close this tab.`:`Exit code ${j.exitCode}. Open a new shell to keep going.`})]}),(0,y.jsx)(Kx,{children:(0,y.jsx)(Yx,{onClick:()=>window.open(kt,`_blank`,`noopener,noreferrer`),children:`New shell`})})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(Gx,{children:[(0,y.jsxs)(qx,{className:`flex items-center gap-2`,children:[(0,y.jsx)(ES,{"aria-hidden":`true`,role:`presentation`,"aria-label":void 0}),`Connection lost`]}),(0,y.jsxs)(Jx,{children:[`The browser lost its connection to the localterm daemon (close code`,` `,j.closeCode,j.closeReason?` · ${j.closeReason}`:``,`). Reconnecting spawns a fresh shell. The previous one can't be reattached.`]})]}),(0,y.jsx)(Kx,{children:(0,y.jsxs)(Yx,{onClick:Dt,disabled:L,children:[L?(0,y.jsx)(ES,{"data-icon":`inline-start`}):null,`Reconnect`]})})]})})})]})},yI=()=>{let e=(0,b.useRef)(!1),t=(0,b.useRef)(!1);return(0,b.useEffect)(()=>{let n=n=>{e.current||t.current&&n.preventDefault()},r=()=>window.addEventListener(`beforeunload`,n);return window.addEventListener(`keydown`,r,{once:!0}),()=>{window.removeEventListener(`keydown`,r),window.removeEventListener(`beforeunload`,n)}},[]),(0,y.jsx)(vI,{onModalOpenChange:(0,b.useCallback)(t=>{e.current=t},[]),onForegroundProcessChange:(0,b.useCallback)(e=>{t.current=e},[])})};sI(),cI(`ready`),(()=>{if(typeof document>`u`||document.getElementById(`localterm-google-fonts`))return;let e=QE();if(!e)return;let t=document.createElement(`link`);t.id=YS,t.rel=`stylesheet`,t.href=e,document.head.appendChild(t)})();var bI=document.getElementById(`root`);if(!bI)throw Error(`Root element not found`);(0,x.createRoot)(bI).render((0,y.jsx)(b.StrictMode,{children:(0,y.jsx)(EE,{delay:300,children:(0,y.jsx)(yI,{})})}));
|
|
115
|
-
//# sourceMappingURL=index-
|
|
113
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function Uj(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(a[e.defId]=e.def)}e.external||Object.keys(a).length>0&&(e.target===`draft-2020-12`?i.$defs=a:i.definitions=a);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,`~standard`,{value:{...t[`~standard`],jsonSchema:{input:Kj(t,`input`,e.processors),output:Kj(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Wj(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Wj(r.element,n);if(r.type===`set`)return Wj(r.valueType,n);if(r.type===`lazy`)return Wj(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type===`default`||r.type===`prefault`)return Wj(r.innerType,n);if(r.type===`intersection`)return Wj(r.left,n)||Wj(r.right,n);if(r.type===`record`||r.type===`map`)return Wj(r.keyType,n)||Wj(r.valueType,n);if(r.type===`pipe`)return Wj(r.in,n)||Wj(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Wj(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Wj(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Wj(e,n))return!0;return!!(r.rest&&Wj(r.rest,n))}return!1}var Gj=(e,t={})=>n=>{let r=Bj({...n,processors:t});return Vj(e,r),Hj(r,e),Uj(r,e)},Kj=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Bj({...i??{},target:a,io:t,processors:n});return Vj(e,o),Hj(o,e),Uj(o,e)},qj={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Jj=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=qj[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Yj=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`,typeof u==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u),typeof a==`number`&&(i.minimum=a,typeof u==`number`&&t.target!==`draft-04`&&(u>=a?delete i.minimum:delete i.exclusiveMinimum)),typeof l==`number`&&(t.target===`draft-04`||t.target===`openapi-3.0`?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l),typeof o==`number`&&(i.maximum=o,typeof l==`number`&&t.target!==`draft-04`&&(l<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c==`number`&&(i.multipleOf=c)},Xj=(e,t,n,r)=>{n.type=`boolean`},Zj=(e,t,n,r)=>{n.not={}},Qj=(e,t,n,r)=>{let i=e._zod.def,a=ED(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},$j=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},eM=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},tM=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},nM=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Vj(a.element,t,{...r,path:[...r.path,`items`]})},rM=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=Vj(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Vj(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},iM=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Vj(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},aM=(e,t,n,r)=>{let i=e._zod.def,a=Vj(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Vj(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},oM=(e,t,n,r)=>{let i=e._zod.def,a=Vj(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},sM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},cM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},lM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},uM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},dM=(e,t,n,r)=>{let i=e._zod.def,a=t.io===`input`?i.in._zod.def.type===`transform`?i.out:i.in:i.out;Vj(a,t,r);let o=t.seen.get(e);o.ref=a},fM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},pM=(e,t,n,r)=>{let i=e._zod.def;Vj(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},mM=$(`ZodISODateTime`,(e,t)=>{Ik.init(e,t),BM.init(e,t)});function hM(e){return sj(mM,e)}var gM=$(`ZodISODate`,(e,t)=>{Lk.init(e,t),BM.init(e,t)});function _M(e){return cj(gM,e)}var vM=$(`ZodISOTime`,(e,t)=>{Rk.init(e,t),BM.init(e,t)});function yM(e){return lj(vM,e)}var bM=$(`ZodISODuration`,(e,t)=>{zk.init(e,t),BM.init(e,t)});function xM(e){return uj(bM,e)}var SM=(e,t)=>{lO.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>fO(e,t)},flatten:{value:t=>dO(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,DD,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,DD,2)}},isEmpty:{get(){return e.issues.length===0}}})};$(`ZodError`,SM);var CM=$(`ZodError`,SM,{Parent:Error}),wM=pO(CM),TM=mO(CM),EM=hO(CM),DM=_O(CM),OM=yO(CM),kM=bO(CM),AM=xO(CM),jM=SO(CM),MM=CO(CM),NM=wO(CM),PM=TO(CM),FM=EO(CM),IM=$(`ZodType`,(e,t)=>(Sk.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Kj(e,`input`),output:Kj(e,`output`)}}),e.toJSONSchema=Gj(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,`_def`,{value:t}),e.check=(...n)=>e.clone(FD(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>GD(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>wM(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>EM(e,t,n),e.parseAsync=async(t,n)=>TM(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>DM(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>OM(e,t,n),e.decode=(t,n)=>kM(e,t,n),e.encodeAsync=async(t,n)=>AM(e,t,n),e.decodeAsync=async(t,n)=>jM(e,t,n),e.safeEncode=(t,n)=>MM(e,t,n),e.safeDecode=(t,n)=>NM(e,t,n),e.safeEncodeAsync=async(t,n)=>PM(e,t,n),e.safeDecodeAsync=async(t,n)=>FM(e,t,n),e.refine=(t,n)=>e.check(ZN(t,n)),e.superRefine=t=>e.check(QN(t)),e.overwrite=t=>e.check(Aj(t)),e.optional=()=>NN(e),e.exactOptional=()=>FN(e),e.nullable=()=>LN(e),e.nullish=()=>NN(LN(e)),e.nonoptional=t=>UN(e,t),e.array=()=>_N(e),e.or=t=>xN([e,t]),e.and=t=>TN(e,t),e.transform=t=>qN(e,jN(t)),e.default=t=>zN(e,t),e.prefault=t=>VN(e,t),e.catch=t=>GN(e,t),e.pipe=t=>qN(e,t),e.readonly=()=>YN(e),e.describe=t=>{let n=e.clone();return LA.add(n,{description:t}),n},Object.defineProperty(e,`description`,{get(){return LA.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return LA.get(e);let n=e.clone();return LA.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),LM=$(`_ZodString`,(e,t)=>{Ck.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jj(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(wj(...t)),e.includes=(...t)=>e.check(Dj(...t)),e.startsWith=(...t)=>e.check(Oj(...t)),e.endsWith=(...t)=>e.check(kj(...t)),e.min=(...t)=>e.check(Sj(...t)),e.max=(...t)=>e.check(xj(...t)),e.length=(...t)=>e.check(Cj(...t)),e.nonempty=(...t)=>e.check(Sj(1,...t)),e.lowercase=t=>e.check(Tj(t)),e.uppercase=t=>e.check(Ej(t)),e.trim=()=>e.check(Mj()),e.normalize=(...t)=>e.check(jj(...t)),e.toLowerCase=()=>e.check(Nj()),e.toUpperCase=()=>e.check(Pj()),e.slugify=()=>e.check(Fj())}),RM=$(`ZodString`,(e,t)=>{Ck.init(e,t),LM.init(e,t),e.email=t=>e.check(zA(VM,t)),e.url=t=>e.check(GA(WM,t)),e.jwt=t=>e.check(oj(aN,t)),e.emoji=t=>e.check(KA(GM,t)),e.guid=t=>e.check(BA(HM,t)),e.uuid=t=>e.check(VA(UM,t)),e.uuidv4=t=>e.check(HA(UM,t)),e.uuidv6=t=>e.check(UA(UM,t)),e.uuidv7=t=>e.check(WA(UM,t)),e.nanoid=t=>e.check(qA(KM,t)),e.guid=t=>e.check(BA(HM,t)),e.cuid=t=>e.check(JA(qM,t)),e.cuid2=t=>e.check(YA(JM,t)),e.ulid=t=>e.check(XA(YM,t)),e.base64=t=>e.check(rj(nN,t)),e.base64url=t=>e.check(ij(rN,t)),e.xid=t=>e.check(ZA(XM,t)),e.ksuid=t=>e.check(QA(ZM,t)),e.ipv4=t=>e.check($A(QM,t)),e.ipv6=t=>e.check(ej($M,t)),e.cidrv4=t=>e.check(tj(eN,t)),e.cidrv6=t=>e.check(nj(tN,t)),e.e164=t=>e.check(aj(iN,t)),e.datetime=t=>e.check(hM(t)),e.date=t=>e.check(_M(t)),e.time=t=>e.check(yM(t)),e.duration=t=>e.check(xM(t))});function zM(e){return RA(RM,e)}var BM=$(`ZodStringFormat`,(e,t)=>{wk.init(e,t),LM.init(e,t)}),VM=$(`ZodEmail`,(e,t)=>{Dk.init(e,t),BM.init(e,t)}),HM=$(`ZodGUID`,(e,t)=>{Tk.init(e,t),BM.init(e,t)}),UM=$(`ZodUUID`,(e,t)=>{Ek.init(e,t),BM.init(e,t)}),WM=$(`ZodURL`,(e,t)=>{Ok.init(e,t),BM.init(e,t)}),GM=$(`ZodEmoji`,(e,t)=>{kk.init(e,t),BM.init(e,t)}),KM=$(`ZodNanoID`,(e,t)=>{Ak.init(e,t),BM.init(e,t)}),qM=$(`ZodCUID`,(e,t)=>{jk.init(e,t),BM.init(e,t)}),JM=$(`ZodCUID2`,(e,t)=>{Mk.init(e,t),BM.init(e,t)}),YM=$(`ZodULID`,(e,t)=>{Nk.init(e,t),BM.init(e,t)}),XM=$(`ZodXID`,(e,t)=>{Pk.init(e,t),BM.init(e,t)}),ZM=$(`ZodKSUID`,(e,t)=>{Fk.init(e,t),BM.init(e,t)}),QM=$(`ZodIPv4`,(e,t)=>{Bk.init(e,t),BM.init(e,t)}),$M=$(`ZodIPv6`,(e,t)=>{Vk.init(e,t),BM.init(e,t)}),eN=$(`ZodCIDRv4`,(e,t)=>{Hk.init(e,t),BM.init(e,t)}),tN=$(`ZodCIDRv6`,(e,t)=>{Uk.init(e,t),BM.init(e,t)}),nN=$(`ZodBase64`,(e,t)=>{Gk.init(e,t),BM.init(e,t)}),rN=$(`ZodBase64URL`,(e,t)=>{qk.init(e,t),BM.init(e,t)}),iN=$(`ZodE164`,(e,t)=>{Jk.init(e,t),BM.init(e,t)}),aN=$(`ZodJWT`,(e,t)=>{Xk.init(e,t),BM.init(e,t)}),oN=$(`ZodNumber`,(e,t)=>{Zk.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yj(e,t,n,r),e.gt=(t,n)=>e.check(vj(t,n)),e.gte=(t,n)=>e.check(yj(t,n)),e.min=(t,n)=>e.check(yj(t,n)),e.lt=(t,n)=>e.check(gj(t,n)),e.lte=(t,n)=>e.check(_j(t,n)),e.max=(t,n)=>e.check(_j(t,n)),e.int=t=>e.check(lN(t)),e.safe=t=>e.check(lN(t)),e.positive=t=>e.check(vj(0,t)),e.nonnegative=t=>e.check(yj(0,t)),e.negative=t=>e.check(gj(0,t)),e.nonpositive=t=>e.check(_j(0,t)),e.multipleOf=(t,n)=>e.check(bj(t,n)),e.step=(t,n)=>e.check(bj(t,n)),e.finite=()=>e;let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function sN(e){return dj(oN,e)}var cN=$(`ZodNumberFormat`,(e,t)=>{Qk.init(e,t),oN.init(e,t)});function lN(e){return fj(cN,e)}var uN=$(`ZodBoolean`,(e,t)=>{$k.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xj(e,t,n,r)});function dN(e){return pj(uN,e)}var fN=$(`ZodUnknown`,(e,t)=>{eA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function pN(){return mj(fN)}var mN=$(`ZodNever`,(e,t)=>{tA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zj(e,t,n,r)});function hN(e){return hj(mN,e)}var gN=$(`ZodArray`,(e,t)=>{rA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>nM(e,t,n,r),e.element=t.element,e.min=(t,n)=>e.check(Sj(t,n)),e.nonempty=t=>e.check(Sj(1,t)),e.max=(t,n)=>e.check(xj(t,n)),e.length=(t,n)=>e.check(Cj(t,n)),e.unwrap=()=>e.element});function _N(e,t){return Ij(gN,e,t)}var vN=$(`ZodObject`,(e,t)=>{cA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>rM(e,t,n,r),ND(e,`shape`,()=>t.shape),e.keyof=()=>DN(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:pN()}),e.loose=()=>e.clone({...e._zod.def,catchall:pN()}),e.strict=()=>e.clone({...e._zod.def,catchall:hN()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>ZD(e,t),e.safeExtend=t=>QD(e,t),e.merge=t=>$D(e,t),e.pick=t=>YD(e,t),e.omit=t=>XD(e,t),e.partial=(...t)=>eO(MN,e,t[0]),e.required=(...t)=>tO(HN,e,t[0])});function yN(e,t){return new vN({type:`object`,shape:e??{},...KD(t)})}var bN=$(`ZodUnion`,(e,t)=>{uA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iM(e,t,n,r),e.options=t.options});function xN(e,t){return new bN({type:`union`,options:e,...KD(t)})}var SN=$(`ZodDiscriminatedUnion`,(e,t)=>{bN.init(e,t),dA.init(e,t)});function CN(e,t,n){return new SN({type:`union`,options:t,discriminator:e,...KD(n)})}var wN=$(`ZodIntersection`,(e,t)=>{fA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>aM(e,t,n,r)});function TN(e,t){return new wN({type:`intersection`,left:e,right:t})}var EN=$(`ZodEnum`,(e,t)=>{hA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qj(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new EN({...t,checks:[],...KD(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new EN({...t,checks:[],...KD(r),entries:i})}});function DN(e,t){return new EN({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...KD(t)})}var ON=$(`ZodLiteral`,(e,t)=>{gA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$j(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,`value`,{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function kN(e,t){return new ON({type:`literal`,values:Array.isArray(e)?e:[e],...KD(t)})}var AN=$(`ZodTransform`,(e,t)=>{_A.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>tM(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new CD(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(sO(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(sO(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function jN(e){return new AN({type:`transform`,transform:e})}var MN=$(`ZodOptional`,(e,t)=>{yA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function NN(e){return new MN({type:`optional`,innerType:e})}var PN=$(`ZodExactOptional`,(e,t)=>{bA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function FN(e){return new PN({type:`optional`,innerType:e})}var IN=$(`ZodNullable`,(e,t)=>{xA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function LN(e){return new IN({type:`nullable`,innerType:e})}var RN=$(`ZodDefault`,(e,t)=>{SA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zN(e,t){return new RN({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():HD(t)}})}var BN=$(`ZodPrefault`,(e,t)=>{wA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function VN(e,t){return new BN({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():HD(t)}})}var HN=$(`ZodNonOptional`,(e,t)=>{TA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function UN(e,t){return new HN({type:`nonoptional`,innerType:e,...KD(t)})}var WN=$(`ZodCatch`,(e,t)=>{DA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function GN(e,t){return new WN({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var KN=$(`ZodPipe`,(e,t)=>{OA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>dM(e,t,n,r),e.in=t.in,e.out=t.out});function qN(e,t){return new KN({type:`pipe`,in:e,out:t})}var JN=$(`ZodReadonly`,(e,t)=>{AA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fM(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function YN(e){return new JN({type:`readonly`,innerType:e})}var XN=$(`ZodCustom`,(e,t)=>{MA.init(e,t),IM.init(e,t),e._zod.processJSONSchema=(t,n,r)=>eM(e,t,n,r)});function ZN(e,t={}){return Lj(XN,e,t)}function QN(e){return Rj(e)}yN({ok:dN(),sessions:sN().int().nonnegative()}).strict(),CN(`type`,[yN({type:kN(`input`),data:zM().max(gD)}).strict(),yN({type:kN(`resize`),cols:sN().int().positive().max(bD),rows:sN().int().positive().max(xD),pixelWidth:sN().int().nonnegative().optional(),pixelHeight:sN().int().nonnegative().optional()}).strict()]);var $N=CN(`type`,[yN({type:kN(`output`),data:zM().max(_D)}).strict(),yN({type:kN(`exit`),code:sN().int().nullable()}).strict(),yN({type:kN(`title`),title:zM().max(vD)}).strict(),yN({type:kN(`session`),shell:zM().min(1),shellName:zM().min(1),pid:sN().int().nonnegative(),cwd:zM().min(1),title:zM().max(vD)}).strict(),yN({type:kN(`cwd`),cwd:zM().min(1)}).strict(),yN({type:kN(`foreground`),process:zM().max(256).nullable()}).strict(),yN({type:kN(`notification`),body:zM().min(1).max(yD)}).strict()]),eP=2.4,tP=.04045,nP=12.92,rP=.055,iP=1.055,aP=.0031308,oP=24389/27,sP=216/24389,cP=.95047,lP=1,uP=1.08883,dP=.008856,fP=7.787,pP=e=>{let t=e/255;return t<=tP?t/nP:((t+rP)/iP)**+eP},mP=e=>e<=0?0:e>=1?255:Math.round(e<=aP?nP*e*255:(iP*e**(1/eP)-rP)*255),hP=e=>e>dP?Math.cbrt(e):fP*e+16/116,gP=e=>{let t=pP(e.r),n=pP(e.g),r=pP(e.b);return{x:.4124564*t+.3575761*n+.1804375*r,y:.2126729*t+.7151522*n+.072175*r,z:.0193339*t+.119192*n+.9503041*r}},_P=e=>{let t=3.2404542*e.x-1.5371385*e.y-.4985314*e.z,n=-.969266*e.x+1.8760108*e.y+.041556*e.z,r=.0556434*e.x-.2040259*e.y+1.0572252*e.z;return{r:mP(t),g:mP(n),b:mP(r)}},vP=e=>{let t=e.x/cP,n=e.y/lP,r=e.z/uP,i=hP(t),a=hP(n),o=hP(r);return{l:116*a-16,a:500*(i-a),b:200*(a-o)}},yP=(e,t)=>{let n=e*e*e;return n>sP?t*n:t*((116*e-16)/oP)},bP=e=>{let t=(e.l+16)/116,n=e.a/500+t,r=t-e.b/200;return{x:yP(n,cP),y:yP(t,lP),z:yP(r,uP)}},xP=e=>vP(gP(e)),SP=e=>_P(bP(e)),CP=e=>{let t=e.replace(/^#/,``);return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16)}},wP=e=>{let t=Math.max(0,Math.min(255,Math.round(e.r))),n=Math.max(0,Math.min(255,Math.round(e.g))),r=Math.max(0,Math.min(255,Math.round(e.b)));return`#${t.toString(16).padStart(2,`0`)}${n.toString(16).padStart(2,`0`)}${r.toString(16).padStart(2,`0`)}`},TP=e=>xP(CP(e)),EP=e=>wP(SP(e)),DP=6,OP=5,kP=24,AP=25,jP=(e,t,n)=>({l:t.l+e*(n.l-t.l),a:t.a+e*(n.a-t.a),b:t.b+e*(n.b-t.b)}),MP=(e,t=!1)=>{let n=e.background??`#000000`,r=e.foreground??`#ffffff`,i=[TP(n),TP(e.red??`#ff0000`),TP(e.green??`#00ff00`),TP(e.yellow??`#ffff00`),TP(e.blue??`#0000ff`),TP(e.magenta??`#ff00ff`),TP(e.cyan??`#00ffff`),TP(r)];if(i[7].l<i[0].l&&!t){let e=i[0];i[0]=i[7],i[7]=e}let a=[];for(let e=0;e<DP;e++){let t=jP(e/OP,i[0],i[1]),n=jP(e/OP,i[2],i[3]),r=jP(e/OP,i[4],i[5]),o=jP(e/OP,i[6],i[7]);for(let e=0;e<DP;e++){let i=jP(e/OP,t,n),s=jP(e/OP,r,o);for(let e=0;e<DP;e++){let t=jP(e/OP,i,s);a.push(EP(t))}}}for(let e=0;e<kP;e++){let t=(e+1)/AP;a.push(EP(jP(t,i[0],i[7])))}return a},NP=`Symbols Nerd Font`,PP=``,FP=async e=>{if(!(typeof document>`u`)&&e.name)try{await document.fonts.ready;let t=[document.fonts.load(`16px "${e.name}"`),document.fonts.load(`bold 16px "${e.name}"`),document.fonts.load(`16px "${NP}"`,PP),document.fonts.load(`bold 16px "${NP}"`,PP)];await Promise.all(t)}catch{}},IP=(e,t)=>`\x1b[${e};${t+1}u`,LP=e=>{let t=e.buffer.active,n=Math.max(0,t.baseY-t.viewportY);return{distanceFromBottom:n,wasAtBottom:n===0}},RP=e=>!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0),zP=(e,t)=>{let n=e.buffer.active,r=Math.max(0,n.baseY-n.viewportY),i=r===0;try{t.fit()}catch{return!1}try{if(i)return e.scrollToBottom(),!0;let t=e.buffer.active;if(r>t.baseY)return e.scrollToBottom(),!0;let n=t.baseY-r-t.viewportY;n!==0&&e.scrollLines(n)}catch{}return!0},BP=(e,t)=>`\r\n\r\n\x1b[2;31m[connection lost · code ${e}${t?` · ${t}`:``}]\x1b[0m\r\n`,VP={block:{blink:`\x1B[1 q`,steady:`\x1B[2 q`},underline:{blink:`\x1B[3 q`,steady:`\x1B[4 q`},bar:{blink:`\x1B[5 q`,steady:`\x1B[6 q`}},HP=(e,t)=>{let n=t?`blink`:`steady`;return`\x1b[?25h${VP[e][n]}`},UP=(e,t)=>`${HP(e,t)}\r\n\x1b[2;32m[reconnected]\x1b[0m\r\n\r\n`,WP=e=>`\r\n\x1b[2;31m[${e===null?`shell exited`:`shell exited with code ${e}`}]\x1b[0m\r\n`,GP=55296,KP=56319,qP=(e,t)=>{if(e.length<=t)return[e];let n=[],r=0;for(;r<e.length;){let i=Math.min(r+t,e.length);if(i<e.length){let t=e.charCodeAt(i-1);t>=GP&&t<=KP&&--i}i===r&&(i=r+t),n.push(e.slice(r,i)),r=i}return n},JP=(e,t)=>{if(t.wasAtBottom){e.scrollToBottom();return}let n=e.buffer.active;if(t.distanceFromBottom>n.baseY){e.scrollToBottom();return}let r=n.baseY-t.distanceFromBottom-n.viewportY;r!==0&&e.scrollLines(r)},YP=new class{terminal=null;chunks=[];scheduled=!1;afterFlush=null;attach(e){this.terminal=e}setAfterFlush(e){this.afterFlush=e}detach(){this.flush(),this.terminal=null,this.afterFlush=null}push(e){this.chunks.push(e),this.scheduled||(this.scheduled=!0,queueMicrotask(()=>this.flush()))}flush(){this.scheduled=!1;let e=this.chunks,t=this.terminal;this.chunks=[],!(!t||e.length===0)&&(e.length===1?t.write(e[0]):t.write(e.join(``)),this.afterFlush?.())}},XP=e=>e[0]===3,ZP=e=>{if(!Number.isFinite(e))return 13;let t=Math.round(e);return t<9?9:t>24?24:t},QP=1/kS,$P=e=>Math.round(e*QP)/QP,eF=e=>{if(!Number.isFinite(e))return OS;let t=$P(e);return t<1?1:t>2?2:t},tF=1/1,nF=e=>Math.round(e*tF)/tF,rF=e=>{if(!Number.isFinite(e))return 0;let t=nF(e);return t<0?0:t>48?48:t},iF=e=>{if(!Number.isFinite(e))return 0;let t=nF(e);return t<0?0:t>48?48:t},aF=()=>{if(typeof navigator>`u`)return!1;let e=navigator.platform||navigator.userAgent||``;return/Mac|iPhone|iPad|iPod/i.test(e)},oF=(e,t,n)=>e.key!==t&&e.key!==t.toUpperCase()?!1:n?e.metaKey&&!e.ctrlKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.altKey,sF=(e,t)=>oF(e,`k`,t),cF=(e,t)=>oF(e,`f`,t),lF=(e,t)=>e.code===`Backslash`?e.altKey&&!e.metaKey&&!e.ctrlKey?!0:t?e.metaKey&&!e.ctrlKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.altKey:!1,uF=e=>{if(typeof window>`u`)return null;try{let t=window.localStorage.getItem(e);return t===null||t.trim()===``?null:t}catch{return null}},dF=(e,t)=>{if(!(typeof window>`u`))try{window.localStorage.setItem(e,t)}catch{}},fF=(e,t,n)=>({load:()=>{let r=uF(e);if(r===null)return t;let i=Number(r);return Number.isFinite(i)?n(i):t},store:t=>dF(e,String(t))}),pF=(e,t)=>({load:()=>{let n=uF(e);return n===`true`?!0:n===`false`?!1:t},store:t=>dF(e,String(t))}),mF=(e,t,n)=>({load:()=>{let r=uF(e);return r!==null&&n(r)?r:t},store:t=>dF(e,t)}),hF=(e,t,n)=>({load:()=>t(uF(e)),store:t=>dF(e,n(t))}),gF=pF(WS,!0),_F=gF.load,vF=gF.store,yF=mF(US,jE,NE),bF=yF.load,xF=yF.store,SF=hF(BS,e=>XE(e).id,e=>e),CF=SF.load,wF=SF.store,TF=fF(VS,13,ZP),EF=TF.load,DF=TF.store,OF=fF(HS,OS,eF),kF=OF.load,AF=OF.store,jF=fF(GS,eD,e=>nD(e)?e:eD),MF=jF.load,NF=jF.store,PF=pF(KS,!0),FF=PF.load,IF=PF.store,LF=hF(zS,e=>aD(e).id,e=>e),RF=LF.load,zF=LF.store,BF=fF(qS,0,rF),VF=BF.load,HF=BF.store,UF=fF(JS,0,iF),WF=UF.load,GF=UF.store,KF=pF(XS,!1),qF=KF.load,JF=KF.store,YF=`<path d='m6 8 4 4-4 4M12 16h6'/>`,XF=[`<circle cx='7' cy='12' r='1.5' fill='currentColor' stroke='none'/>`,`<circle cx='12' cy='12' r='1.5' fill='currentColor' stroke='none'/>`,`<circle cx='17' cy='12' r='1.5' fill='currentColor' stroke='none'/>`].join(``),ZF={ready:`hsl(220 8% 46%)`,running:`hsl(142 72% 45%)`,"alive-quiet":`hsl(210 65% 50%)`,dead:`hsl(0 72% 50%)`},QF={ready:`hsl(220 10% 16%)`,running:`hsl(142 85% 12%)`,"alive-quiet":`hsl(210 70% 14%)`,dead:`hsl(0 80% 12%)`},$F={ready:YF,running:XF,"alive-quiet":YF,dead:YF},eI=`<circle cx='19' cy='7' r='3.5' fill='hsl(0 72% 50%)' stroke='white' stroke-width='1.5'/>`,tI=(e,t=!1)=>{let n=ZF[e],r=QF[e],i=$F[e],a=t?eI:``;return[`<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' color='${r}' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' opacity='${e===`dead`?FS:1}'>`,`<rect x='2' y='4' width='20' height='16' rx='2' fill='${n}'/>`,i,a,`</svg>`].join(``)},nI=`ready`,rI=null,iI=!1,aI=(e,t)=>rI===null||e!==nI||t!==iI,oI=(e,t)=>{nI=e,rI=e,iI=t},sI=()=>{nI=`ready`,rI=null,iI=!1},cI=(e,t=!1)=>{if(typeof document>`u`||!aI(e,t))return;oI(e,t);let n=`data:image/svg+xml,${encodeURIComponent(tI(e,t))}`,r=document.querySelector(`link[rel="icon"]`);r||(r=document.createElement(`link`),r.rel=`icon`,document.head.appendChild(r)),r.type=`image/svg+xml`,r.href=n},lI=`/api/health`,uI=async()=>{try{return(await fetch(lI)).ok}catch{return!1}},dI=(e,t)=>t.buffer.active.type!==`alternate`||t.modes.mouseTrackingMode!==`none`?!1:e.deltaMode===WheelEvent.DOM_DELTA_PIXEL,fI=e=>e||`localterm`,pI=e=>`${jS}${e||`localterm`}`,mI={matchBackground:IS,activeMatchBackground:LS,activeMatchBorder:RS,matchOverviewRuler:LS,activeMatchColorOverviewRuler:RS},hI=`cwd`,gI=e=>{let t=new URL(`/ws`,window.location.href);t.protocol=t.protocol===`https:`?`wss:`:`ws:`;let n=e??new URLSearchParams(window.location.search).get(hI);return n&&t.searchParams.set(hI,n),t.toString()},_I=e=>{let t=new URL(window.location.origin);return e&&t.searchParams.set(hI,e),t.toString()},vI=({onModalOpenChange:e,onForegroundProcessChange:t}={})=>{let n=(0,b.useRef)(null),r=(0,b.useRef)(null),i=(0,b.useRef)(!1),a=(0,b.useRef)(null),o=(0,b.useRef)(null),s=(0,b.useRef)(null),c=(0,b.useRef)(null),l=(0,b.useRef)(null),u=(0,b.useRef)(null),d=(0,b.useRef)(null),f=(0,b.useRef)(RF()),p=(0,b.useRef)(CF()),m=(0,b.useRef)(EF()),h=(0,b.useRef)(kF()),g=(0,b.useRef)(bF()),_=(0,b.useRef)(_F()),v=(0,b.useRef)(MF()),x=(0,b.useRef)(FF()),C=(0,b.useRef)(VF()),w=(0,b.useRef)(WF()),T=(0,b.useRef)(qF()),E=(0,b.useRef)(null),O=(0,b.useRef)(null),k=(0,b.useRef)(null),A=(0,b.useRef)(null),[j,M]=(0,b.useState)(null),[N,P]=(0,b.useState)(0),[F,I]=(0,b.useState)(!1),[L,ee]=(0,b.useState)(!1),[R,te]=(0,b.useState)(!1),[z,B]=(0,b.useState)(!1),V=(0,b.useRef)(null),[H,ne]=(0,b.useState)(0),[U,re]=(0,b.useState)(!1),[ie,ae]=(0,b.useState)(!1),oe=(0,b.useRef)(null),se=(0,b.useRef)(!1),ce=U||ie;se.current=ie;let[le,ue]=(0,b.useState)(``),[de,fe]=(0,b.useState)({resultIndex:-1,resultCount:0}),[pe,me]=(0,b.useState)(f.current),[he,ge]=(0,b.useState)(null),_e=he??pe,ve=(0,b.useMemo)(()=>aD(_e),[_e]),ye=(0,b.useMemo)(()=>({...ve.colors,extendedAnsi:MP(ve.colors)}),[ve]),[be,xe]=(0,b.useState)(p.current),[Se,Ce]=(0,b.useState)(null),we=Se??be,[Te,Ee]=(0,b.useState)(T.current),De=(0,b.useMemo)(()=>XE(we),[we]),[Oe,ke]=(0,b.useState)(m.current),[Ae,je]=(0,b.useState)(h.current),[Me,Ne]=(0,b.useState)(g.current),[Pe,Fe]=(0,b.useState)(null),Ie=Pe??Me,[Le,Re]=(0,b.useState)(_.current),[ze,Be]=(0,b.useState)(v.current),[Ve,He]=(0,b.useState)(x.current),[Ue,We]=(0,b.useState)(C.current),[Ge,Ke]=(0,b.useState)(w.current),[Je,Xe]=(0,b.useState)(null),[Ze,Qe]=(0,b.useState)(`Notification`in window?Notification.permission:`unsupported`),[$e,et]=(0,b.useState)(null),tt=(0,b.useRef)(null),nt=(0,b.useRef)(!1),rt=(0,b.useMemo)(aF,[]);(0,b.useEffect)(()=>{let e=n.current;if(!e)return;let c=!1,l=!1,u=!1,y=``,b=null,C=null,w=null,j=null,N=null,F=0,I=`ready`,L=!1,ee=!1,R=[0],te=()=>R[R.length-1]??0,z=()=>{let e=performance.now()-F;if(e<750){N=window.setTimeout(z,750-e);return}N=null,j!==null&&(window.clearTimeout(j),j=null),I===`running`&&(document.hidden&&(L=!0),ee?(I=`alive-quiet`,cI(`alive-quiet`,L)):(I=`ready`,cI(`ready`,L)))},B=()=>{I!==`running`&&j===null&&(j=window.setTimeout(()=>{j=null,!(c||l)&&(I=`running`,L=!1,cI(`running`))},250)),F=performance.now(),N===null&&(N=window.setTimeout(z,750))},H=()=>{j!==null&&(window.clearTimeout(j),j=null),N!==null&&(window.clearTimeout(N),N=null),(I!==`ready`||L)&&(I=`ready`,L=!1,cI(`ready`))},ne=XE(p.current);FP(ne).then(()=>{if(c)return;let e=r.current;e&&e.clearTextureAtlas(),U._core._charSizeService.measure(),ke()});let U=new $u({allowProposedApi:!0,cursorBlink:_.current,cursorStyle:g.current,fontFamily:ZE(ne,T.current),fontSize:m.current,lineHeight:h.current,scrollback:v.current,theme:{...aD(f.current).colors,extendedAnsi:MP(aD(f.current).colors)},macOptionIsMeta:!0,scrollOnUserInput:x.current,windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0},scrollbar:{showScrollbar:!1}});r.current=U,YP.attach(U);let re=new D;E.current=re,U.loadAddon(re),U.loadAddon(new Nn),U.loadAddon(new S),U.loadAddon(new qe),U.loadAddon(new Ye),U.loadAddon(new Dn);let ie=new ut;U.loadAddon(ie),o.current=ie;let ae=ie.onDidChangeResults(fe);U.open(e),re.proposeDimensions&&=()=>{if(!U||!U.element||!U.element.parentElement)return;let e=U,t=e._core._renderService.dimensions.css.cell.width,n=e._core._renderService.dimensions.css.cell.height;if(t===0||n===0)return;let r=window.getComputedStyle(U.element.parentElement),i=window.getComputedStyle(U.element),a=Math.max(0,parseInt(r.getPropertyValue(`width`)))-(parseInt(i.getPropertyValue(`padding-right`))+parseInt(i.getPropertyValue(`padding-left`))),o=parseInt(r.getPropertyValue(`height`))-(parseInt(i.getPropertyValue(`padding-top`))+parseInt(i.getPropertyValue(`padding-bottom`)));return{cols:Math.max(2,Math.floor(a/t)),rows:Math.max(1,Math.floor(o/n))}};let oe=()=>{let e=U.buffer.active,t=e.length,n=U.rows,r=e.viewportY+n>=t,i=t>n,a=k.current,o=A.current;if(!(!a||!o)&&(a.classList.toggle(`xterm-scrollbar-visible`,!r&&i),i)){let r=n/t,i=e.viewportY/t;o.style.height=`${r*100}%`,o.style.top=`${i*100}%`}};oe();let se=U.onScroll(oe);YP.setAfterFlush(oe);let ce=!1,le=0,ue=0,de=e=>{if(e.button===0){ce=!0,le=e.clientY,ue=U.buffer.active.viewportY;try{e.target.setPointerCapture(e.pointerId)}catch{}e.preventDefault()}},pe=e=>{if(!ce)return;let t=k.current;if(!t)return;let n=t.clientHeight,r=U.buffer.active.length-U.rows;if(r<=0||n<=0)return;let i=n/r,a=e.clientY-le,o=Math.max(0,Math.min(r,ue+Math.round(a/i)));o!==U.buffer.active.viewportY&&U.scrollLines(o-U.buffer.active.viewportY)},me=()=>{ce=!1},he=e=>{if(e.button!==0||e.target===A.current)return;let t=k.current;if(!t)return;let n=t.getBoundingClientRect(),r=(e.clientY-n.top)/n.height,i=U.buffer.active,a=i.length,o=Math.max(0,Math.min(a-U.rows,Math.round(r*a)-Math.floor(U.rows/2)));U.scrollLines(o-i.viewportY)},ge=A.current,_e=k.current;ge&&(ge.addEventListener(`pointerdown`,de),ge.addEventListener(`pointermove`,pe),ge.addEventListener(`pointerup`,me),ge.addEventListener(`pointercancel`,me)),_e&&_e.addEventListener(`pointerdown`,he);try{let e=new ia;e.onContextLoss(()=>e.dispose()),U.loadAddon(e)}catch{}let ve=U.parser.registerCsiHandler({prefix:`>`,final:`u`},e=>{let t=e[0],n=typeof t==`number`?t:1;return R.push(n),!0}),ye=U.parser.registerCsiHandler({prefix:`<`,final:`u`},e=>{let t=e[0],n=typeof t==`number`&&t>0?t:1;for(let e=0;e<n&&R.length>1;e+=1)R.pop();return!0}),be=U.parser.registerCsiHandler({prefix:`=`,final:`u`},e=>{let t=e[0],n=e[1];if(typeof t!=`number`)return!0;let r=t,i=typeof n==`number`&&n>0?n:1,a=R.length-1,o=R[a]??0;return i===1?R[a]=r:i===2?R[a]=o|r:i===3&&(R[a]=o&~r),!0}),xe=U.parser.registerCsiHandler({final:`J`},XP),Se=U.parser.registerCsiHandler({prefix:`?`,final:`J`},XP),Ce=e=>{b?.readyState===WebSocket.OPEN&&b.send(JSON.stringify(e))},we=()=>{let e=d.current;e&&cancelAnimationFrame(e.frameId),d.current=null},Te=()=>{let e=d.current;e&&JP(U,e.anchor)},Ee=e=>{we(),d.current={anchor:e,frameId:requestAnimationFrame(()=>{Te(),d.current=null})}};U.attachCustomWheelEventHandler(e=>dI(e,U)?(e.preventDefault(),!1):!0),U.attachCustomKeyEventHandler(e=>{if(e.key===`Tab`&&(e.metaKey||e.ctrlKey))return!1;if(lF(e,rt)){if(e.type===`keydown`){e.preventDefault();let t=document.getElementById(`new-shell-link`);t instanceof HTMLAnchorElement&&t.click()}return!1}if(sF(e,rt))return e.type===`keydown`&&(e.preventDefault(),V.current?.()),!1;if(cF(e,rt))return e.type===`keydown`&&(e.preventDefault(),O.current?.()),!1;if(e.type===`keydown`&&e.key===`Enter`){let t=RP(e),n=(te()&1)!=0;if(t!==0&&n)return e.preventDefault(),Ce({type:`input`,data:IP(13,t)}),!1;if(t===1)return e.preventDefault(),Ce({type:`input`,data:`
|
|
114
|
+
`}),!1}return!0});let De=e=>{if(l)return;let t=e.trim();t&&(y=t,document.title=fI(t))};s.current=()=>U.focus();let Oe=(e,t)=>{let n=U,r=n._core._renderService?.dimensions?.css?.canvas?.width,i=n._core._renderService?.dimensions?.css?.canvas?.height;Ce({type:`resize`,cols:e,rows:t,...r!=null&&i!=null?{pixelWidth:Math.round(r),pixelHeight:Math.round(i)}:{}})},ke=()=>{let e=LP(U);zP(U,re)&&(Ee(e),Oe(U.cols,U.rows))},Ae=()=>{w!==null&&window.clearTimeout(w),w=window.setTimeout(()=>{w=null,ke()},80)};U.onData(e=>{for(let t of qP(e,gD))Ce({type:`input`,data:t})}),U.onResize(({cols:e,rows:t})=>{Oe(e,t),oe()});let je=new ResizeObserver(Ae),Me=()=>{!document.hidden&&L&&(L=!1,cI(I))};document.addEventListener(`visibilitychange`,Me),je.observe(e),ke(),requestAnimationFrame(()=>U.focus());let Ne=e=>{if(!l){if(l=!0,e===null||e===0){window.close(),setTimeout(()=>{c||(H(),cI(`dead`),U.write(WP(e)),document.title=pI(y),M({reason:`shell-exited`,exitCode:e}),Xe(null))},100);return}H(),cI(`dead`),U.write(WP(e)),document.title=pI(y),M({reason:`shell-exited`,exitCode:e}),Xe(null)}},Pe=(e,t,n)=>{l||(l=!0,H(),cI(`dead`),U.write(BP(e,t)),document.title=pI(y),M({reason:`connection-lost`,closeCode:e,closeReason:t,wasClean:n}),Xe(null))},Fe=()=>{if(c)return;let e=new WebSocket(gI(tt.current));b=e,e.addEventListener(`open`,()=>{c||b!==e||(u=!0,nt.current=!0,P(0),Oe(U.cols,U.rows))}),e.addEventListener(`message`,n=>{if(c||b!==e)return;let r;try{r=JSON.parse(typeof n.data==`string`?n.data:String(n.data))}catch{return}if(typeof r==`object`&&r&&r.type===`output`&&typeof r.data==`string`){let e=r.data;YP.push(e),B();return}let i=$N.safeParse(r);if(!i.success)return;let a=i.data;if(a.type===`title`)De(a.title);else if(a.type===`session`)Xe({shell:a.shell,shellName:a.shellName,pid:a.pid,cwd:a.cwd,title:a.title}),et(a.cwd),De(a.title);else if(a.type===`cwd`)et(a.cwd);else if(a.type===`foreground`){let e=a.process!==null;t?.(e),!e&&I===`alive-quiet`&&(I=`ready`,cI(`ready`,L)),ee=e}else a.type===`notification`?`Notification`in window&&Notification.permission===`granted`&&new Notification(a.body):a.type===`exit`&&(H(),Ne(a.code))}),e.addEventListener(`close`,t=>{if(b===e&&(b=null,nt.current=!1,!c&&!l)){if(u){console.warn(`[localterm] websocket closed: code=${t.code} reason=${JSON.stringify(t.reason)} wasClean=${t.wasClean}`),Pe(t.code,t.reason,t.wasClean);return}P(e=>e+1),C=window.setTimeout(Fe,DS)}}),e.addEventListener(`error`,t=>{console.warn(`[localterm] websocket error`,t);try{e.close()}catch{}})};return a.current=()=>{if(!c){l=!1,u=!1,nt.current=!1,M(null),Xe(null),P(0),cI(`ready`),t?.(!1),C!==null&&(window.clearTimeout(C),C=null);try{b?.close()}catch{}b=null,Fe()}},Fe(),i.current=!0,()=>{c=!0,i.current=!1,ge&&(ge.removeEventListener(`pointerdown`,de),ge.removeEventListener(`pointermove`,pe),ge.removeEventListener(`pointerup`,me),ge.removeEventListener(`pointercancel`,me)),_e&&_e.removeEventListener(`pointerdown`,he),ae.dispose(),se.dispose(),ve.dispose(),ye.dispose(),be.dispose(),xe.dispose(),Se.dispose(),C!==null&&window.clearTimeout(C),w!==null&&window.clearTimeout(w),we(),H(),document.removeEventListener(`visibilitychange`,Me),je.disconnect();try{b?.close()}catch{}b=null,YP.detach(),U.dispose(),document.title=AS}},[]),(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;e&&(e.options.theme=ye)},[ye]),(0,b.useEffect)(()=>{if(!i.current||!r.current)return;let e=!1;return FP(De).then(()=>{if(e)return;let t=r.current;if(!t)return;t.options.fontFamily=ZE(De,Te),t.clearTextureAtlas();let n=E.current;n&&zP(t,n)}),()=>{e=!0}},[De,Te]);let it=(0,b.useCallback)(e=>{me(e),ge(null),zF(e)},[]),at=(0,b.useCallback)(e=>{xe(e),Ce(null),wF(e)},[]),ot=(0,b.useCallback)(e=>{Ee(e),JF(e)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;if(!e)return;e.options.fontSize=Oe;let t=E.current;t&&zP(e,t)},[Oe]);let st=(0,b.useCallback)(e=>{let t=ZP(e);ke(t),DF(t)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;if(!e)return;e.options.lineHeight=Ae;let t=E.current;t&&zP(e,t)},[Ae]);let ct=(0,b.useCallback)(e=>{let t=eF(e);je(t),AF(t)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;e&&(e.options.cursorStyle=Ie)},[Ie]);let lt=(0,b.useCallback)(e=>{Ne(e),Fe(null),xF(e)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;e&&(e.options.cursorBlink=Le)},[Le]);let dt=(0,b.useCallback)(e=>{Re(e),vF(e)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;e&&(e.options.scrollback=ze)},[ze]);let ft=(0,b.useCallback)(e=>{Be(e),NF(e)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;e&&(e.options.scrollOnUserInput=Ve)},[Ve]);let pt=(0,b.useCallback)(e=>{He(e),IF(e)},[]);(0,b.useEffect)(()=>{if(!i.current)return;let e=r.current;if(!e)return;let t=E.current;t&&zP(e,t)},[Ue,Ge]);let mt=(0,b.useCallback)(e=>{let t=rF(e);We(t),HF(t)},[]),ht=(0,b.useCallback)(e=>{let t=iF(e);Ke(t),GF(t)},[]),gt=(0,b.useCallback)(()=>{`Notification`in window&&Notification.requestPermission().then(e=>{Qe(e)})},[]);(0,b.useEffect)(()=>{if(!R)return;let e=c.current;e&&(e.focus(),e.select())},[R,H]);let _t=(0,b.useCallback)(e=>{if(!e){o.current?.clearDecorations(),fe({resultIndex:-1,resultCount:0});return}o.current?.findNext(e,{decorations:mI})},[]),vt=(0,b.useCallback)(e=>{e&&o.current?.findPrevious(e,{decorations:mI})},[]),yt=(0,b.useCallback)(()=>{te(!1),ue(``),fe({resultIndex:-1,resultCount:0}),o.current?.clearDecorations(),s.current?.()},[]),bt=(0,b.useCallback)(()=>{oe.current!==null&&(window.clearTimeout(oe.current),oe.current=null),re(!0)},[]),xt=(0,b.useCallback)(()=>{oe.current=window.setTimeout(()=>{oe.current=null,se.current||re(!1)},200)},[]),St=(0,b.useCallback)(e=>{ae(e),e||(oe.current!==null&&window.clearTimeout(oe.current),oe.current=window.setTimeout(()=>{oe.current=null,re(!1)},200))},[]);V.current=(0,b.useCallback)(()=>{B(e=>!e)},[]);let Ct=(0,b.useCallback)(()=>{B(!1),s.current?.()},[]),wt=(0,b.useCallback)(()=>{te(!0),B(!1),ne(e=>e+1)},[]);O.current=wt;let Tt=(0,b.useCallback)(e=>{let t=e.target.value;ue(t),_t(t)},[_t]),Et=(0,b.useCallback)(e=>{if(cF(e.nativeEvent,rt)){e.preventDefault(),e.currentTarget.select();return}if(e.key===`Escape`){e.preventDefault(),yt();return}e.key===`Enter`&&(e.preventDefault(),e.shiftKey?vt(le):_t(le))},[yt,_t,vt,rt,le]),Dt=(0,b.useCallback)(()=>{ee(!0),a.current?.(),l.current!==null&&window.clearTimeout(l.current),l.current=window.setTimeout(()=>{l.current=null,ee(!1)},800)},[]),Ot=(0,b.useCallback)(()=>{navigator.clipboard.writeText(MS).then(()=>{I(!0),u.current!==null&&window.clearTimeout(u.current),u.current=window.setTimeout(()=>{u.current=null,I(!1)},NS)}).catch(()=>{})},[]);(0,b.useEffect)(()=>()=>{oe.current!==null&&(window.clearTimeout(oe.current),oe.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),u.current!==null&&(window.clearTimeout(u.current),u.current=null)},[]),(0,b.useEffect)(()=>{if(tt.current=$e,!$e)return;let e=new URL(window.location.href);if(e.searchParams.get(hI)!==$e){e.searchParams.set(hI,$e);try{window.history.replaceState(null,``,e)}catch{}}},[$e]);let kt=_I($e),At=j!==null,jt=!At&&N>=2,Mt=At||jt,Nt=j!==null&&j.reason!==`shell-exited`||jt;(0,b.useEffect)(()=>{if(!Nt)return;let e=Date.now(),t=!1,n=null,i=i=>{if(t||nt.current)return;if(i){let e=r.current;e&&(e.write(UP(Ie,Le)),e.refresh(0,e.rows-1),e.focus()),a.current?.();return}let s=Date.now()-e<5e3?250:PS;n=window.setTimeout(o,s)},o=()=>{uI().then(i)};return o(),()=>{t=!0,n!==null&&window.clearTimeout(n)}},[Nt,Ie,Le]),(0,b.useEffect)(()=>{e?.(Mt),Mt&&B(!1)},[Mt,e]);let Pt=de.resultCount===0?`0/0`:`${de.resultIndex+1}/${de.resultCount}`,Ft=ve.colors.background??`#101010`,It=(0,b.useMemo)(()=>{let e=rt?`⌘`:`Ctrl+`,t=iD.map(e=>({id:`theme:${e.id}`,label:`Theme: ${e.name}`,category:`Theme`,action:()=>it(e.id)})),n=YE.map(e=>({id:`font:${e.id}`,label:`Font: ${e.name}`,category:`Font`,action:()=>at(e.id)}));return[...t,...n,{id:`find`,label:`Find in terminal`,category:`Search`,shortcut:`${e}F`,icon:(0,y.jsx)(vd,{className:`size-3.5`}),action:wt},{id:`new-shell`,label:`Open new shell`,category:`Tab`,shortcut:`Alt+T`,icon:(0,y.jsx)(_d,{className:`size-3.5`}),action:()=>{let e=document.getElementById(`new-shell-link`);e instanceof HTMLAnchorElement&&e.click()}},...AE.map(e=>({id:`cursor:${e.id}`,label:`Cursor: ${e.name}`,category:`Cursor`,action:()=>lt(e.id)})),{id:`cursor-blink`,label:`Cursor blink: ${Le?`On`:`Off`}`,category:`Cursor`,action:()=>dt(!Le)},{id:`font-size-up`,label:`Increase font size`,category:`Font`,shortcut:`${e}+`,icon:(0,y.jsx)(gd,{className:`size-3.5`}),action:()=>st(Oe+1)},{id:`font-size-down`,label:`Decrease font size`,category:`Font`,shortcut:`${e}-`,icon:(0,y.jsx)(gd,{className:`size-3.5`}),action:()=>st(Oe-1)},{id:`scroll-on-input`,label:`Pin to bottom on input: ${Ve?`On`:`Off`}`,category:`Scrollback`,action:()=>pt(!Ve)}]},[rt,it,at,wt,lt,Le,dt,Oe,st,Ve,pt]);return(0,y.jsxs)(`div`,{className:`h-dvh w-dvw`,style:{background:Ft},children:[(0,y.jsxs)(`div`,{className:`relative h-full w-full`,children:[(0,y.jsx)(`div`,{ref:n,"aria-label":`terminal session`,className:`absolute`,style:{top:Ge,right:Ue,bottom:Ge,left:Ue}}),(0,y.jsx)(`div`,{ref:k,className:`xterm-scrollbar-track`,style:{top:Ge,right:Ue,bottom:Ge},children:(0,y.jsx)(`div`,{ref:A,className:`xterm-scrollbar-thumb`})}),j===null?null:(0,y.jsx)(Qx,{variant:`destructive`,role:`status`,"aria-live":`polite`,className:`absolute top-2 left-3 z-10`,children:j.reason===`shell-exited`?j.exitCode===null?`exited`:`exited · code ${j.exitCode}`:`disconnected · code ${j.closeCode}`}),(0,y.jsxs)(`div`,{className:qf(`absolute right-0 top-0 z-10 flex flex-col items-end pr-3 pt-1`,ce?`pointer-events-auto`:`pointer-events-none`),onMouseEnter:bt,onMouseLeave:xt,children:[(0,y.jsx)(`div`,{"aria-hidden":`true`,className:qf(`pointer-events-auto mr-0.5 h-[2px] w-5 rounded-full bg-muted-foreground/25 transition-opacity duration-150`,ce||R?`opacity-0`:`opacity-100`)}),!R&&(0,y.jsxs)(`div`,{role:`toolbar`,"aria-label":`terminal actions`,className:qf(`mt-1 flex items-center gap-0.5 rounded-md border border-border/60 bg-background/70 p-0.5 text-muted-foreground shadow-xs backdrop-blur-md`,`transition-[opacity,transform] duration-200 ease-snappy`,ce?`translate-y-0 opacity-100`:`pointer-events-none -translate-y-1 opacity-0`),onMouseDown:e=>e.preventDefault(),onKeyDown:()=>s.current?.(),children:[(0,y.jsx)(hD,{themeId:pe,onThemeChange:it,onThemePreview:ge,fontId:be,onFontChange:at,onFontPreview:Ce,nerdFontEnabled:Te,onNerdFontEnabledChange:ot,fontSize:Oe,onFontSizeChange:st,lineHeight:Ae,onLineHeightChange:ct,cursorStyle:Me,onCursorStyleChange:lt,onCursorStylePreview:Fe,cursorBlink:Le,onCursorBlinkChange:dt,scrollback:ze,onScrollbackChange:ft,scrollOnUserInput:Ve,onScrollOnUserInputChange:pt,paddingX:Ue,onPaddingXChange:mt,paddingY:Ge,onPaddingYChange:ht,notificationsPermission:Ze,onNotificationsPermissionRequest:gt,sessionInfo:Je,onPopoverOpenChange:St,onClose:s.current??void 0}),(0,y.jsx)(Bx,{variant:`ghost`,size:`icon-sm`,onClick:wt,"aria-label":`find in terminal`,className:`hover:text-foreground`,children:(0,y.jsx)(vd,{})}),(0,y.jsx)(Bx,{variant:`ghost`,size:`icon-sm`,nativeButton:!1,"aria-label":`open a new shell in a new browser tab`,render:(0,y.jsx)(`a`,{id:`new-shell-link`,href:kt,target:`_blank`,rel:`noopener noreferrer`}),className:`hover:text-foreground`,children:(0,y.jsx)(_d,{})})]}),R&&(0,y.jsxs)(yS,{role:`search`,"aria-label":`find in terminal`,className:`mt-1 w-80 border-border/60 bg-background/70 text-muted-foreground shadow-xs backdrop-blur-md dark:bg-background/70`,children:[(0,y.jsx)(TS,{ref:c,type:`search`,value:le,onChange:Tt,onKeyDown:Et,placeholder:`Find`,"aria-label":`find query`,className:`text-xs`}),(0,y.jsxs)(xS,{align:`inline-end`,children:[(0,y.jsx)(wS,{role:`status`,"aria-label":`match count`,className:`text-xs tabular-nums`,children:Pt}),(0,y.jsx)(CS,{size:`icon-xs`,onClick:()=>vt(le),disabled:de.resultCount===0,"aria-label":`previous match`,children:(0,y.jsx)(fd,{})}),(0,y.jsx)(CS,{size:`icon-xs`,onClick:()=>_t(le),disabled:de.resultCount===0,"aria-label":`next match`,children:(0,y.jsx)(dd,{})})]})]})]})]}),(0,y.jsx)(tC,{open:z,onClose:Ct,commands:It}),(0,y.jsx)(Vx,{open:Mt,children:(0,y.jsx)(Wx,{children:j===null?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(Gx,{children:[(0,y.jsxs)(qx,{className:`flex items-center gap-2`,children:[(0,y.jsx)(ES,{"aria-hidden":`true`,role:`presentation`,"aria-label":void 0}),`Lost connection`]}),(0,y.jsx)(Jx,{children:`The localterm server isn't responding. Start it again from your terminal, then retry.`})]}),(0,y.jsxs)(yS,{children:[(0,y.jsx)(TS,{readOnly:!0,value:MS,"aria-label":`restart command`,className:`font-mono`}),(0,y.jsx)(xS,{align:`inline-end`,children:(0,y.jsx)(CS,{size:`icon-xs`,onClick:Ot,"aria-label":F?`Copied`:`Copy restart command`,children:F?(0,y.jsx)(ud,{}):(0,y.jsx)(pd,{})})})]}),(0,y.jsx)(Kx,{children:(0,y.jsxs)(Yx,{onClick:Dt,disabled:L,children:[L?(0,y.jsx)(ES,{"data-icon":`inline-start`}):null,`Retry`]})})]}):j.reason===`shell-exited`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(Gx,{children:[(0,y.jsx)(qx,{children:`Shell ended`}),(0,y.jsx)(Jx,{children:j.exitCode===null||j.exitCode===0?`Open a new shell to keep going, or close this tab.`:`Exit code ${j.exitCode}. Open a new shell to keep going.`})]}),(0,y.jsx)(Kx,{children:(0,y.jsx)(Yx,{onClick:()=>window.open(kt,`_blank`,`noopener,noreferrer`),children:`New shell`})})]}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(Gx,{children:[(0,y.jsxs)(qx,{className:`flex items-center gap-2`,children:[(0,y.jsx)(ES,{"aria-hidden":`true`,role:`presentation`,"aria-label":void 0}),`Connection lost`]}),(0,y.jsxs)(Jx,{children:[`The browser lost its connection to the localterm daemon (close code`,` `,j.closeCode,j.closeReason?` · ${j.closeReason}`:``,`). Reconnecting spawns a fresh shell. The previous one can't be reattached.`]})]}),(0,y.jsx)(Kx,{children:(0,y.jsxs)(Yx,{onClick:Dt,disabled:L,children:[L?(0,y.jsx)(ES,{"data-icon":`inline-start`}):null,`Reconnect`]})})]})})})]})},yI=()=>{let e=(0,b.useRef)(!1),t=(0,b.useRef)(!1);return(0,b.useEffect)(()=>{let n=n=>{e.current||t.current&&n.preventDefault()},r=()=>window.addEventListener(`beforeunload`,n);return window.addEventListener(`keydown`,r,{once:!0}),()=>{window.removeEventListener(`keydown`,r),window.removeEventListener(`beforeunload`,n)}},[]),(0,y.jsx)(vI,{onModalOpenChange:(0,b.useCallback)(t=>{e.current=t},[]),onForegroundProcessChange:(0,b.useCallback)(e=>{t.current=e},[])})};sI(),cI(`ready`),(()=>{if(typeof document>`u`||document.getElementById(`localterm-google-fonts`))return;let e=QE();if(!e)return;let t=document.createElement(`link`);t.id=YS,t.rel=`stylesheet`,t.href=e,document.head.appendChild(t)})();var bI=document.getElementById(`root`);if(!bI)throw Error(`Root element not found`);(0,x.createRoot)(bI).render((0,y.jsx)(b.StrictMode,{children:(0,y.jsx)(EE,{delay:300,children:(0,y.jsx)(yI,{})})}));
|
|
115
|
+
//# sourceMappingURL=index-TQyjKb-9.js.map
|