@ms-cloudpack/link-proxy 0.2.4 → 0.2.5

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.
@@ -0,0 +1,2 @@
1
+ export const __webpack_id__=173;export const __webpack_ids__=[173];export const __webpack_modules__={173:e=>{e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}};
2
+ //# sourceMappingURL=173.chunk.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"582.chunk.js","mappings":"6GAEAA,EAAOC,QAAU,WACf,MAAM,IAAIC,MACR,wFAGJ,C","sources":["webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/ws-virtual-e6216dc9c5/package/browser.js"],"sourcesContent":["'use strict';\n\nmodule.exports = function () {\n throw new Error(\n 'ws does not work in the browser. Browser clients must use the native ' +\n 'WebSocket object'\n );\n};\n"],"names":["module","exports","Error"],"sourceRoot":""}
1
+ {"version":3,"file":"173.chunk.js","mappings":"6GAEAA,EAAOC,QAAU,WACf,MAAM,IAAIC,MACR,wFAGJ,C","sources":["webpack://@ms-cloudpack/link-proxy/../../node_modules/.store/ws-virtual-964cd0e897/package/browser.js"],"sourcesContent":["'use strict';\n\nmodule.exports = function () {\n throw new Error(\n 'ws does not work in the browser. Browser clients must use the native ' +\n 'WebSocket object'\n );\n};\n"],"names":["module","exports","Error"],"sourceRoot":""}
@@ -1,3 +1,3 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- export const __webpack_id__=293;export const __webpack_ids__=[293];export const __webpack_modules__={25:e=>{e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),a="/*# ".concat(s," */");return[t].concat([a]).join("\n")}return[t].join("\n")}},191:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,s,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var o=0;o<this.length;o++){var c=this[o][0];null!=c&&(i[c]=!0)}for(var u=0;u<e.length;u++){var d=[].concat(e[u]);r&&i[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),t.push(d))}},t}},214:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},286:e=>{var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var a={},i=[],o=0;o<e.length;o++){var c=e[o],u=r.base?c[0]+r.base:c[0],d=a[u]||0,l="".concat(u," ").concat(d);a[u]=d+1;var p=n(l),h={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)t[p].references++,t[p].updater(h);else{var f=s(h,r);r.byIndex=o,t.splice(o,0,{identifier:l,updater:f,references:1})}i.push(l)}return i}function s(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,s){var a=r(e=e||[],s=s||{});return function(e){e=e||[];for(var i=0;i<a.length;i++){var o=n(a[i]);t[o].references--}for(var c=r(e,s),u=0;u<a.length;u++){var d=n(a[u]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}a=c}}},460:(e,t,n)=>{var r,s,a={};n.r(a),n.d(a,{BRAND:()=>qe,DIRTY:()=>b,EMPTY_PATH:()=>g,INVALID:()=>_,NEVER:()=>jt,OK:()=>k,ParseStatus:()=>v,Schema:()=>N,ZodAny:()=>le,ZodArray:()=>me,ZodBigInt:()=>ae,ZodBoolean:()=>ie,ZodBranded:()=>ze,ZodCatch:()=>$e,ZodDate:()=>oe,ZodDefault:()=>De,ZodDiscriminatedUnion:()=>be,ZodEffects:()=>Ne,ZodEnum:()=>Ze,ZodError:()=>d,ZodFirstPartyTypeKind:()=>Ke,ZodFunction:()=>Se,ZodIntersection:()=>we,ZodIssueCode:()=>c,ZodLazy:()=>Te,ZodLiteral:()=>Oe,ZodMap:()=>Ce,ZodNaN:()=>Le,ZodNativeEnum:()=>Re,ZodNever:()=>he,ZodNull:()=>de,ZodNullable:()=>Me,ZodNumber:()=>se,ZodObject:()=>ye,ZodOptional:()=>Ie,ZodParsedType:()=>i,ZodPipeline:()=>Fe,ZodPromise:()=>je,ZodReadonly:()=>Ue,ZodRecord:()=>Ae,ZodSchema:()=>N,ZodSet:()=>Ee,ZodString:()=>ne,ZodSymbol:()=>ce,ZodTransformer:()=>Ne,ZodTuple:()=>xe,ZodType:()=>N,ZodUndefined:()=>ue,ZodUnion:()=>ve,ZodUnknown:()=>pe,ZodVoid:()=>fe,addIssueToContext:()=>y,any:()=>st,array:()=>ct,bigint:()=>Qe,boolean:()=>Xe,coerce:()=>Rt,custom:()=>Be,date:()=>et,datetimeRegex:()=>X,defaultErrorMap:()=>l,discriminatedUnion:()=>pt,effect:()=>At,enum:()=>kt,function:()=>vt,getErrorMap:()=>f,getParsedType:()=>o,instanceof:()=>He,intersection:()=>ht,isAborted:()=>w,isAsync:()=>C,isDirty:()=>x,isValid:()=>A,late:()=>Ve,lazy:()=>_t,literal:()=>bt,makeIssue:()=>m,map:()=>gt,nan:()=>Ge,nativeEnum:()=>wt,never:()=>it,null:()=>rt,nullable:()=>Et,number:()=>Ye,object:()=>ut,objectUtil:()=>s,oboolean:()=>Zt,onumber:()=>Pt,optional:()=>Ct,ostring:()=>Ot,pipeline:()=>Tt,preprocess:()=>St,promise:()=>xt,quotelessJson:()=>u,record:()=>mt,set:()=>yt,setErrorMap:()=>h,strictObject:()=>dt,string:()=>Je,symbol:()=>tt,transformer:()=>At,tuple:()=>ft,undefined:()=>nt,union:()=>lt,unknown:()=>at,util:()=>r,void:()=>ot}),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(r||(r={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(s||(s={}));const i=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),o=e=>{switch(typeof e){case"undefined":return i.undefined;case"string":return i.string;case"number":return Number.isNaN(e)?i.nan:i.number;case"boolean":return i.boolean;case"function":return i.function;case"bigint":return i.bigint;case"symbol":return i.symbol;case"object":return Array.isArray(e)?i.array:null===e?i.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?i.promise:"undefined"!=typeof Map&&e instanceof Map?i.map:"undefined"!=typeof Set&&e instanceof Set?i.set:"undefined"!=typeof Date&&e instanceof Date?i.date:i.object;default:return i.unknown}},c=r.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),u=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class d extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(r);else if("invalid_return_type"===s.code)r(s.returnTypeError);else if("invalid_arguments"===s.code)r(s.argumentsError);else if(0===s.path.length)n._errors.push(t(s));else{let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof d))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}d.create=e=>new d(e);const l=(e,t)=>{let n;switch(e.code){case c.invalid_type:n=e.received===i.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case c.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,r.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:n=`Unrecognized key(s) in object: ${r.joinValues(e.keys,", ")}`;break;case c.invalid_union:n="Invalid input";break;case c.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${r.joinValues(e.options)}`;break;case c.invalid_enum_value:n=`Invalid enum value. Expected ${r.joinValues(e.options)}, received '${e.received}'`;break;case c.invalid_arguments:n="Invalid function arguments";break;case c.invalid_return_type:n="Invalid function return type";break;case c.invalid_date:n="Invalid date";break;case c.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:r.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case c.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case c.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case c.custom:n="Invalid input";break;case c.invalid_intersection_types:n="Intersection results could not be merged";break;case c.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case c.not_finite:n="Number must be finite";break;default:n=t.defaultError,r.assertNever(e)}return{message:n}};let p=l;function h(e){p=e}function f(){return p}const m=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,a=[...n,...s.path||[]],i={...s,path:a};if(void 0!==s.message)return{...s,path:a,message:s.message};let o="";const c=r.filter((e=>!!e)).slice().reverse();for(const e of c)o=e(i,{data:t,defaultError:o}).message;return{...s,path:a,message:o}},g=[];function y(e,t){const n=f(),r=m({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===l?void 0:l].filter((e=>!!e))});e.common.issues.push(r)}class v{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return _;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,r=await e.value;n.push({key:t,value:r})}return v.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:s}=r;if("aborted"===t.status)return _;if("aborted"===s.status)return _;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!r.alwaysSet||(n[t.value]=s.value)}return{status:e.value,value:n}}}const _=Object.freeze({status:"aborted"}),b=e=>({status:"dirty",value:e}),k=e=>({status:"valid",value:e}),w=e=>"aborted"===e.status,x=e=>"dirty"===e.status,A=e=>"valid"===e.status,C=e=>"undefined"!=typeof Promise&&e instanceof Promise;var E;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(E||(E={}));var S,T,O=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},P=function(e,t,n,r,s){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?s.call(e,n):s?s.value=n:t.set(e,n),n};class Z{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const R=(e,t)=>{if(A(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new d(e.common.issues);return this._error=t,this._error}}};function j(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??s.defaultError}:void 0===s.data?{message:a??r??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:a??n??s.defaultError}},description:s}}class N{get description(){return this._def.description}_getType(e){return o(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new v,ctx:{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(C(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},r=this._parseSync({data:e,path:n.path,parent:n});return R(n,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return A(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>A(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},r=this._parse({data:e,path:n.path,parent:n}),s=await(C(r)?r:Promise.resolve(r));return R(n,s)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const s=e(t),a=()=>r.addIssue({code:c.custom,...n(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(a(),!1))):!!s||(a(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Ne({schema:this,typeName:Ke.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Ie.create(this,this._def)}nullable(){return Me.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return me.create(this)}promise(){return je.create(this,this._def)}or(e){return ve.create([this,e],this._def)}and(e){return we.create(this,e,this._def)}transform(e){return new Ne({...j(this._def),schema:this,typeName:Ke.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new De({...j(this._def),innerType:this,defaultValue:t,typeName:Ke.ZodDefault})}brand(){return new ze({typeName:Ke.ZodBranded,type:this,...j(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new $e({...j(this._def),innerType:this,catchValue:t,typeName:Ke.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Fe.create(this,e)}readonly(){return Ue.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const I=/^c[^\s-]{8,}$/i,M=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,L=/^[a-z0-9_-]{21}$/i,q=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,z=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,F=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let U;const W=/^(?:(?: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])$/,B=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,V=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,K=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,H=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,J=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Y="((\\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])))",G=new RegExp(`^${Y}$`);function Q(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function X(e){let t=`${Y}T${Q(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function ee(e,t){if(!q.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!("object"!=typeof s||null===s||"typ"in s&&"JWT"!==s?.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function te(e,t){return!("v4"!==t&&t||!B.test(e))||!("v6"!==t&&t||!K.test(e))}class ne extends N{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==i.string){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.string,received:t.parsedType}),_}const t=new v;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:c.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:c.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,s=e.data.length<i.value;(r||s)&&(n=this._getOrReturnCtx(e,n),r?y(n,{code:c.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&y(n,{code:c.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)F.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"email",code:c.invalid_string,message:i.message}),t.dirty());else if("emoji"===i.kind)U||(U=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),U.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"emoji",code:c.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)$.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"uuid",code:c.invalid_string,message:i.message}),t.dirty());else if("nanoid"===i.kind)L.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"nanoid",code:c.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)I.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cuid",code:c.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)M.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cuid2",code:c.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)D.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"ulid",code:c.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),y(n,{validation:"url",code:c.invalid_string,message:i.message}),t.dirty()}else"regex"===i.kind?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"regex",code:c.invalid_string,message:i.message}),t.dirty())):"trim"===i.kind?e.data=e.data.trim():"includes"===i.kind?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty()):"toLowerCase"===i.kind?e.data=e.data.toLowerCase():"toUpperCase"===i.kind?e.data=e.data.toUpperCase():"startsWith"===i.kind?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):"endsWith"===i.kind?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):"datetime"===i.kind?X(i).test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:"datetime",message:i.message}),t.dirty()):"date"===i.kind?G.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:"date",message:i.message}),t.dirty()):"time"===i.kind?new RegExp(`^${Q(i)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:"time",message:i.message}),t.dirty()):"duration"===i.kind?z.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"duration",code:c.invalid_string,message:i.message}),t.dirty()):"ip"===i.kind?(s=e.data,("v4"!==(a=i.version)&&a||!W.test(s))&&("v6"!==a&&a||!V.test(s))&&(n=this._getOrReturnCtx(e,n),y(n,{validation:"ip",code:c.invalid_string,message:i.message}),t.dirty())):"jwt"===i.kind?ee(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"jwt",code:c.invalid_string,message:i.message}),t.dirty()):"cidr"===i.kind?te(e.data,i.version)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cidr",code:c.invalid_string,message:i.message}),t.dirty()):"base64"===i.kind?H.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"base64",code:c.invalid_string,message:i.message}),t.dirty()):"base64url"===i.kind?J.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"base64url",code:c.invalid_string,message:i.message}),t.dirty()):r.assertNever(i);var s,a;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:c.invalid_string,...E.errToObj(n)})}_addCheck(e){return new ne({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...E.errToObj(e)})}url(e){return this._addCheck({kind:"url",...E.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...E.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...E.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...E.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...E.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...E.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...E.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...E.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...E.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...E.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...E.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...E.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...E.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...E.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...E.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...E.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...E.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...E.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...E.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...E.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...E.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...E.errToObj(t)})}nonempty(e){return this.min(1,E.errToObj(e))}trim(){return new ne({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ne({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ne({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function re(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}ne.create=e=>new ne({checks:[],typeName:Ke.ZodString,coerce:e?.coerce??!1,...j(e)});class se extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==i.number){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.number,received:t.parsedType}),_}let t;const n=new v;for(const s of this._def.checks)"int"===s.kind?r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:c.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):"multipleOf"===s.kind?0!==re(e.data,s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):"finite"===s.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_finite,message:s.message}),n.dirty()):r.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,E.toString(t))}gt(e,t){return this.setLimit("min",e,!1,E.toString(t))}lte(e,t){return this.setLimit("max",e,!0,E.toString(t))}lt(e,t){return this.setLimit("max",e,!1,E.toString(t))}setLimit(e,t,n,r){return new se({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:E.toString(r)}]})}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:E.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:E.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:E.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:E.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:E.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&r.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}se.create=e=>new se({checks:[],typeName:Ke.ZodNumber,coerce:e?.coerce||!1,...j(e)});class ae extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==i.bigint)return this._getInvalidInput(e);let t;const n=new v;for(const s of this._def.checks)"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):"multipleOf"===s.kind?e.data%s.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):r.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,E.toString(t))}gt(e,t){return this.setLimit("min",e,!1,E.toString(t))}lte(e,t){return this.setLimit("max",e,!0,E.toString(t))}lt(e,t){return this.setLimit("max",e,!1,E.toString(t))}setLimit(e,t,n,r){return new ae({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:E.toString(r)}]})}_addCheck(e){return new ae({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:E.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ae.create=e=>new ae({checks:[],typeName:Ke.ZodBigInt,coerce:e?.coerce??!1,...j(e)});class ie extends N{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==i.boolean){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.boolean,received:t.parsedType}),_}return k(e.data)}}ie.create=e=>new ie({typeName:Ke.ZodBoolean,coerce:e?.coerce||!1,...j(e)});class oe extends N{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==i.date){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.date,received:t.parsedType}),_}if(Number.isNaN(e.data.getTime()))return y(this._getOrReturnCtx(e),{code:c.invalid_date}),_;const t=new v;let n;for(const s of this._def.checks)"min"===s.kind?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:c.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),t.dirty()):"max"===s.kind?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:c.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),t.dirty()):r.assertNever(s);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new oe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:E.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:E.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}oe.create=e=>new oe({checks:[],coerce:e?.coerce||!1,typeName:Ke.ZodDate,...j(e)});class ce extends N{_parse(e){if(this._getType(e)!==i.symbol){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.symbol,received:t.parsedType}),_}return k(e.data)}}ce.create=e=>new ce({typeName:Ke.ZodSymbol,...j(e)});class ue extends N{_parse(e){if(this._getType(e)!==i.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.undefined,received:t.parsedType}),_}return k(e.data)}}ue.create=e=>new ue({typeName:Ke.ZodUndefined,...j(e)});class de extends N{_parse(e){if(this._getType(e)!==i.null){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.null,received:t.parsedType}),_}return k(e.data)}}de.create=e=>new de({typeName:Ke.ZodNull,...j(e)});class le extends N{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}}le.create=e=>new le({typeName:Ke.ZodAny,...j(e)});class pe extends N{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}}pe.create=e=>new pe({typeName:Ke.ZodUnknown,...j(e)});class he extends N{_parse(e){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.never,received:t.parsedType}),_}}he.create=e=>new he({typeName:Ke.ZodNever,...j(e)});class fe extends N{_parse(e){if(this._getType(e)!==i.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.void,received:t.parsedType}),_}return k(e.data)}}fe.create=e=>new fe({typeName:Ke.ZodVoid,...j(e)});class me extends N{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==i.array)return y(t,{code:c.invalid_type,expected:i.array,received:t.parsedType}),_;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,s=t.data.length<r.exactLength.value;(e||s)&&(y(t,{code:e?c.too_big:c.too_small,minimum:s?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(y(t,{code:c.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(y(t,{code:c.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new Z(t,e,t.path,n))))).then((e=>v.mergeArray(n,e)));const s=[...t.data].map(((e,n)=>r.type._parseSync(new Z(t,e,t.path,n))));return v.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new me({...this._def,minLength:{value:e,message:E.toString(t)}})}max(e,t){return new me({...this._def,maxLength:{value:e,message:E.toString(t)}})}length(e,t){return new me({...this._def,exactLength:{value:e,message:E.toString(t)}})}nonempty(e){return this.min(1,e)}}function ge(e){if(e instanceof ye){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ie.create(ge(r))}return new ye({...e._def,shape:()=>t})}return e instanceof me?new me({...e._def,type:ge(e.element)}):e instanceof Ie?Ie.create(ge(e.unwrap())):e instanceof Me?Me.create(ge(e.unwrap())):e instanceof xe?xe.create(e.items.map((e=>ge(e)))):e}me.create=(e,t)=>new me({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ke.ZodArray,...j(t)});class ye extends N{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=r.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==i.object){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.object,received:t.parsedType}),_}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof he&&"strip"===this._def.unknownKeys))for(const e in n.data)s.includes(e)||a.push(e);const o=[];for(const e of s){const t=r[e],s=n.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new Z(n,s,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof he){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)o.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)a.length>0&&(y(n,{code:c.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const r=n.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new Z(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>v.mergeObjectSync(t,e))):v.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return E.errToObj,new ye({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{const r=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:E.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new ye({...this._def,unknownKeys:"strip"})}passthrough(){return new ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ke.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ye({...this._def,catchall:e})}pick(e){const t={};for(const n of r.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new ye({...this._def,shape:()=>t})}omit(e){const t={};for(const n of r.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new ye({...this._def,shape:()=>t})}deepPartial(){return ge(this)}partial(e){const t={};for(const n of r.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new ye({...this._def,shape:()=>t})}required(e){const t={};for(const n of r.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Ie;)e=e._def.innerType;t[n]=e}return new ye({...this._def,shape:()=>t})}keyof(){return Pe(r.objectKeys(this.shape))}}ye.create=(e,t)=>new ye({shape:()=>e,unknownKeys:"strip",catchall:he.create(),typeName:Ke.ZodObject,...j(t)}),ye.strictCreate=(e,t)=>new ye({shape:()=>e,unknownKeys:"strict",catchall:he.create(),typeName:Ke.ZodObject,...j(t)}),ye.lazycreate=(e,t)=>new ye({shape:e,unknownKeys:"strip",catchall:he.create(),typeName:Ke.ZodObject,...j(t)});class ve extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new d(e.ctx.common.issues)));return y(t,{code:c.invalid_union,unionErrors:n}),_}));{let e;const r=[];for(const s of n){const n={...t,common:{...t.common,issues:[]},parent:null},a=s._parseSync({data:t.data,path:t.path,parent:n});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=r.map((e=>new d(e)));return y(t,{code:c.invalid_union,unionErrors:s}),_}}get options(){return this._def.options}}ve.create=(e,t)=>new ve({options:e,typeName:Ke.ZodUnion,...j(t)});const _e=e=>e instanceof Te?_e(e.schema):e instanceof Ne?_e(e.innerType()):e instanceof Oe?[e.value]:e instanceof Ze?e.options:e instanceof Re?r.objectValues(e.enum):e instanceof De?_e(e._def.innerType):e instanceof ue?[void 0]:e instanceof de?[null]:e instanceof Ie?[void 0,..._e(e.unwrap())]:e instanceof Me?[null,..._e(e.unwrap())]:e instanceof ze||e instanceof Ue?_e(e.unwrap()):e instanceof $e?_e(e._def.innerType):[];class be extends N{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.object)return y(t,{code:c.invalid_type,expected:i.object,received:t.parsedType}),_;const n=this.discriminator,r=t.data[n],s=this.optionsMap.get(r);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=_e(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,n)}}return new be({typeName:Ke.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...j(n)})}}function ke(e,t){const n=o(e),s=o(t);if(e===t)return{valid:!0,data:e};if(n===i.object&&s===i.object){const n=r.objectKeys(t),s=r.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const n of s){const r=ke(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}if(n===i.array&&s===i.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const s=ke(e[r],t[r]);if(!s.valid)return{valid:!1};n.push(s.data)}return{valid:!0,data:n}}return n===i.date&&s===i.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class we extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(w(e)||w(r))return _;const s=ke(e.value,r.value);return s.valid?((x(e)||x(r))&&t.dirty(),{status:t.value,value:s.data}):(y(n,{code:c.invalid_intersection_types}),_)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}we.create=(e,t,n)=>new we({left:e,right:t,typeName:Ke.ZodIntersection,...j(n)});class xe extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.array)return y(n,{code:c.invalid_type,expected:i.array,received:n.parsedType}),_;if(n.data.length<this._def.items.length)return y(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new Z(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>v.mergeArray(t,e))):v.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new xe({...this._def,rest:e})}}xe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xe({items:e,typeName:Ke.ZodTuple,rest:null,...j(t)})};class Ae extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.object)return y(n,{code:c.invalid_type,expected:i.object,received:n.parsedType}),_;const r=[],s=this._def.keyType,a=this._def.valueType;for(const e in n.data)r.push({key:s._parse(new Z(n,e,n.path,e)),value:a._parse(new Z(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?v.mergeObjectAsync(t,r):v.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Ae(t instanceof N?{keyType:e,valueType:t,typeName:Ke.ZodRecord,...j(n)}:{keyType:ne.create(),valueType:e,typeName:Ke.ZodRecord,...j(t)})}}class Ce extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.map)return y(n,{code:c.invalid_type,expected:i.map,received:n.parsedType}),_;const r=this._def.keyType,s=this._def.valueType,a=[...n.data.entries()].map((([e,t],a)=>({key:r._parse(new Z(n,e,n.path,[a,"key"])),value:s._parse(new Z(n,t,n.path,[a,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of a){const r=await n.key,s=await n.value;if("aborted"===r.status||"aborted"===s.status)return _;"dirty"!==r.status&&"dirty"!==s.status||t.dirty(),e.set(r.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of a){const r=n.key,s=n.value;if("aborted"===r.status||"aborted"===s.status)return _;"dirty"!==r.status&&"dirty"!==s.status||t.dirty(),e.set(r.value,s.value)}return{status:t.value,value:e}}}}Ce.create=(e,t,n)=>new Ce({valueType:t,keyType:e,typeName:Ke.ZodMap,...j(n)});class Ee extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.set)return y(n,{code:c.invalid_type,expected:i.set,received:n.parsedType}),_;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(y(n,{code:c.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(y(n,{code:c.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const s=this._def.valueType;function a(e){const n=new Set;for(const r of e){if("aborted"===r.status)return _;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const o=[...n.data.values()].map(((e,t)=>s._parse(new Z(n,e,n.path,t))));return n.common.async?Promise.all(o).then((e=>a(e))):a(o)}min(e,t){return new Ee({...this._def,minSize:{value:e,message:E.toString(t)}})}max(e,t){return new Ee({...this._def,maxSize:{value:e,message:E.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ee.create=(e,t)=>new Ee({valueType:e,minSize:null,maxSize:null,typeName:Ke.ZodSet,...j(t)});class Se extends N{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.function)return y(t,{code:c.invalid_type,expected:i.function,received:t.parsedType}),_;function n(e,n){return m({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,f(),l].filter((e=>!!e)),issueData:{code:c.invalid_arguments,argumentsError:n}})}function r(e,n){return m({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,f(),l].filter((e=>!!e)),issueData:{code:c.invalid_return_type,returnTypeError:n}})}const s={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof je){const e=this;return k((async function(...t){const i=new d([]),o=await e._def.args.parseAsync(t,s).catch((e=>{throw i.addIssue(n(t,e)),i})),c=await Reflect.apply(a,this,o);return await e._def.returns._def.type.parseAsync(c,s).catch((e=>{throw i.addIssue(r(c,e)),i}))}))}{const e=this;return k((function(...t){const i=e._def.args.safeParse(t,s);if(!i.success)throw new d([n(t,i.error)]);const o=Reflect.apply(a,this,i.data),c=e._def.returns.safeParse(o,s);if(!c.success)throw new d([r(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Se({...this._def,args:xe.create(e).rest(pe.create())})}returns(e){return new Se({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Se({args:e||xe.create([]).rest(pe.create()),returns:t||pe.create(),typeName:Ke.ZodFunction,...j(n)})}}class Te extends N{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Te.create=(e,t)=>new Te({getter:e,typeName:Ke.ZodLazy,...j(t)});class Oe extends N{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Pe(e,t){return new Ze({values:e,typeName:Ke.ZodEnum,...j(t)})}Oe.create=(e,t)=>new Oe({value:e,typeName:Ke.ZodLiteral,...j(t)});class Ze extends N{constructor(){super(...arguments),S.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{expected:r.joinValues(n),received:t.parsedType,code:c.invalid_type}),_}if(O(this,S,"f")||P(this,S,new Set(this._def.values),"f"),!O(this,S,"f").has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{received:t.data,code:c.invalid_enum_value,options:n}),_}return k(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ze.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ze.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}S=new WeakMap,Ze.create=Pe;class Re extends N{constructor(){super(...arguments),T.set(this,void 0)}_parse(e){const t=r.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==i.string&&n.parsedType!==i.number){const e=r.objectValues(t);return y(n,{expected:r.joinValues(e),received:n.parsedType,code:c.invalid_type}),_}if(O(this,T,"f")||P(this,T,new Set(r.getValidEnumValues(this._def.values)),"f"),!O(this,T,"f").has(e.data)){const e=r.objectValues(t);return y(n,{received:n.data,code:c.invalid_enum_value,options:e}),_}return k(e.data)}get enum(){return this._def.values}}T=new WeakMap,Re.create=(e,t)=>new Re({values:e,typeName:Ke.ZodNativeEnum,...j(t)});class je extends N{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.promise&&!1===t.common.async)return y(t,{code:c.invalid_type,expected:i.promise,received:t.parsedType}),_;const n=t.parsedType===i.promise?t.data:Promise.resolve(t.data);return k(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}je.create=(e,t)=>new je({type:e,typeName:Ke.ZodPromise,...j(t)});class Ne extends N{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:e=>{y(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===s.type){const e=s.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return _;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?_:"dirty"===r.status||"dirty"===t.value?b(r.value):r}));{if("aborted"===t.value)return _;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?_:"dirty"===r.status||"dirty"===t.value?b(r.value):r}}if("refinement"===s.type){const e=e=>{const t=s.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?_:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?_:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===s.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!A(e))return e;const r=s.transform(e.value,a);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>A(e)?Promise.resolve(s.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}r.assertNever(s)}}Ne.create=(e,t,n)=>new Ne({schema:e,typeName:Ke.ZodEffects,effect:t,...j(n)}),Ne.createWithPreprocess=(e,t,n)=>new Ne({schema:t,effect:{type:"preprocess",transform:e},typeName:Ke.ZodEffects,...j(n)});class Ie extends N{_parse(e){return this._getType(e)===i.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ie.create=(e,t)=>new Ie({innerType:e,typeName:Ke.ZodOptional,...j(t)});class Me extends N{_parse(e){return this._getType(e)===i.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Me.create=(e,t)=>new Me({innerType:e,typeName:Ke.ZodNullable,...j(t)});class De extends N{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===i.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}De.create=(e,t)=>new De({innerType:e,typeName:Ke.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...j(t)});class $e extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return C(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new d(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new d(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}$e.create=(e,t)=>new $e({innerType:e,typeName:Ke.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...j(t)});class Le extends N{_parse(e){if(this._getType(e)!==i.nan){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.nan,received:t.parsedType}),_}return{status:"valid",value:e.data}}}Le.create=e=>new Le({typeName:Ke.ZodNaN,...j(e)});const qe=Symbol("zod_brand");class ze extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Fe extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),b(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Fe({in:e,out:t,typeName:Ke.ZodPipeline})}}class Ue extends N{_parse(e){const t=this._def.innerType._parse(e),n=e=>(A(e)&&(e.value=Object.freeze(e.value)),e);return C(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function We(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function Be(e,t={},n){return e?le.create().superRefine(((r,s)=>{const a=e(r);if(a instanceof Promise)return a.then((e=>{if(!e){const e=We(t,r),a=e.fatal??n??!0;s.addIssue({code:"custom",...e,fatal:a})}}));if(!a){const e=We(t,r),a=e.fatal??n??!0;s.addIssue({code:"custom",...e,fatal:a})}})):le.create()}Ue.create=(e,t)=>new Ue({innerType:e,typeName:Ke.ZodReadonly,...j(t)});const Ve={object:ye.lazycreate};var Ke;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ke||(Ke={}));const He=(e,t={message:`Input not instance of ${e.name}`})=>Be((t=>t instanceof e),t),Je=ne.create,Ye=se.create,Ge=Le.create,Qe=ae.create,Xe=ie.create,et=oe.create,tt=ce.create,nt=ue.create,rt=de.create,st=le.create,at=pe.create,it=he.create,ot=fe.create,ct=me.create,ut=ye.create,dt=ye.strictCreate,lt=ve.create,pt=be.create,ht=we.create,ft=xe.create,mt=Ae.create,gt=Ce.create,yt=Ee.create,vt=Se.create,_t=Te.create,bt=Oe.create,kt=Ze.create,wt=Re.create,xt=je.create,At=Ne.create,Ct=Ie.create,Et=Me.create,St=Ne.createWithPreprocess,Tt=Fe.create,Ot=()=>Je().optional(),Pt=()=>Ye().optional(),Zt=()=>Xe().optional(),Rt={string:e=>ne.create({...e,coerce:!0}),number:e=>se.create({...e,coerce:!0}),boolean:e=>ie.create({...e,coerce:!0}),bigint:e=>ae.create({...e,coerce:!0}),date:e=>oe.create({...e,coerce:!0})},jt=_,Nt=a,It=(Nt.object({status:Nt.literal("idle").or(Nt.literal("pending").or(Nt.literal("unknown"))),remainingTasks:Nt.number(),totalTasks:Nt.number(),totalErrors:Nt.number(),totalWarnings:Nt.number()}),Nt.object({id:Nt.string(),name:Nt.string().optional(),inputPath:Nt.string().optional(),outputPath:Nt.string().optional()}));function Mt(e){return ut(e).strict()}const Dt=Mt({file:Nt.string(),line:Nt.number().optional(),column:Nt.number().optional()}),$t=Mt({text:Nt.string(),location:Dt.optional()}),Lt=Mt({text:Nt.string(),source:Nt.string(),location:Dt.optional(),notes:Nt.array($t).optional()}),qt=Nt.object({id:Nt.string(),errors:Nt.array(Lt).optional(),warnings:Nt.array(Lt).optional()}),zt=Nt.object({name:Nt.string(),start:Nt.number(),end:Nt.number().optional(),threwException:Nt.boolean().optional()}),Ft=Nt.object({status:Nt.literal("pending").or(Nt.literal("complete")).optional(),timings:Nt.array(zt).optional(),startTime:Nt.number(),durationMilliseconds:Nt.number().optional(),lastUpdated:Nt.number().optional()}).extend(It.shape).extend(qt.shape);ut({tasks:ct(Ft)});const Ut=_t((()=>Mt({name:Je(),version:Je(),path:Je(),dependencies:mt(Je()),requiredBy:mt(Je()),isExternal:Xe().optional(),isLinked:Xe().optional(),scopedVersions:mt(_t((()=>Ut))).optional()}))),Wt=mt(Je(),Ut),Bt=e=>mt(lt([e,nt()])),Vt=ut({browser:mt(Je()),node:mt(Je())}),Kt=mt(Je(),lt([nt(),Je()])).optional(),Ht=ut({name:Je(),version:Je(),exports:st(),dependencies:Kt,peerDependencies:Kt}),Jt=Mt({path:Je(),rootPath:Je().optional(),includeAll:Xe().optional(),ignoredPackages:Je().array().optional(),ignoreResolutions:Xe().optional(),resolveStrategy:kt(["dedupe","duplicate"]).optional(),remote:ut({resolveMap:Wt,hostUrl:Je(),packages:ut({definitions:Bt(ut({})),transformedDefinitions:Bt(Ht)}),packageHashes:ut({hashesWithSource:Vt,hashesWithNoSource:Vt})}).optional()}),Yt=ut({linkedPath:Jt}),Gt=ut({resolveMap:Wt,linkedPaths:ct(Jt)}),Qt=ut({packagePath:Je(),hash:Je().optional(),definition:Ht.optional()}),Xt=ut({name:Je(),version:Je().optional()}),en=lt([Je(),Xt]),tn=lt([Je(),Xt.required()]),nn=Mt({packageSettings:ct(ut({match:lt([en,ct(en)])}).passthrough()),generated:ut({packageSettings:ct(ut({match:tn}).passthrough())}).passthrough()}).passthrough(),rn=(Nt.number(),Nt.string(),{path:["link","update"],type:Qt}),sn={path:["link","config"],type:nn},an={path:["link","paths"],type:Yt},on={path:["link","done"],type:Gt},cn={path:["link","disconnected"],type:Nt.object({reason:Nt.enum(["lost","unreachable"])})};function un(e){const t={subscribe(t){let n=null,r=!1,s=!1,a=!1;function i(){null!==n?s||(s=!0,"function"==typeof n?n():n&&n.unsubscribe()):a=!0}return n=e({next(e){r||t.next?.(e)},error(e){r||(r=!0,t.error?.(e),i())},complete(){r||(r=!0,t.complete?.(),i())}}),a&&i(),{unsubscribe:i}},pipe:(...e)=>e.reduce(dn,t)};return t}function dn(e,t){return t(e)}function ln(e){let t=e;const n=[],r=un((e=>((e=>{void 0!==t&&e.next(t),n.push(e)})(e),()=>{(e=>{n.splice(n.indexOf(e),1)})(e)})));return r.next=e=>{if(t!==e){t=e;for(const t of n)t.next(e)}},r.get=()=>t,r}function pn(e){return un((t=>function t(n=0,r=e.op){const s=e.links[n];if(!s)throw new Error("No more links to execute - did you forget to add an ending link?");return s({op:r,next:e=>t(n+1,e)})}().subscribe(t)))}Symbol();const hn=()=>{},fn=e=>{Object.freeze&&Object.freeze(e)};function mn(e,t,n){var r,s;const a=t.join(".");return(r=n)[s=a]??(r[s]=new Proxy(hn,{get(r,s){if("string"==typeof s&&"then"!==s)return mn(e,[...t,s],n)},apply(n,r,s){const a=t[t.length-1];let i={args:s,path:t};return"call"===a?i={args:s.length>=2?[s[1]]:[],path:t.slice(0,-1)}:"apply"===a&&(i={args:s.length>=2?s[1]:[],path:t.slice(0,-1)}),fn(i.args),fn(i.path),e(i)}})),n[a]}const gn=e=>mn(e,[],Object.create(null));function yn(e,...t){const n=Object.assign(Object.create(null),e);for(const e of t)for(const t in e){if(t in n&&n[t]!==e[t])throw new Error(`Duplicate key ${t}`);n[t]=e[t]}return n}function vn(e){return!!e&&!Array.isArray(e)&&"object"==typeof e}function _n(e){return Object.assign(Object.create(null),e)}Symbol(),"function"==typeof Symbol&&Symbol.asyncIterator;const bn=e=>e();function kn(e=0){return new Promise((t=>setTimeout(t,e)))}function wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class xn extends Error{}function An(e){if(e instanceof Cn)return e;if(e instanceof Error&&"TRPCError"===e.name)return e;const t=new Cn({code:"INTERNAL_SERVER_ERROR",cause:e});return e instanceof Error&&e.stack&&(t.stack=e.stack),t}class Cn extends Error{constructor(e){const t=function(e){if(e instanceof Error)return e;const t=typeof e;if("undefined"!==t&&"function"!==t&&null!==e){if("object"!==t)return new Error(String(e));if(vn(e)){const t=new xn;for(const n in e)t[n]=e[n];return t}}}(e.cause);super(e.message??t?.message??e.code,{cause:t}),wn(this,"cause",void 0),wn(this,"code",void 0),this.code=e.code,this.name="TRPCError",this.cause||(this.cause=t)}}const En=({shape:e})=>e,Sn={input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}};class Tn extends Error{constructor(){super("Unable to transform response from server")}}function On(e,t){let n;try{n=function(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:{...e,error:n}}}return{ok:!0,result:{...e.result,...(!e.result.type||"data"===e.result.type)&&{type:"data",data:t.deserialize(e.result.data)}}}}(e,t)}catch{throw new Tn}if(!(n.ok||vn(n.error.error)&&"number"==typeof n.error.error.code))throw new Tn;if(n.ok&&!vn(n.result))throw new Tn;return n}const Pn=Symbol("lazy");function Zn(e){const t=Symbol();let n=t;return()=>(n===t&&(n=e()),n)}function Rn(e){return"function"==typeof e&&Pn in e}const jn={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:En,transformer:Sn},Nn=["then","call","apply"];function In(e){return function(t){const n=new Set(Object.keys(t).filter((e=>Nn.includes(e))));if(n.size>0)throw new Error("Reserved words used in `router({})` call: "+Array.from(n).join(", "));const r=_n({}),s=_n({});function a(e){return{ref:e.ref,load:Zn((async()=>{const t=await e.ref(),n=[...e.path,e.key],r=n.join(".");e.aggregate[e.key]=i(t._def.record,n),delete s[r];for(const[r,i]of Object.entries(t._def.lazy)){const t=[...n,r].join(".");s[t]=a({ref:i.ref,path:n,key:r,aggregate:e.aggregate[e.key]})}}))}}function i(e,t=[]){const n=_n({});for(const[c,u]of Object.entries(e??{})){if(Rn(u)){s[[...t,c].join(".")]=a({path:t,ref:u,key:c,aggregate:n});continue}if(vn(o=u)&&vn(o._def)&&"router"in o._def){n[c]=i(u._def.record,[...t,c]);continue}if("function"!=typeof u){n[c]=i(u,[...t,c]);continue}const e=[...t,c].join(".");if(r[e])throw new Error(`Duplicate key: ${e}`);r[e]=u,n[c]=u}var o;return n}const o=i(t),c={_config:e,router:!0,procedures:r,lazy:s,...jn,record:o};return{...o,_def:c,createCaller:Mn()({_def:c})}}}function Mn(){return function(e){const{_def:t}=e;return function(n,r){return gn((async({path:s,args:a})=>{const i=s.join(".");if(1===s.length&&"_def"===s[0])return t;const o=await async function(e,t){const{_def:n}=e;let r=n.procedures[t];for(;!r;){const e=Object.keys(n.lazy).find((e=>t.startsWith(e)));if(!e)return null;const s=n.lazy[e];await s.load(),r=n.procedures[t]}return r}(e,i);let c;try{if(!o)throw new Cn({code:"NOT_FOUND",message:`No procedure found on path "${s}"`});return c="function"==typeof n?await Promise.resolve(n()):n,await o({path:i,getRawInput:async()=>a[0],ctx:c,type:o._def.type,signal:r?.signal})}catch(e){throw r?.onError?.({ctx:c,error:An(e),input:a[0],path:i,type:o?._def.type??"unknown"}),e}}))}}}function Dn(...e){const t=yn({},...e.map((e=>e._def.record)));return In({errorFormatter:e.reduce(((e,t)=>{if(t._def._config.errorFormatter&&t._def._config.errorFormatter!==En){if(e!==En&&e!==t._def._config.errorFormatter)throw new Error("You seem to have several error formatters");return t._def._config.errorFormatter}return e}),En),transformer:e.reduce(((e,t)=>{if(t._def._config.transformer&&t._def._config.transformer!==Sn){if(e!==Sn&&e!==t._def._config.transformer)throw new Error("You seem to have several transformers");return t._def._config.transformer}return e}),Sn),isDev:e.every((e=>e._def._config.isDev)),allowOutsideOfServer:e.every((e=>e._def._config.allowOutsideOfServer)),isServer:e.every((e=>e._def._config.isServer)),$types:e[0]?._def._config.$types})(t)}var $n,Ln;new WeakMap,Symbol.toStringTag,($n=Symbol).dispose??($n.dispose=Symbol()),(Ln=Symbol).asyncDispose??(Ln.asyncDispose=Symbol()),Symbol(),Symbol("ping"),Error,Error,Symbol();const qn="middlewareMarker";function zn(){function e(t){return{_middlewares:t,unstable_pipe(n){const r="_middlewares"in n?n._middlewares:[n];return e([...t,...r])}}}return function(t){return e([t])}}function Fn(e){const t=async function(t){let n;const r=await t.getRawInput();try{n=await e(r)}catch(e){throw new Cn({code:"BAD_REQUEST",cause:e})}const s=vn(t.input)&&vn(n)?{...t.input,...n}:n;return t.next({input:s})};return t._type="input",t}function Un(e){const t=async function({next:t}){const n=await t();if(!n.ok)return n;try{const t=await e(n.data);return{...n,data:t}}catch(e){throw new Cn({message:"Output validation failed",code:"INTERNAL_SERVER_ERROR",cause:e})}};return t._type="output",t}class Wn extends Error{constructor(e){var t,n;super(e[0]?.message),n=void 0,(t="issues")in this?Object.defineProperty(this,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[t]=n,this.name="SchemaError",this.issues=e}}function Bn(e){const t=e,n="~standard"in t;if("function"==typeof t&&"function"==typeof t.assert)return t.assert.bind(t);if("function"==typeof t&&!n)return t;if("function"==typeof t.parseAsync)return t.parseAsync.bind(t);if("function"==typeof t.parse)return t.parse.bind(t);if("function"==typeof t.validateSync)return t.validateSync.bind(t);if("function"==typeof t.create)return t.create.bind(t);if("function"==typeof t.assert)return e=>(t.assert(e),e);if(n)return async e=>{const n=await t["~standard"].validate(e);if(n.issues)throw new Wn(n.issues);return n.value};throw new Error("Could not find a validator fn")}function Vn(e,t){const{middlewares:n=[],inputs:r,meta:s,...a}=t;return Kn({...yn(e,a),inputs:[...e.inputs,...r??[]],middlewares:[...e.middlewares,...n],meta:e.meta&&s?{...e.meta,...s}:s??e.meta})}function Kn(e={}){const t={procedure:!0,inputs:[],middlewares:[],...e};return{_def:t,input(e){const n=Bn(e);return Vn(t,{inputs:[e],middlewares:[Fn(n)]})},output(e){const n=Bn(e);return Vn(t,{output:e,middlewares:[Un(n)]})},meta:e=>Vn(t,{meta:e}),use(e){const n="_middlewares"in e?e._middlewares:[e];return Vn(t,{middlewares:n})},unstable_concat:e=>Vn(t,e._def),concat:e=>Vn(t,e._def),query:e=>Hn({...t,type:"query"},e),mutation:e=>Hn({...t,type:"mutation"},e),subscription:e=>Hn({...t,type:"subscription"},e),experimental_caller:e=>Vn(t,{caller:e})}}function Hn(e,t){const n=Vn(e,{resolver:t,middlewares:[async function(e){const n=await t(e);return{marker:qn,ok:!0,data:n,ctx:e.ctx}}]}),r={...n._def,type:e.type,experimental_caller:Boolean(n._def.caller),meta:n._def.meta,$types:null},s=function(e){async function t(t){if(!t||!("getRawInput"in t))throw new Error(Jn);const n=await Yn(0,e,t);if(!n)throw new Cn({code:"INTERNAL_SERVER_ERROR",message:"No result from middlewares - did you forget to `return next()`?"});if(!n.ok)throw n.error;return n.data}return t._def=e,t.procedure=!0,t}(n._def),a=n._def.caller;if(!a)return s;const i=async(...e)=>await a({args:e,invoke:s,_def:r});return i._def=r,i}const Jn="\nThis is a client-only function.\nIf you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls\n".trim();async function Yn(e,t,n){try{const r=t.middlewares[e];return await r({...n,meta:t.meta,input:n.input,next(r){const s=r;return Yn(e+1,t,{...n,ctx:s?.ctx?{...n.ctx,...s.ctx}:n.ctx,input:s&&"input"in s?s.input:n.input,getRawInput:s?.getRawInput??n.getRawInput})}})}catch(e){return{ok:!1,error:An(e),marker:qn}}}const Gn="undefined"==typeof window||"Deno"in window||"test"===globalThis.process?.env?.NODE_ENV||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;class Qn{context(){return new Qn}meta(){return new Qn}create(e){const t={...e,transformer:(n=e?.transformer??Sn,"input"in n?n:{input:n,output:n}),isDev:e?.isDev??"production"!==globalThis.process?.env.NODE_ENV,allowOutsideOfServer:e?.allowOutsideOfServer??!1,errorFormatter:e?.errorFormatter??En,isServer:e?.isServer??Gn,$types:null};var n;if(!(e?.isServer??Gn)&&!0!==e?.allowOutsideOfServer)throw new Error("You're trying to use @trpc/server in a non-server environment. This is not supported by default.");return{_config:t,procedure:Kn({meta:e?.defaultMeta}),middleware:zn(),router:In(t),mergeRouters:Dn,createCallerFactory:Mn()}}}function Xn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}new Qn;class er extends Error{static from(e,t={}){const n=e;return function(e){return e instanceof er||e instanceof Error&&"TRPCClientError"===e.name}(n)?(t.meta&&(n.meta={...n.meta,...t.meta}),n):vn(r=n)&&vn(r.error)&&"number"==typeof r.error.code&&"string"==typeof r.error.message?new er(n.error.message,{...t,result:n}):new er("string"==typeof(s=n)?s:vn(s)&&"string"==typeof s.message?s.message:"Unknown error",{...t,cause:n});var r,s}constructor(e,t){const n=t?.cause;super(e,{cause:n}),Xn(this,"cause",void 0),Xn(this,"shape",void 0),Xn(this,"data",void 0),Xn(this,"meta",void 0),this.meta=t?.meta,this.cause=n,this.shape=t?.result?.error,this.data=t?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,er.prototype)}}function tr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class nr{$request(e){return pn({links:this.links,op:{...e,context:e.context??{},id:++this.requestId}}).pipe((e=>{let t=0,n=null;const r=[];return un((s=>(t++,r.push(s),n||(n=e.subscribe({next(e){for(const t of r)t.next?.(e)},error(e){for(const t of r)t.error?.(e)},complete(){for(const e of r)e.complete?.()}})),{unsubscribe(){t--,function(){if(0===t&&n){const e=n;n=null,e.unsubscribe()}}();const e=r.findIndex((e=>e===s));e>-1&&r.splice(e,1)}})))}))}async requestAsPromise(e){try{const t=this.$request(e);return(await function(e){const t=new AbortController;return new Promise(((n,r)=>{let s=!1;function a(){s||(s=!0,i.unsubscribe())}t.signal.addEventListener("abort",(()=>{r(t.signal.reason)}));const i=e.subscribe({next(e){s=!0,n(e),a()},error(e){r(e)},complete(){t.abort(),a()}})}))}(t)).result.data}catch(e){throw er.from(e)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(e){switch(e.result.type){case"state":n.onConnectionStateChange?.(e.result);break;case"started":n.onStarted?.({context:e.context});break;case"stopped":n.onStopped?.();break;case"data":case void 0:n.onData?.(e.result.data)}},error(e){n.onError?.(e)},complete(){n.onComplete?.()}})}constructor(e){tr(this,"links",void 0),tr(this,"runtime",void 0),tr(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map((e=>e(this.runtime)))}}const rr=Symbol.for("trpc_untypedClient"),sr={query:"query",mutate:"mutation",subscribe:"subscription"};const ar=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function ir(e){let t=null,n=null;function r(){const r=function(t){const n=[[]];let r=0;for(;;){const s=t[r];if(!s)break;const a=n[n.length-1];s.aborted?(s.reject?.(new Error("Aborted")),r++):e.validate(a.concat(s).map((e=>e.key)))?(a.push(s),r++):0!==a.length?n.push([]):(s.reject?.(new Error("Input is too big for a single dispatch")),r++)}return n}(t);clearTimeout(n),n=null,t=null;for(const t of r){if(!t.length)continue;const n={items:t};for(const e of t)e.batch=n;e.fetch(n.items.map((e=>e.key))).then((async e=>{await Promise.all(e.map((async(e,t)=>{const r=n.items[t];try{const t=await Promise.resolve(e);r.resolve?.(t)}catch(e){r.reject?.(e)}r.batch=null,r.reject=null,r.resolve=null})));for(const e of n.items)e.reject?.(new Error("Missing result")),e.batch=null})).catch((e=>{for(const t of n.items)t.reject?.(e),t.batch=null}))}}return{load:function(e){const s={aborted:!1,key:e,batch:null,resolve:ar,reject:ar},a=new Promise(((e,n)=>{s.reject=n,s.resolve=e,t||(t=[]),t.push(s)}));return n||(n=setTimeout(r)),a}}}const or=e=>"function"==typeof e;function cr(e){return e?"input"in e?e:{input:e,output:e}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}const ur={query:"GET",mutation:"POST",subscription:"PATCH"};function dr(e){return"input"in e?e.transformer.input.serialize(e.input):function(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}(e.inputs.map((t=>e.transformer.input.serialize(t))))}const lr=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const r=[];if(t[1]&&r.push(t[1]),"inputs"in e&&r.push("batch=1"),"query"===e.type||"subscription"===e.type){const t=dr(e);void 0!==t&&"POST"!==e.methodOverride&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+="?"+r.join("&")),n},pr=e=>{if("query"===e.type&&"POST"!==e.methodOverride)return;const t=dr(e);return void 0!==t?JSON.stringify(t):void 0};class hr extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}}const fr=e=>{if(e?.aborted){if(e.throwIfAborted?.(),"undefined"!=typeof DOMException)throw new DOMException("AbortError","AbortError");throw new hr}};function mr(e){const t=function(e){return{url:e.url.toString(),fetch:e.fetch,transformer:cr(e.transformer),methodOverride:e.methodOverride}}(e),n=e.maxURLLength??1/0,r=e.maxItems??1/0;return()=>{const s=s=>({validate(e){if(n===1/0&&r===1/0)return!0;if(e.length>r)return!1;const a=e.map((e=>e.path)).join(","),i=e.map((e=>e.input));return lr({...t,type:s,path:a,inputs:i,signal:null}).length<=n},async fetch(n){const r=n.map((e=>e.path)).join(","),a=n.map((e=>e.input)),i=function(...e){const t=new AbortController,n=e.length;let r=0;const s=()=>{++r===n&&t.abort()};for(const t of e)t?.aborted?s():t?.addEventListener("abort",s,{once:!0});return t.signal}(...n.map((e=>e.signal))),o=await(e=>async function(e){const t={},n=await async function(e){fr(e.signal);const t=e.getUrl(e),n=e.getBody(e),{type:r}=e,s=await(async()=>{const t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),a={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...s};return function(e){if(e)return e;if("undefined"!=typeof window&&or(window.fetch))return window.fetch;if("undefined"!=typeof globalThis&&or(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}(e.fetch)(t,{method:e.methodOverride??ur[r],signal:e.signal,body:n,headers:a})}(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}({...e,contentTypeHeader:"application/json",getUrl:lr,getBody:pr}))({...t,path:r,inputs:a,type:s,headers:()=>e.headers?"function"==typeof e.headers?e.headers({opList:n}):e.headers:{},signal:i});return(Array.isArray(o.json)?o.json:n.map((()=>o.json))).map((e=>({meta:o.meta,json:e})))}}),a={query:ir(s("query")),mutation:ir(s("mutation"))};return({op:e})=>un((n=>{if("subscription"===e.type)throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let r;return a[e.type].load(e).then((e=>{r=e;const s=On(e.json,t.transformer.output);s.ok?(n.next({context:e.meta,result:s.result}),n.complete()):n.error(er.from(s.error,{meta:e.meta}))})).catch((e=>{n.error(er.from(e,{meta:r?.meta}))})),()=>{}}))}}function gr(e){return Array.isArray(e)?e:[e]}const yr={enabled:!1,closeMs:0},vr={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},_r=e=>0===e?0:Math.min(1e3*2**e,3e4),br=(e,...t)=>"function"==typeof e?e(...t):e;function kr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class wr extends Error{constructor(e){super(e.message,{cause:e.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,wr.prototype)}}class xr{reset(){this.timeout&&(clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs))}start(){clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs)}stop(){clearTimeout(this.timeout),this.timeout=void 0}constructor(e,t){kr(this,"onTimeout",void 0),kr(this,"timeoutMs",void 0),kr(this,"timeout",void 0),this.onTimeout=e,this.timeoutMs=t}}function Ar(){let e,t;return{promise:new Promise(((n,r)=>{e=n,t=r})),resolve:e,reject:t}}function Cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Er{register(e,t){const{promise:n,resolve:r}=Ar();return this.outgoingRequests.push({id:String(e.id),message:e,end:n,callbacks:{next:t.next,complete:()=>{t.complete(),r()},error:e=>{t.error(e),r()}}}),()=>{this.delete(e.id),t.complete(),r()}}delete(e){null!==e&&(this.outgoingRequests=this.outgoingRequests.filter((({id:t})=>t!==String(e))),delete this.pendingRequests[String(e)])}flush(){const e=this.outgoingRequests;this.outgoingRequests=[];for(const t of e)this.pendingRequests[t.id]=t;return e}getPendingRequests(){return Object.values(this.pendingRequests)}getPendingRequest(e){return null===e?null:this.pendingRequests[String(e)]}getOutgoingRequests(){return this.outgoingRequests}getRequests(){return[...this.getOutgoingRequests().map((e=>({state:"outgoing",message:e.message,end:e.end,callbacks:e.callbacks}))),...this.getPendingRequests().map((e=>({state:"pending",message:e.message,end:e.end,callbacks:e.callbacks})))]}hasPendingRequests(){return this.getPendingRequests().length>0}hasOutgoingRequests(){return this.outgoingRequests.length>0}constructor(){Cr(this,"outgoingRequests",new Array),Cr(this,"pendingRequests",{})}}function Sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tr(e,{intervalMs:t,pongTimeoutMs:n}){let r,s;function a(){r=setTimeout((()=>{e.send("PING"),s=setTimeout((()=>{e.close()}),n)}),t)}e.addEventListener("open",a),e.addEventListener("message",(({data:e})=>{clearTimeout(r),a(),"PONG"===e&&(clearTimeout(s),clearTimeout(r),a())})),e.addEventListener("close",(()=>{clearTimeout(r),clearTimeout(s)}))}class Or{get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++Or.connectCount;const e=async function(e){const t=await br(e.url);if(!e.connectionParams)return t;const n=t.includes("?")?"&":"?";return t+`${n}connectionParams=1`}(this.urlOptions).then((e=>new this.WebSocketPonyfill(e)));this.openPromise=e.then((async e=>{this.ws=e,e.addEventListener("message",(function({data:e}){"PING"===e&&this.send("PONG")})),this.keepAliveOpts.enabled&&Tr(e,this.keepAliveOpts),e.addEventListener("close",(()=>{this.ws===e&&(this.ws=null)})),await function(e){const{promise:t,resolve:n,reject:r}=Ar();return e.addEventListener("open",(()=>{e.removeEventListener("error",r),n()})),e.addEventListener("error",r),t}(e),this.urlOptions.connectionParams&&e.send(await async function(e){const t={method:"connectionParams",data:await br(e)};return JSON.stringify(t)}(this.urlOptions.connectionParams))}));try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(e){if(Sr(this,"id",++Or.connectCount),Sr(this,"WebSocketPonyfill",void 0),Sr(this,"urlOptions",void 0),Sr(this,"keepAliveOpts",void 0),Sr(this,"wsObservable",ln(null)),Sr(this,"openPromise",null),this.WebSocketPonyfill=e.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive}}function Pr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Sr(Or,"connectCount",0);class Zr{async open(){this.allowReconnect=!0,"connecting"!==this.connectionState.get().state&&this.connectionState.next({type:"state",state:"connecting",error:null});try{await this.activeConnection.open()}catch(e){return this.reconnect(new wr({message:"Initialization error",cause:e})),this.reconnecting}}async close(){this.allowReconnect=!1,this.inactivityTimeout.stop();const e=[];for(const t of this.requestManager.getRequests())"subscription"===t.message.method?t.callbacks.complete():"outgoing"===t.state?t.callbacks.error(er.from(new wr({message:"Closed before connection was established"}))):e.push(t.end);await Promise.all(e).catch((()=>null)),await this.activeConnection.close().catch((()=>null)),this.connectionState.next({type:"state",state:"idle",error:null})}request({op:{id:e,type:t,path:n,input:r,signal:s},transformer:a,lastEventId:i}){return un((o=>{const c=this.batchSend({id:e,method:t,params:{input:a.input.serialize(r),path:n,lastEventId:i}},{...o,next(e){const t=On(e,a.output);t.ok?o.next({result:t.result}):o.error(er.from(t.error))}});return()=>{c(),"subscription"===t&&this.activeConnection.isOpen()&&this.send({id:e,method:"subscription.stop"}),s?.removeEventListener("abort",c)}}))}get connection(){return(e=this.activeConnection).isOpen()?{id:e.id,state:"open",ws:e.ws}:e.isClosed()?{id:e.id,state:"closed",ws:e.ws}:e.ws?{id:e.id,state:"connecting",ws:e.ws}:null;var e}reconnect(e){if(this.connectionState.next({type:"state",state:"connecting",error:er.from(e)}),this.reconnecting)return;const t=async e=>{try{await kn(this.reconnectRetryDelay(e)),this.allowReconnect&&(await this.activeConnection.close(),await this.activeConnection.open(),this.requestManager.hasPendingRequests()&&this.send(this.requestManager.getPendingRequests().map((({message:e})=>e)))),this.reconnecting=null}catch{await t(e+1)}};this.reconnecting=t(0)}setupWebSocketListeners(e){const t=e=>{const t=this.requestManager.getPendingRequests();for(const{message:n,callbacks:r}of t)"subscription"!==n.method&&(r.error(er.from(e??new wr({message:"WebSocket closed",cause:e}))),this.requestManager.delete(n.id))};e.addEventListener("open",(()=>{bn((async()=>{this.lazyMode&&this.inactivityTimeout.start(),this.callbacks.onOpen?.(),this.connectionState.next({type:"state",state:"pending",error:null})})).catch((n=>{e.close(3e3),t(n)}))})),e.addEventListener("message",(({data:e})=>{if(this.inactivityTimeout.reset(),"string"!=typeof e||["PING","PONG"].includes(e))return;const t=JSON.parse(e);"method"in t?this.handleIncomingRequest(t):this.handleResponseMessage(t)})),e.addEventListener("close",(e=>{t(e),this.callbacks.onClose?.(e),this.lazyMode||this.reconnect(new wr({message:"WebSocket closed",cause:e}))})),e.addEventListener("error",(e=>{t(e),this.callbacks.onError?.(e),this.reconnect(new wr({message:"WebSocket closed",cause:e}))}))}handleResponseMessage(e){const t=this.requestManager.getPendingRequest(e.id);if(!t)return;t.callbacks.next(e);let n=!0;"result"in e&&"subscription"===t.message.method&&("data"===e.result.type&&(t.message.params.lastEventId=e.result.id),"stopped"!==e.result.type&&(n=!1)),n&&(t.callbacks.complete(),this.requestManager.delete(e.id))}handleIncomingRequest(e){"reconnect"===e.method&&this.reconnect(new wr({message:"Server requested reconnect"}))}send(e){if(!this.activeConnection.isOpen())throw new Error("Active connection is not open");const t=e instanceof Array?e:[e];this.activeConnection.ws.send(JSON.stringify(1===t.length?t[0]:t))}batchSend(e,t){return this.inactivityTimeout.reset(),bn((async()=>{this.activeConnection.isOpen()||await this.open(),await kn(0),this.requestManager.hasOutgoingRequests()&&this.send(this.requestManager.flush().map((({message:e})=>e)))})).catch((n=>{this.requestManager.delete(e.id),t.error(er.from(n))})),this.requestManager.register(e,t)}constructor(e){Pr(this,"connectionState",void 0),Pr(this,"allowReconnect",!1),Pr(this,"requestManager",new Er),Pr(this,"activeConnection",void 0),Pr(this,"reconnectRetryDelay",void 0),Pr(this,"inactivityTimeout",void 0),Pr(this,"callbacks",void 0),Pr(this,"lazyMode",void 0),Pr(this,"reconnecting",null),this.callbacks={onOpen:e.onOpen,onClose:e.onClose,onError:e.onError};const t={...yr,...e.lazy};this.inactivityTimeout=new xr((()=>{this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()?this.inactivityTimeout.reset():this.close().catch((()=>null))}),t.closeMs),this.activeConnection=new Or({WebSocketPonyfill:e.WebSocket,urlOptions:e,keepAlive:{...vr,...e.keepAlive}}),this.activeConnection.wsObservable.subscribe({next:e=>{e&&this.setupWebSocketListeners(e)}}),this.reconnectRetryDelay=e.retryDelayMs??_r,this.lazyMode=t.enabled,this.connectionState=ln({type:"state",state:t.enabled?"idle":"connecting",error:null}),this.lazyMode||this.open().catch((()=>null))}}function Rr(e){const{client:t}=e,n=cr(e.transformer);return()=>({op:e})=>un((r=>{const s="subscription"===e.type?t.connectionState.subscribe({next(t){r.next({result:t,context:e.context})}}):null,a=t.request({op:e,transformer:n}).subscribe(r);return()=>{a.unsubscribe(),s?.unsubscribe()}}))}async function jr(e){await async function(){if("undefined"!=typeof global){const e=global;if(void 0===e.WebSocket){const{WebSocket:t}=await n.e(582).then(n.t.bind(n,582,19));e.WebSocket=t}}}(),function({reporter:e}){"undefined"!=typeof process&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED="0",e?.ignoreLogMessage("Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable"))}({reporter:e.reporter});const t=new Zr(e),r=function(e,t){try{return new URL(e,t)}catch{throw new Error(`Invalid URL: "${e}", base: ""`)}}(e.url),s="wss:"===r.protocol;r.protocol=s?"https:":"http:";const a=r.toString().replace(/\/$/,""),i=function(e){return function(e){const t=gn((({path:t,args:n})=>{const r=[...t],s=(a=r.pop(),sr[a]);var a;const i=r.join(".");return e[s](i,...n)}));return n=n=>n===rr?e:t[n],new Proxy(hn,{get(e,t){if("then"!==t)return n(t)}});var n}(new nr(e))}({links:[(o={condition:e=>"subscription"===e.type,true:Rr({client:t}),false:mr({url:a})},e=>{const t=gr(o.true).map((t=>t(e))),n=gr(o.false).map((t=>t(e)));return e=>un((r=>{const s=o.condition(e.op)?t:n;return pn({op:e.op,links:s}).subscribe(r)}))})]});var o;return new Proxy({close:async()=>{await t.close()}},{get:(e,t)=>e.hasOwnProperty(t)?e[t]:i[t]})}var Nr=n(286),Ir=n.n(Nr),Mr=n(823),Dr=n.n(Mr),$r=n(509),Lr=n.n($r),qr=n(214),zr=n.n(qr),Fr=n(586),Ur=n.n(Fr),Wr=n(703),Br=n.n(Wr),Vr=n(941),Kr={};Kr.styleTagTransform=Br(),Kr.setAttributes=zr(),Kr.insert=Lr().bind(null,"head"),Kr.domAPI=Dr(),Kr.insertStyleElement=Ur(),Ir()(Vr.default,Kr);const Hr=Vr.default&&Vr.default.locals?Vr.default.locals:void 0;class Jr{element;constructor(e="root"){this.element=document.getElementById(e)}updateStatus(e){const{message:t,tip:n,isError:r=!1,data:s}=e;r?s?console.error(t,s):console.error(t):s?console.debug(t,s):console.debug(t),this.element&&(this.element.innerHTML=`\n <div class="${Hr.statusContainer+(r?` ${Hr.errorContainer}`:"")}">\n <h2 class="${Hr.title}">Cloudpack Link Proxy</h2>\n <p class="${Hr.message}">${r?"Error: ":""}${t}</p>\n ${n?`<p class="${Hr.message}"><strong>Tip:</strong> ${n}</p>`:""}\n <p class="${Hr.warning}">Do not close this page while Cloudpack link is running.</p>\n </div>\n `)}}class Yr{clients=new Map;connectionStates=new Map;checkInterval=null;checkIntervalMs=5e3;addClient(e,t){this.clients.set(e,t),this.connectionStates.set(e,!0)}getClient(e){return this.clients.get(e)}async checkConnection(e){const t=this.clients.get(e);if(!t)return!1;try{return await t.getSessionId.query(),!0}catch(t){return console.warn(`${e} client connection lost:`,t),!1}}startMonitoring(e){this.checkInterval&&window.clearInterval(this.checkInterval),this.checkInterval=window.setInterval((()=>{(async()=>{for(const[t,n]of this.clients){if("link"!=t&&"host"!=t)throw new Error(`Invalid client ID: ${t}`);const n=this.connectionStates.get(t)||!1,r=await this.checkConnection(t);n!==r&&await e({id:t,isConnected:r,wasConnected:n}),this.connectionStates.set(t,r)}})().catch((e=>{console.error("Error in connection monitoring:",e)}))}),this.checkIntervalMs)}stopMonitoring(){this.checkInterval&&(window.clearInterval(this.checkInterval),this.checkInterval=null)}async closeAll(){for(const[e,t]of this.clients)try{await t.close(),console.log(`Closed ${e} client`)}catch(t){console.error(`Error closing ${e} client:`,t)}this.clients.clear(),this.connectionStates.clear()}}async function Gr(e){console.debug(`[Cloudpack] Checking session at ${e}`);const t=await jr({url:e});let n=!1;try{n=!!await t.getSessionId.query()}catch(e){}finally{await t.close()}return n}const Qr=new class{ui;connectionManager;linkedPathData=null;constructor(){this.ui=new Jr,this.connectionManager=new Yr}handleConnectionChange=async e=>{const{id:t,isConnected:n,wasConnected:r}=e;r&&!n&&("host"===t?await this.handleHostDisconnection():"link"===t&&await this.handleLinkDisconnection())};async handleHostDisconnection(e){const t=e?.unreachable??!1,n=t?"unreachable":"lost";this.ui.updateStatus({message:`Connection to host ${n}. The session will be terminated.`,isError:!0});const r=this.connectionManager.getClient("link");let s,a=!1;if(r)try{await r.publishData.mutate({...cn,data:{reason:n}}),a=!0}catch(e){this.ui.updateStatus({message:`Error notifying link client of host connection ${n}.`,isError:!0})}await this.cleanup(),t?s="Make sure you have a <code>cloudpack start</code> session running and use the URL from your app to run link with the following command: <code>cloudpack link --remote [URL]</code>":(s="If you did not close the start session terminal, this is a bug. Please report it.",a||(s+=" Link client was not successfully notified of host disconnection. You may need to terminate the link session in the terminal.")),this.ui.updateStatus({message:`Connection to host ${n}. You can close this page.`,tip:s,isError:!0})}async handleLinkDisconnection(){this.ui.updateStatus({message:"Connection to link client lost. Cleaning up linked paths...",isError:!0});const e=this.connectionManager.getClient("host");if(e&&this.linkedPathData){const{linkedPath:t}=this.linkedPathData,n=t.path;try{await e.unlinkPath.mutate({linkedPath:{path:n}}),this.ui.updateStatus({message:"Connection to link client lost. Successfully unlinked paths on host. You can close this page.",tip:"If you did not close the link client terminal. This is a bug. Please report it."})}catch(e){this.ui.updateStatus({message:"Connection to link client lost. Failed to unlink paths on host.",tip:"You may need to restart the host application to unlink the paths.",isError:!0,data:e})}}else this.ui.updateStatus({message:"Cannot clean up: host client or link data not available",tip:"You may need to restart the host application to unlink the paths.",isError:!0});await this.cleanup()}setupLinkUpdateHandler(){const e=this.connectionManager.getClient("link"),t=this.connectionManager.getClient("host");e&&t&&e.onDataChanged.subscribe(rn,{onData:e=>{this.ui.updateStatus({message:"Forwarding package update to the host...",data:e}),t.notifyLinkChange.mutate(e).then((()=>this.ui.updateStatus({message:"Cloudpack Link Proxy listening for updates..."}))).catch((e=>{this.ui.updateStatus({message:"Error forwarding package update to the host. This is a bug. Please report it.",isError:!0,data:e})}))}})}async setupLinkPathHandler(){const e=this.connectionManager.getClient("host"),t=this.connectionManager.getClient("link");t&&e&&(await t.getData.query(an)||t.onDataChanged.subscribe(an,{onData:n=>{this.ui.updateStatus({message:"Processing link setup...",data:n}),this.linkedPathData=n,e.linkPath.mutate(this.linkedPathData).then((e=>{const{resolveMap:n,linkedPaths:r}=e;this.ui.updateStatus({message:"Sending link setup result back to the link server...",data:e}),t.publishData.mutate({...on,data:{resolveMap:n,linkedPaths:r}}).then((()=>{this.ui.updateStatus({message:"Cloudpack Link Proxy listening for updates..."})})).catch((e=>{this.ui.updateStatus({message:"Error sending link setup result back to the link server. Please try to run link again.",tip:"This is a bug. Please report it.",isError:!0,data:e})}))}))}}))}async setupConfig(){const e=this.connectionManager.getClient("link"),t=this.connectionManager.getClient("host");if(e&&t)try{if(!await e.getData.query(sn)){this.ui.updateStatus({message:"Fetching host configuration..."});const n=await t.getLinkConfig.query();this.ui.updateStatus({message:"Sending host configuration to the link server...",data:n}),await e.publishData.mutate({...sn,data:n}),this.ui.updateStatus({message:"Host configuration sent to the link server."})}}catch(e){this.ui.updateStatus({message:"Error setting up configuration. Please try to run link again.",tip:"This is a bug. Please report it.",isError:!0,data:e})}}async cleanup(){this.connectionManager.stopMonitoring(),await this.connectionManager.closeAll()}async initialize(){this.ui.updateStatus({message:"Initializing Cloudpack Link Proxy..."});try{if(!window.__cloudpack)throw this.ui.updateStatus({message:"Cloudpack context not found on window.",tip:"This is a bug. Please report it.",isError:!0}),new Error("Cloudpack not found on window.");const{pageSessionContext:e}=window.__cloudpack;if(!e)throw this.ui.updateStatus({message:"Session context not found on window.__cloudpack.",tip:"This is a bug. Please report it.",isError:!0,data:window.__cloudpack}),new Error("Session context not found on window.__cloudpack");const{apiUrl:t,hostApiServerUrls:n}=e;if(!n||n.length<=0)return void this.ui.updateStatus({message:"No host URL provided.",tip:"This is a bug. Please report it.",data:e,isError:!0});const r=await jr({url:t});let s;this.connectionManager.addClient("link",r);for(const e of n)if(this.ui.updateStatus({message:`Checking host API server at ${e}...`}),await Gr(e)){this.ui.updateStatus({message:`Host API server is active at ${e}.`}),s=e;break}if(!s)return void await this.handleHostDisconnection({unreachable:!0});const a=await jr({url:s});this.connectionManager.addClient("host",a);const i=await r.getSessionId.query(),o=await a.getSessionId.query();this.ui.updateStatus({message:`Link Session: ${i}, Host Session: ${o}`}),this.connectionManager.startMonitoring(this.handleConnectionChange),this.setupLinkUpdateHandler(),await this.setupLinkPathHandler(),await this.setupConfig()}catch(e){const t=e instanceof Error?e.message:String(e);this.ui.updateStatus({message:t,isError:!0,tip:"This is a bug. Please report it.",data:e}),await this.cleanup()}}};Qr.initialize()},509:e=>{var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},586:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},703:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},823:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var s=void 0!==n.layer;s&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,s&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},941:(e,t,n)=>{n.d(t,{default:()=>o});var r=n(25),s=n.n(r),a=n(191),i=n.n(a)()(s());i.push([e.id,":root {\n --color-neutral-background1: #ffffff;\n --color-status-danger-background1: #fdf3f4;\n --color-neutral-background2: #fafafa;\n --color-status-danger-foreground1: #b10e1c;\n --color-neutral-foreground1: #242424;\n --color-neutral-foreground2: #424242;\n}\n\n@media (prefers-color-scheme: dark) {\n :root {\n --color-neutral-background1: #292929;\n --color-status-danger-background1: #3b0509;\n --color-neutral-background2: #1f1f1f;\n --color-status-danger-foreground1: #dc626d;\n --color-neutral-foreground1: #ffffff;\n --color-neutral-foreground2: #d6d6d6;\n }\n}\n\nbody {\n background-color: var(--color-neutral-background1);\n margin: 0;\n padding: 0;\n font-family:\n 'Segoe UI',\n 'Segoe UI Web (West European)',\n -apple-system,\n BlinkMacSystemFont,\n Roboto,\n 'Helvetica Neue',\n sans-serif;\n}\n\n.v64eNmuXrV4WWsOKdGgy {\n padding: 20px;\n border-radius: 4px;\n background-color: var(--color-neutral-background2);\n margin: 20px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n\n.ScZ3E77NPMqtBzp0OwUr {\n background-color: var(--color-status-danger-background1);\n}\n\n.b6Vf2DbiFQkD7AEkJ7p_ h2 {\n color: var(--color-neutral-foreground1);\n margin-top: 0;\n}\n\n._05tS4aUzls4kEWk9hkA7 {\n color: var(--color-neutral-foreground1);\n}\n\n.ScZ3E77NPMqtBzp0OwUr .b6Vf2DbiFQkD7AEkJ7p_ {\n color: var(--color-status-danger-foreground1);\n}\n\n.ScZ3E77NPMqtBzp0OwUr ._05tS4aUzls4kEWk9hkA7 {\n color: var(--color-status-danger-foreground1);\n}\n\n._05tS4aUzls4kEWk9hkA7 code {\n background-color: var(--color-neutral-background1);\n padding: 2px 5px;\n border-radius: 3px;\n font-family: 'Consolas', 'Monaco', 'Courier New', monospace;\n font-size: 0.9em;\n}\n\n.ScZ3E77NPMqtBzp0OwUr ._05tS4aUzls4kEWk9hkA7 code {\n background-color: rgba(0, 0, 0, 0.1);\n}\n\n.kheFps3bT2VbnjAMYfSr {\n font-weight: bold;\n margin-top: 20px;\n color: var(--color-neutral-foreground2);\n}\n","",{version:3,sources:["webpack://./src/UIManager.module.css"],names:[],mappings:"AAAA;EACE,oCAAoC;EACpC,0CAA0C;EAC1C,oCAAoC;EACpC,0CAA0C;EAC1C,oCAAoC;EACpC,oCAAoC;AACtC;;AAEA;EACE;IACE,oCAAoC;IACpC,0CAA0C;IAC1C,oCAAoC;IACpC,0CAA0C;IAC1C,oCAAoC;IACpC,oCAAoC;EACtC;AACF;;AAEA;EACE,kDAAkD;EAClD,SAAS;EACT,UAAU;EACV;;;;;;;cAOY;AACd;;AAEA;EACE,aAAa;EACb,kBAAkB;EAClB,kDAAkD;EAClD,YAAY;EACZ,wCAAwC;AAC1C;;AAEA;EACE,wDAAwD;AAC1D;;AAEA;EACE,uCAAuC;EACvC,aAAa;AACf;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,kDAAkD;EAClD,gBAAgB;EAChB,kBAAkB;EAClB,2DAA2D;EAC3D,gBAAgB;AAClB;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,uCAAuC;AACzC",sourcesContent:[":root {\n --color-neutral-background1: #ffffff;\n --color-status-danger-background1: #fdf3f4;\n --color-neutral-background2: #fafafa;\n --color-status-danger-foreground1: #b10e1c;\n --color-neutral-foreground1: #242424;\n --color-neutral-foreground2: #424242;\n}\n\n@media (prefers-color-scheme: dark) {\n :root {\n --color-neutral-background1: #292929;\n --color-status-danger-background1: #3b0509;\n --color-neutral-background2: #1f1f1f;\n --color-status-danger-foreground1: #dc626d;\n --color-neutral-foreground1: #ffffff;\n --color-neutral-foreground2: #d6d6d6;\n }\n}\n\n:global body {\n background-color: var(--color-neutral-background1);\n margin: 0;\n padding: 0;\n font-family:\n 'Segoe UI',\n 'Segoe UI Web (West European)',\n -apple-system,\n BlinkMacSystemFont,\n Roboto,\n 'Helvetica Neue',\n sans-serif;\n}\n\n.statusContainer {\n padding: 20px;\n border-radius: 4px;\n background-color: var(--color-neutral-background2);\n margin: 20px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n\n.errorContainer {\n background-color: var(--color-status-danger-background1);\n}\n\n.title h2 {\n color: var(--color-neutral-foreground1);\n margin-top: 0;\n}\n\n.message {\n color: var(--color-neutral-foreground1);\n}\n\n.errorContainer .title {\n color: var(--color-status-danger-foreground1);\n}\n\n.errorContainer .message {\n color: var(--color-status-danger-foreground1);\n}\n\n.message code {\n background-color: var(--color-neutral-background1);\n padding: 2px 5px;\n border-radius: 3px;\n font-family: 'Consolas', 'Monaco', 'Courier New', monospace;\n font-size: 0.9em;\n}\n\n.errorContainer .message code {\n background-color: rgba(0, 0, 0, 0.1);\n}\n\n.warning {\n font-weight: bold;\n margin-top: 20px;\n color: var(--color-neutral-foreground2);\n}\n"],sourceRoot:""}]),i.locals={statusContainer:"v64eNmuXrV4WWsOKdGgy",errorContainer:"ScZ3E77NPMqtBzp0OwUr",title:"b6Vf2DbiFQkD7AEkJ7p_",message:"_05tS4aUzls4kEWk9hkA7",warning:"kheFps3bT2VbnjAMYfSr"};const o=i}};import e from"../runtime.js";import*as t from"./index.js";e.C(t),e(e.s=460);
2
+ export const __webpack_id__=293;export const __webpack_ids__=[293];export const __webpack_modules__={25:e=>{e.exports=function(e){var t=e[1],n=e[3];if(!n)return t;if("function"==typeof btoa){var r=btoa(unescape(encodeURIComponent(JSON.stringify(n)))),s="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(r),a="/*# ".concat(s," */");return[t].concat([a]).join("\n")}return[t].join("\n")}},191:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,r,s,a){"string"==typeof e&&(e=[[null,e,void 0]]);var i={};if(r)for(var o=0;o<this.length;o++){var c=this[o][0];null!=c&&(i[c]=!0)}for(var u=0;u<e.length;u++){var d=[].concat(e[u]);r&&i[d[0]]||(void 0!==a&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=a),n&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=n):d[2]=n),s&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=s):d[4]="".concat(s)),t.push(d))}},t}},214:(e,t,n)=>{e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},286:e=>{var t=[];function n(e){for(var n=-1,r=0;r<t.length;r++)if(t[r].identifier===e){n=r;break}return n}function r(e,r){for(var a={},i=[],o=0;o<e.length;o++){var c=e[o],u=r.base?c[0]+r.base:c[0],d=a[u]||0,l="".concat(u," ").concat(d);a[u]=d+1;var p=n(l),h={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)t[p].references++,t[p].updater(h);else{var f=s(h,r);r.byIndex=o,t.splice(o,0,{identifier:l,updater:f,references:1})}i.push(l)}return i}function s(e,t){var n=t.domAPI(t);return n.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;n.update(e=t)}else n.remove()}}e.exports=function(e,s){var a=r(e=e||[],s=s||{});return function(e){e=e||[];for(var i=0;i<a.length;i++){var o=n(a[i]);t[o].references--}for(var c=r(e,s),u=0;u<a.length;u++){var d=n(a[u]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}a=c}}},460:(e,t,n)=>{var r,s,a={};n.r(a),n.d(a,{BRAND:()=>qe,DIRTY:()=>b,EMPTY_PATH:()=>g,INVALID:()=>_,NEVER:()=>jt,OK:()=>k,ParseStatus:()=>v,Schema:()=>N,ZodAny:()=>le,ZodArray:()=>me,ZodBigInt:()=>ae,ZodBoolean:()=>ie,ZodBranded:()=>ze,ZodCatch:()=>$e,ZodDate:()=>oe,ZodDefault:()=>De,ZodDiscriminatedUnion:()=>be,ZodEffects:()=>Ne,ZodEnum:()=>Ze,ZodError:()=>d,ZodFirstPartyTypeKind:()=>Ke,ZodFunction:()=>Se,ZodIntersection:()=>we,ZodIssueCode:()=>c,ZodLazy:()=>Te,ZodLiteral:()=>Oe,ZodMap:()=>Ce,ZodNaN:()=>Le,ZodNativeEnum:()=>Re,ZodNever:()=>he,ZodNull:()=>de,ZodNullable:()=>Me,ZodNumber:()=>se,ZodObject:()=>ye,ZodOptional:()=>Ie,ZodParsedType:()=>i,ZodPipeline:()=>Fe,ZodPromise:()=>je,ZodReadonly:()=>Ue,ZodRecord:()=>Ae,ZodSchema:()=>N,ZodSet:()=>Ee,ZodString:()=>ne,ZodSymbol:()=>ce,ZodTransformer:()=>Ne,ZodTuple:()=>xe,ZodType:()=>N,ZodUndefined:()=>ue,ZodUnion:()=>ve,ZodUnknown:()=>pe,ZodVoid:()=>fe,addIssueToContext:()=>y,any:()=>st,array:()=>ct,bigint:()=>Qe,boolean:()=>Xe,coerce:()=>Rt,custom:()=>Be,date:()=>et,datetimeRegex:()=>X,defaultErrorMap:()=>l,discriminatedUnion:()=>pt,effect:()=>At,enum:()=>kt,function:()=>vt,getErrorMap:()=>f,getParsedType:()=>o,instanceof:()=>He,intersection:()=>ht,isAborted:()=>w,isAsync:()=>C,isDirty:()=>x,isValid:()=>A,late:()=>Ve,lazy:()=>_t,literal:()=>bt,makeIssue:()=>m,map:()=>gt,nan:()=>Ge,nativeEnum:()=>wt,never:()=>it,null:()=>rt,nullable:()=>Et,number:()=>Ye,object:()=>ut,objectUtil:()=>s,oboolean:()=>Zt,onumber:()=>Pt,optional:()=>Ct,ostring:()=>Ot,pipeline:()=>Tt,preprocess:()=>St,promise:()=>xt,quotelessJson:()=>u,record:()=>mt,set:()=>yt,setErrorMap:()=>h,strictObject:()=>dt,string:()=>Je,symbol:()=>tt,transformer:()=>At,tuple:()=>ft,undefined:()=>nt,union:()=>lt,unknown:()=>at,util:()=>r,void:()=>ot}),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(r||(r={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(s||(s={}));const i=r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),o=e=>{switch(typeof e){case"undefined":return i.undefined;case"string":return i.string;case"number":return Number.isNaN(e)?i.nan:i.number;case"boolean":return i.boolean;case"function":return i.function;case"bigint":return i.bigint;case"symbol":return i.symbol;case"object":return Array.isArray(e)?i.array:null===e?i.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?i.promise:"undefined"!=typeof Map&&e instanceof Map?i.map:"undefined"!=typeof Set&&e instanceof Set?i.set:"undefined"!=typeof Date&&e instanceof Date?i.date:i.object;default:return i.unknown}},c=r.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),u=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class d extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const s of e.issues)if("invalid_union"===s.code)s.unionErrors.map(r);else if("invalid_return_type"===s.code)r(s.returnTypeError);else if("invalid_arguments"===s.code)r(s.argumentsError);else if(0===s.path.length)n._errors.push(t(s));else{let e=n,r=0;for(;r<s.path.length;){const n=s.path[r];r===s.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(s))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(e){if(!(e instanceof d))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}d.create=e=>new d(e);const l=(e,t)=>{let n;switch(e.code){case c.invalid_type:n=e.received===i.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case c.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,r.jsonStringifyReplacer)}`;break;case c.unrecognized_keys:n=`Unrecognized key(s) in object: ${r.joinValues(e.keys,", ")}`;break;case c.invalid_union:n="Invalid input";break;case c.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${r.joinValues(e.options)}`;break;case c.invalid_enum_value:n=`Invalid enum value. Expected ${r.joinValues(e.options)}, received '${e.received}'`;break;case c.invalid_arguments:n="Invalid function arguments";break;case c.invalid_return_type:n="Invalid function return type";break;case c.invalid_date:n="Invalid date";break;case c.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:r.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case c.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case c.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case c.custom:n="Invalid input";break;case c.invalid_intersection_types:n="Intersection results could not be merged";break;case c.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case c.not_finite:n="Number must be finite";break;default:n=t.defaultError,r.assertNever(e)}return{message:n}};let p=l;function h(e){p=e}function f(){return p}const m=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,a=[...n,...s.path||[]],i={...s,path:a};if(void 0!==s.message)return{...s,path:a,message:s.message};let o="";const c=r.filter((e=>!!e)).slice().reverse();for(const e of c)o=e(i,{data:t,defaultError:o}).message;return{...s,path:a,message:o}},g=[];function y(e,t){const n=f(),r=m({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===l?void 0:l].filter((e=>!!e))});e.common.issues.push(r)}class v{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return _;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t){const t=await e.key,r=await e.value;n.push({key:t,value:r})}return v.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:s}=r;if("aborted"===t.status)return _;if("aborted"===s.status)return _;"dirty"===t.status&&e.dirty(),"dirty"===s.status&&e.dirty(),"__proto__"===t.value||void 0===s.value&&!r.alwaysSet||(n[t.value]=s.value)}return{status:e.value,value:n}}}const _=Object.freeze({status:"aborted"}),b=e=>({status:"dirty",value:e}),k=e=>({status:"valid",value:e}),w=e=>"aborted"===e.status,x=e=>"dirty"===e.status,A=e=>"valid"===e.status,C=e=>"undefined"!=typeof Promise&&e instanceof Promise;var E;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(E||(E={}));var S,T,O=function(e,t,n,r){if("a"===n&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?r:"a"===n?r.call(e):r?r.value:t.get(e)},P=function(e,t,n,r,s){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!s)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?s.call(e,n):s?s.value=n:t.set(e,n),n};class Z{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const R=(e,t)=>{if(A(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new d(e.common.issues);return this._error=t,this._error}}};function j(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:s}:{errorMap:(t,s)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??s.defaultError}:void 0===s.data?{message:a??r??s.defaultError}:"invalid_type"!==t.code?{message:s.defaultError}:{message:a??n??s.defaultError}},description:s}}class N{get description(){return this._def.description}_getType(e){return o(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new v,ctx:{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(C(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){const n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},r=this._parseSync({data:e,path:n.path,parent:n});return R(n,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:t});return A(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((e=>A(e)?{value:e.value}:{issues:t.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},r=this._parse({data:e,path:n.path,parent:n}),s=await(C(r)?r:Promise.resolve(r));return R(n,s)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const s=e(t),a=()=>r.addIssue({code:c.custom,...n(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(a(),!1))):!!s||(a(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Ne({schema:this,typeName:Ke.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return Ie.create(this,this._def)}nullable(){return Me.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return me.create(this)}promise(){return je.create(this,this._def)}or(e){return ve.create([this,e],this._def)}and(e){return we.create(this,e,this._def)}transform(e){return new Ne({...j(this._def),schema:this,typeName:Ke.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new De({...j(this._def),innerType:this,defaultValue:t,typeName:Ke.ZodDefault})}brand(){return new ze({typeName:Ke.ZodBranded,type:this,...j(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new $e({...j(this._def),innerType:this,catchValue:t,typeName:Ke.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Fe.create(this,e)}readonly(){return Ue.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const I=/^c[^\s-]{8,}$/i,M=/^[0-9a-z]+$/,D=/^[0-9A-HJKMNP-TV-Z]{26}$/i,$=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,L=/^[a-z0-9_-]{21}$/i,q=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,z=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,F=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let U;const W=/^(?:(?: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])$/,B=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,V=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,K=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,H=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,J=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Y="((\\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])))",G=new RegExp(`^${Y}$`);function Q(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function X(e){let t=`${Y}T${Q(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function ee(e,t){if(!q.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),s=JSON.parse(atob(r));return!("object"!=typeof s||null===s||"typ"in s&&"JWT"!==s?.typ||!s.alg||t&&s.alg!==t)}catch{return!1}}function te(e,t){return!("v4"!==t&&t||!B.test(e))||!("v6"!==t&&t||!K.test(e))}class ne extends N{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==i.string){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.string,received:t.parsedType}),_}const t=new v;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:c.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:c.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,s=e.data.length<i.value;(r||s)&&(n=this._getOrReturnCtx(e,n),r?y(n,{code:c.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):s&&y(n,{code:c.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)F.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"email",code:c.invalid_string,message:i.message}),t.dirty());else if("emoji"===i.kind)U||(U=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),U.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"emoji",code:c.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)$.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"uuid",code:c.invalid_string,message:i.message}),t.dirty());else if("nanoid"===i.kind)L.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"nanoid",code:c.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)I.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cuid",code:c.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)M.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cuid2",code:c.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)D.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"ulid",code:c.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),y(n,{validation:"url",code:c.invalid_string,message:i.message}),t.dirty()}else"regex"===i.kind?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"regex",code:c.invalid_string,message:i.message}),t.dirty())):"trim"===i.kind?e.data=e.data.trim():"includes"===i.kind?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty()):"toLowerCase"===i.kind?e.data=e.data.toLowerCase():"toUpperCase"===i.kind?e.data=e.data.toUpperCase():"startsWith"===i.kind?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):"endsWith"===i.kind?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):"datetime"===i.kind?X(i).test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:"datetime",message:i.message}),t.dirty()):"date"===i.kind?G.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:"date",message:i.message}),t.dirty()):"time"===i.kind?new RegExp(`^${Q(i)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{code:c.invalid_string,validation:"time",message:i.message}),t.dirty()):"duration"===i.kind?z.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"duration",code:c.invalid_string,message:i.message}),t.dirty()):"ip"===i.kind?(s=e.data,("v4"!==(a=i.version)&&a||!W.test(s))&&("v6"!==a&&a||!V.test(s))&&(n=this._getOrReturnCtx(e,n),y(n,{validation:"ip",code:c.invalid_string,message:i.message}),t.dirty())):"jwt"===i.kind?ee(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"jwt",code:c.invalid_string,message:i.message}),t.dirty()):"cidr"===i.kind?te(e.data,i.version)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"cidr",code:c.invalid_string,message:i.message}),t.dirty()):"base64"===i.kind?H.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"base64",code:c.invalid_string,message:i.message}),t.dirty()):"base64url"===i.kind?J.test(e.data)||(n=this._getOrReturnCtx(e,n),y(n,{validation:"base64url",code:c.invalid_string,message:i.message}),t.dirty()):r.assertNever(i);var s,a;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:c.invalid_string,...E.errToObj(n)})}_addCheck(e){return new ne({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...E.errToObj(e)})}url(e){return this._addCheck({kind:"url",...E.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...E.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...E.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...E.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...E.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...E.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...E.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...E.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...E.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...E.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...E.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...E.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...E.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...E.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...E.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...E.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...E.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...E.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...E.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...E.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...E.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...E.errToObj(t)})}nonempty(e){return this.min(1,E.errToObj(e))}trim(){return new ne({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ne({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ne({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function re(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r;return Number.parseInt(e.toFixed(s).replace(".",""))%Number.parseInt(t.toFixed(s).replace(".",""))/10**s}ne.create=e=>new ne({checks:[],typeName:Ke.ZodString,coerce:e?.coerce??!1,...j(e)});class se extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==i.number){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.number,received:t.parsedType}),_}let t;const n=new v;for(const s of this._def.checks)"int"===s.kind?r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:c.invalid_type,expected:"integer",received:"float",message:s.message}),n.dirty()):"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),n.dirty()):"multipleOf"===s.kind?0!==re(e.data,s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):"finite"===s.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_finite,message:s.message}),n.dirty()):r.assertNever(s);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,E.toString(t))}gt(e,t){return this.setLimit("min",e,!1,E.toString(t))}lte(e,t){return this.setLimit("max",e,!0,E.toString(t))}lt(e,t){return this.setLimit("max",e,!1,E.toString(t))}setLimit(e,t,n,r){return new se({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:E.toString(r)}]})}_addCheck(e){return new se({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:E.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:E.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:E.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:E.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:E.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&r.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}se.create=e=>new se({checks:[],typeName:Ke.ZodNumber,coerce:e?.coerce||!1,...j(e)});class ae extends N{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==i.bigint)return this._getInvalidInput(e);let t;const n=new v;for(const s of this._def.checks)"min"===s.kind?(s.inclusive?e.data<s.value:e.data<=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):"max"===s.kind?(s.inclusive?e.data>s.value:e.data>=s.value)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),n.dirty()):"multipleOf"===s.kind?e.data%s.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),y(t,{code:c.not_multiple_of,multipleOf:s.value,message:s.message}),n.dirty()):r.assertNever(s);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.bigint,received:t.parsedType}),_}gte(e,t){return this.setLimit("min",e,!0,E.toString(t))}gt(e,t){return this.setLimit("min",e,!1,E.toString(t))}lte(e,t){return this.setLimit("max",e,!0,E.toString(t))}lt(e,t){return this.setLimit("max",e,!1,E.toString(t))}setLimit(e,t,n,r){return new ae({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:E.toString(r)}]})}_addCheck(e){return new ae({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:E.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:E.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:E.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:E.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:E.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ae.create=e=>new ae({checks:[],typeName:Ke.ZodBigInt,coerce:e?.coerce??!1,...j(e)});class ie extends N{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==i.boolean){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.boolean,received:t.parsedType}),_}return k(e.data)}}ie.create=e=>new ie({typeName:Ke.ZodBoolean,coerce:e?.coerce||!1,...j(e)});class oe extends N{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==i.date){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.date,received:t.parsedType}),_}if(Number.isNaN(e.data.getTime()))return y(this._getOrReturnCtx(e),{code:c.invalid_date}),_;const t=new v;let n;for(const s of this._def.checks)"min"===s.kind?e.data.getTime()<s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:c.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),t.dirty()):"max"===s.kind?e.data.getTime()>s.value&&(n=this._getOrReturnCtx(e,n),y(n,{code:c.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),t.dirty()):r.assertNever(s);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new oe({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:E.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:E.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}oe.create=e=>new oe({checks:[],coerce:e?.coerce||!1,typeName:Ke.ZodDate,...j(e)});class ce extends N{_parse(e){if(this._getType(e)!==i.symbol){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.symbol,received:t.parsedType}),_}return k(e.data)}}ce.create=e=>new ce({typeName:Ke.ZodSymbol,...j(e)});class ue extends N{_parse(e){if(this._getType(e)!==i.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.undefined,received:t.parsedType}),_}return k(e.data)}}ue.create=e=>new ue({typeName:Ke.ZodUndefined,...j(e)});class de extends N{_parse(e){if(this._getType(e)!==i.null){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.null,received:t.parsedType}),_}return k(e.data)}}de.create=e=>new de({typeName:Ke.ZodNull,...j(e)});class le extends N{constructor(){super(...arguments),this._any=!0}_parse(e){return k(e.data)}}le.create=e=>new le({typeName:Ke.ZodAny,...j(e)});class pe extends N{constructor(){super(...arguments),this._unknown=!0}_parse(e){return k(e.data)}}pe.create=e=>new pe({typeName:Ke.ZodUnknown,...j(e)});class he extends N{_parse(e){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.never,received:t.parsedType}),_}}he.create=e=>new he({typeName:Ke.ZodNever,...j(e)});class fe extends N{_parse(e){if(this._getType(e)!==i.undefined){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.void,received:t.parsedType}),_}return k(e.data)}}fe.create=e=>new fe({typeName:Ke.ZodVoid,...j(e)});class me extends N{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==i.array)return y(t,{code:c.invalid_type,expected:i.array,received:t.parsedType}),_;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,s=t.data.length<r.exactLength.value;(e||s)&&(y(t,{code:e?c.too_big:c.too_small,minimum:s?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(y(t,{code:c.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(y(t,{code:c.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new Z(t,e,t.path,n))))).then((e=>v.mergeArray(n,e)));const s=[...t.data].map(((e,n)=>r.type._parseSync(new Z(t,e,t.path,n))));return v.mergeArray(n,s)}get element(){return this._def.type}min(e,t){return new me({...this._def,minLength:{value:e,message:E.toString(t)}})}max(e,t){return new me({...this._def,maxLength:{value:e,message:E.toString(t)}})}length(e,t){return new me({...this._def,exactLength:{value:e,message:E.toString(t)}})}nonempty(e){return this.min(1,e)}}function ge(e){if(e instanceof ye){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Ie.create(ge(r))}return new ye({...e._def,shape:()=>t})}return e instanceof me?new me({...e._def,type:ge(e.element)}):e instanceof Ie?Ie.create(ge(e.unwrap())):e instanceof Me?Me.create(ge(e.unwrap())):e instanceof xe?xe.create(e.items.map((e=>ge(e)))):e}me.create=(e,t)=>new me({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ke.ZodArray,...j(t)});class ye extends N{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=r.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==i.object){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.object,received:t.parsedType}),_}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof he&&"strip"===this._def.unknownKeys))for(const e in n.data)s.includes(e)||a.push(e);const o=[];for(const e of s){const t=r[e],s=n.data[e];o.push({key:{status:"valid",value:e},value:t._parse(new Z(n,s,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof he){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)o.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)a.length>0&&(y(n,{code:c.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const r=n.data[t];o.push({key:{status:"valid",value:t},value:e._parse(new Z(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of o){const n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e})).then((e=>v.mergeObjectSync(t,e))):v.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(e){return E.errToObj,new ye({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{const r=this._def.errorMap?.(t,n).message??n.defaultError;return"unrecognized_keys"===t.code?{message:E.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new ye({...this._def,unknownKeys:"strip"})}passthrough(){return new ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ke.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ye({...this._def,catchall:e})}pick(e){const t={};for(const n of r.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new ye({...this._def,shape:()=>t})}omit(e){const t={};for(const n of r.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new ye({...this._def,shape:()=>t})}deepPartial(){return ge(this)}partial(e){const t={};for(const n of r.objectKeys(this.shape)){const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()}return new ye({...this._def,shape:()=>t})}required(e){const t={};for(const n of r.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Ie;)e=e._def.innerType;t[n]=e}return new ye({...this._def,shape:()=>t})}keyof(){return Pe(r.objectKeys(this.shape))}}ye.create=(e,t)=>new ye({shape:()=>e,unknownKeys:"strip",catchall:he.create(),typeName:Ke.ZodObject,...j(t)}),ye.strictCreate=(e,t)=>new ye({shape:()=>e,unknownKeys:"strict",catchall:he.create(),typeName:Ke.ZodObject,...j(t)}),ye.lazycreate=(e,t)=>new ye({shape:e,unknownKeys:"strip",catchall:he.create(),typeName:Ke.ZodObject,...j(t)});class ve extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new d(e.ctx.common.issues)));return y(t,{code:c.invalid_union,unionErrors:n}),_}));{let e;const r=[];for(const s of n){const n={...t,common:{...t.common,issues:[]},parent:null},a=s._parseSync({data:t.data,path:t.path,parent:n});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const s=r.map((e=>new d(e)));return y(t,{code:c.invalid_union,unionErrors:s}),_}}get options(){return this._def.options}}ve.create=(e,t)=>new ve({options:e,typeName:Ke.ZodUnion,...j(t)});const _e=e=>e instanceof Te?_e(e.schema):e instanceof Ne?_e(e.innerType()):e instanceof Oe?[e.value]:e instanceof Ze?e.options:e instanceof Re?r.objectValues(e.enum):e instanceof De?_e(e._def.innerType):e instanceof ue?[void 0]:e instanceof de?[null]:e instanceof Ie?[void 0,..._e(e.unwrap())]:e instanceof Me?[null,..._e(e.unwrap())]:e instanceof ze||e instanceof Ue?_e(e.unwrap()):e instanceof $e?_e(e._def.innerType):[];class be extends N{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.object)return y(t,{code:c.invalid_type,expected:i.object,received:t.parsedType}),_;const n=this.discriminator,r=t.data[n],s=this.optionsMap.get(r);return s?t.common.async?s._parseAsync({data:t.data,path:t.path,parent:t}):s._parseSync({data:t.data,path:t.path,parent:t}):(y(t,{code:c.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),_)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=_e(n.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const s of t){if(r.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);r.set(s,n)}}return new be({typeName:Ke.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...j(n)})}}function ke(e,t){const n=o(e),s=o(t);if(e===t)return{valid:!0,data:e};if(n===i.object&&s===i.object){const n=r.objectKeys(t),s=r.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const n of s){const r=ke(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}if(n===i.array&&s===i.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const s=ke(e[r],t[r]);if(!s.valid)return{valid:!1};n.push(s.data)}return{valid:!0,data:n}}return n===i.date&&s===i.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class we extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(w(e)||w(r))return _;const s=ke(e.value,r.value);return s.valid?((x(e)||x(r))&&t.dirty(),{status:t.value,value:s.data}):(y(n,{code:c.invalid_intersection_types}),_)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}we.create=(e,t,n)=>new we({left:e,right:t,typeName:Ke.ZodIntersection,...j(n)});class xe extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.array)return y(n,{code:c.invalid_type,expected:i.array,received:n.parsedType}),_;if(n.data.length<this._def.items.length)return y(n,{code:c.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),_;!this._def.rest&&n.data.length>this._def.items.length&&(y(n,{code:c.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new Z(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>v.mergeArray(t,e))):v.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new xe({...this._def,rest:e})}}xe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new xe({items:e,typeName:Ke.ZodTuple,rest:null,...j(t)})};class Ae extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.object)return y(n,{code:c.invalid_type,expected:i.object,received:n.parsedType}),_;const r=[],s=this._def.keyType,a=this._def.valueType;for(const e in n.data)r.push({key:s._parse(new Z(n,e,n.path,e)),value:a._parse(new Z(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?v.mergeObjectAsync(t,r):v.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Ae(t instanceof N?{keyType:e,valueType:t,typeName:Ke.ZodRecord,...j(n)}:{keyType:ne.create(),valueType:e,typeName:Ke.ZodRecord,...j(t)})}}class Ce extends N{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.map)return y(n,{code:c.invalid_type,expected:i.map,received:n.parsedType}),_;const r=this._def.keyType,s=this._def.valueType,a=[...n.data.entries()].map((([e,t],a)=>({key:r._parse(new Z(n,e,n.path,[a,"key"])),value:s._parse(new Z(n,t,n.path,[a,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of a){const r=await n.key,s=await n.value;if("aborted"===r.status||"aborted"===s.status)return _;"dirty"!==r.status&&"dirty"!==s.status||t.dirty(),e.set(r.value,s.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of a){const r=n.key,s=n.value;if("aborted"===r.status||"aborted"===s.status)return _;"dirty"!==r.status&&"dirty"!==s.status||t.dirty(),e.set(r.value,s.value)}return{status:t.value,value:e}}}}Ce.create=(e,t,n)=>new Ce({valueType:t,keyType:e,typeName:Ke.ZodMap,...j(n)});class Ee extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==i.set)return y(n,{code:c.invalid_type,expected:i.set,received:n.parsedType}),_;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(y(n,{code:c.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(y(n,{code:c.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const s=this._def.valueType;function a(e){const n=new Set;for(const r of e){if("aborted"===r.status)return _;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const o=[...n.data.values()].map(((e,t)=>s._parse(new Z(n,e,n.path,t))));return n.common.async?Promise.all(o).then((e=>a(e))):a(o)}min(e,t){return new Ee({...this._def,minSize:{value:e,message:E.toString(t)}})}max(e,t){return new Ee({...this._def,maxSize:{value:e,message:E.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ee.create=(e,t)=>new Ee({valueType:e,minSize:null,maxSize:null,typeName:Ke.ZodSet,...j(t)});class Se extends N{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.function)return y(t,{code:c.invalid_type,expected:i.function,received:t.parsedType}),_;function n(e,n){return m({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,f(),l].filter((e=>!!e)),issueData:{code:c.invalid_arguments,argumentsError:n}})}function r(e,n){return m({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,f(),l].filter((e=>!!e)),issueData:{code:c.invalid_return_type,returnTypeError:n}})}const s={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof je){const e=this;return k((async function(...t){const i=new d([]),o=await e._def.args.parseAsync(t,s).catch((e=>{throw i.addIssue(n(t,e)),i})),c=await Reflect.apply(a,this,o);return await e._def.returns._def.type.parseAsync(c,s).catch((e=>{throw i.addIssue(r(c,e)),i}))}))}{const e=this;return k((function(...t){const i=e._def.args.safeParse(t,s);if(!i.success)throw new d([n(t,i.error)]);const o=Reflect.apply(a,this,i.data),c=e._def.returns.safeParse(o,s);if(!c.success)throw new d([r(o,c.error)]);return c.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Se({...this._def,args:xe.create(e).rest(pe.create())})}returns(e){return new Se({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new Se({args:e||xe.create([]).rest(pe.create()),returns:t||pe.create(),typeName:Ke.ZodFunction,...j(n)})}}class Te extends N{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Te.create=(e,t)=>new Te({getter:e,typeName:Ke.ZodLazy,...j(t)});class Oe extends N{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return y(t,{received:t.data,code:c.invalid_literal,expected:this._def.value}),_}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Pe(e,t){return new Ze({values:e,typeName:Ke.ZodEnum,...j(t)})}Oe.create=(e,t)=>new Oe({value:e,typeName:Ke.ZodLiteral,...j(t)});class Ze extends N{constructor(){super(...arguments),S.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{expected:r.joinValues(n),received:t.parsedType,code:c.invalid_type}),_}if(O(this,S,"f")||P(this,S,new Set(this._def.values),"f"),!O(this,S,"f").has(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return y(t,{received:t.data,code:c.invalid_enum_value,options:n}),_}return k(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Ze.create(e,{...this._def,...t})}exclude(e,t=this._def){return Ze.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}S=new WeakMap,Ze.create=Pe;class Re extends N{constructor(){super(...arguments),T.set(this,void 0)}_parse(e){const t=r.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==i.string&&n.parsedType!==i.number){const e=r.objectValues(t);return y(n,{expected:r.joinValues(e),received:n.parsedType,code:c.invalid_type}),_}if(O(this,T,"f")||P(this,T,new Set(r.getValidEnumValues(this._def.values)),"f"),!O(this,T,"f").has(e.data)){const e=r.objectValues(t);return y(n,{received:n.data,code:c.invalid_enum_value,options:e}),_}return k(e.data)}get enum(){return this._def.values}}T=new WeakMap,Re.create=(e,t)=>new Re({values:e,typeName:Ke.ZodNativeEnum,...j(t)});class je extends N{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==i.promise&&!1===t.common.async)return y(t,{code:c.invalid_type,expected:i.promise,received:t.parsedType}),_;const n=t.parsedType===i.promise?t.data:Promise.resolve(t.data);return k(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}je.create=(e,t)=>new je({type:e,typeName:Ke.ZodPromise,...j(t)});class Ne extends N{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ke.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),s=this._def.effect||null,a={addIssue:e=>{y(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===s.type){const e=s.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return _;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?_:"dirty"===r.status||"dirty"===t.value?b(r.value):r}));{if("aborted"===t.value)return _;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?_:"dirty"===r.status||"dirty"===t.value?b(r.value):r}}if("refinement"===s.type){const e=e=>{const t=s.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?_:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?_:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===s.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!A(e))return e;const r=s.transform(e.value,a);if(r instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:r}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>A(e)?Promise.resolve(s.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}r.assertNever(s)}}Ne.create=(e,t,n)=>new Ne({schema:e,typeName:Ke.ZodEffects,effect:t,...j(n)}),Ne.createWithPreprocess=(e,t,n)=>new Ne({schema:t,effect:{type:"preprocess",transform:e},typeName:Ke.ZodEffects,...j(n)});class Ie extends N{_parse(e){return this._getType(e)===i.undefined?k(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ie.create=(e,t)=>new Ie({innerType:e,typeName:Ke.ZodOptional,...j(t)});class Me extends N{_parse(e){return this._getType(e)===i.null?k(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Me.create=(e,t)=>new Me({innerType:e,typeName:Ke.ZodNullable,...j(t)});class De extends N{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===i.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}De.create=(e,t)=>new De({innerType:e,typeName:Ke.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...j(t)});class $e extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return C(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new d(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new d(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}$e.create=(e,t)=>new $e({innerType:e,typeName:Ke.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...j(t)});class Le extends N{_parse(e){if(this._getType(e)!==i.nan){const t=this._getOrReturnCtx(e);return y(t,{code:c.invalid_type,expected:i.nan,received:t.parsedType}),_}return{status:"valid",value:e.data}}}Le.create=e=>new Le({typeName:Ke.ZodNaN,...j(e)});const qe=Symbol("zod_brand");class ze extends N{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Fe extends N{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),b(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?_:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Fe({in:e,out:t,typeName:Ke.ZodPipeline})}}class Ue extends N{_parse(e){const t=this._def.innerType._parse(e),n=e=>(A(e)&&(e.value=Object.freeze(e.value)),e);return C(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function We(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function Be(e,t={},n){return e?le.create().superRefine(((r,s)=>{const a=e(r);if(a instanceof Promise)return a.then((e=>{if(!e){const e=We(t,r),a=e.fatal??n??!0;s.addIssue({code:"custom",...e,fatal:a})}}));if(!a){const e=We(t,r),a=e.fatal??n??!0;s.addIssue({code:"custom",...e,fatal:a})}})):le.create()}Ue.create=(e,t)=>new Ue({innerType:e,typeName:Ke.ZodReadonly,...j(t)});const Ve={object:ye.lazycreate};var Ke;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(Ke||(Ke={}));const He=(e,t={message:`Input not instance of ${e.name}`})=>Be((t=>t instanceof e),t),Je=ne.create,Ye=se.create,Ge=Le.create,Qe=ae.create,Xe=ie.create,et=oe.create,tt=ce.create,nt=ue.create,rt=de.create,st=le.create,at=pe.create,it=he.create,ot=fe.create,ct=me.create,ut=ye.create,dt=ye.strictCreate,lt=ve.create,pt=be.create,ht=we.create,ft=xe.create,mt=Ae.create,gt=Ce.create,yt=Ee.create,vt=Se.create,_t=Te.create,bt=Oe.create,kt=Ze.create,wt=Re.create,xt=je.create,At=Ne.create,Ct=Ie.create,Et=Me.create,St=Ne.createWithPreprocess,Tt=Fe.create,Ot=()=>Je().optional(),Pt=()=>Ye().optional(),Zt=()=>Xe().optional(),Rt={string:e=>ne.create({...e,coerce:!0}),number:e=>se.create({...e,coerce:!0}),boolean:e=>ie.create({...e,coerce:!0}),bigint:e=>ae.create({...e,coerce:!0}),date:e=>oe.create({...e,coerce:!0})},jt=_,Nt=a,It=(Nt.object({status:Nt.literal("idle").or(Nt.literal("pending").or(Nt.literal("unknown"))),remainingTasks:Nt.number(),totalTasks:Nt.number(),totalErrors:Nt.number(),totalWarnings:Nt.number()}),Nt.object({id:Nt.string(),name:Nt.string().optional(),inputPath:Nt.string().optional(),outputPath:Nt.string().optional()}));function Mt(e){return ut(e).strict()}const Dt=Mt({file:Nt.string(),line:Nt.number().optional(),column:Nt.number().optional()}),$t=Mt({text:Nt.string(),location:Dt.optional()}),Lt=Mt({text:Nt.string(),source:Nt.string(),location:Dt.optional(),notes:Nt.array($t).optional()}),qt=Nt.object({id:Nt.string(),errors:Nt.array(Lt).optional(),warnings:Nt.array(Lt).optional()}),zt=Nt.object({name:Nt.string(),start:Nt.number(),end:Nt.number().optional(),threwException:Nt.boolean().optional()}),Ft=Nt.object({status:Nt.literal("pending").or(Nt.literal("complete")).optional(),timings:Nt.array(zt).optional(),startTime:Nt.number(),durationMilliseconds:Nt.number().optional(),lastUpdated:Nt.number().optional()}).extend(It.shape).extend(qt.shape);ut({tasks:ct(Ft)});const Ut=_t((()=>Mt({name:Je(),version:Je(),path:Je(),dependencies:mt(Je()),requiredBy:mt(Je()),isExternal:Xe().optional(),isLinked:Xe().optional(),scopedVersions:mt(_t((()=>Ut))).optional()}))),Wt=mt(Je(),Ut),Bt=e=>mt(lt([e,nt()])),Vt=ut({browser:mt(Je()),node:mt(Je())}),Kt=mt(Je(),lt([nt(),Je()])).optional(),Ht=ut({name:Je(),version:Je(),exports:st(),dependencies:Kt,peerDependencies:Kt}),Jt=Mt({path:Je(),rootPath:Je().optional(),includeAll:Xe().optional(),ignoredPackages:Je().array().optional(),ignoreResolutions:Xe().optional(),resolveStrategy:kt(["dedupe","duplicate"]).optional(),remote:ut({resolveMap:Wt,hostUrl:Je(),packages:ut({definitions:Bt(ut({})),transformedDefinitions:Bt(Ht)}),packageHashes:ut({hashesWithSource:Vt,hashesWithNoSource:Vt})}).optional()}),Yt=ut({linkedPath:Jt}),Gt=ut({resolveMap:Wt,linkedPaths:ct(Jt)}),Qt=ut({packagePath:Je(),hash:Je().optional(),definition:Ht.optional()}),Xt=ut({name:Je(),version:Je().optional()}),en=lt([Je(),Xt]),tn=lt([Je(),Xt.required()]),nn=Mt({packageSettings:ct(ut({match:lt([en,ct(en)])}).passthrough()),generated:ut({packageSettings:ct(ut({match:tn}).passthrough())}).passthrough()}).passthrough(),rn=(Nt.number(),Nt.string(),{path:["link","update"],type:Qt}),sn={path:["link","config"],type:nn},an={path:["link","paths"],type:Yt},on={path:["link","done"],type:Gt},cn={path:["link","disconnected"],type:Nt.object({reason:Nt.enum(["lost","unreachable"])})};function un(e){const t={subscribe(t){let n=null,r=!1,s=!1,a=!1;function i(){null!==n?s||(s=!0,"function"==typeof n?n():n&&n.unsubscribe()):a=!0}return n=e({next(e){r||t.next?.(e)},error(e){r||(r=!0,t.error?.(e),i())},complete(){r||(r=!0,t.complete?.(),i())}}),a&&i(),{unsubscribe:i}},pipe:(...e)=>e.reduce(dn,t)};return t}function dn(e,t){return t(e)}function ln(e){let t=e;const n=[],r=un((e=>((e=>{void 0!==t&&e.next(t),n.push(e)})(e),()=>{(e=>{n.splice(n.indexOf(e),1)})(e)})));return r.next=e=>{if(t!==e){t=e;for(const t of n)t.next(e)}},r.get=()=>t,r}function pn(e){return un((t=>function t(n=0,r=e.op){const s=e.links[n];if(!s)throw new Error("No more links to execute - did you forget to add an ending link?");return s({op:r,next:e=>t(n+1,e)})}().subscribe(t)))}Symbol();const hn=()=>{},fn=e=>{Object.freeze&&Object.freeze(e)};function mn(e,t,n){var r,s;const a=t.join(".");return(r=n)[s=a]??(r[s]=new Proxy(hn,{get(r,s){if("string"==typeof s&&"then"!==s)return mn(e,[...t,s],n)},apply(n,r,s){const a=t[t.length-1];let i={args:s,path:t};return"call"===a?i={args:s.length>=2?[s[1]]:[],path:t.slice(0,-1)}:"apply"===a&&(i={args:s.length>=2?s[1]:[],path:t.slice(0,-1)}),fn(i.args),fn(i.path),e(i)}})),n[a]}const gn=e=>mn(e,[],Object.create(null));function yn(e,...t){const n=Object.assign(Object.create(null),e);for(const e of t)for(const t in e){if(t in n&&n[t]!==e[t])throw new Error(`Duplicate key ${t}`);n[t]=e[t]}return n}function vn(e){return!!e&&!Array.isArray(e)&&"object"==typeof e}function _n(e){return Object.assign(Object.create(null),e)}Symbol(),"function"==typeof Symbol&&Symbol.asyncIterator;const bn=e=>e();function kn(e=0){return new Promise((t=>setTimeout(t,e)))}function wn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class xn extends Error{}function An(e){if(e instanceof Cn)return e;if(e instanceof Error&&"TRPCError"===e.name)return e;const t=new Cn({code:"INTERNAL_SERVER_ERROR",cause:e});return e instanceof Error&&e.stack&&(t.stack=e.stack),t}class Cn extends Error{constructor(e){const t=function(e){if(e instanceof Error)return e;const t=typeof e;if("undefined"!==t&&"function"!==t&&null!==e){if("object"!==t)return new Error(String(e));if(vn(e)){const t=new xn;for(const n in e)t[n]=e[n];return t}}}(e.cause);super(e.message??t?.message??e.code,{cause:t}),wn(this,"cause",void 0),wn(this,"code",void 0),this.code=e.code,this.name="TRPCError",this.cause||(this.cause=t)}}const En=({shape:e})=>e,Sn={input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}};class Tn extends Error{constructor(){super("Unable to transform response from server")}}function On(e,t){let n;try{n=function(e,t){if("error"in e){const n=t.deserialize(e.error);return{ok:!1,error:{...e,error:n}}}return{ok:!0,result:{...e.result,...(!e.result.type||"data"===e.result.type)&&{type:"data",data:t.deserialize(e.result.data)}}}}(e,t)}catch{throw new Tn}if(!(n.ok||vn(n.error.error)&&"number"==typeof n.error.error.code))throw new Tn;if(n.ok&&!vn(n.result))throw new Tn;return n}const Pn=Symbol("lazy");function Zn(e){const t=Symbol();let n=t;return()=>(n===t&&(n=e()),n)}function Rn(e){return"function"==typeof e&&Pn in e}const jn={_ctx:null,_errorShape:null,_meta:null,queries:{},mutations:{},subscriptions:{},errorFormatter:En,transformer:Sn},Nn=["then","call","apply"];function In(e){return function(t){const n=new Set(Object.keys(t).filter((e=>Nn.includes(e))));if(n.size>0)throw new Error("Reserved words used in `router({})` call: "+Array.from(n).join(", "));const r=_n({}),s=_n({});function a(e){return{ref:e.ref,load:Zn((async()=>{const t=await e.ref(),n=[...e.path,e.key],r=n.join(".");e.aggregate[e.key]=i(t._def.record,n),delete s[r];for(const[r,i]of Object.entries(t._def.lazy)){const t=[...n,r].join(".");s[t]=a({ref:i.ref,path:n,key:r,aggregate:e.aggregate[e.key]})}}))}}function i(e,t=[]){const n=_n({});for(const[c,u]of Object.entries(e??{})){if(Rn(u)){s[[...t,c].join(".")]=a({path:t,ref:u,key:c,aggregate:n});continue}if(vn(o=u)&&vn(o._def)&&"router"in o._def){n[c]=i(u._def.record,[...t,c]);continue}if("function"!=typeof u){n[c]=i(u,[...t,c]);continue}const e=[...t,c].join(".");if(r[e])throw new Error(`Duplicate key: ${e}`);r[e]=u,n[c]=u}var o;return n}const o=i(t),c={_config:e,router:!0,procedures:r,lazy:s,...jn,record:o};return{...o,_def:c,createCaller:Mn()({_def:c})}}}function Mn(){return function(e){const{_def:t}=e;return function(n,r){return gn((async({path:s,args:a})=>{const i=s.join(".");if(1===s.length&&"_def"===s[0])return t;const o=await async function(e,t){const{_def:n}=e;let r=n.procedures[t];for(;!r;){const e=Object.keys(n.lazy).find((e=>t.startsWith(e)));if(!e)return null;const s=n.lazy[e];await s.load(),r=n.procedures[t]}return r}(e,i);let c;try{if(!o)throw new Cn({code:"NOT_FOUND",message:`No procedure found on path "${s}"`});return c="function"==typeof n?await Promise.resolve(n()):n,await o({path:i,getRawInput:async()=>a[0],ctx:c,type:o._def.type,signal:r?.signal})}catch(e){throw r?.onError?.({ctx:c,error:An(e),input:a[0],path:i,type:o?._def.type??"unknown"}),e}}))}}}function Dn(...e){const t=yn({},...e.map((e=>e._def.record)));return In({errorFormatter:e.reduce(((e,t)=>{if(t._def._config.errorFormatter&&t._def._config.errorFormatter!==En){if(e!==En&&e!==t._def._config.errorFormatter)throw new Error("You seem to have several error formatters");return t._def._config.errorFormatter}return e}),En),transformer:e.reduce(((e,t)=>{if(t._def._config.transformer&&t._def._config.transformer!==Sn){if(e!==Sn&&e!==t._def._config.transformer)throw new Error("You seem to have several transformers");return t._def._config.transformer}return e}),Sn),isDev:e.every((e=>e._def._config.isDev)),allowOutsideOfServer:e.every((e=>e._def._config.allowOutsideOfServer)),isServer:e.every((e=>e._def._config.isServer)),$types:e[0]?._def._config.$types})(t)}var $n,Ln;new WeakMap,Symbol.toStringTag,($n=Symbol).dispose??($n.dispose=Symbol()),(Ln=Symbol).asyncDispose??(Ln.asyncDispose=Symbol()),Symbol(),Symbol("ping"),Error,Error,Symbol();const qn="middlewareMarker";function zn(){function e(t){return{_middlewares:t,unstable_pipe(n){const r="_middlewares"in n?n._middlewares:[n];return e([...t,...r])}}}return function(t){return e([t])}}function Fn(e){const t=async function(t){let n;const r=await t.getRawInput();try{n=await e(r)}catch(e){throw new Cn({code:"BAD_REQUEST",cause:e})}const s=vn(t.input)&&vn(n)?{...t.input,...n}:n;return t.next({input:s})};return t._type="input",t}function Un(e){const t=async function({next:t}){const n=await t();if(!n.ok)return n;try{const t=await e(n.data);return{...n,data:t}}catch(e){throw new Cn({message:"Output validation failed",code:"INTERNAL_SERVER_ERROR",cause:e})}};return t._type="output",t}class Wn extends Error{constructor(e){var t,n;super(e[0]?.message),n=void 0,(t="issues")in this?Object.defineProperty(this,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[t]=n,this.name="SchemaError",this.issues=e}}function Bn(e){const t=e,n="~standard"in t;if("function"==typeof t&&"function"==typeof t.assert)return t.assert.bind(t);if("function"==typeof t&&!n)return t;if("function"==typeof t.parseAsync)return t.parseAsync.bind(t);if("function"==typeof t.parse)return t.parse.bind(t);if("function"==typeof t.validateSync)return t.validateSync.bind(t);if("function"==typeof t.create)return t.create.bind(t);if("function"==typeof t.assert)return e=>(t.assert(e),e);if(n)return async e=>{const n=await t["~standard"].validate(e);if(n.issues)throw new Wn(n.issues);return n.value};throw new Error("Could not find a validator fn")}function Vn(e,t){const{middlewares:n=[],inputs:r,meta:s,...a}=t;return Kn({...yn(e,a),inputs:[...e.inputs,...r??[]],middlewares:[...e.middlewares,...n],meta:e.meta&&s?{...e.meta,...s}:s??e.meta})}function Kn(e={}){const t={procedure:!0,inputs:[],middlewares:[],...e};return{_def:t,input(e){const n=Bn(e);return Vn(t,{inputs:[e],middlewares:[Fn(n)]})},output(e){const n=Bn(e);return Vn(t,{output:e,middlewares:[Un(n)]})},meta:e=>Vn(t,{meta:e}),use(e){const n="_middlewares"in e?e._middlewares:[e];return Vn(t,{middlewares:n})},unstable_concat:e=>Vn(t,e._def),concat:e=>Vn(t,e._def),query:e=>Hn({...t,type:"query"},e),mutation:e=>Hn({...t,type:"mutation"},e),subscription:e=>Hn({...t,type:"subscription"},e),experimental_caller:e=>Vn(t,{caller:e})}}function Hn(e,t){const n=Vn(e,{resolver:t,middlewares:[async function(e){const n=await t(e);return{marker:qn,ok:!0,data:n,ctx:e.ctx}}]}),r={...n._def,type:e.type,experimental_caller:Boolean(n._def.caller),meta:n._def.meta,$types:null},s=function(e){async function t(t){if(!t||!("getRawInput"in t))throw new Error(Jn);const n=await Yn(0,e,t);if(!n)throw new Cn({code:"INTERNAL_SERVER_ERROR",message:"No result from middlewares - did you forget to `return next()`?"});if(!n.ok)throw n.error;return n.data}return t._def=e,t.procedure=!0,t}(n._def),a=n._def.caller;if(!a)return s;const i=async(...e)=>await a({args:e,invoke:s,_def:r});return i._def=r,i}const Jn="\nThis is a client-only function.\nIf you want to call this function on the server, see https://trpc.io/docs/v11/server/server-side-calls\n".trim();async function Yn(e,t,n){try{const r=t.middlewares[e];return await r({...n,meta:t.meta,input:n.input,next(r){const s=r;return Yn(e+1,t,{...n,ctx:s?.ctx?{...n.ctx,...s.ctx}:n.ctx,input:s&&"input"in s?s.input:n.input,getRawInput:s?.getRawInput??n.getRawInput})}})}catch(e){return{ok:!1,error:An(e),marker:qn}}}const Gn="undefined"==typeof window||"Deno"in window||"test"===globalThis.process?.env?.NODE_ENV||!!globalThis.process?.env?.JEST_WORKER_ID||!!globalThis.process?.env?.VITEST_WORKER_ID;class Qn{context(){return new Qn}meta(){return new Qn}create(e){const t={...e,transformer:(n=e?.transformer??Sn,"input"in n?n:{input:n,output:n}),isDev:e?.isDev??"production"!==globalThis.process?.env.NODE_ENV,allowOutsideOfServer:e?.allowOutsideOfServer??!1,errorFormatter:e?.errorFormatter??En,isServer:e?.isServer??Gn,$types:null};var n;if(!(e?.isServer??Gn)&&!0!==e?.allowOutsideOfServer)throw new Error("You're trying to use @trpc/server in a non-server environment. This is not supported by default.");return{_config:t,procedure:Kn({meta:e?.defaultMeta}),middleware:zn(),router:In(t),mergeRouters:Dn,createCallerFactory:Mn()}}}function Xn(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}new Qn;class er extends Error{static from(e,t={}){const n=e;return function(e){return e instanceof er||e instanceof Error&&"TRPCClientError"===e.name}(n)?(t.meta&&(n.meta={...n.meta,...t.meta}),n):vn(r=n)&&vn(r.error)&&"number"==typeof r.error.code&&"string"==typeof r.error.message?new er(n.error.message,{...t,result:n}):new er("string"==typeof(s=n)?s:vn(s)&&"string"==typeof s.message?s.message:"Unknown error",{...t,cause:n});var r,s}constructor(e,t){const n=t?.cause;super(e,{cause:n}),Xn(this,"cause",void 0),Xn(this,"shape",void 0),Xn(this,"data",void 0),Xn(this,"meta",void 0),this.meta=t?.meta,this.cause=n,this.shape=t?.result?.error,this.data=t?.result?.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,er.prototype)}}function tr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class nr{$request(e){return pn({links:this.links,op:{...e,context:e.context??{},id:++this.requestId}}).pipe((e=>{let t=0,n=null;const r=[];return un((s=>(t++,r.push(s),n||(n=e.subscribe({next(e){for(const t of r)t.next?.(e)},error(e){for(const t of r)t.error?.(e)},complete(){for(const e of r)e.complete?.()}})),{unsubscribe(){t--,function(){if(0===t&&n){const e=n;n=null,e.unsubscribe()}}();const e=r.findIndex((e=>e===s));e>-1&&r.splice(e,1)}})))}))}async requestAsPromise(e){try{const t=this.$request(e);return(await function(e){const t=new AbortController;return new Promise(((n,r)=>{let s=!1;function a(){s||(s=!0,i.unsubscribe())}t.signal.addEventListener("abort",(()=>{r(t.signal.reason)}));const i=e.subscribe({next(e){s=!0,n(e),a()},error(e){r(e)},complete(){t.abort(),a()}})}))}(t)).result.data}catch(e){throw er.from(e)}}query(e,t,n){return this.requestAsPromise({type:"query",path:e,input:t,context:n?.context,signal:n?.signal})}mutation(e,t,n){return this.requestAsPromise({type:"mutation",path:e,input:t,context:n?.context,signal:n?.signal})}subscription(e,t,n){return this.$request({type:"subscription",path:e,input:t,context:n.context,signal:n.signal}).subscribe({next(e){switch(e.result.type){case"state":n.onConnectionStateChange?.(e.result);break;case"started":n.onStarted?.({context:e.context});break;case"stopped":n.onStopped?.();break;case"data":case void 0:n.onData?.(e.result.data)}},error(e){n.onError?.(e)},complete(){n.onComplete?.()}})}constructor(e){tr(this,"links",void 0),tr(this,"runtime",void 0),tr(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=e.links.map((e=>e(this.runtime)))}}const rr=Symbol.for("trpc_untypedClient"),sr={query:"query",mutate:"mutation",subscribe:"subscription"};const ar=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function ir(e){let t=null,n=null;function r(){const r=function(t){const n=[[]];let r=0;for(;;){const s=t[r];if(!s)break;const a=n[n.length-1];s.aborted?(s.reject?.(new Error("Aborted")),r++):e.validate(a.concat(s).map((e=>e.key)))?(a.push(s),r++):0!==a.length?n.push([]):(s.reject?.(new Error("Input is too big for a single dispatch")),r++)}return n}(t);clearTimeout(n),n=null,t=null;for(const t of r){if(!t.length)continue;const n={items:t};for(const e of t)e.batch=n;e.fetch(n.items.map((e=>e.key))).then((async e=>{await Promise.all(e.map((async(e,t)=>{const r=n.items[t];try{const t=await Promise.resolve(e);r.resolve?.(t)}catch(e){r.reject?.(e)}r.batch=null,r.reject=null,r.resolve=null})));for(const e of n.items)e.reject?.(new Error("Missing result")),e.batch=null})).catch((e=>{for(const t of n.items)t.reject?.(e),t.batch=null}))}}return{load:function(e){const s={aborted:!1,key:e,batch:null,resolve:ar,reject:ar},a=new Promise(((e,n)=>{s.reject=n,s.resolve=e,t||(t=[]),t.push(s)}));return n||(n=setTimeout(r)),a}}}const or=e=>"function"==typeof e;function cr(e){return e?"input"in e?e:{input:e,output:e}:{input:{serialize:e=>e,deserialize:e=>e},output:{serialize:e=>e,deserialize:e=>e}}}const ur={query:"GET",mutation:"POST",subscription:"PATCH"};function dr(e){return"input"in e?e.transformer.input.serialize(e.input):function(e){const t={};for(let n=0;n<e.length;n++){const r=e[n];t[n]=r}return t}(e.inputs.map((t=>e.transformer.input.serialize(t))))}const lr=e=>{const t=e.url.split("?");let n=t[0].replace(/\/$/,"")+"/"+e.path;const r=[];if(t[1]&&r.push(t[1]),"inputs"in e&&r.push("batch=1"),"query"===e.type||"subscription"===e.type){const t=dr(e);void 0!==t&&"POST"!==e.methodOverride&&r.push(`input=${encodeURIComponent(JSON.stringify(t))}`)}return r.length&&(n+="?"+r.join("&")),n},pr=e=>{if("query"===e.type&&"POST"!==e.methodOverride)return;const t=dr(e);return void 0!==t?JSON.stringify(t):void 0};class hr extends Error{constructor(){const e="AbortError";super(e),this.name=e,this.message=e}}const fr=e=>{if(e?.aborted){if(e.throwIfAborted?.(),"undefined"!=typeof DOMException)throw new DOMException("AbortError","AbortError");throw new hr}};function mr(e){const t=function(e){return{url:e.url.toString(),fetch:e.fetch,transformer:cr(e.transformer),methodOverride:e.methodOverride}}(e),n=e.maxURLLength??1/0,r=e.maxItems??1/0;return()=>{const s=s=>({validate(e){if(n===1/0&&r===1/0)return!0;if(e.length>r)return!1;const a=e.map((e=>e.path)).join(","),i=e.map((e=>e.input));return lr({...t,type:s,path:a,inputs:i,signal:null}).length<=n},async fetch(n){const r=n.map((e=>e.path)).join(","),a=n.map((e=>e.input)),i=function(...e){const t=new AbortController,n=e.length;let r=0;const s=()=>{++r===n&&t.abort()};for(const t of e)t?.aborted?s():t?.addEventListener("abort",s,{once:!0});return t.signal}(...n.map((e=>e.signal))),o=await(e=>async function(e){const t={},n=await async function(e){fr(e.signal);const t=e.getUrl(e),n=e.getBody(e),{type:r}=e,s=await(async()=>{const t=await e.headers();return Symbol.iterator in t?Object.fromEntries(t):t})(),a={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...s};return function(e){if(e)return e;if("undefined"!=typeof window&&or(window.fetch))return window.fetch;if("undefined"!=typeof globalThis&&or(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}(e.fetch)(t,{method:e.methodOverride??ur[r],signal:e.signal,body:n,headers:a})}(e);t.response=n;const r=await n.json();return t.responseJSON=r,{json:r,meta:t}}({...e,contentTypeHeader:"application/json",getUrl:lr,getBody:pr}))({...t,path:r,inputs:a,type:s,headers:()=>e.headers?"function"==typeof e.headers?e.headers({opList:n}):e.headers:{},signal:i});return(Array.isArray(o.json)?o.json:n.map((()=>o.json))).map((e=>({meta:o.meta,json:e})))}}),a={query:ir(s("query")),mutation:ir(s("mutation"))};return({op:e})=>un((n=>{if("subscription"===e.type)throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");let r;return a[e.type].load(e).then((e=>{r=e;const s=On(e.json,t.transformer.output);s.ok?(n.next({context:e.meta,result:s.result}),n.complete()):n.error(er.from(s.error,{meta:e.meta}))})).catch((e=>{n.error(er.from(e,{meta:r?.meta}))})),()=>{}}))}}function gr(e){return Array.isArray(e)?e:[e]}const yr={enabled:!1,closeMs:0},vr={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},_r=e=>0===e?0:Math.min(1e3*2**e,3e4),br=(e,...t)=>"function"==typeof e?e(...t):e;function kr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class wr extends Error{constructor(e){super(e.message,{cause:e.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,wr.prototype)}}class xr{reset(){this.timeout&&(clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs))}start(){clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs)}stop(){clearTimeout(this.timeout),this.timeout=void 0}constructor(e,t){kr(this,"onTimeout",void 0),kr(this,"timeoutMs",void 0),kr(this,"timeout",void 0),this.onTimeout=e,this.timeoutMs=t}}function Ar(){let e,t;return{promise:new Promise(((n,r)=>{e=n,t=r})),resolve:e,reject:t}}function Cr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Er{register(e,t){const{promise:n,resolve:r}=Ar();return this.outgoingRequests.push({id:String(e.id),message:e,end:n,callbacks:{next:t.next,complete:()=>{t.complete(),r()},error:e=>{t.error(e),r()}}}),()=>{this.delete(e.id),t.complete(),r()}}delete(e){null!==e&&(this.outgoingRequests=this.outgoingRequests.filter((({id:t})=>t!==String(e))),delete this.pendingRequests[String(e)])}flush(){const e=this.outgoingRequests;this.outgoingRequests=[];for(const t of e)this.pendingRequests[t.id]=t;return e}getPendingRequests(){return Object.values(this.pendingRequests)}getPendingRequest(e){return null===e?null:this.pendingRequests[String(e)]}getOutgoingRequests(){return this.outgoingRequests}getRequests(){return[...this.getOutgoingRequests().map((e=>({state:"outgoing",message:e.message,end:e.end,callbacks:e.callbacks}))),...this.getPendingRequests().map((e=>({state:"pending",message:e.message,end:e.end,callbacks:e.callbacks})))]}hasPendingRequests(){return this.getPendingRequests().length>0}hasOutgoingRequests(){return this.outgoingRequests.length>0}constructor(){Cr(this,"outgoingRequests",new Array),Cr(this,"pendingRequests",{})}}function Sr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tr(e,{intervalMs:t,pongTimeoutMs:n}){let r,s;function a(){r=setTimeout((()=>{e.send("PING"),s=setTimeout((()=>{e.close()}),n)}),t)}e.addEventListener("open",a),e.addEventListener("message",(({data:e})=>{clearTimeout(r),a(),"PONG"===e&&(clearTimeout(s),clearTimeout(r),a())})),e.addEventListener("close",(()=>{clearTimeout(r),clearTimeout(s)}))}class Or{get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++Or.connectCount;const e=async function(e){const t=await br(e.url);if(!e.connectionParams)return t;const n=t.includes("?")?"&":"?";return t+`${n}connectionParams=1`}(this.urlOptions).then((e=>new this.WebSocketPonyfill(e)));this.openPromise=e.then((async e=>{this.ws=e,e.addEventListener("message",(function({data:e}){"PING"===e&&this.send("PONG")})),this.keepAliveOpts.enabled&&Tr(e,this.keepAliveOpts),e.addEventListener("close",(()=>{this.ws===e&&(this.ws=null)})),await function(e){const{promise:t,resolve:n,reject:r}=Ar();return e.addEventListener("open",(()=>{e.removeEventListener("error",r),n()})),e.addEventListener("error",r),t}(e),this.urlOptions.connectionParams&&e.send(await async function(e){const t={method:"connectionParams",data:await br(e)};return JSON.stringify(t)}(this.urlOptions.connectionParams))}));try{await this.openPromise}finally{this.openPromise=null}}async close(){try{await this.openPromise}finally{this.ws?.close()}}constructor(e){if(Sr(this,"id",++Or.connectCount),Sr(this,"WebSocketPonyfill",void 0),Sr(this,"urlOptions",void 0),Sr(this,"keepAliveOpts",void 0),Sr(this,"wsObservable",ln(null)),Sr(this,"openPromise",null),this.WebSocketPonyfill=e.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive}}function Pr(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Sr(Or,"connectCount",0);class Zr{async open(){this.allowReconnect=!0,"connecting"!==this.connectionState.get().state&&this.connectionState.next({type:"state",state:"connecting",error:null});try{await this.activeConnection.open()}catch(e){return this.reconnect(new wr({message:"Initialization error",cause:e})),this.reconnecting}}async close(){this.allowReconnect=!1,this.inactivityTimeout.stop();const e=[];for(const t of this.requestManager.getRequests())"subscription"===t.message.method?t.callbacks.complete():"outgoing"===t.state?t.callbacks.error(er.from(new wr({message:"Closed before connection was established"}))):e.push(t.end);await Promise.all(e).catch((()=>null)),await this.activeConnection.close().catch((()=>null)),this.connectionState.next({type:"state",state:"idle",error:null})}request({op:{id:e,type:t,path:n,input:r,signal:s},transformer:a,lastEventId:i}){return un((o=>{const c=this.batchSend({id:e,method:t,params:{input:a.input.serialize(r),path:n,lastEventId:i}},{...o,next(e){const t=On(e,a.output);t.ok?o.next({result:t.result}):o.error(er.from(t.error))}});return()=>{c(),"subscription"===t&&this.activeConnection.isOpen()&&this.send({id:e,method:"subscription.stop"}),s?.removeEventListener("abort",c)}}))}get connection(){return(e=this.activeConnection).isOpen()?{id:e.id,state:"open",ws:e.ws}:e.isClosed()?{id:e.id,state:"closed",ws:e.ws}:e.ws?{id:e.id,state:"connecting",ws:e.ws}:null;var e}reconnect(e){if(this.connectionState.next({type:"state",state:"connecting",error:er.from(e)}),this.reconnecting)return;const t=async e=>{try{await kn(this.reconnectRetryDelay(e)),this.allowReconnect&&(await this.activeConnection.close(),await this.activeConnection.open(),this.requestManager.hasPendingRequests()&&this.send(this.requestManager.getPendingRequests().map((({message:e})=>e)))),this.reconnecting=null}catch{await t(e+1)}};this.reconnecting=t(0)}setupWebSocketListeners(e){const t=e=>{const t=this.requestManager.getPendingRequests();for(const{message:n,callbacks:r}of t)"subscription"!==n.method&&(r.error(er.from(e??new wr({message:"WebSocket closed",cause:e}))),this.requestManager.delete(n.id))};e.addEventListener("open",(()=>{bn((async()=>{this.lazyMode&&this.inactivityTimeout.start(),this.callbacks.onOpen?.(),this.connectionState.next({type:"state",state:"pending",error:null})})).catch((n=>{e.close(3e3),t(n)}))})),e.addEventListener("message",(({data:e})=>{if(this.inactivityTimeout.reset(),"string"!=typeof e||["PING","PONG"].includes(e))return;const t=JSON.parse(e);"method"in t?this.handleIncomingRequest(t):this.handleResponseMessage(t)})),e.addEventListener("close",(e=>{t(e),this.callbacks.onClose?.(e),this.lazyMode||this.reconnect(new wr({message:"WebSocket closed",cause:e}))})),e.addEventListener("error",(e=>{t(e),this.callbacks.onError?.(e),this.reconnect(new wr({message:"WebSocket closed",cause:e}))}))}handleResponseMessage(e){const t=this.requestManager.getPendingRequest(e.id);if(!t)return;t.callbacks.next(e);let n=!0;"result"in e&&"subscription"===t.message.method&&("data"===e.result.type&&(t.message.params.lastEventId=e.result.id),"stopped"!==e.result.type&&(n=!1)),n&&(t.callbacks.complete(),this.requestManager.delete(e.id))}handleIncomingRequest(e){"reconnect"===e.method&&this.reconnect(new wr({message:"Server requested reconnect"}))}send(e){if(!this.activeConnection.isOpen())throw new Error("Active connection is not open");const t=e instanceof Array?e:[e];this.activeConnection.ws.send(JSON.stringify(1===t.length?t[0]:t))}batchSend(e,t){return this.inactivityTimeout.reset(),bn((async()=>{this.activeConnection.isOpen()||await this.open(),await kn(0),this.requestManager.hasOutgoingRequests()&&this.send(this.requestManager.flush().map((({message:e})=>e)))})).catch((n=>{this.requestManager.delete(e.id),t.error(er.from(n))})),this.requestManager.register(e,t)}constructor(e){Pr(this,"connectionState",void 0),Pr(this,"allowReconnect",!1),Pr(this,"requestManager",new Er),Pr(this,"activeConnection",void 0),Pr(this,"reconnectRetryDelay",void 0),Pr(this,"inactivityTimeout",void 0),Pr(this,"callbacks",void 0),Pr(this,"lazyMode",void 0),Pr(this,"reconnecting",null),this.callbacks={onOpen:e.onOpen,onClose:e.onClose,onError:e.onError};const t={...yr,...e.lazy};this.inactivityTimeout=new xr((()=>{this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()?this.inactivityTimeout.reset():this.close().catch((()=>null))}),t.closeMs),this.activeConnection=new Or({WebSocketPonyfill:e.WebSocket,urlOptions:e,keepAlive:{...vr,...e.keepAlive}}),this.activeConnection.wsObservable.subscribe({next:e=>{e&&this.setupWebSocketListeners(e)}}),this.reconnectRetryDelay=e.retryDelayMs??_r,this.lazyMode=t.enabled,this.connectionState=ln({type:"state",state:t.enabled?"idle":"connecting",error:null}),this.lazyMode||this.open().catch((()=>null))}}function Rr(e){const{client:t}=e,n=cr(e.transformer);return()=>({op:e})=>un((r=>{const s="subscription"===e.type?t.connectionState.subscribe({next(t){r.next({result:t,context:e.context})}}):null,a=t.request({op:e,transformer:n}).subscribe(r);return()=>{a.unsubscribe(),s?.unsubscribe()}}))}async function jr(e){await async function(){if("undefined"!=typeof global){const e=global;if(void 0===e.WebSocket){const{WebSocket:t}=await n.e(173).then(n.t.bind(n,173,19));e.WebSocket=t}}}(),function({reporter:e}){"undefined"!=typeof process&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED="0",e?.ignoreLogMessage("Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable"))}({reporter:e.reporter});const t=new Zr(e),r=function(e,t){try{return new URL(e,t)}catch{throw new Error(`Invalid URL: "${e}", base: ""`)}}(e.url),s="wss:"===r.protocol;r.protocol=s?"https:":"http:";const a=r.toString().replace(/\/$/,""),i=function(e){return function(e){const t=gn((({path:t,args:n})=>{const r=[...t],s=(a=r.pop(),sr[a]);var a;const i=r.join(".");return e[s](i,...n)}));return n=n=>n===rr?e:t[n],new Proxy(hn,{get(e,t){if("then"!==t)return n(t)}});var n}(new nr(e))}({links:[(o={condition:e=>"subscription"===e.type,true:Rr({client:t}),false:mr({url:a})},e=>{const t=gr(o.true).map((t=>t(e))),n=gr(o.false).map((t=>t(e)));return e=>un((r=>{const s=o.condition(e.op)?t:n;return pn({op:e.op,links:s}).subscribe(r)}))})]});var o;return new Proxy({close:async()=>{await t.close()}},{get:(e,t)=>e.hasOwnProperty(t)?e[t]:i[t]})}var Nr=n(286),Ir=n.n(Nr),Mr=n(823),Dr=n.n(Mr),$r=n(509),Lr=n.n($r),qr=n(214),zr=n.n(qr),Fr=n(586),Ur=n.n(Fr),Wr=n(703),Br=n.n(Wr),Vr=n(941),Kr={};Kr.styleTagTransform=Br(),Kr.setAttributes=zr(),Kr.insert=Lr().bind(null,"head"),Kr.domAPI=Dr(),Kr.insertStyleElement=Ur(),Ir()(Vr.default,Kr);const Hr=Vr.default&&Vr.default.locals?Vr.default.locals:void 0;class Jr{element;constructor(e="root"){this.element=document.getElementById(e)}updateStatus(e){const{message:t,tip:n,isError:r=!1,data:s}=e;r?s?console.error(t,s):console.error(t):s?console.debug(t,s):console.debug(t),this.element&&(this.element.innerHTML=`\n <div class="${Hr.statusContainer+(r?` ${Hr.errorContainer}`:"")}">\n <h2 class="${Hr.title}">Cloudpack Link Proxy</h2>\n <p class="${Hr.message}">${r?"Error: ":""}${t}</p>\n ${n?`<p class="${Hr.message}"><strong>Tip:</strong> ${n}</p>`:""}\n <p class="${Hr.warning}">Do not close this page while Cloudpack link is running.</p>\n </div>\n `)}}class Yr{clients=new Map;connectionStates=new Map;checkInterval=null;checkIntervalMs=5e3;addClient(e,t){this.clients.set(e,t),this.connectionStates.set(e,!0)}getClient(e){return this.clients.get(e)}async checkConnection(e){const t=this.clients.get(e);if(!t)return!1;try{return await t.getSessionId.query(),!0}catch(t){return console.warn(`${e} client connection lost:`,t),!1}}startMonitoring(e){this.checkInterval&&window.clearInterval(this.checkInterval),this.checkInterval=window.setInterval((()=>{(async()=>{for(const[t,n]of this.clients){if("link"!=t&&"host"!=t)throw new Error(`Invalid client ID: ${t}`);const n=this.connectionStates.get(t)||!1,r=await this.checkConnection(t);n!==r&&await e({id:t,isConnected:r,wasConnected:n}),this.connectionStates.set(t,r)}})().catch((e=>{console.error("Error in connection monitoring:",e)}))}),this.checkIntervalMs)}stopMonitoring(){this.checkInterval&&(window.clearInterval(this.checkInterval),this.checkInterval=null)}async closeAll(){for(const[e,t]of this.clients)try{await t.close(),console.log(`Closed ${e} client`)}catch(t){console.error(`Error closing ${e} client:`,t)}this.clients.clear(),this.connectionStates.clear()}}async function Gr(e){console.debug(`[Cloudpack] Checking session at ${e}`);const t=await jr({url:e});let n=!1;try{n=!!await t.getSessionId.query()}catch(e){}finally{await t.close()}return n}const Qr=new class{ui;connectionManager;linkedPathData=null;constructor(){this.ui=new Jr,this.connectionManager=new Yr}handleConnectionChange=async e=>{const{id:t,isConnected:n,wasConnected:r}=e;r&&!n&&("host"===t?await this.handleHostDisconnection():"link"===t&&await this.handleLinkDisconnection())};async handleHostDisconnection(e){const t=e?.unreachable??!1,n=t?"unreachable":"lost";this.ui.updateStatus({message:`Connection to host ${n}. The session will be terminated.`,isError:!0});const r=this.connectionManager.getClient("link");let s,a=!1;if(r)try{await r.publishData.mutate({...cn,data:{reason:n}}),a=!0}catch(e){this.ui.updateStatus({message:`Error notifying link client of host connection ${n}.`,isError:!0})}await this.cleanup(),t?s="Make sure you have a <code>cloudpack start</code> session running and use the URL from your app to run link with the following command: <code>cloudpack link --remote [URL]</code>":(s="If you did not close the start session terminal, this is a bug. Please report it.",a||(s+=" Link client was not successfully notified of host disconnection. You may need to terminate the link session in the terminal.")),this.ui.updateStatus({message:`Connection to host ${n}. You can close this page.`,tip:s,isError:!0})}async handleLinkDisconnection(){this.ui.updateStatus({message:"Connection to link client lost. Cleaning up linked paths...",isError:!0});const e=this.connectionManager.getClient("host");if(e&&this.linkedPathData){const{linkedPath:t}=this.linkedPathData,n=t.path;try{await e.unlinkPath.mutate({linkedPath:{path:n}}),this.ui.updateStatus({message:"Connection to link client lost. Successfully unlinked paths on host. You can close this page.",tip:"If you did not close the link client terminal. This is a bug. Please report it."})}catch(e){this.ui.updateStatus({message:"Connection to link client lost. Failed to unlink paths on host.",tip:"You may need to restart the host application to unlink the paths.",isError:!0,data:e})}}else this.ui.updateStatus({message:"Cannot clean up: host client or link data not available",tip:"You may need to restart the host application to unlink the paths.",isError:!0});await this.cleanup()}setupLinkUpdateHandler(){const e=this.connectionManager.getClient("link"),t=this.connectionManager.getClient("host");e&&t&&e.onDataChanged.subscribe(rn,{onData:e=>{this.ui.updateStatus({message:"Forwarding package update to the host...",data:e}),t.notifyLinkChange.mutate(e).then((()=>this.ui.updateStatus({message:"Cloudpack Link Proxy listening for updates..."}))).catch((e=>{this.ui.updateStatus({message:"Error forwarding package update to the host. This is a bug. Please report it.",isError:!0,data:e})}))}})}async setupLinkPathHandler(){const e=this.connectionManager.getClient("host"),t=this.connectionManager.getClient("link");t&&e&&(await t.getData.query(an)||t.onDataChanged.subscribe(an,{onData:n=>{this.ui.updateStatus({message:"Processing link setup...",data:n}),this.linkedPathData=n,e.linkPath.mutate(this.linkedPathData).then((e=>{const{resolveMap:n,linkedPaths:r}=e;this.ui.updateStatus({message:"Sending link setup result back to the link server...",data:e}),t.publishData.mutate({...on,data:{resolveMap:n,linkedPaths:r}}).then((()=>{this.ui.updateStatus({message:"Cloudpack Link Proxy listening for updates..."})})).catch((e=>{this.ui.updateStatus({message:"Error sending link setup result back to the link server. Please try to run link again.",tip:"This is a bug. Please report it.",isError:!0,data:e})}))}))}}))}async setupConfig(){const e=this.connectionManager.getClient("link"),t=this.connectionManager.getClient("host");if(e&&t)try{if(!await e.getData.query(sn)){this.ui.updateStatus({message:"Fetching host configuration..."});const n=await t.getLinkConfig.query();this.ui.updateStatus({message:"Sending host configuration to the link server...",data:n}),await e.publishData.mutate({...sn,data:n}),this.ui.updateStatus({message:"Host configuration sent to the link server."})}}catch(e){this.ui.updateStatus({message:"Error setting up configuration. Please try to run link again.",tip:"This is a bug. Please report it.",isError:!0,data:e})}}async cleanup(){this.connectionManager.stopMonitoring(),await this.connectionManager.closeAll()}async initialize(){this.ui.updateStatus({message:"Initializing Cloudpack Link Proxy..."});try{if(!window.__cloudpack)throw this.ui.updateStatus({message:"Cloudpack context not found on window.",tip:"This is a bug. Please report it.",isError:!0}),new Error("Cloudpack not found on window.");const{pageSessionContext:e}=window.__cloudpack;if(!e)throw this.ui.updateStatus({message:"Session context not found on window.__cloudpack.",tip:"This is a bug. Please report it.",isError:!0,data:window.__cloudpack}),new Error("Session context not found on window.__cloudpack");const{apiUrl:t,hostApiServerUrls:n}=e;if(!n||n.length<=0)return void this.ui.updateStatus({message:"No host URL provided.",tip:"This is a bug. Please report it.",data:e,isError:!0});const r=await jr({url:t});let s;this.connectionManager.addClient("link",r);for(const e of n)if(this.ui.updateStatus({message:`Checking host API server at ${e}...`}),await Gr(e)){this.ui.updateStatus({message:`Host API server is active at ${e}.`}),s=e;break}if(!s)return void await this.handleHostDisconnection({unreachable:!0});const a=await jr({url:s});this.connectionManager.addClient("host",a);const i=await r.getSessionId.query(),o=await a.getSessionId.query();this.ui.updateStatus({message:`Link Session: ${i}, Host Session: ${o}`}),this.connectionManager.startMonitoring(this.handleConnectionChange),this.setupLinkUpdateHandler(),await this.setupLinkPathHandler(),await this.setupConfig()}catch(e){const t=e instanceof Error?e.message:String(e);this.ui.updateStatus({message:t,isError:!0,tip:"This is a bug. Please report it.",data:e}),await this.cleanup()}}};Qr.initialize()},509:e=>{var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},586:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},703:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},823:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var s=void 0!==n.layer;s&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,s&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},941:(e,t,n)=>{n.d(t,{default:()=>o});var r=n(25),s=n.n(r),a=n(191),i=n.n(a)()(s());i.push([e.id,":root {\n --color-neutral-background1: #ffffff;\n --color-status-danger-background1: #fdf3f4;\n --color-neutral-background2: #fafafa;\n --color-status-danger-foreground1: #b10e1c;\n --color-neutral-foreground1: #242424;\n --color-neutral-foreground2: #424242;\n}\n\n@media (prefers-color-scheme: dark) {\n :root {\n --color-neutral-background1: #292929;\n --color-status-danger-background1: #3b0509;\n --color-neutral-background2: #1f1f1f;\n --color-status-danger-foreground1: #dc626d;\n --color-neutral-foreground1: #ffffff;\n --color-neutral-foreground2: #d6d6d6;\n }\n}\n\nbody {\n background-color: var(--color-neutral-background1);\n margin: 0;\n padding: 0;\n font-family:\n 'Segoe UI',\n 'Segoe UI Web (West European)',\n -apple-system,\n BlinkMacSystemFont,\n Roboto,\n 'Helvetica Neue',\n sans-serif;\n}\n\n.v64eNmuXrV4WWsOKdGgy {\n padding: 20px;\n border-radius: 4px;\n background-color: var(--color-neutral-background2);\n margin: 20px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n\n.ScZ3E77NPMqtBzp0OwUr {\n background-color: var(--color-status-danger-background1);\n}\n\n.b6Vf2DbiFQkD7AEkJ7p_ h2 {\n color: var(--color-neutral-foreground1);\n margin-top: 0;\n}\n\n._05tS4aUzls4kEWk9hkA7 {\n color: var(--color-neutral-foreground1);\n}\n\n.ScZ3E77NPMqtBzp0OwUr .b6Vf2DbiFQkD7AEkJ7p_ {\n color: var(--color-status-danger-foreground1);\n}\n\n.ScZ3E77NPMqtBzp0OwUr ._05tS4aUzls4kEWk9hkA7 {\n color: var(--color-status-danger-foreground1);\n}\n\n._05tS4aUzls4kEWk9hkA7 code {\n background-color: var(--color-neutral-background1);\n padding: 2px 5px;\n border-radius: 3px;\n font-family: 'Consolas', 'Monaco', 'Courier New', monospace;\n font-size: 0.9em;\n}\n\n.ScZ3E77NPMqtBzp0OwUr ._05tS4aUzls4kEWk9hkA7 code {\n background-color: rgba(0, 0, 0, 0.1);\n}\n\n.kheFps3bT2VbnjAMYfSr {\n font-weight: bold;\n margin-top: 20px;\n color: var(--color-neutral-foreground2);\n}\n","",{version:3,sources:["webpack://./src/UIManager.module.css"],names:[],mappings:"AAAA;EACE,oCAAoC;EACpC,0CAA0C;EAC1C,oCAAoC;EACpC,0CAA0C;EAC1C,oCAAoC;EACpC,oCAAoC;AACtC;;AAEA;EACE;IACE,oCAAoC;IACpC,0CAA0C;IAC1C,oCAAoC;IACpC,0CAA0C;IAC1C,oCAAoC;IACpC,oCAAoC;EACtC;AACF;;AAEA;EACE,kDAAkD;EAClD,SAAS;EACT,UAAU;EACV;;;;;;;cAOY;AACd;;AAEA;EACE,aAAa;EACb,kBAAkB;EAClB,kDAAkD;EAClD,YAAY;EACZ,wCAAwC;AAC1C;;AAEA;EACE,wDAAwD;AAC1D;;AAEA;EACE,uCAAuC;EACvC,aAAa;AACf;;AAEA;EACE,uCAAuC;AACzC;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,6CAA6C;AAC/C;;AAEA;EACE,kDAAkD;EAClD,gBAAgB;EAChB,kBAAkB;EAClB,2DAA2D;EAC3D,gBAAgB;AAClB;;AAEA;EACE,oCAAoC;AACtC;;AAEA;EACE,iBAAiB;EACjB,gBAAgB;EAChB,uCAAuC;AACzC",sourcesContent:[":root {\n --color-neutral-background1: #ffffff;\n --color-status-danger-background1: #fdf3f4;\n --color-neutral-background2: #fafafa;\n --color-status-danger-foreground1: #b10e1c;\n --color-neutral-foreground1: #242424;\n --color-neutral-foreground2: #424242;\n}\n\n@media (prefers-color-scheme: dark) {\n :root {\n --color-neutral-background1: #292929;\n --color-status-danger-background1: #3b0509;\n --color-neutral-background2: #1f1f1f;\n --color-status-danger-foreground1: #dc626d;\n --color-neutral-foreground1: #ffffff;\n --color-neutral-foreground2: #d6d6d6;\n }\n}\n\n:global body {\n background-color: var(--color-neutral-background1);\n margin: 0;\n padding: 0;\n font-family:\n 'Segoe UI',\n 'Segoe UI Web (West European)',\n -apple-system,\n BlinkMacSystemFont,\n Roboto,\n 'Helvetica Neue',\n sans-serif;\n}\n\n.statusContainer {\n padding: 20px;\n border-radius: 4px;\n background-color: var(--color-neutral-background2);\n margin: 20px;\n box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);\n}\n\n.errorContainer {\n background-color: var(--color-status-danger-background1);\n}\n\n.title h2 {\n color: var(--color-neutral-foreground1);\n margin-top: 0;\n}\n\n.message {\n color: var(--color-neutral-foreground1);\n}\n\n.errorContainer .title {\n color: var(--color-status-danger-foreground1);\n}\n\n.errorContainer .message {\n color: var(--color-status-danger-foreground1);\n}\n\n.message code {\n background-color: var(--color-neutral-background1);\n padding: 2px 5px;\n border-radius: 3px;\n font-family: 'Consolas', 'Monaco', 'Courier New', monospace;\n font-size: 0.9em;\n}\n\n.errorContainer .message code {\n background-color: rgba(0, 0, 0, 0.1);\n}\n\n.warning {\n font-weight: bold;\n margin-top: 20px;\n color: var(--color-neutral-foreground2);\n}\n"],sourceRoot:""}]),i.locals={statusContainer:"v64eNmuXrV4WWsOKdGgy",errorContainer:"ScZ3E77NPMqtBzp0OwUr",title:"b6Vf2DbiFQkD7AEkJ7p_",message:"_05tS4aUzls4kEWk9hkA7",warning:"kheFps3bT2VbnjAMYfSr"};const o=i}};import e from"../runtime.js";import*as t from"./index.js";e.C(t),e(e.s=460);
3
3
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/link-proxy",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "A proxy to connect link clients.",
5
5
  "license": "MIT",
6
6
  "types": "./lib/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "prepack": "cp .npmignore dist/.npmignore"
24
24
  },
25
25
  "devDependencies": {
26
- "@ms-cloudpack/api-server": "^0.63.2",
26
+ "@ms-cloudpack/api-server": "^0.63.3",
27
27
  "@ms-cloudpack/common-types-browser": "^0.6.0",
28
28
  "@ms-cloudpack/eslint-plugin-internal": "^0.0.1",
29
29
  "@ms-cloudpack/scripts": "^0.0.1"
@@ -1,2 +0,0 @@
1
- export const __webpack_id__=582;export const __webpack_ids__=[582];export const __webpack_modules__={582:e=>{e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}};
2
- //# sourceMappingURL=582.chunk.js.map