@avantf/dsh-mission 0.3.0
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/LICENSE +21 -0
- package/README.md +249 -0
- package/cordis.patch.yml +13 -0
- package/lib/client.js +225 -0
- package/lib/dsh-build.json +16 -0
- package/lib/envinit-bootstrap.js +334 -0
- package/lib/index.js +7021 -0
- package/lib/interface-version.json +4 -0
- package/lib/mission-core/capacity.d.ts +100 -0
- package/lib/mission-core/continuation.d.ts +106 -0
- package/lib/mission-core/dispatch.d.ts +165 -0
- package/lib/mission-core/engine.d.ts +331 -0
- package/lib/mission-core/index.d.ts +25 -0
- package/lib/mission-core/liveness.d.ts +99 -0
- package/lib/mission-core/prompt.d.ts +112 -0
- package/lib/mission-core/resources.d.ts +57 -0
- package/lib/mission-core/timing.d.ts +37 -0
- package/lib/mission-core/tree.d.ts +447 -0
- package/lib/mission-core/trouble.d.ts +40 -0
- package/lib/mission-core/types.d.ts +409 -0
- package/lib/mission-core/wellformed.d.ts +98 -0
- package/lib/types/claims.d.ts +3 -0
- package/lib/types/claims.d.ts.map +1 -0
- package/lib/types/client/MissionTreeView.d.ts +247 -0
- package/lib/types/client/MissionTreeView.d.ts.map +1 -0
- package/lib/types/client/api.d.ts +184 -0
- package/lib/types/client/api.d.ts.map +1 -0
- package/lib/types/client/contract.d.ts +209 -0
- package/lib/types/client/contract.d.ts.map +1 -0
- package/lib/types/client/index.d.ts +48 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/seat.d.ts +26 -0
- package/lib/types/client/seat.d.ts.map +1 -0
- package/lib/types/client/styles.d.ts +6 -0
- package/lib/types/client/styles.d.ts.map +1 -0
- package/lib/types/coldResume.d.ts +123 -0
- package/lib/types/coldResume.d.ts.map +1 -0
- package/lib/types/domain.d.ts +93 -0
- package/lib/types/domain.d.ts.map +1 -0
- package/lib/types/envinit.d.ts +126 -0
- package/lib/types/envinit.d.ts.map +1 -0
- package/lib/types/executorSession.d.ts +129 -0
- package/lib/types/executorSession.d.ts.map +1 -0
- package/lib/types/faces.d.ts +30 -0
- package/lib/types/faces.d.ts.map +1 -0
- package/lib/types/host.d.ts +752 -0
- package/lib/types/host.d.ts.map +1 -0
- package/lib/types/index.d.ts +48 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/interface_gate.d.ts +51 -0
- package/lib/types/interface_gate.d.ts.map +1 -0
- package/lib/types/log.d.ts +18 -0
- package/lib/types/log.d.ts.map +1 -0
- package/lib/types/projectionCache.d.ts +22 -0
- package/lib/types/projectionCache.d.ts.map +1 -0
- package/lib/types/prompt.d.ts +106 -0
- package/lib/types/prompt.d.ts.map +1 -0
- package/lib/types/source.d.ts +22 -0
- package/lib/types/source.d.ts.map +1 -0
- package/lib/types/store.d.ts +20 -0
- package/lib/types/store.d.ts.map +1 -0
- package/lib/types/timeFormat.d.ts +56 -0
- package/lib/types/timeFormat.d.ts.map +1 -0
- package/lib/types/tools.d.ts +34 -0
- package/lib/types/tools.d.ts.map +1 -0
- package/lib/types/wellformed.d.ts +43 -0
- package/lib/types/wellformed.d.ts.map +1 -0
- package/lib/types/wire.d.ts +178 -0
- package/lib/types/wire.d.ts.map +1 -0
- package/lib/types/workerEvents.d.ts +36 -0
- package/lib/types/workerEvents.d.ts.map +1 -0
- package/lib/types/workerSessions.d.ts +256 -0
- package/lib/types/workerSessions.d.ts.map +1 -0
- package/package.json +145 -0
package/lib/client.js
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
window.__ModuleLoader__.load({ id: "@avantf/dsh-mission", factory: (require) => {
|
|
2
|
+
var module = { exports: {} }; var exports = module.exports;
|
|
3
|
+
"use strict";var cc=Object.create;var Ge=Object.defineProperty;var uc=Object.getOwnPropertyDescriptor;var lc=Object.getOwnPropertyNames;var dc=Object.getPrototypeOf,fc=Object.prototype.hasOwnProperty;var tr=(e,t)=>{for(var n in t)Ge(e,n,{get:t[n],enumerable:!0})},nr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of lc(t))!fc.call(e,o)&&o!==n&&Ge(e,o,{get:()=>t[o],enumerable:!(r=uc(t,o))||r.enumerable});return e};var pc=(e,t,n)=>(n=e!=null?cc(dc(e)):{},nr(t||!e||!e.__esModule?Ge(n,"default",{value:e,enumerable:!0}):n,e)),hc=e=>nr(Ge({},"__esModule",{value:!0}),e);var Dd={};tr(Dd,{apply:()=>Md,inject:()=>Ad,name:()=>Td});module.exports=hc(Dd);var j=require("react");var I={};tr(I,{BIGINT_FORMAT_RANGES:()=>Qe,CONSTANT_CATCH:()=>pr,Class:()=>Dt,NUMBER_FORMAT_RANGES:()=>Re,aborted:()=>ee,allowsEval:()=>Vt,assert:()=>xc,assertEqual:()=>mc,assertIs:()=>yc,assertNever:()=>bc,assertNotEqual:()=>gc,assignProp:()=>Y,attachSchema:()=>tt,base64ToUint8Array:()=>dr,base64urlToUint8Array:()=>Lc,cached:()=>Te,captureStackTrace:()=>qe,cleanEnum:()=>Dc,cleanRegex:()=>Ae,clone:()=>Q,cloneDef:()=>zc,codePointLength:()=>Me,constantCatch:()=>hr,createTransparentProxy:()=>Pc,defineLazy:()=>or,defineLazyInternal:()=>Z,derived:()=>Vc,esc:()=>Ft,escapeRegex:()=>me,explicitlyAborted:()=>Jt,extend:()=>Tc,finalizeIssue:()=>ue,floatSafeRemainder:()=>jt,getElementAtPath:()=>Sc,getEnumValues:()=>ze,getLengthableOrigin:()=>De,getParsedType:()=>Ec,getSizableOrigin:()=>lr,hexToUint8Array:()=>Fc,hide:()=>nt,installLazyProp:()=>Kc,isObject:()=>_e,isPlainObject:()=>he,issue:()=>ke,joinValues:()=>Xe,jsonStringifyReplacer:()=>Se,members:()=>Ht,merge:()=>Nc,mergeDefs:()=>ce,normalizeParams:()=>S,nullish:()=>Lt,numKeys:()=>Ic,objectClone:()=>wc,omit:()=>Zc,optionalKeys:()=>Wt,own:()=>de,parsedType:()=>Kt,partial:()=>Rc,pick:()=>Oc,prefixIssues:()=>Ce,primitiveTypes:()=>cr,promiseAllObject:()=>kc,propertyKeyTypes:()=>Bt,randomString:()=>$c,rawShape:()=>Ne,required:()=>Cc,safeExtend:()=>Ac,shallowClone:()=>ar,slugify:()=>Ut,stringifyPrimitive:()=>Ye,toZod:()=>vc,uint8ArrayToBase64:()=>fr,uint8ArrayToBase64url:()=>jc,uint8ArrayToHex:()=>Uc,unwrapMessage:()=>we});function mc(e){return e}function gc(e){return e}function vc(){return e=>e}function yc(e){}function bc(e){throw new Error("Unexpected value in exhaustive check")}function xc(e){}function ze(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Xe(e,t="|"){return e.map(n=>Ye(n)).join(t)}function Se(e,t){return typeof t=="bigint"?t.toString():t}var Mt=class{constructor(t){this._getter=t,this._value=void 0}get value(){let t=this._getter;return t!==void 0&&(this._value=t(),this._getter=void 0),this._value}};function Te(e){return new Mt(e)}function Lt(e){return e==null}function Ae(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function jt(e,t){let n=e/t,r=Math.round(n),o=4*Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}var rr=Symbol("evaluating");function or(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==rr)return r===void 0&&(r=rr,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function wc(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Y(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ne(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function ae(e){return Ne(e._zod.def)??e._zod.def.shape}function sr(e,t,n){Object.defineProperty(e,t,{get(){let r=n();return Y(this,t,r),r},enumerable:!0,configurable:!0})}function ir(e,t,n){t in e?Y(e,t,n):e[t]=n}function pe(e,t,n,r){let o=ae(t);for(let s of n){let i=Object.getOwnPropertyDescriptor(o,s);i.enumerable&&(i.get?sr(e,s,()=>{let a=t._zod.def.shape[s];return r?r(a,s):a}):ir(e,s,r?r(i.value,s):i.value))}}function _c(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?sr(e,n,()=>t[n]):ir(e,n,r.value))}}function ce(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function zc(e){return ce(e._zod.def)}function Sc(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function kc(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let o={};for(let s=0;s<t.length;s++)o[t[s]]=r[s];return o})}function $c(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function Ft(e){return JSON.stringify(e)}function Ut(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var qe="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Vt=Te(()=>{if(X.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function he(e){if(_e(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(_e(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ar(e){return he(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function Ic(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}var Ec=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},Bt=new Set(["string","number","symbol"]),cr=new Set(["string","number","bigint","boolean","symbol","undefined"]);function me(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Q(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function S(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Pc(e){let t;return new Proxy({},{get(n,r,o){return t??(t=e()),Reflect.get(t,r,o)},set(n,r,o,s){return t??(t=e()),Reflect.set(t,r,o,s)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,o){return t??(t=e()),Reflect.defineProperty(t,r,o)}})}function Ye(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function Wt(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Re={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Qe={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function Oc(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let s={};return pe(s,e,et(e,t)),Q(e,ce(n,{shape:s,checks:[]}))}function et(e,t){let n=ae(e),r=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,o)?.enumerable)throw new Error(`Unrecognized key: "${String(o)}"`);t[o]&&r.push(o)}return r}function Zc(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(et(e,t)),i={};return pe(i,e,Reflect.ownKeys(ae(e)).filter(a=>!s.has(a))),Q(e,ce(n,{shape:i,checks:[]}))}function Tc(e,t){if(!he(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let o=ae(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Q(e,ce(e._zod.def,{shape:ur(e,t)}))}function ur(e,t){let n={};return pe(n,e,Reflect.ownKeys(ae(e))),_c(n,t),n}function Ac(e,t){if(!he(t))throw new Error("Invalid input to safeExtend: expected a plain object");return Q(e,ce(e._zod.def,{shape:ur(e,t)}))}function Nc(e,t){if(!t?._zod?.def)throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n={};pe(n,e,Reflect.ownKeys(ae(e))),pe(n,t,Reflect.ownKeys(ae(t)));let r=ce(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Q(e,r)}function Rc(e,t,n,r="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw new Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(et(t,n)):void 0,c={};return pe(c,t,Reflect.ownKeys(ae(t)),e&&((u,f)=>a&&!a.has(f)?u:new e({type:"optional",innerType:u}))),Q(t,ce(t._zod.def,{shape:c,checks:[]}))}function Cc(e,t,n){let r=n?new Set(et(t,n)):void 0,o={};return pe(o,t,Reflect.ownKeys(ae(t)),(s,i)=>r&&!r.has(i)?s:new e({type:"nonoptional",innerType:s})),Q(t,ce(t._zod.def,{shape:o}))}function ee(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Jt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ce(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function we(e){return typeof e=="string"?e:e?.message}function tt(e,t,n){var r;for(let o=t;o<e.length;o++)(r=e[o]).schema??(r.schema=n)}function ue(e,t,n){var r;let o=e.inst?._zod?.traits;o?.has("$ZodType")&&(o.has("$ZodCheck")?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:we(e.inst?._zod.def?.error?.(e))??we(s?.(e))??we(t?.error?.(e))??we(n.customError?.(e))??we(n.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e))c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__"||(a[c]=e[c]);return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=e.input),a}function lr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}var Mc=/[\uD800-\uDBFF]/;function Me(e){let t=e.length;if(!Mc.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)===55296&&(e.charCodeAt(r+1)&64512)===56320&&(n--,r++);return n}function De(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Kt(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function ke(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function Dc(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function dr(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function fr(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function Lc(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return dr(t+n)}function jc(e){return fr(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Fc(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function Uc(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Dt=class{constructor(...t){}};function Ht(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Bc(e,n,r.value)}}function de(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function nt(e,t,n){return de(e,t,n,!1)}function Vc(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return de(this,n,r(this))},set(o){de(this,n,o)}})}return t}function Bc(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:de(this,t,n.bind(this))},set(r){de(this,t,r)}})}function Wc(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Ct,le=!1,Jc={configurable:!0,get(){le=!0}};function Z(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Ct!==e._zod){Ct=void 0;return}Ct=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Jc);let o=le;le=!1;try{let s=n(this);return le?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s}),le=le||o,s}catch(s){throw delete this[t],le=le||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function Kc(e,t,n,r){let o=Wc(e,t);o&&Object.defineProperty(o,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,s),s.value=n(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:s})}})}var pr="~constantCatch";function hr(e){let t=()=>e;return t[pr]=!0,t}var mr;var Gt={value:void 0,enumerable:!1},gr="captureStackTrace"in Error?Error:null;function Hc(e){let t=gr;if(t){let n=t.stackTraceLimit;if(typeof n=="number"){try{t.stackTraceLimit=0}catch{return gr=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function h(e,t,n,r){let o={};function s(p){this.def=p,this.constr=d,this.traits=new Set}s.prototype=o;let i=n,a=i&&new WeakSet;function c(p,l){if(p._zod){if(p._zod.traits.has(e))return}else{Gt.value=new s(l);try{Object.defineProperty(p,"_zod",Gt)}finally{Gt.value=void 0}}if(p._zod.traits.add(e),t(p,l),a){let y=Object.getPrototypeOf(p),v=p._zod.constr.prototype,b=y;for(;b&&b!==v;)b=Object.getPrototypeOf(b);let x=b??y;a.has(x)||(a.add(x),Ht(x,i))}let g=d.prototype;for(let y in g)Object.prototype.hasOwnProperty.call(g,y)&&(y in p||(p[y]=g[y].bind(p)))}let u=r?.Parent??Object;class f extends u{}Object.defineProperty(f,"name",{value:e});function d(p){let l=r?.Parent?Hc(f):this;c(l,p);let g=l._zod.deferred;if(g){for(let v of g)v();l._zod.deferred=void 0}let y=globalThis.__zod_globalConfig?.postProcessor;return y&&y(l),l}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:p=>r?.Parent&&p instanceof r.Parent?!0:p?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var te=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},$e=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(mr=globalThis).__zod_globalConfig??(mr.__zod_globalConfig={});var X=globalThis.__zod_globalConfig;function ne(e){return e&&Object.assign(X,e),X}function Gc(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Se,2)),e.message}function Xc(e){this._zod.message=e}var qc={get:Gc,set:Xc,enumerable:!0,configurable:!0},qt={value:void 0,enumerable:!1},vr=new WeakSet([Object.prototype,Error.prototype]),yr=(e,t)=>{e.name="$ZodError",qt.value=t,Object.defineProperty(e,"issues",qt),qt.value=void 0,Object.defineProperty(e,"message",qc);let n=Object.getPrototypeOf(e);vr.has(n)||(vr.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let r=()=>this.message;return Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,"toString",{value:r,configurable:!0,writable:!0})}}))},br=h("$ZodError",yr),Vd=h("$ZodError",yr,void 0,{Parent:Error});function Yc(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t==="__proto__"?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function xr(e,t=n=>n.message){let n={},r=[];for(let o of e.issues)o.path.length>0?Yc(n,o.path[0],()=>[]).push(t(o)):r.push(t(o));return{formErrors:r,fieldErrors:n}}function wr(e,t=n=>n.message){let n={_errors:[]},r=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map(a=>r({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")r({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")r({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)n._errors.push(t(i));else{let c=n,u=0;for(;u<a.length;){let f=a[u],d=u===a.length-1;if(f==="_errors"){d&&c._errors.push(t(i)),u++;continue}Object.prototype.hasOwnProperty.call(c,f)||Object.defineProperty(c,f,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let p=c[f];d&&p._errors.push(t(i)),c=p,u++}}}};return r(e),n}function rt(e,t){return{callee:t?.callee??e,Err:t?.Err}}var ot=e=>{let t=(n,r,o,s)=>{let i=o?{...o,async:!1}:{async:!1},a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new te;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>ue(u,i,ne())));throw qe(c,s?.callee??t),c}return a.value};return t};var st=e=>{let t=async(n,r,o,s)=>{let i=o?{...o,async:!0}:{async:!0},a=n._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(s?.Err??e)(a.issues.map(u=>ue(u,i,ne())));throw qe(c,s?.callee??t),c}return a.value};return t};var it=e=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new te;return s.issues.length?_r(e,s.issues,o):{success:!0,data:s.value}};function _r(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(o=>ue(o,n,ne()))),t=void 0,n=void 0),r},set error(o){r=o,t=void 0,n=void 0}}}var at=e=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},s=t._zod.run({value:n,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?_r(e,s.issues,o):{success:!0,data:s.value}};var Qc=Symbol.for("zod.compile.invalid"),eu=Symbol.for("zod.compile.fallback"),Yt=(e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Qc)return!0;if(r.definite===!0&&n===void 0)return!1}return tu(e,t,n)};function tu(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,s;if(o?(r[eu]=!0,s=o({value:t,issues:[]},r)):s=e._zod.run({value:t,issues:[]},r),s instanceof Promise)throw new te;return s.issues.length===0}var Qt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length===0},zr=e=>{let t=ot(e),n=(r,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(r,o,a,rt(n,i))};return n};var Sr=e=>{let t=ot(e),n=(r,o,s,i)=>t(r,o,s,rt(n,i));return n};var kr=e=>{let t=st(e),n=async(r,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(r,o,a,rt(n,i))};return n};var $r=e=>{let t=st(e),n=async(r,o,s,i)=>await t(r,o,s,rt(n,i));return n};var Ir=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return it(e)(t,n,o)};var Er=e=>(t,n,r)=>it(e)(t,n,r);var Pr=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return at(e)(t,n,o)};var Or=e=>async(t,n,r)=>at(e)(t,n,r);var Zr=/^[cC][0-9a-z]{6,}$/,Tr=/^[0-9a-z]+$/,Ar=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Nr=/^[0-9a-vA-V]{20}$/,Rr=/^[A-Za-z0-9]{27}$/,Cr=/^[a-zA-Z0-9_-]{21}$/;function Mr(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Dr=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Lr=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,tn=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;var jr=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var nu="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Fr(){return new RegExp(nu,"u")}var Ur=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var Br=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Wr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Jr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kr=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Hr=/^https?$/,Gr=/^\+[1-9]\d{6,14}$/;var Xr="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";function ru(e){return new RegExp(`^${e}$`)}var qr=ru(Xr);function en(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Yr(e){return new RegExp(`^${en(e)}$`)}function Qr(e){let t=["Z"];e.offset&&t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${en({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,r=e.local?`${n}|${en({precision:e.precision})}`:n;return new RegExp(`^${Xr}T(?:${r})$`)}var eo=/^[\s\S]{0,}$/;var nn=/^-?\d+(?:\.\d+)?$/,to=/^(?:true|false)$/i;var no=/^[^A-Z]*$/,ro=/^[^a-z]*$/;var V=h("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])});var rn=e=>{let t=e.value;return!Lt(t)&&t.length!==void 0},ct={number:"number",bigint:"bigint",object:"date"},on=h("$ZodCheckLessThan",(e,t)=>{V.init(e,t);let n=ct[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:ct[typeof r.value]??n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sn=h("$ZodCheckGreaterThan",(e,t)=>{V.init(e,t);let n=ct[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:ct[typeof r.value]??n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),oo=h("$ZodCheckMultipleOf",(e,t)=>{V.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):jt(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),so=h("$ZodCheckNumberFormat",(e,t)=>{V.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,s]=Re[t.format];e._zod.check=i=>{let a=i.value;if(n){if(!Number.isInteger(a)){i.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}a<o&&i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),a>s&&i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var io=h("$ZodCheckMaxLength",(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.check=r=>{let o=r.value,s=o.length;if((typeof o=="string"&&s>t.maximum?Me(o):s)<=t.maximum)return;let a=De(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ao=h("$ZodCheckMinLength",(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.check=r=>{let o=r.value,s=o.length;if((typeof o=="string"&&s>=t.minimum&&s<t.minimum*2?Me(o):s)>=t.minimum)return;let a=De(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),co=h("$ZodCheckLengthEquals",(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.check=r=>{let o=r.value,s=o.length,i=typeof o=="string"&&s>=t.length&&s<=t.length*2?Me(o):s;if(i===t.length)return;let a=De(o),c=i>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),je=h("$ZodCheckStringFormat",(e,t)=>{var n,r;V.init(e,t),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),uo=h("$ZodCheckRegex",(e,t)=>{je.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),lo=h("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=no),je.init(e,t)}),fo=h("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ro),je.init(e,t)}),po=h("$ZodCheckIncludes",(e,t)=>{V.init(e,t);let n=me(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),ho=h("$ZodCheckStartsWith",(e,t)=>{V.init(e,t);let n=new RegExp(`^${me(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),mo=h("$ZodCheckEndsWith",(e,t)=>{V.init(e,t);let n=new RegExp(`.*${me(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});var go=h("$ZodCheckOverwrite",(e,t)=>{V.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});var ut=class{constructor(t=[],n={}){this.content=[],this.indent=0,this.args=t,this.closed=n}indented(t){this.indent+=1;try{t(this)}finally{this.indent-=1}}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
|
|
4
|
+
`).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),s=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(let i of s)this.content.push(i)}compile(){let t=Function,n=this?.content??[""];return new t(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
|
+
${n.join(`
|
|
6
|
+
`)}
|
|
7
|
+
};`)(...Object.values(this.closed))}};var yo={major:4,minor:6,patch:5};var N=h("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=yo;let r=e._zod.def.checks,o=e._zod.traits.has("$ZodCheck")?[e,...r??[]]:r?.length?[...r]:[];for(let s of o)for(let i of s._zod.onattach)i(e);if(o.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(a,c,u)=>{if(a.memo)return a;let f=ee(a),d;for(let p of c){if(p._zod.def.when){if(Jt(a)||!p._zod.def.when(a))continue}else if(f)continue;let l=a.issues.length,g=p._zod.check(a);if(g instanceof Promise&&u?.async===!1)throw new te;if(d||g instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await g,a.issues.length!==l&&(tt(a.issues,l,e),f||(f=ee(a,l)))});else{if(a.issues.length===l)continue;tt(a.issues,l,e),f||(f=ee(a,l))}}return d?d.then(()=>a):a},i=(a,c,u)=>{if(ee(a))return a.aborted=!0,a;let f=s(c,o,u);if(f instanceof Promise){if(u.async===!1)throw new te;return f.then(d=>e._zod.parse(d,u))}return e._zod.parse(f,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let f=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(d=>i(d,a,c)):i(f,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new te;return u.then(f=>s(f,o,c))}return s(u,o,c)}}},{get"~standard"(){return nt(this,"~standard",cn(this))},set"~standard"(e){de(this,"~standard",e)}}),Po=(e,t)=>e.issues.length?{issues:e.issues.map(n=>ue(n,t,ne()))}:{value:e.value};async function su(e,t){let n={async:!0};return Po(await e._zod.run({value:t,issues:[]},n),n)}function cn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Po(r,n)}catch{}return su(e,t)},vendor:"zod",version:1}}var pt=h("$ZodString",(e,t)=>{N.init(e,t),e._zod.pattern=t.pattern??eo,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),A=h("$ZodStringFormat",(e,t)=>{je.init(e,t),pt.init(e,t)}),Oo=h("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Lr),A.init(e,t)}),Zo=h("$ZodUUID",(e,t)=>{if(t.version){let r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=tn(r))}else t.pattern??(t.pattern=tn());A.init(e,t)}),To=h("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=jr),A.init(e,t)}),Ao=1,dt=2;function No(e){try{return typeof URL<"u"&&typeof URL.canParse=="function"?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function iu(e,t){return!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t)?No(e)||dt:au(e,t)}function au(e,t){if(!t.normalize&&t.protocol?.source===Hr.source&&!/^https?:\/\//i.test(e))return Ao;try{if(typeof URL<"u"){let n=URL;if(typeof n.parse=="function")return n.parse(e)??dt}return new URL(e)}catch{return dt}}var cu=/[\t\n\r]/g;function bo(e){return e.replace(cu,"")}function uu(e,t){return t.lastIndex=0,t.test(e.hostname)}function lu(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Ro=h("$ZodURL",(e,t)=>{A.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),o=iu(r,t);if(o===Ao){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}if(o===dt){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort});return}if(o===!0){n.value=bo(r);return}t.hostname&&!uu(o,t.hostname)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!lu(o,t.protocol)&&n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?o.href:bo(r);return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Co=h("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Fr()),A.init(e,t)}),Mo=h("$ZodNanoID",(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw new Error(`Invalid nanoid length: ${t.length}`);t.pattern??(t.pattern=t.length===void 0?Cr:Mr(t.length)),A.init(e,t)}),Do=h("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Zr),A.init(e,t)}),Lo=h("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Tr),A.init(e,t)}),jo=h("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ar),A.init(e,t)}),Fo=h("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Nr),A.init(e,t)}),Uo=h("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Rr),A.init(e,t)}),Vo=h("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Qr(t)),A.init(e,t)}),Bo=h("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=qr),A.init(e,t)}),Wo=h("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Yr(t)),A.init(e,t)}),Jo=h("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Dr),A.init(e,t)}),Ko=h("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Ur),A.init(e,t)}),du=/^[0-9a-fA-F:.]+$/;function Ho(e){return du.test(e)?No(`http://[${e}]`):!1}var Go=h("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Vr),A.init(e,t),e._zod.check=n=>{Ho(n.value)||n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}});var Xo=h("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Br),A.init(e,t)});function fu(e){let t=e.split("/");if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let o=Number(r);return`${o}`!==r||o<0||o>128?!1:Ho(n)}var qo=h("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Wr),A.init(e,t),e._zod.check=n=>{fu(n.value)||n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}});function Yo(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var un=/^[0-9a-zA-Z+/]*={0,2}$/,Qo=h("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=un),A.init(e,t),e._zod.check=n=>{Yo(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}),ht=/^[A-Za-z0-9_-]*$/;function pu(e){if(!ht.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return Yo(n)}var es=h("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ht),A.init(e,t),e._zod.check=n=>{pu(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),ts=h("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Gr),A.init(e,t)});function hu(e,t=null){try{let n=e.split(".");if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}var ns=h("$ZodJWT",(e,t)=>{A.init(e,t),e._zod.check=n=>{hu(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}});var ln=h("$ZodNumber",(e,t)=>{N.init(e,t),e._zod.pattern=nn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let o=n.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return n;let s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:String(o):void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),n}}),rs=h("$ZodNumberFormat",(e,t)=>{so.init(e,t),ln.init(e,t)}),os=h("$ZodBoolean",(e,t)=>{N.init(e,t),e._zod.pattern=to,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let o=n.value;return typeof o=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}});var ss=h("$ZodAny",(e,t)=>{N.init(e,t),e._zod.parse=n=>n}),is=h("$ZodUnknown",(e,t)=>{N.init(e,t),e._zod.parse=n=>n}),as=h("$ZodNever",(e,t)=>{N.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function xo(e,t,n){e.issues.length&&t.issues.push(...Ce(n,e.issues)),t.value[n]=e.value}var cs=h("$ZodArray",(e,t)=>{N.init(e,t);let n=X.memoizer;n?.attach(e),e._zod.parse=(r,o)=>{let s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=n?n.alloc(e,r,Array(s.length),o):Array(s.length);let i=[],a=o?.abortEarly;for(let c=0;c<s.length;c++){let u=s[c],f=t.element._zod.run({value:u,issues:[]},o);if(f instanceof Promise)i.push(f.then(d=>xo(d,r,c)));else if(xo(f,r,c),a&&f.issues.length!==0&&ee(f))break}return i.length?Promise.all(i).then(()=>r):r}});function ft(e,t,n,r,o,s){let i=n in r,a=s==="optional";if(!(!i&&a&&o==="optional")){if(e.issues.length){if(o!==void 0&&a&&!i)return;t.issues.push(...Ce(n,e.issues))}if(!i&&o===void 0){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?(i||o==="defaulted"&&!a)&&(t.value[n]=void 0):t.value[n]=e.value}}var mu=[];function us(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:mu,o=r.length?[...t,...r]:t;for(let i of o)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=Wt(e.shape);return{...e,allKeys:o,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function ls(e,t,n,r,o,s,i){let a=[],c=o.keySet,u=o.catchall._zod,f=u.def.type,d=u.optin,p=u.optout,l=0;for(let g in t){if(i&&n.issues.length!==l){if(ee(n,l))break;l=n.issues.length}if(c.has(g))continue;if(g==="__proto__"){f==="never"&&a.push(g);continue}if(f==="never"){a.push(g);continue}let y=u.run({value:t[g],issues:[]},r);y instanceof Promise?e.push(y.then(v=>ft(v,n,g,t,d,p))):ft(y,n,g,t,d,p)}return a.length&&n.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var gu=h("$ZodObject",(e,t)=>{N.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape"),r=n?.get?n.get.raw:t.shape??{};if(r){let u=()=>{let f={...r};return Object.defineProperty(t,"shape",{value:f}),u.raw=f,f};u.raw=r,Object.defineProperty(t,"shape",{get:u})}let o=Te(()=>us(t));Z(e,"propValues",u=>{let f=u.def.shape,d={};for(let p in f){let l=f[p]._zod;if(l.values){Object.prototype.hasOwnProperty.call(d,p)||Y(d,p,new Set);for(let g of l.values)d[p].add(g);l.optin!==void 0&&d[p].add(void 0)}}return d});let s=_e,i=t.catchall,a,c=X.memoizer;c?.attach(e),e._zod.parse=(u,f)=>{a??(a=o.value);let d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value=c?c.alloc(e,u,{},f):{};let p=[],l=a.shape,g=f?.abortEarly,y=u.issues.length;for(let v of a.allKeys){if(g&&u.issues.length!==y){if(ee(u,y))break;y=u.issues.length}if(v==="__proto__")continue;let b=l[v],x=b._zod.optin,w=b._zod.optout,P=b._zod.run({value:d[v],issues:[]},f);P instanceof Promise?p.push(P.then(z=>ft(z,u,v,d,x,w))):ft(P,u,v,d,x,w)}return i?ls(p,d,u,f,o.value,e,g===!0):p.length?Promise.all(p).then(()=>u):u}}),ds=h("$ZodObjectJIT",(e,t)=>{gu.init(e,t);let n=e._zod.parse,r=Te(()=>us(t)),o=X.memoizer,s=l=>{let g=r.value,y=g.symbolKeys,v=new ut(["payload","ctx"],{shape:l,inst:e,memo:o,syms:y}),b=z=>`shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`,x=(z,k)=>`
|
|
8
|
+
let ${z}_ab = false;
|
|
9
|
+
for (let i = 0; i < ${z}.issues.length; i++) {
|
|
10
|
+
const iss = ${z}.issues[i];
|
|
11
|
+
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
12
|
+
payload.issues.push(iss);
|
|
13
|
+
if (iss.continue !== true) ${z}_ab = true;
|
|
14
|
+
}
|
|
15
|
+
if (${z}_ab && ctx && ctx.abortEarly) {
|
|
16
|
+
payload.value = newResult;
|
|
17
|
+
return payload;
|
|
18
|
+
}`;v.write("const input = payload.value;");let w=Object.create(null),P=0;for(let z of g.allKeys)w[z]=`key_${P++}`;v.write(o?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let z of g.allKeys){if(z==="__proto__")continue;let k=w[z],$=typeof z=="symbol"?`syms[${y.indexOf(z)}]`:Ft(z),C=`${$} in input`,K=l[z],W=K?._zod?.optin,F=W!==void 0,B=K?._zod?.optout==="optional";if(v.write(`const ${k} = ${b($)};`),F&&B){let ie=W==="optional"?`${k}_present`:`${k}.value !== undefined || ${k}_present`;v.write(`
|
|
19
|
+
const ${k}_present = ${C};
|
|
20
|
+
if (!${k}.issues.length || ${k}_present) {
|
|
21
|
+
if (${k}.issues.length) {${x(k,$)}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (${ie}) {
|
|
25
|
+
newResult[${$}] = ${k}.value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
`)}else F?(v.write(`
|
|
30
|
+
if (${k}.issues.length) {${x(k,$)}
|
|
31
|
+
}
|
|
32
|
+
`),W==="defaulted"?v.write(`newResult[${$}] = ${k}.value;`):v.write(`
|
|
33
|
+
if (${k}.value !== undefined || ${C}) {
|
|
34
|
+
newResult[${$}] = ${k}.value;
|
|
35
|
+
}
|
|
36
|
+
`)):v.write(`
|
|
37
|
+
const ${k}_present = ${C};
|
|
38
|
+
if (${k}.issues.length) {${x(k,$)}
|
|
39
|
+
}
|
|
40
|
+
if (!${k}_present && !${k}.issues.length) {
|
|
41
|
+
payload.issues.push({
|
|
42
|
+
code: "invalid_type",
|
|
43
|
+
expected: "nonoptional",
|
|
44
|
+
input: undefined,
|
|
45
|
+
path: [${$}]
|
|
46
|
+
});
|
|
47
|
+
if (ctx && ctx.abortEarly) {
|
|
48
|
+
payload.value = newResult;
|
|
49
|
+
return payload;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (${k}_present) {
|
|
54
|
+
newResult[${$}] = ${k}.value;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
`)}return v.write("payload.value = newResult;"),v.write("return payload;"),v.compile()},i,a=_e,c=!X.jitless,f=c&&Vt.value,d=t.catchall,p;e._zod.parse=(l,g)=>{p??(p=r.value);let y=l.value;return a(y)?c&&f&&g?.async===!1&&g.jitless!==!0?(i||(i=s(t.shape)),l=i(l,g),d?ls([],y,l,g,p,e,g?.abortEarly===!0):l):n(l,g):(l.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),l)}});function wo(e,t,n,r){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let o=e.filter(s=>!ee(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(i=>ue(i,r,ne())))}),t)}var fs=h("$ZodUnion",(e,t)=>{N.init(e,t),Z(e,"optin",r=>r.def.options.some(o=>o._zod.optin==="defaulted")?"defaulted":r.def.options.some(o=>o._zod.optin!==void 0)?"optional":void 0),Z(e,"optout",r=>r.def.options.some(o=>o._zod.optout==="optional")?"optional":void 0),Z(e,"values",r=>{if(r.def.options.every(o=>o._zod.values))return new Set(r.def.options.flatMap(o=>Array.from(o._zod.values)))}),Z(e,"pattern",r=>{if(r.def.options.every(o=>o._zod.pattern)){let o=r.def.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>Ae(s.source)).join("|")})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let s=!1,i=[];for(let a of t.options){let c=a._zod.run({value:r.value,issues:[]},o);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}return s?Promise.all(i).then(a=>wo(a,r,e,o)):wo(i,r,e,o)}});var ps=h("$ZodIntersection",(e,t)=>{N.init(e,t),e._zod.parse=(n,r)=>{let o=n.value,s=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return s instanceof Promise||i instanceof Promise?Promise.all([s,i]).then(([c,u])=>_o(n,c,u)):_o(n,s,i)}});function an(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(he(e)&&he(t)){let n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),o={...e,...t};Object.prototype.hasOwnProperty.call(o,"__proto__")&&delete o.__proto__;for(let s of r){if(s==="__proto__")continue;let i=an(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};o[s]=i.data}return{valid:!0,data:o}}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 o=e[r],s=t[r],i=an(o,s);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function _o(e,t,n){let r=new Map,o,s=new Map,i=(u,f)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)o??(o=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let p=String(u.path[0]);s.has(p)||s.set(p,u),d=[p]}else return!1;for(let p of d)r.has(p)||r.set(p,{}),r.get(p)[f]=!0;return!0};for(let u of t.issues)i(u,"l")||e.issues.push(u);for(let u of n.issues)i(u,"r")||e.issues.push(u);let a=[...r].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=o?a.filter(f=>o.keys.includes(f)):[];u.length&&e.issues.push({...o,keys:u});for(let f of a)!u.includes(f)&&s.has(f)&&e.issues.push(s.get(f))}let c=an(t.value,n.value);if(!c.valid){if(ee(e))return e;throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var hs=h("$ZodEnum",(e,t)=>{N.init(e,t);let n=ze(t.entries),r=new Set(n);e._zod.values=r,Z(e,"pattern",o=>{let s=ze(o.def.entries).filter(i=>Bt.has(typeof i));return new RegExp(s.length?`^(${s.map(i=>me(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,s)=>{let i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}});var ms=h("$ZodTransform",(e,t)=>{N.init(e,t),e._zod.optin="optional",X.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new $e(e.constructor.name);let o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n));if(o instanceof Promise)throw new te;return n.value=o,n}});function zo(e,t){return e.value=t.issues.length?void 0:t.value,e}var dn=h("$ZodOptional",(e,t)=>{N.init(e,t),Z(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Z(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r,void 0]):void 0}),Z(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Ae(r.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(n.value===void 0){if(t.innerType._zod.optin!=="defaulted")return n;let o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>zo(n,s)):zo(n,o)}return t.innerType._zod.run(n,r)}}),gs=h("$ZodExactOptional",(e,t)=>{dn.init(e,t),Z(e,"values",n=>n.def.innerType._zod.values),Z(e,"pattern",n=>n.def.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),vs=h("$ZodNullable",(e,t)=>{N.init(e,t),Z(e,"optin",n=>n.def.innerType._zod.optin),Z(e,"optout",n=>n.def.innerType._zod.optout),Z(e,"pattern",n=>{let r=n.def.innerType._zod.pattern;return r?new RegExp(`^(${Ae(r.source)}|null)$`):void 0}),Z(e,"values",n=>n.def.innerType._zod.values?new Set([...n.def.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),ys=h("$ZodDefault",(e,t)=>{N.init(e,t),e._zod.optin="defaulted",Z(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>So(s,t)):So(o,t)}});function So(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var bs=h("$ZodPrefault",(e,t)=>{N.init(e,t),e._zod.optin="defaulted",Z(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),xs=h("$ZodNonOptional",(e,t)=>{N.init(e,t),Z(e,"values",n=>{let r=n.def.innerType._zod.values;return r?new Set([...r].filter(o=>o!==void 0)):void 0}),e._zod.parse=(n,r)=>{let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(s=>ko(s,e)):ko(o,e)}});function ko(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function $o(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(o=>ue(o,r,ne()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ws=h("$ZodCatch",(e,t)=>{N.init(e,t),Z(e,"optin",n=>n.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Z(e,"optout",n=>n.def.innerType._zod.optout),Z(e,"values",n=>n.def.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run({value:n.value,issues:[]},r);return o instanceof Promise?o.then(s=>$o(n,s,t,r)):$o(n,o,t,r)}});var _s=h("$ZodPipe",(e,t)=>{N.init(e,t),Z(e,"values",n=>n.def.in._zod.values),Z(e,"optin",n=>n.def.in._zod.optin),Z(e,"optout",n=>n.def.out._zod.optout),Z(e,"propValues",n=>n.def.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){let s=t.out._zod.run(n,r);return s instanceof Promise?s.then(i=>lt(i,t.in,r)):lt(s,t.in,r)}let o=t.in._zod.run(n,r);return o instanceof Promise?o.then(s=>lt(s,t.out,r)):lt(o,t.out,r)}});function lt(e,t,n){return e.issues.some(r=>r.code!=="unrecognized_keys")?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var zs=h("$ZodReadonly",(e,t)=>{N.init(e,t),Z(e,"propValues",n=>n.def.innerType._zod.propValues),Z(e,"values",n=>n.def.innerType._zod.values),Z(e,"optin",n=>n.def.innerType?._zod?.optin),Z(e,"optout",n=>n.def.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);let o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Io):Io(o)}});function Io(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Ss=h("$ZodCustom",(e,t)=>{V.init(e,t),N.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{let r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(s=>Eo(s,n,r,e));Eo(o,n,r,e)}});function Eo(e,t,n,r){if(!e){let o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(ke(o))}}var pn=class extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform"),this.name="ZodCyclicError"}},hn="~memo",ks=[];function $s(e){return e!==null&&typeof e=="object"}function fn(e){return e.map(t=>t.path?{...t,path:t.path.slice()}:{...t})}var Is=new WeakMap,Fe=0,vt=1,Ue=2;function yt(e,t,n){let r=Is.get(e);if(r!==void 0)return r?Ue:Fe;if(t.has(e))return Ue;t.add(e);let o=Fe,s=f=>{if(o!==Ue&&f?._zod){let d=yt(f,t,n);d>o&&(o=d)}},i=(f,d)=>{let p=Fe;for(let l of Reflect.ownKeys(f)){let g=Object.getOwnPropertyDescriptor(f,l);if(d&&!g.enumerable)continue;let y=g.get?vt:g.value?._zod?yt(g.value,t,n):Fe;y>p&&(p=y)}return p},a=f=>{f>o&&(o=f)},c=e._zod.def,u=c.type;switch(u){case"object":{let f=Ne(c);a(f?i(f,!0):vt),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(let f of c.items)s(f);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(let f of c.options)s(f);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{let f=c._cachedInner??(n?e._zod.innerType:void 0);a(f?yt(f,t,!1):vt);break}case"template_literal":case"string":case"number":case"int":case"boolean":case"bigint":case"symbol":case"undefined":case"null":case"void":case"never":case"any":case"unknown":case"date":case"nan":case"enum":case"literal":case"file":case"transform":case"custom":break;default:for(let f in c){let d=Object.getOwnPropertyDescriptor(c,f);if(!d||d.get)continue;let p=d.value;if(!(!p||typeof p!="object")){if(p._zod)s(p);else if(Array.isArray(p))for(let l of p)s(l)}}}return t.delete(e),vu(e,o)}function vu(e,t){return t!==vt&&Is.set(e,t===Ue),t}function yu(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var mt,gt=[],bu={alloc(e,t,n){let r=mt;if(!r)return n;mt=void 0;let o={value:n,issues:null};return r.set(t.value,o),gt.push(o),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let n=e._zod.parse,r=(o,s)=>{if(s.direction!=="backward"&&xu(s,o.value))throw new pn;return n(o,s)};e._zod.parse=r,e._zod.run===n&&(e._zod.run=r)})},attach(e){var t;let n,r=!1,o,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,a=(c,u)=>{if(n===void 0){let b=yt(e,new Set,!1);if(b===Fe)return e._zod.parse=i,e._zod.run===a&&(e._zod.run=i),i(c,u);b===Ue||r?n=!0:r=!0}let f=c.value;if(!$s(f))return i(c,u);let d=u[hn];d||(d={buckets:new WeakMap,backEdges:void 0},u[hn]=d);let p;o===u?p=s:(p=yu(d,e),o=u,s=p);let l=p.get(f);if(l)return c.value=l.value,l.issues?l.issues.length&&c.issues.push(...fn(l.issues)):(c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(l.value)),c;mt=p;let g=gt.length,y=i(c,u);mt=void 0;let v=gt.length>g?gt.pop():void 0;return y instanceof Promise?y.then(b=>(v&&(v.issues=b.issues.length?fn(b.issues):ks),b)):(v&&(v.issues=y.issues.length?fn(y.issues):ks),y)};e._zod.parse=a,e._zod.run===i&&(e._zod.run=a)})}};function Es(){return bu}function xu(e,t){let n=e[hn]?.backEdges;return n!==void 0&&$s(t)&&n.has(t)}var wu=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(s){return e[s]??null}let n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",currency_code:"currency code",credit_card:"credit card number",iban:"IBAN",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};function o(s,i){return s==="number"&&typeof i=="number"&&!Number.isFinite(i)?String(i):r[s]??s}return s=>{switch(s.code){case"invalid_type":{let i=o(s.expected),a=Kt(s.input),c=o(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":return s.values.length===1?`Invalid input: expected ${Ye(s.values[0])}`:`Invalid option: expected one of ${Xe(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);return a?`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`:`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);return a?`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`:`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;return i.format==="starts_with"?`Invalid string: must start with "${i.prefix}"`:i.format==="ends_with"?`Invalid string: must end with "${i.suffix}"`:i.format==="includes"?`Invalid string: must include "${i.includes}"`:i.format==="regex"?`Invalid string: must match pattern ${i.pattern}`:`Invalid ${n[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${Xe(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":return s.options&&Array.isArray(s.options)&&s.options.length>0?`Invalid discriminator value. Expected ${s.options.map(a=>`'${a}'`).join(" | ")}`:s.inclusive===!1?"Invalid input: more than one option matched":"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function Ps(){return{localeError:wu()}}var Os;var mn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){let r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){let n=t._zod.parent;if(n){let r={...this.get(n)??{}};delete r.id;let o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function _u(){return new mn}(Os=globalThis).__zod_globalRegistry??(Os.__zod_globalRegistry=_u());var ge=globalThis.__zod_globalRegistry;function Zs(e){return e.checks&&(e.checks=[...e.checks]),e}function Ts(e,t){return new e(Zs({type:"string",...S(t)}))}function As(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...S(t)})}function Ns(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...S(t)})}function Rs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...S(t)})}function Cs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...S(t)})}function Ms(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...S(t)})}function Ds(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...S(t)})}function Ls(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...S(t)})}function js(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...S(t)})}function Fs(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...S(t)})}function Us(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...S(t)})}function Vs(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...S(t)})}function Bs(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...S(t)})}function Ws(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...S(t)})}function Js(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...S(t)})}function Ks(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...S(t)})}function Hs(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...S(t)})}function Gs(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...S(t)})}function Xs(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...S(t)})}function qs(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...S(t)})}function Ys(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...S(t)})}function Qs(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...S(t)})}function ei(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...S(t)})}function ti(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...S(t)})}function ni(e,t){return new e({type:"string",format:"date",check:"string_format",...S(t)})}function ri(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...S(t)})}function oi(e,t){return new e({type:"string",format:"duration",check:"string_format",...S(t)})}function si(e,t){return new e(Zs({type:"number",checks:[],...S(t)}))}function ii(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...S(t)})}function ai(e,t){return new e({type:"boolean",...S(t)})}function ci(e){return new e({type:"any"})}function ui(e){return new e({type:"unknown"})}function li(e,t){return new e({type:"never",...S(t)})}function bt(e,t){return new on({check:"less_than",...S(t),value:e,inclusive:!1})}function Ve(e,t){return new on({check:"less_than",...S(t),value:e,inclusive:!0})}function xt(e,t){return new sn({check:"greater_than",...S(t),value:e,inclusive:!1})}function Be(e,t){return new sn({check:"greater_than",...S(t),value:e,inclusive:!0})}function wt(e,t){return new oo({check:"multiple_of",...S(t),value:e})}function _t(e,t){return new io({check:"max_length",...S(t),maximum:e})}function Ie(e,t){return new ao({check:"min_length",...S(t),minimum:e})}function zt(e,t){return new co({check:"length_equals",...S(t),length:e})}function gn(e,t){return new uo({check:"string_format",format:"regex",...S(t),pattern:e})}function vn(e){return new lo({check:"string_format",format:"lowercase",...S(e)})}function yn(e){return new fo({check:"string_format",format:"uppercase",...S(e)})}function bn(e,t){return new po({check:"string_format",format:"includes",...S(t),includes:e})}function xn(e,t){return new ho({check:"string_format",format:"starts_with",...S(t),prefix:e})}function wn(e,t){return new mo({check:"string_format",format:"ends_with",...S(t),suffix:e})}function fe(e){return new go({check:"overwrite",tx:e})}function _n(e){return fe(t=>t.normalize(e))}function zn(){return fe(e=>e.trim())}function Sn(){return fe(e=>e.toLowerCase())}function kn(){return fe(e=>e.toUpperCase())}function $n(){return fe(e=>Ut(e))}function di(e,t,n){return new e({type:"array",element:t,...S(n)})}function fi(e,t,n){return new e({type:"custom",check:"custom",fn:t,...S(n)})}function pi(e,t){let n=zu(r=>(r.addIssue=o=>{if(typeof o=="string")r.issues.push(ke(o,r.value,n._zod.def));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),"input"in s||(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(ke(s))}},e(r.value,r)),t);return n}function zu(e,t){let n=new V({check:"custom",...S(t)});return n._zod.check=e,n}function We(e,...t){for(let n of t)for(let r of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,r)&&Y(e,r,n[r]);return e}function En(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??ge,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??"ref",reused:e?.reused??"inline",intersections:[],deferred:[],external:e?.external??void 0}}function ve(e,t,n,r,o){let s=typeof t.unrepresentable=="function"?t.unrepresentable({zodSchema:e,path:r.path,message:o}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw new Error(o);return Object.assign(n,s),!0}function U(e,t,n={path:[],schemaPath:[]}){var r;let o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;let i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{let p=i.schema,l=t.processors[o.type];if(!l)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);l(e,t,p,f)}let d=e._zod.parent;d&&(i.ref||(i.ref=d),U(d,t,f),t.seen.get(d).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&We(i.schema,c),t.io==="input"&&J(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&"_prefault"in i.schema&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function hi(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Pn(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=r.get(a);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(a,i[0])}}let o=i=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,p=e.external.uri??(g=>g);if(d)return{ref:p(d)};let l=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=l,{defId:l,ref:`${p("__shared")}#/${a}/${hi(l)}`}}let c="#",u=`${c}/${a}/`;if(i[1]===n&&!i[1].schema.id)return{ref:c};let f=i[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:u+hi(f)}},s=i=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=o(i);a.def={...a.schema},u&&(a.defId=u);let f=a.schema;for(let d in f)delete f[d];f.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw new Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
58
|
+
|
|
59
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}a.count>1&&e.reused==="ref"&&s(i)}e.external&&(e.sharedDefsExtractedFor=e.external)}function vi(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let r of t){if(!r||typeof r!="object")return;vi(r);let o=Object.keys(r);if(o.length!==1||o[0]!=="type")return;let s=r.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!="string")return;n.includes(i)||n.push(i)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var yi=new Set(["type","properties","required","additionalProperties"]),mi=["oneOf","anyOf"];function gi(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!="object"||t===null?null:Object.keys(t).length?t:null}function In(e){let t=[];for(let s of e){if(typeof s!="object"||s.type!=="object")return null;for(let i in s)if(!yi.has(i))return null;t.push(s)}let n={},r=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(n,i))continue;let a=[];for(let u of t){let f=u.properties?.[i]??gi(u);f!=null&&(a.some(d=>JSON.stringify(d)===JSON.stringify(f))||a.push(f))}let c=a.length===1?a[0]:In(a)??{allOf:a};Y(n,i,c)}for(let i of s.required??[])r.add(i)}let o={type:"object",properties:n};if(r.size&&(o.required=[...r]),t.every(s=>s.additionalProperties===!1))o.additionalProperties=!1;else{let s=[];for(let i of t){let a=gi(i);a&&!s.some(c=>JSON.stringify(c)===JSON.stringify(a))&&s.push(a)}s.length===1?o.additionalProperties=s[0]:s.length>1&&(o.additionalProperties={allOf:s})}return o}function Su(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let o of yi)if(o in e)return;let n=t.filter(o=>mi.some(s=>Array.isArray(o[s]))),r=null;if(!n.length)r=In(t);else{let o=n[0],s=mi.find(c=>Array.isArray(o[c]));if(Object.keys(o).length!==1)return;let i=t.filter(c=>c!==o),a=o[s].map(c=>In([...i,c]));if(a.some(c=>!c))return;r={[s]:a}}r&&(delete e.allOf,We(e,r))}function On(e,t){let n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let r=a=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,f={...u},d=c.ref;if(c.ref=null,d){r(d);let l=e.seen.get(d),g=l.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(u.allOf=u.allOf??[],u.allOf.push(g)):We(u,g),We(u,f),a._zod.parent===d)for(let v in u)v==="$ref"||v==="allOf"||v in f||delete u[v];if(g.$ref&&l.def)for(let v in u)v==="$ref"||v==="allOf"||v in l.def&&JSON.stringify(u[v])===JSON.stringify(l.def[v])&&delete u[v]}let p=a._zod.parent;if(p&&p!==d){r(p);let l=e.seen.get(p);if(l?.schema.$ref&&(u.$ref=l.schema.$ref,l.def))for(let g in u)g==="$ref"||g==="allOf"||g in l.def&&JSON.stringify(u[g])===JSON.stringify(l.def[g])&&delete u[g]}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())r(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())vi(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let f=u?.allOf;if(!Array.isArray(f))continue;let d=a.get(f);d?d.push(u):a.set(f,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])Su(u)}}let o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(a)}We(o,n.defId?n.schema:n.def??n.schema);let s=e.metadataRegistry.get(t)?.id;s!==void 0&&o.id===s&&delete o.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,Y(i,c.defId,c.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(i).length>0&&(e.target==="draft-2020-12"?o.$defs=i:o.definitions=i);try{let a=JSON.parse(JSON.stringify(o));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Je(t,"input",e.processors),output:Je(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function J(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 J(r.element,n);if(r.type==="set")return J(r.valueType,n);if(r.type==="lazy")return J(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"||r.type==="catch")return J(r.innerType,n);if(r.type==="intersection")return J(r.left,n)||J(r.right,n);if(r.type==="record"||r.type==="map")return J(r.keyType,n)||J(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:J(r.in,n)||J(r.out,n);if(r.type==="object"){for(let o in r.shape)if(J(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(let o of r.options)if(J(o,n))return!0;return!1}if(r.type==="tuple"){for(let o of r.items)if(J(o,n))return!0;return!!(r.rest&&J(r.rest,n))}return!1}var bi=(e,t={})=>n=>{let r=En({...n,processors:t});return U(e,r),Pn(r,e),On(r,e)},Je=(e,t,n={})=>r=>{let{libraryOptions:o,target:s}=r??{},i=En({...o??{},target:s,io:t,processors:n});return U(e,i),Pn(i,e),On(i,e)};var Ee=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},Pe=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},xi=(e,t)=>{Ee(e,"minimum",t),Pe(e,"maximum",t)},Si=(e,t)=>{e.multipleOf??(e.multipleOf=[]),e.multipleOf.includes(t)||e.multipleOf.push(t)},ki=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},$i=(e,t)=>{e.mime=e.mime?e.mime.filter(n=>t.includes(n)):[...t]},Ii=(e,t)=>{e.format=t,t.includes("int")&&(e.isInt=!0)},wi=(e,t)=>Ee(e,"minimum",t.minimum),_i=(e,t)=>Pe(e,"maximum",t.maximum),zi=e=>(t,n)=>{Ii(t,n.format);let[r,o]=e[n.format];Ee(t,"minimum",r),Pe(t,"maximum",o)},ku={greater_than:(e,t)=>Ee(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Pe(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Si(e,t.value),number_format:zi(Re),bigint_format:zi(Qe),min_length:wi,max_length:_i,length_equals:(e,t)=>xi(e,t.length),min_size:wi,max_size:_i,size_equals:(e,t)=>xi(e,t.size),string_format:(e,t)=>{Ii(e,t.format),t.pattern&&ki(e,t.pattern),(t.format==="base64"||t.format==="base64url")&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>$i(e,t.mime)};function re(e){let t={},n=e._zod.def,r=e._zod.traits.has("$ZodCheck")?[e,...n.checks??[]]:n.checks??[];for(let s of r)ku[s._zod.def.check]?.(t,s._zod.def);let o=e._zod.bag;o.minimum!==void 0&&Ee(t,"minimum",o.minimum),o.exclusiveMinimum!==void 0&&Ee(t,"exclusiveMinimum",o.exclusiveMinimum),o.maximum!==void 0&&Pe(t,"maximum",o.maximum),o.exclusiveMaximum!==void 0&&Pe(t,"exclusiveMaximum",o.exclusiveMaximum),o.multipleOf!==void 0&&Si(t,o.multipleOf),o.format!==void 0&&(t.format??(t.format=o.format),o.format.includes("int")&&(t.isInt=!0)),o.mime&&$i(t,o.mime);for(let s of o.patterns??[])ki(t,s);return t}var $u={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Iu=new Map([[un,Jr],[ht,Kr]]),Eu=e=>Iu.get(e)??e,Ei=(e,t,n,r)=>{let o=n;o.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:f}=re(e);if(typeof s=="number"&&(o.minLength=s),typeof i=="number"&&(o.maxLength=i),a&&(o.format=$u[a]??a,o.format===""&&delete o.format,(a==="time"||f)&&delete o.format),u&&(o.contentEncoding=u),c&&c.size>0){let d=[...c].map(Eu);d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},Pi=(e,t,n,r)=>{let o=n,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:f}=re(e);o.type=f?"integer":"number";let d=typeof u=="number"&&u>=(s??Number.NEGATIVE_INFINITY),p=typeof c=="number"&&c<=(i??Number.POSITIVE_INFINITY),l=t.target==="draft-04"||t.target==="openapi-3.0";if(d?l?(o.minimum=u,o.exclusiveMinimum=!0):o.exclusiveMinimum=u:typeof s=="number"&&(o.minimum=s),p?l?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c:typeof i=="number"&&(o.maximum=i),a){let g=new Set;for(let b of a)Number.isFinite(b)&&b!==0?g.add(Math.abs(b)):ve(e,t,o,r,`A multipleOf divisor of ${b} cannot be represented in JSON Schema`);let[y,...v]=g;y!==void 0&&(o.multipleOf=y),v.length&&(o.allOf=[...o.allOf??[],...v.map(b=>({multipleOf:b}))])}},Oi=(e,t,n,r)=>{n.type="boolean"};var Zi=(e,t,n,r)=>{n.not={}},Ti=(e,t,n,r)=>{},Ai=(e,t,n,r)=>{};var Ni=(e,t,n,r)=>{let o=e._zod.def,s=ze(o.entries);if(s.length===0){n.not={};return}s.every(i=>typeof i=="number")&&(n.type="number"),s.every(i=>typeof i=="string")&&(n.type="string"),n.enum=s};var Ri=(e,t,n,r)=>{ve(e,t,n,r,"Custom types cannot be represented in JSON Schema")};var Ci=(e,t,n,r)=>{ve(e,t,n,r,"Transforms cannot be represented in JSON Schema")};var Mi=(e,t,n,r)=>{let o=n,s=e._zod.def,{minimum:i,maximum:a}=re(e);typeof i=="number"&&(o.minItems=i),typeof a=="number"&&(o.maxItems=a),o.type="array",o.items=U(s.element,t,{...r,path:[...r.path,"items"]})};function Zn(e){let t=e._zod.def;return t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform")?Zn(t.out):t.type==="catch"?Zn(t.innerType):e._zod.optin}var Di=(e,t,n,r)=>{let o=n,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&ve(e,t,o,r,"Symbol keys cannot be represented in JSON Schema"))return;o.type="object",o.properties={};for(let u in i)Y(o.properties,u,U(i[u],t,{...r,path:[...r.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let f=s.shape[u];(t.io==="input"?Zn(f)===void 0:f._zod.optout===void 0)&&c.push(u)}c.length>0&&(o.required=c),s.catchall?._zod.def.type==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=U(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Li=(e,t,n,r)=>{let o=e._zod.def,s=o.inclusive===!1,i=o.options.map((a,c)=>U(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=i:n.anyOf=i},ji=(e,t,n,r)=>{let o=e._zod.def,s=U(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=U(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];n.allOf=c,t.intersections.push(c)};var Fi=(e,t,n,r)=>{let o=e._zod.def,s=U(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},Ui=(e,t,n,r)=>{let o=e._zod.def;U(o.innerType,t,r);let s=t.seen.get(e);s.ref=o.innerType},Tn=Symbol();function Vi(e,t,n,r,o){let s=!1,i=JSON.stringify(e,(a,c)=>typeof c!="bigint"?c:(s=!0,null));return s?(ve(t,n,r,o,"BigInt defaults cannot be represented in JSON Schema"),Tn):JSON.parse(i)}var Bi=(e,t,n,r)=>{let o=e._zod.def;U(o.innerType,t,r);let s=t.seen.get(e);s.ref=o.innerType;let i=Vi(o.defaultValue,e,t,n,r);i!==Tn&&(n.default=i)},Wi=(e,t,n,r)=>{let o=e._zod.def;U(o.innerType,t,r);let s=t.seen.get(e);if(s.ref=o.innerType,t.io!=="input")return;let i=Vi(o.defaultValue,e,t,n,r);i!==Tn&&(n._prefault=i)},Ji=(e,t,n,r)=>{let o=e._zod.def;U(o.innerType,t,r);let s=t.seen.get(e);s.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{ve(e,t,n,r,"Dynamic catch values are not supported in JSON Schema");return}n.default=i},Ki=(e,t,n,r)=>{let o=e._zod.def,s=o.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?o.out:o.in:o.out;U(i,t,r);let a=t.seen.get(e);a.ref=i},Hi=(e,t,n,r)=>{let o=e._zod.def;U(o.innerType,t,r);let s=t.seen.get(e);s.ref=o.innerType,n.readOnly=!0};var An=(e,t,n,r)=>{let o=e._zod.def;U(o.innerType,t,r);let s=t.seen.get(e);s.ref=o.innerType};var Gi=new WeakSet([Object.prototype,Error.prototype]);function St(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let r=n(this);return Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0}),r},set(r){Object.defineProperty(this,t,{value:r,configurable:!0,writable:!0})}})}var Cu=(e,t)=>{br.init(e,t),e.name="ZodError";let n=Object.getPrototypeOf(e);Gi.has(n)||(Gi.add(n),St(n,"format",r=>o=>wr(r,o)),St(n,"flatten",r=>o=>xr(r,o)),St(n,"addIssue",r=>o=>{r.issues.push(o),r.message=JSON.stringify(r.issues,Se,2)}),St(n,"addIssues",r=>o=>{r.issues.push(...o),r.message=JSON.stringify(r.issues,Se,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))};var q=h("ZodError",Cu,void 0,{Parent:Error});var Xi=ot(q),qi=st(q),Yi=it(q),Qi=at(q),ea=zr(q),ta=Sr(q),na=kr(q),ra=$r(q),oa=Ir(q),sa=Er(q),ia=Pr(q),aa=Or(q);function Du(){X.localeError||ne(Ps())}function Cn(){X.memoizer||ne({memoizer:Es()})}var M=h("ZodType",(e,t)=>(Du(),N.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(I.mergeDefs(t,{checks:[...t.checks??[],...e.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Q(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Rl(e,t))},superRefine(e,t){return this.check(Cl(e,t))},overwrite(e){return this.check(fe(e))},optional(){return la(this)},exactOptional(){return _l(this)},nullable(){return da(this)},nullish(){return la(da(this))},nonoptional(e){return El(this,e)},array(){return H(this)},or(e){return vl([this,e])},and(e){return bl(this,e)},transform(e){return fa(this,wl(e))},default(e){return kl(this,e)},prefault(e){return Il(this,e)},catch(e){return Ol(this,e)},pipe(e){return fa(this,e)},readonly(){return Al(this)},describe(e){let t=this.clone();return ge.add(t,{description:e}),t},meta(...e){if(e.length===0)return ge.get(this);let t=this.clone();return ge.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return I.hide(this,"~standard",{...cn(this),jsonSchema:{input:Je(this,"input"),output:Je(this,"output")}})},set"~standard"(e){I.own(this,"~standard",e)},parse:function e(t,n){return Xi(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await qi(this,t,n,{callee:e})},safeParse(e,t){return Yi(this,e,t)},async safeParseAsync(e,t){return Qi(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){I.own(this,"spa",e)},validate(e,t){return Yt(this,e,t)},validateAsync(e,t){return Qt(this,e,t)},encode:function e(t,n){return ea(this,t,n,{callee:e})},decode:function e(t,n){return ta(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await na(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await ra(this,t,n,{callee:e})},safeEncode(e,t){return oa(this,e,t)},safeDecode(e,t){return sa(this,e,t)},async safeEncodeAsync(e,t){return ia(this,e,t)},async safeDecodeAsync(e,t){return aa(this,e,t)},toJSONSchema(e){return bi(this,{})(e)},get description(){return ge.get(this)?.description},get _def(){return this._zod.def}}),pa=h("_ZodString",(e,t)=>{pt.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ei(e,n,r,o)},I.derived({format:e=>re(e).format??null,minLength:e=>re(e).minimum??null,maxLength:e=>re(e).maximum??null},{regex(...e){return this.check(gn(...e))},includes(...e){return this.check(bn(...e))},startsWith(...e){return this.check(xn(...e))},endsWith(...e){return this.check(wn(...e))},min(...e){return this.check(Ie(...e))},max(...e){return this.check(_t(...e))},length(...e){return this.check(zt(...e))},nonempty(...e){return this.check(Ie(1,...e))},lowercase(e){return this.check(vn(e))},uppercase(e){return this.check(yn(e))},trim(){return this.check(zn())},normalize(...e){return this.check(_n(...e))},toLowerCase(){return this.check(Sn())},toUpperCase(){return this.check(kn())},slugify(){return this.check($n())}})),Lu=h("ZodString",(e,t)=>{pt.init(e,t),pa.init(e,t)},{email(e){return this.check(As(Bu,e))},url(e){return this.check(Ls(Ju,e))},jwt(e){return this.check(ei(al,e))},emoji(e){return this.check(js(Ku,e))},guid(e){return this.check(Ns(Wu,e))},uuid(e){return this.check(Rs(kt,e))},uuidv4(e){return this.check(Cs(kt,e))},uuidv6(e){return this.check(Ms(kt,e))},uuidv7(e){return this.check(Ds(kt,e))},nanoid(e){return this.check(Fs(Hu,e))},cuid(e){return this.check(Us(Gu,e))},cuid2(e){return this.check(Vs(Xu,e))},ulid(e){return this.check(Bs(qu,e))},base64(e){return this.check(qs(ol,e))},base64url(e){return this.check(Ys(sl,e))},xid(e){return this.check(Ws(Yu,e))},ksuid(e){return this.check(Js(Qu,e))},ipv4(e){return this.check(Ks(el,e))},ipv6(e){return this.check(Hs(tl,e))},cidrv4(e){return this.check(Gs(nl,e))},cidrv6(e){return this.check(Xs(rl,e))},e164(e){return this.check(Qs(il,e))},datetime(e){return this.check(ti(ju,e))},date(e){return this.check(ni(Fu,e))},time(e){return this.check(ri(Uu,e))},duration(e){return this.check(oi(Vu,e))}});function _(e){return Ts(Lu,e)}var R=h("ZodStringFormat",(e,t)=>{A.init(e,t),pa.init(e,t)}),ju=h("ZodISODateTime",(e,t)=>{Vo.init(e,t),R.init(e,t)}),Fu=h("ZodISODate",(e,t)=>{Bo.init(e,t),R.init(e,t)}),Uu=h("ZodISOTime",(e,t)=>{Wo.init(e,t),R.init(e,t)}),Vu=h("ZodISODuration",(e,t)=>{Jo.init(e,t),R.init(e,t)}),Bu=h("ZodEmail",(e,t)=>{To.init(e,t),R.init(e,t)});var Wu=h("ZodGUID",(e,t)=>{Oo.init(e,t),R.init(e,t)});var kt=h("ZodUUID",(e,t)=>{Zo.init(e,t),R.init(e,t)});var Ju=h("ZodURL",(e,t)=>{Ro.init(e,t),R.init(e,t)});var Ku=h("ZodEmoji",(e,t)=>{Co.init(e,t),R.init(e,t)});var Hu=h("ZodNanoID",(e,t)=>{Mo.init(e,t),R.init(e,t)});var Gu=h("ZodCUID",(e,t)=>{Do.init(e,t),R.init(e,t)});var Xu=h("ZodCUID2",(e,t)=>{Lo.init(e,t),R.init(e,t)});var qu=h("ZodULID",(e,t)=>{jo.init(e,t),R.init(e,t)});var Yu=h("ZodXID",(e,t)=>{Fo.init(e,t),R.init(e,t)});var Qu=h("ZodKSUID",(e,t)=>{Uo.init(e,t),R.init(e,t)});var el=h("ZodIPv4",(e,t)=>{Ko.init(e,t),R.init(e,t)});var tl=h("ZodIPv6",(e,t)=>{Go.init(e,t),R.init(e,t)});var nl=h("ZodCIDRv4",(e,t)=>{Xo.init(e,t),R.init(e,t)});var rl=h("ZodCIDRv6",(e,t)=>{qo.init(e,t),R.init(e,t)});var ol=h("ZodBase64",(e,t)=>{Qo.init(e,t),R.init(e,t)});var sl=h("ZodBase64URL",(e,t)=>{es.init(e,t),R.init(e,t)});var il=h("ZodE164",(e,t)=>{ts.init(e,t),R.init(e,t)});var al=h("ZodJWT",(e,t)=>{ns.init(e,t),R.init(e,t)});var ha=h("ZodNumber",(e,t)=>{ln.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Pi(e,n,r,o),e.isFinite=!0},I.derived({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=re(e);return Math.max(t??Number.NEGATIVE_INFINITY,n??Number.NEGATIVE_INFINITY)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=re(e);return Math.min(t??Number.POSITIVE_INFINITY,n??Number.POSITIVE_INFINITY)},isInt:e=>{let{isInt:t,multipleOf:n}=re(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>re(e).format??null},{gt(e,t){return this.check(xt(e,t))},gte(e,t){return this.check(Be(e,t))},min(e,t){return this.check(Be(e,t))},lt(e,t){return this.check(bt(e,t))},lte(e,t){return this.check(Ve(e,t))},max(e,t){return this.check(Ve(e,t))},int(e){return this.check(ca(e))},safe(e){return this.check(ca(e))},positive(e){return this.check(xt(0,e))},nonnegative(e){return this.check(Be(0,e))},negative(e){return this.check(bt(0,e))},nonpositive(e){return this.check(Ve(0,e))},multipleOf(e,t){return this.check(wt(e,t))},step(e,t){return this.check(wt(e,t))},finite(){return this}}));function L(e){return si(ha,e)}var cl=h("ZodNumberFormat",(e,t)=>{rs.init(e,t),ha.init(e,t)});function ca(e){return ii(cl,e)}var ul=h("ZodBoolean",(e,t)=>{os.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Oi(e,n,r,o)});function $t(e){return ai(ul,e)}var ll=h("ZodAny",(e,t)=>{ss.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ti(e,n,r,o)});function ma(){return ci(ll)}var dl=h("ZodUnknown",(e,t)=>{is.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ai(e,n,r,o)});function ua(){return ui(dl)}var fl=h("ZodNever",(e,t)=>{as.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Zi(e,n,r,o)});function pl(e){return li(fl,e)}var hl=h("ZodArray",(e,t)=>{Cn(),cs.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Mi(e,n,r,o),e.element=t.element},{min(e,t){return this.check(Ie(e,t))},nonempty(e){return this.check(Ie(1,e))},max(e,t){return this.check(_t(e,t))},length(e,t){return this.check(zt(e,t))},unwrap(){return this.element}});function H(e,t){return di(hl,e,t)}var ml=h("ZodObject",(e,t)=>{Cn(),ds.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Di(e,n,r,o),I.installLazyProp(e,"shape",n=>n._zod.def.shape,!1)},{keyof(){return Ke(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(I.mergeDefs(this._zod.def,{catchall:e}))},passthrough(){return this.clone(I.mergeDefs(this._zod.def,{catchall:ua()}))},loose(){return this.clone(I.mergeDefs(this._zod.def,{catchall:ua()}))},strict(){return this.clone(I.mergeDefs(this._zod.def,{catchall:pl()}))},strip(){return this.clone(I.mergeDefs(this._zod.def,{catchall:void 0}))},extend(e){return I.extend(this,e)},safeExtend(e){return I.safeExtend(this,e)},merge(e){return I.merge(this,e)},pick(e){return I.pick(this,e)},omit(e){return I.omit(this,e)},partial(...e){return I.partial(ga,this,e[0])},exactPartial(...e){return I.partial(va,this,e[0],"exactPartial")},required(...e){return I.required(ya,this,e[0])}});function T(e,t){let n={type:"object",shape:e??{},...I.normalizeParams(t)};return new ml(n)}var gl=h("ZodUnion",(e,t)=>{fs.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Li(e,n,r,o),e.options=t.options});function vl(e,t){return new gl({type:"union",options:e,...I.normalizeParams(t)})}var yl=h("ZodIntersection",(e,t)=>{ps.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ji(e,n,r,o)});function bl(e,t){return new yl({type:"intersection",left:e,right:t})}var Rn=h("ZodEnum",(e,t)=>{hs.init(e,t),M.init(e,t),e._zod.processJSONSchema=(r,o,s)=>Ni(e,r,o,s),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{let s={};for(let i of r)if(n.has(i))s[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Rn({...t,checks:[],...I.normalizeParams(o),entries:s})},e.exclude=(r,o)=>{let s={...t.entries};for(let i of r)if(n.has(i))delete s[i];else throw new Error(`Key ${i} not found in enum`);return new Rn({...t,checks:[],...I.normalizeParams(o),entries:s})}});function Ke(e,t){let n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Rn({type:"enum",entries:n,...I.normalizeParams(t)})}var xl=h("ZodTransform",(e,t)=>{Cn(),ms.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ci(e,n,r,o),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new $e(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(I.issue(s,n.value,t));else{let i=s;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),"input"in i||(i.input=n.value),i.inst??(i.inst=e),n.issues.push(I.issue(i))}};let o=t.transform(n.value,n);return o instanceof Promise?o.then(s=>(n.value=s,n)):(n.value=o,n)}});function wl(e){return new xl({type:"transform",transform:e})}var ga=h("ZodOptional",(e,t)=>{dn.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>An(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function la(e){return new ga({type:"optional",innerType:e})}var va=h("ZodExactOptional",(e,t)=>{gs.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>An(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function _l(e){return new va({type:"optional",innerType:e})}var zl=h("ZodNullable",(e,t)=>{vs.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Fi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function da(e){return new zl({type:"nullable",innerType:e})}var Sl=h("ZodDefault",(e,t)=>{ys.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Bi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kl(e,t){return new Sl({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():I.shallowClone(t)}})}var $l=h("ZodPrefault",(e,t)=>{bs.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Wi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Il(e,t){return new $l({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():I.shallowClone(t)}})}var ya=h("ZodNonOptional",(e,t)=>{xs.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ui(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function El(e,t){return new ya({type:"nonoptional",innerType:e,...I.normalizeParams(t)})}var Pl=h("ZodCatch",(e,t)=>{ws.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ji(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ol(e,t){return new Pl({type:"catch",innerType:e,catchValue:typeof t=="function"?t:I.constantCatch(t)})}var Zl=h("ZodPipe",(e,t)=>{_s.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ki(e,n,r,o),e.in=t.in,e.out=t.out});function fa(e,t){return new Zl({type:"pipe",in:e,out:t})}var Tl=h("ZodReadonly",(e,t)=>{zs.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Hi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Al(e){return new Tl({type:"readonly",innerType:e})}var Nl=h("ZodCustom",(e,t)=>{Ss.init(e,t),M.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Ri(e,n,r,o)});function Rl(e,t={}){return fi(Nl,e,t)}function Cl(e,t){return pi(e,t)}var ba="@avantf/dsh-mission",Mn="avantfMission";function Dn(e,t){return{mode:"strict",typeSymbol:t,schema:e,create:()=>e}}function ye(e,t,n=[],r={}){let o=`${ba}#${Mn}/${e}`;return{id:o,service:Mn,namespace:Mn,method:e,...r.stream===!0?{mode:"stream",cancellation:{parameter:"signal"}}:{},invocation:{kind:"direct"},parameters:[{name:"args",wire:"args",source:"json",codec:Dn(t,`${o}:args`)},...n.map(s=>({name:s.name,wire:s.name,source:"json",codec:Dn(s.schema,`${o}:${s.name}`),...s.acceptsUndefined===void 0?{}:{acceptsUndefined:s.acceptsUndefined}}))],result:Dn(ma(),`${o}:result`)}}var Ml=[];function G(e,t){return{name:e,schema:t,create:()=>t}}var xa=T({reason:Ke(["capacity","unit","slot","aging"]),resource:Ke(["cpu","memory"]).optional(),needed:L().optional(),available:L().optional(),unit:_().optional()});var Dl=T({id:_(),parentId:_().nullable(),children:H(_()),depth:L(),title:_(),context:H(_()),contextCount:L().default(0),corrections:H(_()),correctionCount:L().default(0),status:_(),attempts:L(),createdAt:L(),dispatchedAt:L().nullable().default(null),endedAt:L().nullable().default(null),hasResult:$t(),resultRef:_().nullable(),workerSessionId:_().nullable().default(null),workerLive:$t().default(!1),weight:L().default(1),waitingFor:xa.nullable().default(null)}),Ll=T({rootId:_(),nodes:H(Dl),closedAt:L().nullable()}),jl=[ye("snapshot",T({sessionId:_().optional()})),ye("detail",T({sessionId:_().optional(),nodeId:_()})),ye("result",T({sessionId:_().optional(),nodeId:_()})),ye("delete",T({sessionId:_().optional(),rootId:_()})),ye("cleanFinished",T({sessionId:_().optional()})),ye("resolveExecutorSession",T({sessionId:_().optional(),nodeId:_()})),ye("watch",T({sessionId:_().optional()}),[],{stream:!0})],It=3,Et=2,Pt=3,Ln=T({wire:L().optional(),trees:H(Ll)}),Fl=T({text:_(),error:_().optional()}),Ul=T({deleted:H(_()),error:_().optional()}),jn=T({deleted:H(_()),skipped:H(_())}),Vl=T({id:_(),rootId:_(),title:_(),description:_(),context:H(_()),corrections:H(_()),analysisNotes:H(_()),analysisAttempt:L(),status:_(),attempts:L(),depth:L(),createdAt:L().optional(),dispatchedAt:L().nullable().default(null),endedAt:L().nullable().default(null),result:_().nullable(),resultPointer:_().nullable(),workerSessionId:_().nullable().default(null),workerLive:$t().default(!1),weight:L().default(1),waitingFor:xa.nullable().default(null)}),Fn=T({node:Vl.optional(),children:H(T({id:_(),title:_(),status:_(),result:_().nullable(),resultPointer:_().nullable()})),error:_().optional()}),Bl=T({sessionId:_().optional(),status:Ke(["resolved","never-dispatched","not-found","unsupported"]).optional(),error:_().optional()}),Wl=T({revision:L()});Ml.push(G("snapshotargs",T({sessionId:_().optional()})),G("snapshotResult",Ln),G("deleteargs",T({sessionId:_().optional(),rootId:_()})),G("deleteResult",Ul),G("cleanFinishedargs",T({sessionId:_().optional()})),G("cleanFinishedResult",jn),G("detailargs",T({sessionId:_().optional(),nodeId:_()})),G("detailResult",Fn),G("resultargs",T({sessionId:_().optional(),nodeId:_()})),G("resultText",Fl),G("resolveExecutorSessionargs",T({sessionId:_().optional(),nodeId:_()})),G("executorSessionResult",Bl),G("watchargs",T({sessionId:_().optional()})),G("watchFrame",Wl));var wa={package:ba,descriptors:jl};var E=require("react");var oe=pc(require("react"),1),Oa=require("react-dom");function _a(e){return typeof e=="object"?e.key:e}function za(e,t){let n=e.length;return new Proxy(e,{get(r,o,s){if(typeof o=="string"){let i=o.charCodeAt(0);if(i>=48&&i<=57){let a=+o;if(Number.isInteger(a)&&a>=0&&a<n){let c=r[a];if(typeof c!="object"){let u=t[a*2];c=r[a]={index:a,key:c,start:u,size:t[a*2+1],end:u+t[a*2+1],lane:0}}return c}}if(o==="length")return n}return Reflect.get(r,o,s)}})}function be(e,t,n){let r=n.initialDeps??[],o,s=!0;function i(){var a;let u=0,f=e();if(!(f.length!==r.length||f.some((l,g)=>r[g]!==l)))return o;r=f;let p=0;return o=t(...f),n?.onChange&&!(s&&n.skipInitialOnChange)&&n.onChange(o),s=!1,o}return i.updateDeps=a=>{r=a},i}function Un(e,t){if(e===void 0)throw new Error(`Unexpected undefined${t?`: ${t}`:""}`);return e}var Vn=(e,t)=>Math.abs(e-t)<1.01,Sa=(e,t,n)=>{let r;return Object.assign(function(...o){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,o),n)},{cancel:()=>{e.clearTimeout(r)}})};var He,Bn=()=>{if(He!==void 0)return He;if(typeof navigator>"u")return He=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return He=!0;let e=navigator.maxTouchPoints;return He=navigator.platform==="MacIntel"&&e!==void 0&&e>0};var ka=e=>{let{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},Jl=e=>e,Kl=e=>{let t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,o=new Array(r);for(let s=0;s<r;s++)o[s]=t+s;return o},$a=(e,t)=>{let n=e.scrollElement;if(!n)return;let r=e.targetWindow;if(!r)return;let o=i=>{let{width:a,height:c}=i;t({width:Math.round(a),height:Math.round(c)})};if(o(ka(n)),!r.ResizeObserver)return()=>{};let s=new r.ResizeObserver(i=>{let a=()=>{let c=i[0];if(c?.borderBoxSize){let u=c.borderBoxSize[0];if(u){o({width:u.inlineSize,height:u.blockSize});return}}o(ka(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},Ot={passive:!0};var Hl=typeof window>"u"?!0:"onscrollend"in window,Gl=(e,t,n)=>{let r=e.scrollElement;if(!r)return;let o=e.targetWindow;if(!o)return;let s=e.options.useScrollendEvent&&Hl,i=0,a=s?null:Sa(o,()=>t(n(r),!1),e.options.isScrollingResetDelay),c=d=>()=>{i=n(r),a?.(),t(i,d)},u=c(!0),f=c(!1);return r.addEventListener("scroll",u,Ot),s&&r.addEventListener("scrollend",f,Ot),()=>{r.removeEventListener("scroll",u),s&&r.removeEventListener("scrollend",f),a?.cancel()}},Ia=(e,t)=>Gl(e,t,n=>{let{horizontal:r,isRtl:o}=e.options;return r?n.scrollLeft*(o&&-1||1):n.scrollTop});var Xl=(e,t,n)=>{if(n.options.useCachedMeasurements){let r=n.indexFromElement(e),o=n.options.getItemKey(r);return n.itemSizeCache.get(o)??n.options.estimateSize(r)}if(t?.borderBoxSize){let r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){let r=n.indexFromElement(e),o=n.options.getItemKey(r),s=n.itemSizeCache.get(o);if(s!==void 0)return s}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},ql=(e,{adjustments:t=0,behavior:n},r)=>{var o,s;(s=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||s.call(o,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})};var Ea=ql;function Yl(e,t,n,r){if(t===0)return!1;let o=r(0),s=new Set,i=0;for(;i<e;){let c=n(i);if(c===o)break;s.add(c),i++}let a=e-i;if(a===0||a>=t)return!1;for(let c=0;c<a;c++)if(r(c)!==n(i+c))return!1;for(let c=a;c<t;c++)if(s.has(r(c)))return!1;return!0}var Zt=class{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this._clampedAdjustment=null,this.elementsCache=new Map,this.now=()=>{var n,r,o;return((o=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:o.call(r))??Date.now()},this.observer=(()=>{let n=null,r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(o=>{o.forEach(s=>{let i=()=>{let a=s.target,c=this.indexFromElement(a);if(!a.isConnected){this.observer.unobserve(a);for(let[u,f]of this.elementsCache)if(f===a){this.elementsCache.delete(u);break}return}this.isIndexInRange(c)&&this.shouldMeasureDuringScroll(c)&&this.resizeItem(c,this.options.measureElement(a,s,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(i):i()})}));return{disconnect:()=>{var o;(o=r())==null||o.disconnect(),n=null},observe:o=>{var s;return(s=r())==null?void 0:s.observe(o,{box:"border-box"})},unobserve:o=>{var s;return(s=r())==null?void 0:s.unobserve(o)}}})(),this.range=null,this.setOptions=n=>{var r;let o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Jl,rangeExtractor:Kl,onChange:()=>{},measureElement:Xl,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(let d in n){let p=n[d];p!==void 0&&(o[d]=p)}let s=this.options,i=null,a=null,c=!1;if(s!==void 0&&s.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){let d=s.count,p=o.count,l=this.getMeasurements(),g=((r=this._singleLaneMeasurements)==null?void 0:r.items)??l,y=P=>_a(g[P]),v=d>0?y(0):null,b=d>0?y(d-1):null;if(p!==d||d>0&&p>0&&(o.getItemKey(0)!==v||o.getItemKey(p-1)!==b)){c=!0;let P=d>0?this.getVirtualItemForOffset(this.getScrollOffset())??l[0]:null;P&&(i=[P.key,this.getScrollOffset()-P.start]);let z=o.followOnAppend===!0?"auto":o.followOnAppend||null;z&&p>0&&this.isAtEnd(s.scrollEndThreshold)&&(d===0||o.getItemKey(p-1)!==b)&&(p>d||Yl(d,p,y,o.getItemKey))&&(a=z)}}this.options=o,c&&(this.pendingMin=0,this.itemSizeCacheVersion++);let u=!1,f=0;if(i&&this.scrollOffset!==null){let[d,p]=i,l=this.getMeasurements(),{count:g,getItemKey:y}=this.options,v=0;for(;v<g&&y(v)!==d;)v++;if(v<g){let b=l[v];if(b){let x=Math.max(0,b.start+p);!a&&x!==this.scrollOffset&&(f=x-this.scrollOffset,this.scrollOffset=x,u=!0)}}}(u||a)&&(this.pendingScrollAnchor=[u?i[0]:null,u?i[1]:0,a,f])},this.notify=n=>{var r,o;(o=(r=this.options).onChange)==null||o.call(r,this,n)},this.maybeNotify=be(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.isScrolling=!1,this.scrollDirection=null,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._clampedAdjustment=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n,r;let o=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==o){if(this.cleanup(),!o){this.maybeNotify();return}if(this.scrollElement=o,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(i=>{this.observer.observe(i)}),this.unsubs.push(this.options.observeElementRect(this,i=>{this.scrollRect=i,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(i,a)=>{if(a&&this._intendedScrollOffset===null&&i===this.scrollOffset)return;this._intendedScrollOffset!==null&&Math.abs(i-this._intendedScrollOffset)<1.5&&(i=this._intendedScrollOffset),this._intendedScrollOffset=null,this._clampedAdjustment!==null&&Math.abs(i-this._clampedAdjustment.maxAtWrite)>=1.5&&(this._clampedAdjustment=null),this.scrollAdjustments=0;let c=this.getScrollOffset();this.scrollDirection=a?c===i?this.scrollDirection:c<i?"forward":"backward":null,this.scrollOffset=i,this.isScrolling=a,this._flushIosDeferredIfReady(),this.scrollState&&this.scheduleScrollReconcile(),this.maybeNotify()})),"addEventListener"in this.scrollElement){let i=this.scrollElement,a=()=>{this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},c=()=>{this._iosTouching=!1,!(!Bn()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};i.addEventListener("touchstart",a,Ot),i.addEventListener("touchend",c,Ot),this.unsubs.push(()=>{i.removeEventListener("touchstart",a),i.removeEventListener("touchend",c),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}let s=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,s&&this.scrollElement&&this.options.enabled){let[i,a,c,u]=s;i!==null&&!c&&(Bn()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?u!==0&&(this._iosDeferredAdjustment+=u):((r=this.scrollState)==null?void 0:r.behavior)==="smooth"&&!Vn(this.getScrollOffset()-u,this.scrollState.lastTargetOffset)||this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),c&&this.scrollToEnd({behavior:c})}this._retryClampedAdjustment()},this._retryClampedAdjustment=()=>{if(this._clampedAdjustment===null||!this.scrollElement||!this.options.enabled)return;let{target:n,maxAtWrite:r}=this._clampedAdjustment,o=this.getMaxScrollOffset();o>r+.5&&(this._clampedAdjustment=n>o+.5?{target:n,maxAtWrite:o}:null,this._scrollToOffset(n,{adjustments:void 0,behavior:void 0}))},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;let n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;if(this._iosDeferredAdjustment<0&&n>=r-1){this._iosDeferredAdjustment=0;return}let o=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=o,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getMeasurementOptions=be(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode,this.options.gap],(n,r,o,s,i,a,c,u)=>(this.prevLanes!==void 0&&this.prevLanes!==a&&(this.lanesChangedFlag=!0),this.prevLanes=a,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:o,getItemKey:s,enabled:i,lanes:a,laneAssignmentMode:c,gap:u}),{key:!1}),this.isIndexInRange=n=>n>=0&&n<this.options.count,this.getMeasurements=be(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:o,getItemKey:s,enabled:i,lanes:a,laneAssignmentMode:c,gap:u},f)=>{var d;let p=this.itemSizeCache;if(!i)return this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(let x of this.laneAssignments.keys())x>=n&&this.laneAssignments.delete(x);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this._singleLaneMeasurements=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(x=>{this.itemSizeCache.set(x.key,x.size)}));let l=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),a===1){let x=n*2,w=(d=this._singleLaneMeasurements)==null?void 0:d.flat;if(!w||w.length<x){let $=new Float64Array(x);w&&l>0&&$.set(w.subarray(0,l*2)),w=$}let P=l===0?new Array(n):this._singleLaneMeasurements.items.slice(),z;if(l===0)z=r+o;else{let $=l-1;z=w[$*2]+w[$*2+1]+u}for(let $=l;$<n;$++){let C=s($);P[$]=C;let K=p.get(C),W=typeof K=="number"?K:this.options.estimateSize($);w[$*2]=z,w[$*2+1]=W,z+=W+u}this._singleLaneMeasurements={flat:w,items:P};let k=za(P,w);return this.measurementsCache=k,k}let g=this.measurementsCache.slice(0,l),y=new Array(a).fill(void 0),v=new Float64Array(a),b=0;for(let x=0;x<l;x++){let w=g[x];w&&(y[w.lane]===void 0&&b++,y[w.lane]=x,v[w.lane]=w.end)}for(let x=l;x<n;x++){let w=s(x),P=this.laneAssignments.get(x),z,k,$=c==="estimate"||p.has(w);if(P!==void 0&&this.options.lanes>1){z=P;let F=y[z],B=F!==void 0?g[F]:void 0;k=B?B.end+u:r+o}else if(b===a){let F=0,B=v[0],ie=y[0];for(let se=1;se<a;se++){let xe=v[se];(xe<B||xe===B&&y[se]<ie)&&(F=se,B=xe,ie=y[se])}z=F,k=B+u,$&&this.laneAssignments.set(x,z)}else z=x%this.options.lanes,k=r+o,$&&this.laneAssignments.set(x,z);let C=p.get(w),K=typeof C=="number"?C:this.options.estimateSize(x),W=k+K;g[x]={index:x,start:k,size:K,end:W,key:w,lane:z},y[z]===void 0&&b++,y[z]=x,v[z]=W}return this.measurementsCache=g,g},{key:!1,debug:()=>this.options.debug}),this.calculateRange=be(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,o,s)=>n.length===0||r===0?(this.range=null,null):(this.range=ed(n,r,o,s,s===1&&this._singleLaneMeasurements!==null?this._singleLaneMeasurements.flat:null),this.range),{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=be(()=>{let n=null,r=null,o=this.calculateRange();return o&&(n=o.startIndex,r=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,o,s,i)=>s===null||i===null?[]:n({startIndex:s,endIndex:i,overscan:r,count:o}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{let r=this.options.indexAttribute,o=n.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;let o=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(o!==void 0&&this.range){let s=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),i=Math.max(0,o-s),a=Math.min(this.options.count-1,o+s);return n>=i&&n<=a}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,a)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(a))});return}let r=this.indexFromElement(n);if(!this.isIndexInRange(r))return;let o=this.options.getItemKey(r),s=this.elementsCache.get(o);s!==n&&(s&&this.observer.unobserve(s),this.observer.observe(n),this.elementsCache.set(o,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var o,s,i;if(!this.isIndexInRange(n))return;let a,c,u,f=(o=this._singleLaneMeasurements)==null?void 0:o.flat;if(this.options.lanes===1&&f!=null)u=this.options.getItemKey(n),c=f[n*2],a=f[n*2+1];else{let l=this.measurementsCache[n];if(!l)return;u=l.key,c=l.start,a=l.size}let d=this.itemSizeCache.get(u)??a,p=r-d;if(p!==0){let l=this.options.anchorTo==="end"&&((s=this.scrollState)==null?void 0:s.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,g=l?this.getTotalSize():0,y=this.getScrollOffset()+this.scrollAdjustments,b=!this.itemSizeCache.has(u)?c<y:c+d<=y&&this.scrollDirection!=="backward",x=((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:u,start:c,size:a,end:c+a,lane:0},p,this):b);(this.pendingMin===null||n<this.pendingMin)&&(this.pendingMin=n),this.itemSizeCache.set(u,r),this.itemSizeCacheVersion++;let w=!1;l?w=this.applyScrollAdjustment(this.getTotalSize()-g):x&&(w=this.applyScrollAdjustment(p)),this.notify(w),this._retryClampedAdjustment()}},this.getVirtualItems=be(()=>[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{let o=[];for(let s=0,i=n.length;s<i;s++){let a=n[s],c=r[a];o.push(c)}return o},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{var r;let o=this.getMeasurements();if(o.length===0)return;let s=(r=this._singleLaneMeasurements)==null?void 0:r.flat,i=this.options.lanes===1&&s!=null,a=Pa(0,o.length-1,i?c=>s[c*2]:c=>Un(o[c]).start,n);return Un(o[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{let n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,o=0)=>{if(!this.scrollElement)return 0;let s=this.getSize(),i=this.getScrollOffset();r==="auto"&&(r=n>=i+s?"end":"start"),r==="center"?n+=(o-s)/2:r==="end"&&(n-=s);let a=this.getMaxScrollOffset();return Math.max(Math.min(a,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));let o=this.getSize(),s=this.getScrollOffset(),i=this.measurementsCache[n];if(!i)return;if(r==="auto")if(i.end>=s+o-this.options.scrollPaddingEnd)r="end";else if(i.start<=s+this.options.scrollPaddingStart)r="start";else return[s,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];let a=r==="end"?i.end+this.options.scrollPaddingEnd:i.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,r,i.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:o="auto"}={})=>{this._iosDeferredAdjustment=0;let s=this.getOffsetForAlignment(n,r),i=this.now();this.scrollState={index:null,align:r,behavior:o,startedAt:i,lastTargetOffset:s,stableFrames:0},this._scrollToOffset(s,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:o="auto"}={})=>{this._iosDeferredAdjustment=0,n=Math.max(0,Math.min(n,this.options.count-1));let s=this.getOffsetForIndex(n,r);if(!s)return;let[i,a]=s,c=this.now();this.scrollState={index:n,align:a,behavior:o,startedAt:c,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:o}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{let o=this.getScrollOffset()+n,s=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:s,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n,r;let o=this.getMeasurements(),s;if(o.length===0)s=this.options.paddingStart;else if(this.options.lanes===1){let i=o.length-1,a=(n=this._singleLaneMeasurements)==null?void 0:n.flat;a!=null?s=a[i*2]+a[i*2+1]:s=((r=o[i])==null?void 0:r.end)??0}else{let i=Array(this.options.lanes).fill(null),a=o.length-1;for(;a>=0&&i.some(c=>c===null);){let c=o[a];i[c.lane]===null&&(i[c.lane]=c.end),a--}s=Math.max(...i.filter(c=>c!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{let n=[];if(this.itemSizeCache.size===0)return n;let r=this.getMeasurements();for(let o of r)o&&this.itemSizeCache.has(o.key)&&n.push({index:o.index,key:o.key,start:o.start,size:o.size,end:o.end,lane:o.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:o})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:o,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){if(t===0)return!1;if(Bn()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded))return this._iosDeferredAdjustment+=t,!1;{let r=this.getScrollOffset()+this.scrollAdjustments+t,o=this.scrollElement,s=o!==null&&("scrollHeight"in o||"document"in o)?this.getMaxScrollOffset():null;return this._clampedAdjustment=s!==null&&r>s+.5?{target:r,maxAtWrite:s}:null,this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}),this.scrollOffset!==null&&(this.scrollOffset+=this.scrollAdjustments,this.scrollOffset<0&&(this.scrollOffset=0),this.scrollAdjustments=0),!0}}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}let r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,o=r?r[0]:this.scrollState.lastTargetOffset,s=1,i=o!==this.scrollState.lastTargetOffset;if(!i&&Vn(o,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=s){this.getScrollOffset()!==o&&this._scrollToOffset(o,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,i){let a=this.getSize()||600,c=Math.abs(o-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&c>a;this.scrollState.lastTargetOffset=o,u||(this.scrollState.behavior="auto"),this._scrollToOffset(o,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}},Pa=(e,t,n,r)=>{for(;e<=t;){let o=(e+t)/2|0,s=n(o);if(s<r)e=o+1;else if(s>r)t=o-1;else return o}return e>0?e-1:0};function Ql(e,t,n){let r=0;for(;r<=t;){let o=(r+t)/2|0,s=e[o*2];if(s<n)r=o+1;else if(s>n)t=o-1;else return o}return r>0?r-1:0}function ed(e,t,n,r,o){let s=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:s};if(r===1&&o!==null){let u=Ql(o,s,n),f=u,d=n+t;for(;f<s&&o[f*2]+o[f*2+1]<d;)f++;return{startIndex:u,endIndex:f}}let a=Pa(0,s,u=>e[u].start,n),c=a;if(r===1)for(;c<s&&e[c].end<n+t;)c++;else if(r>1){let u=Array(r).fill(0);for(;c<s&&u.some(d=>d<n+t);){let d=e[c];u[d.lane]=d.end,c++}let f=Array(r).fill(n+t);for(;a>=0&&f.some(d=>d>=n);){let d=e[a];f[d.lane]=d.start,a--}a=Math.max(0,a-a%r),c=Math.min(s,c+(r-1-c%r))}return{startIndex:a,endIndex:c}}var Wn=typeof document<"u"?oe.useLayoutEffect:oe.useEffect;function td({useFlushSync:e=!0,directDomUpdates:t=!1,directDomUpdatesMode:n="transform",...r}){let o=oe.useReducer(d=>d+1,0)[1],s=oe.useRef({enabled:t,mode:n,container:null,lastSize:null,lastPositions:new WeakMap,prevRange:null});s.current.enabled=t,s.current.mode=n;let i=oe.useRef(!1),a=d=>{let p=s.current;if(!p.enabled||!p.container)return;let l=d.getTotalSize();if(l!==p.lastSize){p.lastSize=l;let g=d.options.horizontal?"width":"height";p.container.style[g]=`${l}px`}},c=d=>{let p=s.current;if(!p.enabled||!p.container)return;a(d);let l=!!d.options.horizontal,g=p.mode==="transform",y=l?"left":"top",v=d.options.scrollMargin,b=d.getVirtualItems();for(let x of b){let w=x.start-v,P=d.elementsCache.get(x.key);P&&p.lastPositions.get(P)!==w&&(p.lastPositions.set(P,w),g?P.style.transform=l?`translate3d(${w}px, 0, 0)`:`translate3d(0, ${w}px, 0)`:P.style[y]=`${w}px`)}},u={...r,onChange:(d,p)=>{var l;let g=s.current,y=!0;if(g.enabled){c(d);let v=d.range,b=g.prevRange;y=!b||b.isScrolling!==d.isScrolling||b.startIndex!==v?.startIndex||b.endIndex!==v?.endIndex,y&&(g.prevRange=v?{startIndex:v.startIndex,endIndex:v.endIndex,isScrolling:d.isScrolling}:null)}y&&(e&&p&&!i.current?(0,Oa.flushSync)(o):o()),(l=r.onChange)==null||l.call(r,d,p)}},[f]=oe.useState(()=>{let d=new Zt(u),p=d.measureElement;return d.measureElement=l=>{i.current=!0;try{p(l)}finally{i.current=!1}},Object.assign(d,{containerRef:l=>{let g=s.current;if(g.container=l,g.lastSize=null,l&&g.enabled){let y=d.getTotalSize();g.lastSize=y;let v=d.options.horizontal?"width":"height";l.style[v]=`${y}px`}}})});return f.setOptions(u),Wn(()=>f._didMount(),[]),Wn(()=>(a(f),f._willUpdate())),Wn(()=>{c(f)}),f}function Za(e){return td({observeElementRect:$a,observeElementOffset:Ia,scrollToFn:Ea,...e})}var Ta="avantf-dsh-mission-styles",nd=`
|
|
60
|
+
.avwf-root { display: flex; flex-direction: column; gap: 8px; height: 100%; overflow: hidden; padding: 8px 0 16px; font-size: 12px; width: 100%; max-width: var(--dsh-chat-content-width); margin: 0 auto; }
|
|
61
|
+
/* Line the panel up with the conversation's content column instead of running flush to the
|
|
62
|
+
viewport edges \u2014 the same rule @avantf/mem-dsh uses on the same shared property
|
|
63
|
+
(--dsh-chat-content-width, published by ui-conversation's root and what ui-chat's message
|
|
64
|
+
column centers itself on), so the \u8BB0\u5FC6 tab and this one sit on one axis and one width. The
|
|
65
|
+
property is inherited; where it is absent the declaration is invalid at computed-value time
|
|
66
|
+
and max-width falls back to none, i.e. full bleed as before. No horizontal padding on the
|
|
67
|
+
root: the tree boxes ARE the items, and their edges must land where the \u8BB0\u5FC6 items' do. */
|
|
68
|
+
.avwf-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 8px; }
|
|
69
|
+
/* The windowed list: a canvas of the full scroll height, with only the trees inside
|
|
70
|
+
the window mounted and placed by the virtualizer. */
|
|
71
|
+
.avwf-canvas { position: relative; width: 100%; }
|
|
72
|
+
.avwf-slot { position: absolute; top: 0; left: 0; width: 100%; padding-bottom: 8px; }
|
|
73
|
+
/* Text colours come from the label tokens, never from opacity.
|
|
74
|
+
Opacity is the trap: it MULTIPLIES down a subtree, so one dimmed ancestor plus one dimmed
|
|
75
|
+
child lands near 2.5:1 in either theme \u2014 unreadable at 12px. Measured on the item fill
|
|
76
|
+
(bg-layer-1 = #fff light / #232324 dark): label-primary 18.9:1 and 15.0:1,
|
|
77
|
+
label-secondary 5.8:1 and 10.4:1. Both clear 4.5:1 on both themes; label-tertiary
|
|
78
|
+
(3.7:1 light) is only used for affordances, not for anything that must be read. */
|
|
79
|
+
.avwf-empty, .avwf-error, .avwf-warn { color: var(--dsw-alias-label-secondary); padding: 8px 2px; line-height: 1.6; }
|
|
80
|
+
.avwf-error { color: var(--dsw-alias-state-error-primary, #d9534f); }
|
|
81
|
+
/* A version-skew note, not a failure: the trees below it are still rendered, so it must not read as
|
|
82
|
+
the error colour. Same token family as the error, one step softer, with a readable fallback. */
|
|
83
|
+
.avwf-warn { color: var(--dsw-alias-state-warning-primary, #b8860b); }
|
|
84
|
+
/* Item colours come from the same design tokens @avantf/mem-dsh uses for its \u8BB0\u5FC6 items, so
|
|
85
|
+
the two tabs read as one surface: fill from bg-layer-1, text from label-primary. Both tokens
|
|
86
|
+
are defined by the shell for light and dark; an absent token makes the declaration invalid at
|
|
87
|
+
computed-value time, i.e. it degrades to transparent/inherited rather than to a wrong colour. */
|
|
88
|
+
.avwf-tree { border: 1px solid color-mix(in srgb, currentColor 18%, transparent); border-radius: 6px; padding: 4px 0 6px; background: var(--dsw-alias-bg-layer-1); color: var(--dsw-alias-label-primary); }
|
|
89
|
+
.avwf-tree-settled { border-style: dashed; }
|
|
90
|
+
.avwf-tree-header { display: flex; align-items: center; gap: 8px; padding: 2px 8px 6px; border-bottom: 1px solid color-mix(in srgb, currentColor 12%, transparent); margin-bottom: 4px; }
|
|
91
|
+
.avwf-root-id { font-family: ui-monospace, monospace; color: var(--dsw-alias-label-secondary); }
|
|
92
|
+
.avwf-tree-summary { color: var(--dsw-alias-label-secondary); }
|
|
93
|
+
.avwf-spacer { flex: 1 1 auto; }
|
|
94
|
+
.avwf-node { display: flex; flex-direction: column; }
|
|
95
|
+
.avwf-row { display: flex; align-items: center; gap: 6px; padding: 1px 8px 1px 0; line-height: 1.7; border-radius: 3px; }
|
|
96
|
+
.avwf-row:hover { background: color-mix(in srgb, currentColor 6%, transparent); }
|
|
97
|
+
.avwf-twisty { width: 16px; flex: 0 0 16px; border: 0; background: transparent; color: var(--dsw-alias-label-secondary); font: inherit; cursor: pointer; padding: 0; }
|
|
98
|
+
.avwf-twisty-empty { cursor: default; color: var(--dsw-alias-label-dimmed, currentColor); }
|
|
99
|
+
.avwf-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--avwf-status, currentColor); }
|
|
100
|
+
.avwf-title { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 6px; font: inherit; text-align: left; padding: 0; border: 0; background: transparent; color: inherit; cursor: pointer; }
|
|
101
|
+
.avwf-title-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
102
|
+
.avwf-title:hover .avwf-title-text { text-decoration: underline; text-underline-offset: 2px; }
|
|
103
|
+
.avwf-title-open .avwf-title-text { font-weight: 600; }
|
|
104
|
+
.avwf-detail-hint { color: var(--dsw-alias-label-secondary); }
|
|
105
|
+
.avwf-reused { color: var(--dsw-alias-label-secondary); border: 0.5px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 3px; padding: 0 3px; }
|
|
106
|
+
/* Same treatment as the reused tag: a bordered label, because both say "read this row differently"
|
|
107
|
+
rather than naming a state. Deliberately NOT a status hue \u2014 a correction is an event, not a status. */
|
|
108
|
+
.avwf-corrected { border: 0.5px solid color-mix(in srgb, currentColor 35%, transparent); border-radius: 3px; padding: 0 3px; }
|
|
109
|
+
.avwf-row:hover .avwf-detail-hint { color: var(--dsw-alias-label-primary); }
|
|
110
|
+
/* The badge is text: it wears a label colour and takes its status hue from the tint only.
|
|
111
|
+
A status colour as TEXT does not survive both themes (light-theme green is 2.3:1). */
|
|
112
|
+
.avwf-badge { flex: 0 0 auto; padding: 0 6px; border-radius: 9px; font-size: 11px; color: var(--dsw-alias-label-primary); background: color-mix(in srgb, var(--avwf-status, currentColor) 18%, transparent); }
|
|
113
|
+
.avwf-meta { flex: 0 0 auto; color: var(--dsw-alias-label-secondary); font-size: 11px; }
|
|
114
|
+
/* Timing is digits: tabular figures keep a column of rows from jittering as durations tick over, and
|
|
115
|
+
the row marker is deliberately the same .avwf-meta weight as every other small label so it does not
|
|
116
|
+
compete with the status badge. */
|
|
117
|
+
.avwf-timing { font-variant-numeric: tabular-nums; }
|
|
118
|
+
/* A queued mission: same bordered label as the reused/corrected tags, because being deferred by an
|
|
119
|
+
admission gate is a NORMAL queuing fact, not a status \u2014 it must not wear a status hue. */
|
|
120
|
+
.avwf-waiting { border: 0.5px dashed color-mix(in srgb, currentColor 45%, transparent); border-radius: 3px; padding: 0 3px; }
|
|
121
|
+
.avwf-context { color: var(--dsw-alias-label-secondary); padding-top: 1px; padding-bottom: 3px; line-height: 1.5; }
|
|
122
|
+
/* A status is a HUE, published as a custom property and consumed by shapes (the dot) and as a
|
|
123
|
+
background tint (the badge). The state tokens are the platform's own \u2014 the --dsh-color-*
|
|
124
|
+
names this file used before do not exist in the design platform, so each of them was
|
|
125
|
+
silently falling back to the hardcoded hex. */
|
|
126
|
+
.avwf-ready { --avwf-status: var(--dsw-alias-state-business-primary, #4a9eda); }
|
|
127
|
+
.avwf-running { --avwf-status: var(--dsw-alias-state-warn-label, #d9a441); }
|
|
128
|
+
.avwf-interrupted { --avwf-status: var(--dsw-alias-state-warn-label, #d9a441); }
|
|
129
|
+
.avwf-blocked { --avwf-status: var(--dsw-alias-label-tertiary, #8a8f96); }
|
|
130
|
+
.avwf-done { --avwf-status: var(--dsw-alias-state-success-primary, #4c9a5a); }
|
|
131
|
+
.avwf-failed { --avwf-status: var(--dsw-alias-state-error-primary, #d9534f); }
|
|
132
|
+
.avwf-delete { flex: 0 0 auto; font: inherit; font-size: 11px; padding: 0 6px; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 4px; background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer; }
|
|
133
|
+
.avwf-delete:hover { color: var(--dsw-alias-label-primary); }
|
|
134
|
+
/* A disabled control is allowed to read as inert; an enabled one is not. */
|
|
135
|
+
.avwf-delete:disabled { opacity: .4; cursor: default; }
|
|
136
|
+
.avwf-delete-armed { color: var(--dsw-alias-state-error-primary, #d9534f); border-color: currentColor; }
|
|
137
|
+
/* The batch-clean bar above the list. Same control vocabulary as the per-tree delete, one row of its
|
|
138
|
+
own so the two gestures are never confused: this one acts on EVERY closed tree. */
|
|
139
|
+
.avwf-toolbar { flex: 0 0 auto; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
|
|
140
|
+
.avwf-clean { flex: 0 0 auto; font: inherit; font-size: 11px; padding: 0 8px; border: 1px solid color-mix(in srgb, currentColor 45%, transparent); border-radius: 4px; background: transparent; color: var(--dsw-alias-label-secondary); cursor: pointer; }
|
|
141
|
+
.avwf-clean:hover { color: var(--dsw-alias-label-primary); }
|
|
142
|
+
.avwf-clean:disabled { opacity: .4; cursor: default; }
|
|
143
|
+
.avwf-clean-armed { color: var(--dsw-alias-state-error-primary, #d9534f); border-color: currentColor; }
|
|
144
|
+
.avwf-detail-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
|
|
145
|
+
.avwf-detail-none { color: var(--dsw-alias-label-secondary); }
|
|
146
|
+
.avwf-detail-pointer { color: var(--dsw-alias-label-secondary); font-family: ui-monospace, monospace; }
|
|
147
|
+
.avwf-detail-failed { color: var(--dsw-alias-state-error-primary, #d9534f); }
|
|
148
|
+
/* The corrections are the reader's own instructions, not background: full-strength text, where the
|
|
149
|
+
context list above stays secondary. */
|
|
150
|
+
.avwf-detail-corrections { color: var(--dsw-alias-label-primary); }
|
|
151
|
+
/* One entry of a list section \u2014 context / analysis / corrections \u2014 and the identical box a child's
|
|
152
|
+
result wears, because these are all multi-line prose and the box, not a bullet glyph, is what
|
|
153
|
+
separates them. Shared on purpose: the four sections have to read as ONE list style. */
|
|
154
|
+
.avwf-detail-item { padding: 5px 9px; border-radius: 5px; background: color-mix(in srgb, currentColor 5%, transparent); }
|
|
155
|
+
.avwf-detail-child { display: flex; flex-direction: column; gap: 2px; }
|
|
156
|
+
/* The expanded full result wears the same box as every other long entry, so it reads as one block
|
|
157
|
+
instead of as prose that starts again after the locator. */
|
|
158
|
+
.avwf-detail-full { padding: 6px 10px; border-radius: 5px; background: color-mix(in srgb, currentColor 4%, transparent); }
|
|
159
|
+
/* A link-styled button: the panel's one "do this now" affordance. It wears the shell's LINK token,
|
|
160
|
+
not a status hue \u2014 a status colour as text does not survive both themes (see the badge note). */
|
|
161
|
+
.avwf-link { align-self: flex-start; padding: 0; border: 0; background: transparent; font: inherit; color: var(--dsw-alias-link, var(--dsw-alias-label-primary)); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
|
|
162
|
+
.avwf-link:hover { text-decoration-thickness: 2px; }
|
|
163
|
+
.avwf-link:disabled { color: var(--dsw-alias-label-secondary); cursor: default; text-decoration: none; }
|
|
164
|
+
/* The node id as an ENTRY (the tree header's root id, the dialog's heading id). It is ALWAYS the
|
|
165
|
+
entry (W18) \u2014 a handle opens the session directly, a record without one is looked up on click, and
|
|
166
|
+
a host that cannot do either explains itself on click \u2014 so this is the clickable form and the link
|
|
167
|
+
token is what makes it read as one affordance, not a hue. */
|
|
168
|
+
.avwf-node-id { font-family: ui-monospace, monospace; }
|
|
169
|
+
.avwf-worker-link { padding: 0; border: 0; background: transparent; font: inherit; font-family: ui-monospace, monospace; font-size: 12px; color: var(--dsw-alias-link, var(--dsw-alias-label-primary)); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
|
|
170
|
+
.avwf-worker-link:hover { text-decoration-thickness: 2px; }
|
|
171
|
+
/* W18: an id with no handle LOOKS like the entry it is (a dashed underline says "this will go and
|
|
172
|
+
find something"), and \u67E5\u627E\u4E2D\u2026 replaces the id while the click is being answered \u2014 a click that
|
|
173
|
+
silently did nothing for a second reads as a broken button. The retry glyph marks an id whose
|
|
174
|
+
last lookup missed; it is a hint, not a second control (the id itself is the only entry). */
|
|
175
|
+
.avwf-worker-lookup { text-decoration-style: dashed; }
|
|
176
|
+
.avwf-worker-busy { color: var(--dsw-alias-label-secondary); }
|
|
177
|
+
.avwf-worker-retry { color: var(--dsw-alias-label-secondary); }
|
|
178
|
+
.avwf-worker-error { color: var(--dsw-alias-state-error-primary, #d9534f); }
|
|
179
|
+
.avwf-detail-child-head { display: flex; align-items: center; gap: 6px; }
|
|
180
|
+
.avwf-detail-child-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
181
|
+
/* The detail dialog, built to the shell's \u8BBE\u7F6E panel: full-viewport mask + a centered card split
|
|
182
|
+
into a section rail and a scrolling content column. Layout numbers follow that panel where the
|
|
183
|
+
content is the same shape; the card is 1040x880, wider than the settings panel because the
|
|
184
|
+
reading matter here is a column of prose plus long lists, and the settings' 800px left the
|
|
185
|
+
content column cramped once the 176px rail took its share. */
|
|
186
|
+
.avwf-dialog-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
|
|
187
|
+
.avwf-dialog-mask { position: absolute; inset: 0; background: var(--dsw-alias-bg-mask-1); backdrop-filter: var(--dsw-mask-blur); }
|
|
188
|
+
.avwf-dialog-panel { position: relative; z-index: 1; display: flex; width: 1040px; height: min(880px, calc(100vh - 2 * max(24px, var(--dsh-frame-top-clearance, 24px)))); max-width: calc(100vw - 48px); border-radius: 24px; overflow: hidden; background: var(--dsw-alias-bg-layer-2); box-shadow: var(--dsw-elevation-prominent); --dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2); --dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2); }
|
|
189
|
+
.avwf-dialog-nav { flex: none; display: flex; flex-direction: column; gap: 18px; width: 176px; padding: 22px 12px 0; box-sizing: border-box; }
|
|
190
|
+
.avwf-dialog-nav-title { padding: 0 12px; font-size: 17px; line-height: 26px; font-weight: 500; color: var(--dsw-alias-label-primary); }
|
|
191
|
+
.avwf-dialog-nav-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
|
|
192
|
+
.avwf-dialog-nav-cell { display: flex; align-items: center; gap: 8px; height: 42px; padding: 9px 12px; box-sizing: border-box; border: none; border-radius: 12px; background: transparent; cursor: pointer; font-family: inherit; font-size: 15px; line-height: 24px; color: var(--dsw-alias-label-primary); text-align: left; }
|
|
193
|
+
.avwf-dialog-nav-cell:hover { background: var(--dsw-specific-sidebar-nav-item-hover, color-mix(in srgb, currentColor 6%, transparent)); }
|
|
194
|
+
.avwf-dialog-nav-cell-active { background: var(--dsw-specific-sidebar-nav-item-active, color-mix(in srgb, currentColor 9%, transparent)); }
|
|
195
|
+
.avwf-dialog-nav-label { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
|
|
196
|
+
.avwf-dialog-nav-count { flex: none; font-size: 13px; color: var(--dsw-alias-label-secondary); }
|
|
197
|
+
.avwf-dialog-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
|
|
198
|
+
.avwf-dialog-header { flex: none; display: flex; align-items: flex-start; gap: 12px; padding: 20px 16px 10px 14px; box-sizing: border-box; }
|
|
199
|
+
.avwf-dialog-head-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
|
|
200
|
+
/* The mission's title IS the dialog heading. It wraps rather than elides: a title is the one piece of
|
|
201
|
+
text a reader must not have to hover to read, and titles run to 80 characters by construction. */
|
|
202
|
+
.avwf-dialog-head-title { margin: 0; font-size: 17px; line-height: 1.45; font-weight: 600; color: var(--dsw-alias-label-primary); overflow-wrap: anywhere; }
|
|
203
|
+
.avwf-dialog-head-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--dsw-alias-label-secondary); }
|
|
204
|
+
.avwf-dialog-head-id { font-family: ui-monospace, monospace; }
|
|
205
|
+
/* The full \u53D7\u7406/\u6D3E\u53D1/\u7ED3\u675F line: it wraps onto its own line inside the flex meta row rather than
|
|
206
|
+
squeezing the id/status/attempts beside it, because it is three instants wide by construction. */
|
|
207
|
+
.avwf-dialog-head-time { flex-basis: 100%; font-variant-numeric: tabular-nums; }
|
|
208
|
+
.avwf-dialog-head-meta .avwf-badge { font-size: 12px; }
|
|
209
|
+
.avwf-dialog-close { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0; border: none; border-radius: 30px; background: transparent; cursor: pointer; font: inherit; font-size: 16px; color: var(--dsw-alias-label-primary); }
|
|
210
|
+
.avwf-dialog-close:hover { background: var(--dsw-alias-interactive-bg-hover, color-mix(in srgb, currentColor 6%, transparent)); }
|
|
211
|
+
/* The body is the only scrolling region: the rail is short and the header is fixed, so a long
|
|
212
|
+
description or a long child list scrolls inside a panel that stays put \u2014 the point of the dialog.
|
|
213
|
+
15px/1.7, one step above the row text: this is the surface meant for actual reading, and 14px at
|
|
214
|
+
this width read as fine print. The section hints and the meta lines scale with it. */
|
|
215
|
+
.avwf-dialog-body { flex: 1; min-height: 0; padding: 0 28px 28px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.7; }
|
|
216
|
+
.avwf-dialog-body .avwf-meta { font-size: 13px; }
|
|
217
|
+
.avwf-dialog-hint { color: var(--dsw-alias-label-secondary); font-size: 13px; line-height: 1.6; }
|
|
218
|
+
`;function Aa(){if(document.getElementById(Ta)!==null)return;let t=document.createElement("style");t.id=Ta,t.setAttribute("data-plugin","@avantf/dsh-mission"),t.textContent=nd,document.head.appendChild(t)}function Tt(e){let t=new Date(e),n=r=>String(r).padStart(2,"0");return`${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function rd(e){let t=Math.max(0,Math.round(e/1e3));if(t<60)return`${String(t)}s`;let n=Math.floor(t/60);if(n<60){let i=t%60;return i===0?`${String(n)}m`:`${String(n)}m${String(i)}s`}let r=Math.floor(n/60);if(r<24){let i=n%60;return i===0?`${String(r)}h`:`${String(r)}h${String(i)}m`}let o=Math.floor(r/24),s=r%24;return s===0?`${String(o)}d`:`${String(o)}d${String(s)}h`}function Jn(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function od(e){let t=Jn(e.createdAt);return`\u53D7\u7406 ${t===null?"\u2014":Tt(t)}`}function Na(e){return Jn(e.dispatchedAt)}function Ra(e){return Jn(e.endedAt)}function Ca(e){let t=Na(e),n=Ra(e);return n!==null?t===null?"\u672A\u6D3E\u53D1":`\u8017\u65F6 ${rd(n-t)}`:t===null?void 0:`\u8D77 ${Tt(t)}`}function Ma(e){let t=Na(e),n=Ra(e),r=[od(e)];return r.push(t===null?"\u6D3E\u53D1 \u2014":`\u6D3E\u53D1 ${Tt(t)}`),r.push(n===null?"\u7ED3\u675F \u2014":`\u7ED3\u675F ${Tt(n)}`),r.join(" \uFF5C ")}var m=require("react/jsx-runtime"),ja=["done","failed"],Fa=4e3,sd=25,id=5,ad=120,cd=600,Nt={blocked:"\u7B49\u5F85\u5B50\u4EFB\u52A1",ready:"\u5F85\u6267\u884C",running:"\u6267\u884C\u4E2D",interrupted:"\u5DF2\u4E2D\u65AD",done:"\u5DF2\u5B8C\u6210",failed:"\u5DF2\u5931\u8D25"};function ud(e){return e==null?void 0:e.reason==="unit"?{text:"\u6392\u961F\u4E2D",title:e.unit===void 0?"\u540C\u4E00\u8303\u56F4\u6B63\u6709\u522B\u7684\u4EFB\u52A1\u5728\u8DD1\uFF0C\u7B49\u5B83\u7ED3\u675F":`\u8303\u56F4\u300C${e.unit}\u300D\u6B63\u6709\u522B\u7684\u4EFB\u52A1\u5728\u8DD1\uFF0C\u7B49\u5B83\u7ED3\u675F`}:e.reason==="slot"?{text:"\u6392\u961F\u4E2D",title:"\u540C\u65F6\u6267\u884C\u7684\u4EFB\u52A1\u6570\u5DF2\u8FBE\u4E0A\u9650\uFF0C\u7B49\u4E00\u4E2A\u7A7A\u4F4D"}:e.reason==="aging"?{text:"\u6392\u961F\u4E2D",title:"\u6709\u4EFB\u52A1\u7B49\u5F97\u592A\u4E45\u3001\u5DF2\u9884\u7559\u6574\u673A\uFF1A\u6B63\u5728\u8DD1\u7684\u6392\u7A7A\u540E\u5148\u6D3E\u5B83\uFF0C\u672C\u4EFB\u52A1\u968F\u540E"}:e.resource==="memory"?{text:"\u7B49\u5185\u5B58",title:`${e.needed===void 0||e.available===void 0?"\u5269\u4F59\u53EF\u7528\u5185\u5B58\u65E0\u6CD5\u786E\u8BA4\uFF08\u672C\u5E73\u53F0\u6CA1\u6709\u8FD9\u4E2A\u4FE1\u53F7\uFF09":`\u53EF\u7528\u7EA6 ${String(Math.round(e.available/1048576))} MB\uFF0C\u4F4E\u4E8E\u4E0B\u9650 ${String(Math.round(e.needed/1048576))} MB`}\uFF1B\u4F4E\u4E8E\u4E0B\u9650\u65F6\u5148\u4E0D\u6D3E\u65B0\u4EFB\u52A1\uFF0C\u4E0D\u662F\u62D2\u7EDD`}:{text:"\u7B49\u5BB9\u91CF",title:`\u6574\u673A\u5BB9\u91CF\u4E0D\u591F\uFF0C\u7B49\u6B63\u5728\u8DD1\u7684\u4EFB\u52A1\u7ED3\u675F${e.needed===void 0||e.available===void 0?"":`\uFF08\u9700\u8981 ${String(e.needed)} \u6838\uFF0C\u5F53\u524D\u7A7A\u4F59 ${String(e.available)} \u6838\uFF09`}`}}function ld(e,t){return t.children.map(n=>e.get(n)).filter(n=>n!==void 0)}var Kn=new Set;function dd({text:e,pointer:t,full:n,canLoad:r,onToggle:o}){let s=e!==null&&e!=="";if(!s&&t===null)return(0,m.jsx)("div",{className:"avwf-detail-text avwf-detail-none",children:"\uFF08\u672A\u63D0\u4EA4\u7ED3\u679C\uFF09"});let i=n?.status==="ready";return(0,m.jsxs)(m.Fragment,{children:[s&&!i?(0,m.jsx)("div",{className:"avwf-detail-text",children:e}):null,i?(0,m.jsx)("div",{className:"avwf-detail-text avwf-detail-full",children:n.text}):null,t===null?null:(0,m.jsxs)(m.Fragment,{children:[i?null:(0,m.jsx)("div",{className:"avwf-detail-text avwf-detail-none",children:"\u7ED3\u679C\u8FC7\u957F\uFF0C\u8282\u70B9\u4E0A\u53EA\u7559\u4E86\u5F00\u5934\uFF1B\u5B8C\u6574\u5185\u5BB9\u4E0D\u5728\u8282\u70B9\u91CC\u3002"}),(0,m.jsx)("div",{className:"avwf-detail-text avwf-detail-pointer",title:t,children:t}),r?(0,m.jsx)("button",{type:"button",className:"avwf-link",disabled:n?.status==="loading",onClick:o,children:n?.status==="loading"?"\u8BFB\u53D6\u4E2D\u2026":i?"\u6536\u8D77\u5B8C\u6574\u7ED3\u679C":"\u67E5\u770B\u5B8C\u6574\u7ED3\u679C"}):null]}),n?.status==="error"?(0,m.jsxs)("div",{className:"avwf-detail-text avwf-detail-failed",children:["\u8BFB\u53D6\u5B8C\u6574\u7ED3\u679C\u5931\u8D25\uFF1A",n.error]}):null]})}function Da({nodeId:e,text:t,pointer:n,loadResult:r}){let[o,s]=(0,E.useState)(void 0);return(0,m.jsx)(dd,{text:t,pointer:n,full:o,canLoad:r!==void 0,onToggle:()=>{if(o?.status==="ready"){s(void 0);return}r!==void 0&&(s({status:"loading"}),r(e).then(a=>{s({status:"ready",text:a})}).catch(a=>{s({status:"error",error:a instanceof Error?a.message:String(a)})}))}})}function At({children:e}){return(0,m.jsx)("div",{className:"avwf-dialog-hint",children:e})}function Hn({entries:e,tone:t}){return(0,m.jsx)(m.Fragment,{children:e.map(n=>(0,m.jsx)("div",{className:t==="emphasis"?"avwf-detail-item avwf-detail-corrections":"avwf-detail-item",children:n},n))})}function fd(e,t={}){let n=e.node,r=[{id:"content",label:"\u5185\u5BB9",body:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(At,{children:"\u8FD9\u4E2A\u4EFB\u52A1\u8981\u8FBE\u6210\u4EC0\u4E48 \u2014\u2014 \u8FD9\u91CC\u662F\u9A8C\u6536\u7684\u5BF9\u8C61\u3002"}),(0,m.jsx)("div",{className:"avwf-detail-text",children:n.description===""?"\uFF08\u65E0\uFF09":n.description})]})}];return n.context.length>0&&r.push({id:"context",label:"\u4E0A\u4E0B\u6587",count:n.context.length,body:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(At,{children:"\u4E3A\u4EC0\u4E48\u9700\u8981\u8FD9\u4E2A\u4EFB\u52A1\uFF1A\u62C6\u89E3\u5B83\u7684\u4EBA\u5199\u4E0B\u7684\u524D\u63D0\u4E0E\u7406\u7531\uFF08\u6839\u4EFB\u52A1\u662F owner \u7684\u521D\u59CB\u5224\u65AD\uFF09\u3002\u524D\u63D0\u4E0D\u662F\u9A8C\u6536\u6807\u51C6\u3002"}),(0,m.jsx)(Hn,{entries:n.context})]})}),n.analysisNotes.length>0&&r.push({id:"analysis",label:"\u62C6\u89E3\u4FE1\u606F",count:n.analysisNotes.length,body:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(At,{children:"\u6267\u884C\u8005\u5728\u62C6\u89E3\u524D\u5199\u4E0B\u7684\u5206\u6790\uFF1A\u7F3A\u4EC0\u4E48\u524D\u63D0\u3001\u6392\u9664\u4E86\u54EA\u6761\u8DEF\u3001\u5B50\u4EFB\u52A1\u5B8C\u6210\u540E\u8981\u5224\u65AD\u4EC0\u4E48\u3002"}),(0,m.jsx)(Hn,{entries:n.analysisNotes}),n.analysisAttempt>0?(0,m.jsxs)("div",{className:"avwf-dialog-hint",children:["\u6700\u8FD1\u4E00\u6761\u5199\u4E8E\u7B2C ",n.analysisAttempt," \u6B21\u6D3E\u53D1\u3002"]}):null]})}),n.corrections.length>0&&r.push({id:"corrections",label:"\u7EA0\u504F",count:n.corrections.length,body:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(At,{children:"\u6309\u5148\u540E\u987A\u5E8F\uFF1B\u76EE\u6807\u4EE5\u300C\u6807\u9898\u300D\u4E3A\u51C6\uFF0C\u8FD9\u91CC\u662F\u6B64\u540E\u6BCF\u4E00\u6B21\u6539\u52A8\u7684\u65B9\u5411\u3002"}),(0,m.jsx)(Hn,{entries:n.corrections,tone:"emphasis"})]})}),r.push({id:"result",label:"\u7ED3\u679C",body:(0,m.jsx)(Da,{nodeId:n.id,text:n.result,pointer:n.resultPointer,loadResult:t.loadResult})}),e.children.length>0&&r.push({id:"children",label:"\u5B50\u4EFB\u52A1",count:e.children.length,body:(0,m.jsx)(m.Fragment,{children:e.children.map(o=>(0,m.jsxs)("div",{className:"avwf-detail-item avwf-detail-child",children:[(0,m.jsxs)("div",{className:"avwf-detail-child-head",children:[(0,m.jsx)("span",{className:`avwf-dot avwf-${o.status}`,title:o.status}),(0,m.jsx)("span",{className:"avwf-detail-child-title",title:o.id,children:o.title}),(0,m.jsx)("span",{className:"avwf-meta",children:Nt[o.status]??o.status})]}),(0,m.jsx)(Da,{nodeId:o.id,text:o.result,pointer:o.resultPointer,loadResult:t.loadResult})]},o.id))})}),r}function pd(e){let t=[],n=e;for(;;){let r=n.parentElement;if(r===null)break;for(let o of Array.from(r.children))o===n||!(o instanceof HTMLElement)||o.inert||(o.inert=!0,t.push(o));if(r===document.body)break;n=r}return()=>{for(let r of t)r.inert=!1}}function hd(e,t){return{parentSessionId:e,childSessionId:t,mode:"continuable"}}function md(e,t){return typeof e=="string"&&e!==""?`\u6253\u5F00\u6267\u884C\u8FD9\u4E2A\u4EFB\u52A1\u7684\u4F1A\u8BDD\uFF08${t===!0?"\u8FDB\u884C\u4E2D":"\u5DF2\u7ED3\u675F"}\uFF09`:"\u5C1D\u8BD5\u6253\u5F00\u6267\u884C\u8FD9\u4E2A\u4EFB\u52A1\u7684\u4F1A\u8BDD\uFF08\u8BB0\u5F55\u91CC\u6CA1\u6709\u53E5\u67C4\uFF0C\u70B9\u51FB\u65F6\u67E5\u627E\uFF09"}function gd(e,t){let n=t===void 0||t===""?"":`\uFF08${t}\uFF09`;switch(e){case"never-dispatched":return"\u8FD9\u4E2A\u4EFB\u52A1\u4ECE\u672A\u6D3E\u53D1\u8FC7\u6267\u884C\u8005\u4F1A\u8BDD\uFF1A\u6CA1\u6709\u53EF\u6253\u5F00\u7684\u6267\u884C\u8005\u3002";case"not-found":return`\u627E\u4E0D\u5230\u8FD9\u4E2A\u4EFB\u52A1\u7684\u6267\u884C\u8005\u4F1A\u8BDD${n}\uFF1A\u5B83\u53EF\u80FD\u5DF2\u88AB\u6E05\u7406\uFF0C\u6216\u65E5\u5FD7\u5DF2\u4E0D\u5728\u672C\u673A\u3002`;case"unsupported":return t===void 0||t===""?"\u65E0\u6CD5\u6253\u5F00\u6267\u884C\u8005\u4F1A\u8BDD\uFF1A\u8FD9\u4E2A\u5BBF\u4E3B\u4E0D\u652F\u6301\u8FD9\u6B21\u67E5\u627E\u3002":`\u65E0\u6CD5\u6253\u5F00\u6267\u884C\u8005\u4F1A\u8BDD\uFF1A${t}`;case"open":return`\u627E\u5230\u6267\u884C\u8005\u4F1A\u8BDD\uFF0C\u4F46\u6253\u5F00\u5931\u8D25${n}\u3002`}}function La(e,t){return e?"\u67E5\u627E\u4E2D\u2026":t}async function vd(e){let t=(s,i)=>({opened:!1,reason:s,message:gd(s,i)}),n=s=>s instanceof Error?s.message:String(s);if(e.open===void 0)return t("unsupported","\u5F53\u524D\u5BBF\u4E3B\u6CA1\u6709 uiWorkspace \u670D\u52A1");let r=e.workerSessionId,o=typeof r=="string"&&r!==""?r:void 0;if(o===void 0){let s=e.resolveSession;if(s===void 0)return t("unsupported","\u8FD9\u4E2A\u5BBF\u4E3B\u8FD8\u4E0D\u652F\u6301\u67E5\u627E\u6267\u884C\u8005\u4F1A\u8BDD");e.onLookupStart?.();let i;try{i=await s(e.nodeId)}catch(a){return t("unsupported",n(a))}if(i.status!=="resolved"||typeof i.sessionId!="string"||i.sessionId===""){let a=i.status==="resolved"?"not-found":i.status;return t(a,i.error)}o=i.sessionId}try{return await Promise.resolve(e.open(hd(e.parentSessionId,o))),{opened:!0,workerSessionId:o}}catch(s){return t("open",n(s))}}function yd(e){return async()=>{if(e.busy)return;e.setFailed(!1);let t=await vd({nodeId:e.nodeId,parentSessionId:e.parentSessionId,workerSessionId:e.workerSessionId,...e.open===void 0?{}:{open:e.open},...e.resolveSession===void 0?{}:{resolveSession:e.resolveSession},onLookupStart:()=>{e.setBusy(!0)}}).finally(()=>{e.setBusy(!1)});t.opened||(e.setFailed(!0),e.onFailure(t.message))}}function Ua({nodeId:e,workerSessionId:t,workerLive:n,sessionId:r,open:o,onFailure:s,resolveSession:i,className:a}){let[c,u]=(0,E.useState)(!1),[f,d]=(0,E.useState)(!1),p=typeof t=="string"&&t!=="",l=md(t,n),g=p?`\u6267\u884C\u8FD9\u4E2A\u4EFB\u52A1\u7684\u4F1A\u8BDD ${t}\uFF08${n===!0?"\u8FDB\u884C\u4E2D":"\u5DF2\u7ED3\u675F"}\uFF09`:"\u6267\u884C\u8FD9\u4E2A\u4EFB\u52A1\u7684\u4F1A\u8BDD\uFF08\u8BB0\u5F55\u91CC\u6CA1\u6709\u53E5\u67C4\uFF0C\u70B9\u51FB\u65F6\u6309\u65F6\u95F4\u7A97\u4E0E\u9996\u6761\u63D0\u793A\u8BCD\u67E5\u627E\uFF09",y=o===void 0?"\uFF1B\u5F53\u524D\u5BBF\u4E3B\u6CA1\u6709 uiWorkspace \u670D\u52A1\uFF0C\u65E0\u6CD5\u8DF3\u8F6C":"",v=yd({nodeId:e,parentSessionId:r,workerSessionId:t,...o===void 0?{}:{open:o},...i===void 0?{}:{resolveSession:i},busy:c,setBusy:u,setFailed:d,onFailure:s});return(0,m.jsxs)("button",{type:"button",className:`${a} avwf-node-id avwf-worker-link${p?"":" avwf-worker-lookup"}`,title:`${l}
|
|
219
|
+
${g}\uFF1B\u4E0D\u662F\u4EFB\u52A1\u8BE6\u60C5${y}`,"aria-label":l,disabled:c,onClick:()=>{v()},children:[f&&!c?(0,m.jsx)("span",{className:"avwf-worker-retry",title:"\u4E0A\u6B21\u6CA1\u627E\u5230\uFF1B\u518D\u70B9\u4E00\u6B21\u91CD\u8BD5",children:"\u21BB "}):null,c?(0,m.jsx)("span",{className:"avwf-worker-busy",children:La(!0,e)}):La(!1,e)]})}function Va({message:e}){return(0,m.jsx)("span",{className:"avwf-worker-error",role:"alert",children:e})}function bd({nodeId:e,state:t,onClose:n,loadResult:r,sessionId:o,openWorkerSession:s,resolveWorkerSession:i}){(0,E.useEffect)(()=>{let b=x=>{x.key==="Escape"&&n()};return document.addEventListener("keydown",b),()=>{document.removeEventListener("keydown",b)}},[n]);let a=(0,E.useRef)(null),c=(0,E.useRef)(null);(0,E.useEffect)(()=>{let b=c.current,x=document.activeElement instanceof HTMLElement?document.activeElement:null,w=b===null?()=>{}:pd(b);return a.current?.focus(),()=>{w(),x?.isConnected===!0&&x.focus()}},[]);let[u,f]=(0,E.useState)(void 0),[d,p]=(0,E.useState)(void 0),l=t?.status==="ready"?t.detail:void 0,g=l===void 0?[]:fd(l,{loadResult:r}),y=g.find(b=>b.id===u)??g[0],v=(0,E.useId)();return(0,m.jsxs)("div",{ref:c,className:"avwf-dialog-overlay",role:"presentation",children:[(0,m.jsx)("div",{className:"avwf-dialog-mask","aria-hidden":"true",onClick:n}),(0,m.jsxs)("div",{className:"avwf-dialog-panel",role:"dialog","aria-modal":"true","aria-labelledby":v,children:[(0,m.jsxs)("nav",{className:"avwf-dialog-nav",children:[(0,m.jsx)("div",{className:"avwf-dialog-nav-title",children:"\u4EFB\u52A1\u8BE6\u60C5"}),(0,m.jsx)("div",{className:"avwf-dialog-nav-list",children:g.map(b=>(0,m.jsxs)("button",{type:"button",className:b.id===y?.id?"avwf-dialog-nav-cell avwf-dialog-nav-cell-active":"avwf-dialog-nav-cell","aria-current":b.id===y?.id?"true":void 0,onClick:()=>{f(b.id)},children:[(0,m.jsx)("span",{className:"avwf-dialog-nav-label",children:b.label}),b.count===void 0?null:(0,m.jsx)("span",{className:"avwf-dialog-nav-count",children:b.count})]},b.id))})]}),(0,m.jsxs)("div",{className:"avwf-dialog-content",children:[(0,m.jsxs)("div",{className:"avwf-dialog-header",children:[(0,m.jsxs)("div",{className:"avwf-dialog-head-text",children:[(0,m.jsx)("h2",{id:v,className:"avwf-dialog-head-title",title:l?.node.title,children:l?.node.title??"\u4EFB\u52A1\u8BE6\u60C5"}),(0,m.jsxs)("div",{className:"avwf-dialog-head-meta",children:[(0,m.jsx)(Ua,{nodeId:l?.node.id??e,workerSessionId:l?.node.workerSessionId,workerLive:l?.node.workerLive,sessionId:o,onFailure:p,className:"avwf-dialog-head-id",...s===void 0?{}:{open:s},...i===void 0?{}:{resolveSession:i}}),d===void 0?null:(0,m.jsx)(Va,{message:d}),l===void 0?null:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("span",{className:`avwf-badge avwf-${l.node.status}`,children:Nt[l.node.status]??l.node.status}),(0,m.jsxs)("span",{children:["\u7B2C ",l.node.attempts," \u6B21\u6D3E\u53D1 \xB7 \u6DF1\u5EA6 ",l.node.depth]}),(0,m.jsx)("span",{className:"avwf-dialog-head-time",children:Ma(l.node)})]})]})]}),(0,m.jsx)("button",{ref:a,type:"button",className:"avwf-dialog-close","aria-label":"\u5173\u95ED",onClick:n,children:"\u2715"})]}),(0,m.jsx)("div",{className:"avwf-dialog-body",children:t===void 0||t.status==="loading"?(0,m.jsx)("div",{className:"avwf-detail-text avwf-detail-none",children:"\u8BFB\u53D6\u4EFB\u52A1\u8BE6\u60C5\u2026"}):t.status==="error"?(0,m.jsxs)("div",{className:"avwf-detail-text avwf-detail-failed",children:["\u8BFB\u53D6\u4EFB\u52A1\u8BE6\u60C5\u5931\u8D25\uFF1A",t.error]}):y===void 0?(0,m.jsx)("div",{className:"avwf-detail-text avwf-detail-none",children:"\u6CA1\u6709\u8BE6\u60C5\u53EF\u663E\u793A"}):y.body})]})]})]})}function xd(e,t){return e===t||e.id===t.id&&e.parentId===t.parentId&&e.depth===t.depth&&e.title===t.title&&e.status===t.status&&e.attempts===t.attempts&&e.dispatchedAt===t.dispatchedAt&&e.endedAt===t.endedAt&&e.hasResult===t.hasResult&&e.resultRef===t.resultRef&&e.workerSessionId===t.workerSessionId&&e.workerLive===t.workerLive&&e.weight===t.weight&&(e.contextCount??e.context.length)===(t.contextCount??t.context.length)&&(e.correctionCount??e.corrections.length)===(t.correctionCount??t.corrections.length)&&e.corrections.length===t.corrections.length&&e.corrections.every((n,r)=>n===t.corrections[r])&&e.children.length===t.children.length&&e.children.every((n,r)=>n===t.children[r])&&wd(e.waitingFor,t.waitingFor)}function wd(e,t){return e===t?!0:e==null||t===null||t===void 0?!1:e.reason===t.reason&&e.resource===t.resource&&e.needed===t.needed&&e.available===t.available&&e.unit===t.unit}function _d(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var zd=(0,E.memo)(function e({node:t,byId:n,depth:r,viaParentId:o,ancestors:s=Kn,actions:i}){let{openId:a,onOpenDetail:c}=i,u=ld(n,t).filter($=>!s.has($.id)),f=o!==void 0&&t.parentId!==o,[d,p]=(0,E.useState)(void 0),l=ja.includes(t.status),g=d??!l,y=u.length>0,v={paddingLeft:`${String(r*14+6)}px`},b=a===t.id,x=ud(t.waitingFor),w=Math.max(t.contextCount??0,t.context.length),P=t.corrections,z=Math.max(t.correctionCount??0,P.length),k=Ca(t);return(0,m.jsxs)("div",{className:"avwf-node",children:[(0,m.jsxs)("div",{className:"avwf-row",style:v,children:[(0,m.jsx)("button",{type:"button",className:y?"avwf-twisty":"avwf-twisty avwf-twisty-empty",onClick:()=>{p(!g)},"aria-expanded":y?g:void 0,tabIndex:y?0:-1,title:y?"\u5C55\u5F00/\u6536\u8D77\u5B50\u4EFB\u52A1":void 0,children:y?g?"\u25BE":"\u25B8":"\xB7"}),(0,m.jsxs)("button",{type:"button",className:b?"avwf-title avwf-title-open":"avwf-title",onClick:()=>{c(t.id)},"aria-haspopup":"dialog","aria-expanded":b,title:`${t.title}
|
|
220
|
+
\u70B9\u51FB\u67E5\u770B\u4EFB\u52A1\u8BE6\u60C5`,children:[(0,m.jsx)("span",{className:`avwf-dot avwf-${t.status}`,title:t.status}),(0,m.jsx)("span",{className:"avwf-title-text",children:t.title})]}),f?(0,m.jsx)("span",{className:"avwf-meta avwf-reused",title:"\u8FD9\u4E2A\u8282\u70B9\u662F\u590D\u7528\u7684\u524D\u63D0\uFF0C\u51FA\u751F\u5728\u522B\u7684\u4EFB\u52A1\u4E0B",children:"\u590D\u7528"}):null,z>0?(0,m.jsxs)("span",{className:"avwf-meta avwf-corrected",title:`\u5DF2\u7EA0\u504F ${String(z)} \u6B21\uFF1A
|
|
221
|
+
${P.join(`
|
|
222
|
+
`)}`+(z>P.length?`
|
|
223
|
+
\uFF08\u8FD9\u91CC\u53EA\u5217\u6700\u65B0 ${String(P.length)} \u6761\uFF0C\u5168\u90E8\u5728\u8BE6\u60C5\u91CC\uFF09`:""),children:["\u5DF2\u7EA0\u504F ",z," \u6B21"]}):null,(0,m.jsx)("span",{className:`avwf-badge avwf-${t.status}`,children:Nt[t.status]??t.status}),x===void 0?null:(0,m.jsx)("span",{className:"avwf-meta avwf-waiting",title:x.title,children:x.text}),t.weight!==void 0&&t.weight>1?(0,m.jsxs)("span",{className:"avwf-meta",title:`\u8FD9\u4E2A\u4EFB\u52A1\u6309 ${String(t.weight)} \u6838\u53C2\u4E0E\u6574\u673A\u5BB9\u91CF\u5206\u914D`,children:["\u7EA6\u5360 ",t.weight," \u6838"]}):null,t.attempts>1?(0,m.jsxs)("span",{className:"avwf-meta",children:["\u7B2C ",t.attempts," \u6B21"]}):null,k===void 0?null:(0,m.jsx)("span",{className:"avwf-meta avwf-timing",title:"\u5728\u8BE6\u60C5\u91CC\u770B\u5B8C\u6574\u65F6\u95F4",children:k}),t.resultRef!==null?(0,m.jsx)("span",{className:"avwf-meta",title:t.resultRef,children:"\u7ED3\u679C\u5DF2\u843D\u76D8"}):null,(0,m.jsx)("span",{className:"avwf-meta avwf-detail-hint",children:"\u8BE6\u60C5"})]}),w>0?(0,m.jsxs)("div",{className:"avwf-context",style:{paddingLeft:`${String(r*14+30)}px`},children:["\u80CC\u666F ",w," \u6761\uFF08\u8BE6\u60C5\u91CC\u53EF\u89C1\uFF09"]}):null,g&&y?u.map($=>(0,m.jsx)(e,{node:$,byId:n,depth:r+1,viaParentId:t.id,ancestors:new Set([...s,t.id]),actions:i},$.id)):null]})},(e,t)=>e.depth===t.depth&&e.viaParentId===t.viaParentId&&e.byId===t.byId&&e.actions===t.actions&&_d(e.ancestors??Kn,t.ancestors??Kn)&&xd(e.node,t.node));function Sd({tree:e,actions:t,busy:n,onDeleteTree:r,sessionId:o,openWorkerSession:s,resolveWorkerSession:i}){let a=e.nodes.find(v=>v.id===e.rootId),c=a!==void 0&&ja.includes(a.status),u=e.nodes.reduce((v,b)=>(v[b.status]=(v[b.status]??0)+1,v),{}),f=Object.entries(u).map(([v,b])=>`${String(b)} ${Nt[v]??v}`).join(" \xB7 "),[d,p]=(0,E.useState)(!1),[l,g]=(0,E.useState)(void 0),y=(0,E.useMemo)(()=>new Map(e.nodes.map(v=>[v.id,v])),[e.nodes]);return(0,E.useEffect)(()=>{if(!d)return;let v=setTimeout(()=>{p(!1)},Fa);return()=>{clearTimeout(v)}},[d]),(0,m.jsxs)("section",{className:c?"avwf-tree avwf-tree-settled":"avwf-tree",children:[(0,m.jsxs)("header",{className:"avwf-tree-header",children:[(0,m.jsx)(Ua,{nodeId:e.rootId,workerSessionId:a?.workerSessionId,workerLive:a?.workerLive,sessionId:o,onFailure:g,className:"avwf-root-id",...s===void 0?{}:{open:s},...i===void 0?{}:{resolveSession:i}}),l===void 0?null:(0,m.jsx)(Va,{message:l}),(0,m.jsx)("span",{className:"avwf-tree-summary",children:f}),e.closedAt===null?null:(0,m.jsx)("span",{className:"avwf-meta",children:"\u5DF2\u5F52\u6863"}),(0,m.jsx)("span",{className:"avwf-spacer"}),(0,m.jsx)("button",{type:"button",className:d?"avwf-delete avwf-delete-armed":"avwf-delete",disabled:!c||n===e.rootId,title:c?"\u5220\u9664\u6574\u68F5\u6811\uFF1A\u5168\u90E8\u8282\u70B9\u4E0E\u7ED3\u679C\u4E00\u5E76\u5220\u9664\uFF0C\u4E0D\u53EF\u6062\u590D":"\u4EFB\u52A1\u6811\u8FD8\u5728\u8DD1\uFF1A\u5148\u7ED3\u675F\u5B83\uFF08cancel_mission\uFF09\uFF0C\u6216\u7B49\u5B83\u6536\u655B\u540E\u518D\u5220\u9664",onClick:()=>{if(!d){p(!0);return}p(!1),r(e.rootId)},children:n===e.rootId?"\u5220\u9664\u4E2D\u2026":d?"\u786E\u8BA4\u5220\u9664":"\u5220\u9664"})]}),a===void 0?(0,m.jsx)("div",{className:"avwf-empty",children:"\u6839\u8282\u70B9\u7F3A\u5931"}):(0,m.jsx)(zd,{node:a,byId:y,depth:0,actions:t})]})}function kd({finished:e,busy:t,onClean:n}){let[r,o]=(0,E.useState)(!1);return(0,E.useEffect)(()=>{if(!r)return;let i=setTimeout(()=>{o(!1)},Fa);return()=>{clearTimeout(i)}},[r]),(0,m.jsx)("div",{className:"avwf-toolbar",children:(0,m.jsx)("button",{type:"button",className:r?"avwf-clean avwf-clean-armed":"avwf-clean",disabled:e===0||t,title:e===0?"\u672C\u4F1A\u8BDD\u6CA1\u6709\u5DF2\u5B8C\u6210\uFF08finish_mission \u6536\u5C3E\uFF09\u7684\u4EFB\u52A1\u6811":`\u5220\u9664\u672C\u4F1A\u8BDD\u5168\u90E8 ${String(e)} \u68F5\u5DF2\u5B8C\u6210\u4EFB\u52A1\u6811\uFF1A\u8282\u70B9\u4E0E\u7ED3\u679C\u4E00\u5E76\u5220\u9664\uFF0C\u4E0D\u53EF\u6062\u590D`,onClick:()=>{if(!r){o(!0);return}o(!1),n()},children:t?"\u6E05\u7406\u4E2D\u2026":r?`\u786E\u8BA4\u6E05\u7406 ${String(e)} \u68F5`:`\u6E05\u7406\u5DF2\u5B8C\u6210${e===0?"":`\uFF08${String(e)}\uFF09`}`})})}function Ba({useSnapshot:e,onDeleteTree:t,onCleanFinished:n,loadDetail:r,loadResult:o,sessionId:s,openWorkerSession:i,resolveWorkerSession:a}){Aa();let c=e(),[u,f]=(0,E.useState)(void 0),[d,p]=(0,E.useState)(void 0),[l,g]=(0,E.useState)(!1),[y,v]=(0,E.useState)(void 0),[b,x]=(0,E.useState)(!1),[w,P]=(0,E.useState)(void 0),[z,k]=(0,E.useState)(void 0),$=(0,E.useRef)(r);$.current=r;let C=O=>{f(O),p(void 0),t(O).then(()=>c.refresh()).catch(D=>{p(D instanceof Error?D.message:String(D))}).finally(()=>{f(void 0)})},K=()=>{n!==void 0&&(g(!0),v(void 0),x(!1),n().then(O=>(v(O.deleted.length===0?`\u6CA1\u6709\u5DF2\u5B8C\u6210\u7684\u4EFB\u52A1\u6811\u53EF\u6E05\u7406\uFF08\u8DF3\u8FC7 ${String(O.skipped.length)} \u68F5\u672A\u6536\u5C3E\uFF09\u3002`:`\u5DF2\u6E05\u7406 ${String(O.deleted.length)} \u68F5\u5DF2\u5B8C\u6210\u4EFB\u52A1\uFF08\u8DF3\u8FC7 ${String(O.skipped.length)} \u68F5\u4ECD\u5728\u8FDB\u884C\uFF09\u3002`),c.refresh())).catch(O=>{x(!0),v(O instanceof Error?O.message:String(O))}).finally(()=>{g(!1)}))},W=O=>{k(D=>D?.nodeId===O&&D.status==="ready"?D:{nodeId:O,status:"loading"}),$.current(O).then(D=>{k(Ze=>Ze?.nodeId===O?{nodeId:O,status:"ready",detail:D}:Ze)}).catch(D=>{k(Ze=>Ze?.nodeId===O?{nodeId:O,status:"error",error:D instanceof Error?D.message:String(D)}:Ze)})};(0,E.useEffect)(()=>{w!==void 0&&W(w)},[c.data,w]);let F=c.data?.trees??[],B=F.length>sd,ie=(0,E.useRef)(null),se=Za({count:B?F.length:0,enabled:B,estimateSize:()=>ad,getItemKey:O=>F[O]?.rootId??O,getScrollElement:()=>ie.current,initialRect:{width:0,height:cd},overscan:id}),xe=(0,E.useCallback)(O=>{P(O)},[]),ic=(0,E.useMemo)(()=>({openId:w,onOpenDetail:xe}),[w,xe]),ac=F.filter(O=>O.closedAt!==null).length,er=(O,D)=>(0,m.jsx)("div",{className:D===void 0?void 0:"avwf-slot","data-index":D?.index,ref:D===void 0?void 0:se.measureElement,style:D?.style,children:(0,m.jsx)(Sd,{tree:O,actions:ic,busy:u,onDeleteTree:C,sessionId:s,...i===void 0?{}:{openWorkerSession:i},...a===void 0?{}:{resolveWorkerSession:a}})},O.rootId);return(0,m.jsxs)("div",{className:"avwf-root",children:[c.error!==void 0?(0,m.jsx)("div",{className:"avwf-error",children:c.error}):null,c.data?.skew!==void 0?(0,m.jsx)("div",{className:"avwf-warn",children:c.data.skew}):null,d!==void 0?(0,m.jsxs)("div",{className:"avwf-error",children:["\u5220\u9664\u5931\u8D25\uFF1A",d]}):null,n===void 0||F.length===0?null:(0,m.jsx)(kd,{finished:ac,busy:l,onClean:K}),y===void 0?null:(0,m.jsx)("div",{className:b?"avwf-error":"avwf-meta",children:y}),c.loading&&c.data===void 0?(0,m.jsx)("div",{className:"avwf-empty",children:"\u8BFB\u53D6\u4E2D\u2026"}):null,(0,m.jsx)("div",{className:"avwf-scroll",ref:ie,children:B?(0,m.jsx)("div",{className:"avwf-canvas",style:{height:`${String(se.getTotalSize())}px`},children:se.getVirtualItems().map(O=>{let D=F[O.index];return D===void 0?null:er(D,{index:O.index,style:{transform:`translateY(${String(O.start)}px)`}})})}):F.map(O=>er(O))}),w===void 0?null:(0,m.jsx)(bd,{nodeId:w,state:z?.nodeId===w?z:void 0,onClose:()=>{P(void 0)},loadResult:o,sessionId:s,...i===void 0?{}:{openWorkerSession:i},...a===void 0?{}:{resolveWorkerSession:a}},w)]})}var Rt=5e3,Wa=400,Ja=3e4;function Ka(e){return`${String(e.queued)}:${e.running?"1":"0"}`}function $d(e){if(typeof e=="string")return e;if(e===null||typeof e!="object")return String(e);let t=e.message;if(typeof t=="string"&&t!=="")return t;try{return JSON.stringify(e)}catch{return String(e)}}function Ha(e,t){let n;return{request:()=>{n===void 0&&(n=setTimeout(()=>{n=void 0,e()},t))},cancel:()=>{n!==void 0&&(clearTimeout(n),n=void 0)}}}function Oe(e){if(e===null||typeof e!="object")return{value:e};let t=e;return t.ok===!1?{error:$d(t.error)}:t.ok===!0?{value:t.value}:{value:e}}function Gn(e,t){let n=t.slice(0,3).join("; ");return`${e}\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u6570\u636E\uFF08${n}\uFF09\u2014\u2014 \u5BBF\u4E3B\u4E0E\u5BA2\u6237\u7AEF\u53EF\u80FD\u4E0D\u662F\u540C\u4E00\u7248\u672C\uFF1A\u5BA2\u6237\u7AEF\u968F\u9875\u9762\u5237\u65B0\uFF0C\u5BBF\u4E3B\u53EA\u5728 dsh web \u542F\u52A8\u65F6\u52A0\u8F7D\u4E00\u6B21\uFF0C\u91CD\u542F dsh web \u540E\u518D\u8BD5\u3002`}function Xn(e){return e.issues.map(t=>`${t.path.map(String).join(".")||"(\u6839)"}: ${t.message}`)}function Id(e){return typeof e=="string"?e:e==null?"\u4EFB\u52A1\u6811\u62D2\u7EDD\u4E86\u8FD9\u6B21\u64CD\u4F5C":JSON.stringify(e)}function Ed(e){let t=e!==null&&typeof e=="object"?e.wire:void 0;if(t!==It)return t===void 0?`\u5BBF\u4E3B\u6CA1\u6709\u56DE\u62A5 wire \u7248\u672C\uFF08\u5B83\u6BD4\u672C\u5BA2\u6237\u7AEF\u65E7\uFF09\uFF1A\u9762\u677F\u53EF\u80FD\u7F3A\u5C11\u65B0\u5B57\u6BB5\uFF0C\u91CD\u542F dsh web \u8BA9\u4E24\u534A\u5BF9\u9F50\u3002\uFF08\u672C\u5BA2\u6237\u7AEF\u8BF4 wire=${String(It)}\uFF09`:`\u5BBF\u4E3B\u56DE\u62A5\u7684 wire \u7248\u672C\u662F ${String(t)}\uFF0C\u672C\u5BA2\u6237\u7AEF\u53EA\u8BA4\u8BC6 ${String(It)}\uFF1A\u9762\u677F\u7EE7\u7EED\u663E\u793A\uFF0C\u4F46\u4E24\u534A\u53EF\u80FD\u5DF2\u7ECF\u9519\u4F4D\u2014\u2014\u91CD\u542F dsh web \u540E\u518D\u8BD5\u3002`}async function Ga(e,t){let{value:n,error:r}=Oe(await e.snapshot({sessionId:t}));if(r!==void 0)throw new Error(r);let o=Ln.safeParse(n);if(!o.success)throw new Error(Gn("\u4EFB\u52A1\u6811",Xn(o.error)));let s=Ed(n),i=o.data.wire;return{trees:o.data.trees,...i===void 0?{}:{wire:i},...s===void 0?{}:{skew:s}}}async function Xa(e,t,n){let{value:r,error:o}=Oe(await e.delete({sessionId:t,rootId:n}));if(o!==void 0)throw new Error(o);let s=r;if(s!==null&&typeof s=="object"&&s.error!==void 0)throw new Error(Id(s.error));let i=s!==null&&typeof s=="object"?s.deleted:void 0;return Array.isArray(i)?i:[]}async function qa(e,t,n){if(n===void 0||n<Pt)throw new Error(Zd(n));let r=e.cleanFinished;if(typeof r!="function")throw new Error("\u5BBF\u4E3B\u53EF\u80FD\u6CA1\u6709\u6CE8\u518C\u8FD9\u4E2A\u63A5\u53E3\uFF08\u65E7\u7248\u672C / \u672A\u91CD\u542F\uFF09\uFF1ARemote \u9762\u6CA1\u6709 cleanFinished \u8C03\u7528\uFF0C\u5BBF\u4E3B\u53EA\u5728 dsh web \u542F\u52A8\u65F6\u52A0\u8F7D\u4E00\u6B21\uFF0C\u91CD\u542F dsh web \u540E\u518D\u8BD5\u3002");let o;try{o=await r({sessionId:t})}catch(c){throw new Error(qn(c))}let{value:s,error:i}=Oe(o);if(i!==void 0)throw new Error(i);let a=jn.safeParse(s);if(!a.success)throw new Error(Gn("\u5DF2\u5B8C\u6210\u4EFB\u52A1\u6E05\u7406",Xn(a.error)));return{deleted:a.data.deleted,skipped:a.data.skipped}}function Pd(e){let t=Fn.safeParse(e);return t.success?{...t.data.node===void 0?{}:{node:t.data.node},children:t.data.children??[],...t.data.error===void 0?{}:{error:t.data.error}}:{error:Gn("\u4EFB\u52A1\u8BE6\u60C5",Xn(t.error))}}async function Ya(e,t,n){let{value:r,error:o}=Oe(await e.detail({sessionId:t,nodeId:n}));if(o!==void 0)throw new Error(o);let s=Pd(r);if(s.error!==void 0)throw new Error(s.error);if(s.node===void 0)throw new Error(`\u4EFB\u52A1 ${n} \u6CA1\u6709\u53EF\u663E\u793A\u7684\u8BE6\u60C5`);return{node:s.node,children:s.children??[]}}function qn(e){let t=e instanceof Error?e.message:String(e);return/404|not found/iu.test(t)?`\u5BBF\u4E3B\u53EF\u80FD\u6CA1\u6709\u6CE8\u518C\u8FD9\u4E2A\u63A5\u53E3\uFF08\u65E7\u7248\u672C / \u672A\u91CD\u542F\uFF09\uFF1A\u5BA2\u6237\u7AEF\u4F1A\u968F\u9875\u9762\u5237\u65B0\uFF0C\u5BBF\u4E3B\u53EA\u5728 dsh web \u542F\u52A8\u65F6\u52A0\u8F7D\u4E00\u6B21\uFF0C\u6240\u4EE5 dsh web \u5F88\u53EF\u80FD\u8FD8\u5728\u8DD1\u65E7\u7684\u5BBF\u4E3B\u4EE3\u7801\u3002\u91CD\u542F dsh web \u540E\u518D\u8BD5\u3002\uFF08\u539F\u59CB\u9519\u8BEF\uFF1A${t}\uFF09`:t}function Od(e){return`${e===void 0?`\u5BBF\u4E3B\u6CA1\u6709\u56DE\u62A5 wire \u7248\u672C\uFF08\u672C\u5BA2\u6237\u7AEF\u9700\u8981 ${String(Et)}\uFF09`:`\u5BBF\u4E3B\u4ECD\u5728\u8FD0\u884C\u65E7\u7248\u672C\uFF08wire ${String(e)} < ${String(Et)}\uFF09`}\uFF1A\u5B83\u8FD8\u6CA1\u6709\u6CE8\u518C resolveExecutorSession \u8FD9\u6761\u8C03\u7528\uFF0C\u6240\u4EE5\u8FD9\u6B21\u67E5\u627E\u6CA1\u6709\u53D1\u51FA\u53BB\u3002\u91CD\u542F dsh \u540E\u5373\u53EF\u70B9\u51FB\u5386\u53F2\u4EFB\u52A1\u3002`}function Zd(e){return`${e===void 0?`\u5BBF\u4E3B\u6CA1\u6709\u56DE\u62A5 wire \u7248\u672C\uFF08\u672C\u5BA2\u6237\u7AEF\u9700\u8981 ${String(Pt)}\uFF09`:`\u5BBF\u4E3B\u4ECD\u5728\u8FD0\u884C\u65E7\u7248\u672C\uFF08wire ${String(e)} < ${String(Pt)}\uFF09`}\uFF1A\u5B83\u8FD8\u6CA1\u6709\u6CE8\u518C cleanFinished \u8FD9\u6761\u8C03\u7528\uFF0C\u6240\u4EE5\u8FD9\u6B21\u6E05\u7406\u6CA1\u6709\u53D1\u51FA\u53BB\u3002\u91CD\u542F dsh web \u540E\u5373\u53EF\u6279\u91CF\u6E05\u7406\u5DF2\u5B8C\u6210\u4EFB\u52A1\uFF08\u4E5F\u53EF\u4EE5\u5148\u7528 /clean missions all\uFF09\u3002`}async function Qa(e,t,n){let r=e.result;if(typeof r!="function")throw new Error("\u8FD9\u4E2A\u5BBF\u4E3B\u4E0D\u652F\u6301\u8BFB\u56DE\u5B8C\u6574\u7ED3\u679C\uFF08Remote \u9762\u6CA1\u6709 result \u8C03\u7528\uFF09");let o;try{o=await r({sessionId:t,nodeId:n})}catch(u){throw new Error(qn(u))}let{value:s,error:i}=Oe(o);if(i!==void 0)throw new Error(i);let a=s;if(a!==null&&typeof a=="object"&&typeof a.error=="string")throw new Error(a.error);let c=a!==null&&typeof a=="object"?a.text:void 0;if(typeof c!="string")throw new Error("\u5B8C\u6574\u7ED3\u679C\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u6570\u636E");return c}async function ec(e,t,n,r){if(r===void 0||r<Et)throw new Error(Od(r));let o=e.resolveExecutorSession;if(typeof o!="function")throw new Error("\u5BBF\u4E3B\u53EF\u80FD\u6CA1\u6709\u6CE8\u518C\u8FD9\u4E2A\u63A5\u53E3\uFF08\u65E7\u7248\u672C / \u672A\u91CD\u542F\uFF09\uFF1ARemote \u9762\u6CA1\u6709 resolveExecutorSession \u8C03\u7528\uFF0C\u5BBF\u4E3B\u53EA\u5728 dsh web \u542F\u52A8\u65F6\u52A0\u8F7D\u4E00\u6B21\uFF0C\u91CD\u542F dsh web \u540E\u518D\u8BD5\u3002");let s;try{s=await o({sessionId:t,nodeId:n})}catch(f){throw new Error(qn(f))}let{value:i,error:a}=Oe(s);if(a!==void 0)throw new Error(a);let c=i;if(c===null||typeof c!="object")throw new Error("\u67E5\u627E\u6267\u884C\u8005\u4F1A\u8BDD\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u6570\u636E");let u=c.status;if(u!=="resolved"&&u!=="never-dispatched"&&u!=="not-found"&&u!=="unsupported")throw new Error("\u67E5\u627E\u6267\u884C\u8005\u4F1A\u8BDD\u8FD4\u56DE\u4E86\u65E0\u6CD5\u8BC6\u522B\u7684\u6570\u636E");return{status:u,...typeof c.sessionId=="string"?{sessionId:c.sessionId}:{},...typeof c.error=="string"?{error:c.error}:{}}}async function tc(e,t,n,r){let o=e.watch;if(typeof o=="function")for await(let s of o.call(e,{sessionId:t},n)){if(n.aborted)return;r()}}var nc=1e3;function Yn(e,t,n,r=globalThis){if(typeof n?.interval=="function")return n.interval(e,t);let o=r.setInterval,s=r.clearInterval;if(typeof o=="function"&&typeof s=="function"){let i=o(e,t);return()=>{s(i)}}return()=>{}}function rc(e){return Array.isArray(e?.queue)?e.queue.length:-1}function oc(e){return e?.running===!0}var Td="avantf-mission",Ad=["remote","slots","locale"],Qn="avantf-mission",sc="[avantf-mission]",Nd={"view.missions":"\u4EFB\u52A1"},Rd={"view.missions":"Works"};function Cd(e){let{sessionId:t,getRemote:n,mounted:r,schedule:o,keepalive:s,revision:i,log:a,noteWire:c}=e,[u,f]=(0,j.useState)(void 0),[d,p]=(0,j.useState)(void 0),[l,g]=(0,j.useState)(!1),[y,v]=(0,j.useState)("pending"),b=(0,j.useRef)(!0),x=(0,j.useRef)(0),w=(0,j.useCallback)(async()=>{await r;let k=n();if(k===void 0){p("\u4EFB\u52A1\u6811 Remote \u672A\u6302\u8F7D\uFF1A\u672C\u63D2\u4EF6\u81EA\u5E26\u7684 typert contribution \u6302\u8F7D\u5931\u8D25\uFF08\u8BE6\u89C1\u63A7\u5236\u53F0\uFF09\u3002");return}let $=++x.current;g(!0);try{let C=await Ga(k,t);if($!==x.current)return;c(C.wire),f(C),p(void 0)}catch(C){if($!==x.current)return;p(`\u8BFB\u53D6\u4EFB\u52A1\u6811\u5931\u8D25\uFF1A${C instanceof Error?C.message:String(C)}`)}finally{$===x.current&&g(!1)}},[r,n,t,c]),P=(0,j.useMemo)(()=>Ha(()=>{w()},Wa),[w]),z=P.request;return(0,j.useEffect)(()=>P.cancel,[P]),(0,j.useEffect)(()=>{if(b.current){b.current=!1,w();return}z()},[w,i,z]),(0,j.useEffect)(()=>{let k=new AbortController,$=!0,C;return(async()=>{await r;let K=n();if(!$)return;if(K===void 0||typeof K.watch!="function"){v("timer");return}v("stream");let W=0,F=async()=>{let B=0;try{await tc(K,t,k.signal,()=>{B+=1,z()})}catch(ie){a("error",`change stream ended with an error: ${String(ie)}`)}if($){if(W=B===0?W+1:0,W>=2){a("error","change stream delivered nothing twice; falling back to the refresh timer"),v("timer");return}z(),C=setTimeout(()=>{F()},nc)}};F()})(),()=>{$=!1,k.abort(),C!==void 0&&clearTimeout(C)}},[r,n,t,z]),(0,j.useEffect)(()=>{if(y==="timer")return o(()=>{w()})},[y,o,w]),(0,j.useEffect)(()=>s(()=>{w()}),[s,w]),{data:u,loading:l,error:d,refresh:w}}function Md(e){let t=(l,g)=>{console[l](`${sc} ${g}`);try{l==="error"&&e.logger.error(`${sc} ${g}`)}catch{}};t("log","client half mounting: conversation.view seat + avantfMission Remote namespace"),e.effect(()=>e.locale.register(Qn,{zh:Nd,en:Rd}),"avantf-mission: dictionaries");let n={},r=l=>{n.wire=l},o=(()=>{let l=()=>{};return{promise:new Promise(y=>{l=y}),settle:l}})();e.remote.$mount(wa).then(()=>{n.remote=e.get("remote.avantfMission"),n.remote===void 0?t("error",'contribution mounted but ctx.get("remote.avantfMission") is undefined; the view will report it'):t("log","Remote namespace mounted: the \u4EFB\u52A1 view can read the tree"),o.settle()}).catch(l=>{t("error",`mounting the Remote contribution failed: ${String(l)}`),o.settle()});let s=e.locale.bind(Qn),i=l=>Yn(l,Rt,e.get("timer")),a=l=>Yn(l,Ja,e.get("timer")),c=typeof setInterval=="function"&&typeof clearInterval=="function";t("log",e.get("timer")!==void 0?`auto-refresh: engine change stream, platform timer fallback (${String(Rt)} ms)`:c?`auto-refresh: engine change stream, browser timer fallback (${String(Rt)} ms)`:"auto-refresh: engine change stream + session events only");let u=()=>n.remote,f=()=>{let l=e.get("uiWorkspace");return l!==void 0&&typeof l.openSession=="function"?l:void 0};function d(l){let g=l.useSession(v=>rc(v)),y=l.useSession(v=>oc(v));return Ka({queued:g,running:y})}let p=l=>{let y=d(l),v=f();return(0,j.createElement)(Ba,{useSnapshot:()=>Cd({sessionId:l.sessionId,getRemote:u,mounted:o.promise,schedule:i,keepalive:a,revision:y,log:t,noteWire:r}),onDeleteTree:async b=>{let x=u();if(x===void 0)throw new Error("\u4EFB\u52A1\u6811 Remote \u672A\u6302\u8F7D");await Xa(x,l.sessionId,b)},onCleanFinished:async()=>{let b=u();if(b===void 0)throw new Error("\u4EFB\u52A1\u6811 Remote \u672A\u6302\u8F7D");return await qa(b,l.sessionId,n.wire)},loadDetail:async b=>{let x=u();if(x===void 0)throw new Error("\u4EFB\u52A1\u6811 Remote \u672A\u6302\u8F7D");return await Ya(x,l.sessionId,b)},loadResult:async b=>{let x=u();if(x===void 0)throw new Error("\u4EFB\u52A1\u6811 Remote \u672A\u6302\u8F7D");return await Qa(x,l.sessionId,b)},sessionId:l.sessionId,resolveWorkerSession:async b=>{let x=u();if(x===void 0)throw new Error("\u4EFB\u52A1\u6811 Remote \u672A\u6302\u8F7D");return await ec(x,l.sessionId,b,n.wire)},...v===void 0?{}:{openWorkerSession:b=>{v.openSession(b)}}})};e.slots.inject("conversation.view",()=>e.slots.register({name:"conversation.view",id:"missions",order:20,locale:Qn,label:()=>s("view.missions")},p)),t("log","registered the conversation.view seat: id=missions order=20")}
|
|
224
|
+
|
|
225
|
+
return module.exports; } });
|