@synnaxlabs/drift 0.40.0 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ "use strict";const Er=require("@reduxjs/toolkit"),Ze=(n=!1,...e)=>{n&&console.log(...e)},Rn=(n=!1,...e)=>{n&&console.group(...e)},Dt=n=>{n&&console.groupEnd()},$r=n=>{const e=n.replace(/_[a-z]/g,t=>t[1].toUpperCase());return e.length>1&&e[0]===e[0].toUpperCase()&&e[1]===e[1].toUpperCase()||e.length===0?e:e[0].toLowerCase()+e.slice(1)},jn=n=>{const e=(t,r=Ut)=>{if(typeof t=="string")return n(t);if(Array.isArray(t))return t.map(a=>e(a,r));if(!jt(t))return t;r=Rr(r);const s={},i=t;return Object.keys(i).forEach(a=>{let o=i[a];const c=n(a);r.recursive&&(jt(o)?gn(o,r.keepTypesOnRecursion)||(o=e(o,r)):r.recursiveInArray&&mn(o)&&(o=[...o].map(l=>{let p=l;return jt(l)?gn(p,r.keepTypesOnRecursion)||(p=e(l,r)):mn(l)&&(p=e({key:l},r).key),p}))),s[c]=o}),s};return e},Zn=jn($r),Cr=n=>n.replace(/([a-z0-9])([A-Z])/g,(e,t,r)=>`${t}_${r.toLowerCase()}`),Mr=jn(Cr),Ut={recursive:!0,recursiveInArray:!0,keepTypesOnRecursion:[Number,String,Uint8Array]},Rr=(n=Ut)=>(n.recursive==null?n=Ut:n.recursiveInArray??(n.recursiveInArray=!1),n),mn=n=>n!=null&&Array.isArray(n),jt=n=>n!=null&&typeof n=="object"&&!Array.isArray(n),gn=(n,e)=>(e||[]).some(t=>n instanceof t),Je=n=>n!=null&&typeof n=="object"&&!Array.isArray(n);var jr=Object.defineProperty,Zr=(n,e,t)=>e in n?jr(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,He=(n,e,t)=>Zr(n,typeof e!="symbol"?e+"":e,t);let Br=class{constructor(){He(this,"contentType","application/json"),He(this,"decoder"),He(this,"encoder"),this.decoder=new TextDecoder,this.encoder=new TextEncoder}encode(e){return this.encoder.encode(this.encodeString(e)).buffer}decode(e,t){return this.decodeString(this.decoder.decode(e),t)}decodeString(e,t){const r=JSON.parse(e),s=Zn(r);return t!=null?t.parse(s):s}encodeString(e){const t=Mr(e);return JSON.stringify(t,(r,s)=>ArrayBuffer.isView(s)?Array.from(s):Je(s)&&"encode_value"in s?typeof s.value=="bigint"?s.value.toString():s.value:typeof s=="bigint"?s.toString():s)}static registerCustomType(){}},Dr=class{constructor(){He(this,"contentType","text/csv")}encode(e){const t=this.encodeString(e);return new TextEncoder().encode(t).buffer}decode(e,t){const r=new TextDecoder().decode(e);return this.decodeString(r,t)}encodeString(e){if(!Array.isArray(e)||e.length===0||!Je(e[0]))throw new Error("Payload must be an array of objects");const t=Object.keys(e[0]),r=[t.join(",")];return e.forEach(s=>{const i=t.map(a=>JSON.stringify(s[a]??""));r.push(i.join(","))}),r.join(`
2
+ `)}decodeString(e,t){const[r,...s]=e.trim().split(`
3
+ `).map(o=>o.trim());if(r.length===0)return t!=null?t.parse({}):{};const i=r.split(",").map(o=>o.trim()),a={};return i.forEach(o=>{a[o]=[]}),s.forEach(o=>{const c=o.split(",").map(l=>l.trim());i.forEach((l,p)=>{const g=this.parseValue(c[p]);g!=null&&a[l].push(g)})}),t!=null?t.parse(a):a}parseValue(e){if(e==null||e.length===0)return null;const t=Number(e);return isNaN(t)?e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e:t}static registerCustomType(){}},Ur=class{constructor(){He(this,"contentType","text/plain")}encode(e){return new TextEncoder().encode(e).buffer}decode(e,t){const r=new TextDecoder().decode(e);return t!=null?t.parse(r):r}};const pt=new Br;new Dr;new Ur;var S;(function(n){n.assertEqual=s=>s;function e(s){}n.assertIs=e;function t(s){throw new Error}n.assertNever=t,n.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},n.getValidEnumValues=s=>{const i=n.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(const o of i)a[o]=s[o];return n.objectValues(a)},n.objectValues=s=>n.objectKeys(s).map(function(i){return s[i]}),n.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},n.find=(s,i)=>{for(const a of s)if(i(a))return a},n.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}n.joinValues=r,n.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(S||(S={}));var Pt;(function(n){n.mergeShapes=(e,t)=>({...e,...t})})(Pt||(Pt={}));const y=S.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),se=n=>{switch(typeof n){case"undefined":return y.undefined;case"string":return y.string;case"number":return isNaN(n)?y.nan:y.number;case"boolean":return y.boolean;case"function":return y.function;case"bigint":return y.bigint;case"symbol":return y.symbol;case"object":return Array.isArray(n)?y.array:n===null?y.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?y.promise:typeof Map<"u"&&n instanceof Map?y.map:typeof Set<"u"&&n instanceof Set?y.set:typeof Date<"u"&&n instanceof Date?y.date:y.object;default:return y.unknown}},f=S.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"]),Pr=n=>JSON.stringify(n,null,2).replace(/"([^"]+)":/g,"$1:");class z extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};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(i){return i.message},r={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)r._errors.push(t(a));else{let o=r,c=0;for(;c<a.path.length;){const l=a.path[c];c===a.path.length-1?(o[l]=o[l]||{_errors:[]},o[l]._errors.push(t(a))):o[l]=o[l]||{_errors:[]},o=o[l],c++}}};return s(this),r}static assert(e){if(!(e instanceof z))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,S.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){const t={},r=[];for(const s of this.issues)s.path.length>0?(t[s.path[0]]=t[s.path[0]]||[],t[s.path[0]].push(e(s))):r.push(e(s));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}z.create=n=>new z(n);const Ce=(n,e)=>{let t;switch(n.code){case f.invalid_type:n.received===y.undefined?t="Required":t=`Expected ${n.expected}, received ${n.received}`;break;case f.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(n.expected,S.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:t=`Unrecognized key(s) in object: ${S.joinValues(n.keys,", ")}`;break;case f.invalid_union:t="Invalid input";break;case f.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${S.joinValues(n.options)}`;break;case f.invalid_enum_value:t=`Invalid enum value. Expected ${S.joinValues(n.options)}, received '${n.received}'`;break;case f.invalid_arguments:t="Invalid function arguments";break;case f.invalid_return_type:t="Invalid function return type";break;case f.invalid_date:t="Invalid date";break;case f.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(t=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?t=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?t=`Invalid input: must end with "${n.validation.endsWith}"`:S.assertNever(n.validation):n.validation!=="regex"?t=`Invalid ${n.validation}`:t="Invalid";break;case f.too_small:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:t="Invalid input";break;case f.too_big:n.type==="array"?t=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?t=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?t=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?t=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?t=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:t="Invalid input";break;case f.custom:t="Invalid input";break;case f.invalid_intersection_types:t="Intersection results could not be merged";break;case f.not_multiple_of:t=`Number must be a multiple of ${n.multipleOf}`;break;case f.not_finite:t="Number must be finite";break;default:t=e.defaultError,S.assertNever(n)}return{message:t}};let Bn=Ce;function Lr(n){Bn=n}function bt(){return Bn}const xt=n=>{const{data:e,path:t,errorMaps:r,issueData:s}=n,i=[...t,...s.path||[]],a={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let o="";const c=r.filter(l=>!!l).slice().reverse();for(const l of c)o=l(a,{data:e,defaultError:o}).message;return{...s,path:i,message:o}},Wr=[];function m(n,e){const t=bt(),r=xt({issueData:e,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,t,t===Ce?void 0:Ce].filter(s=>!!s)});n.common.issues.push(r)}class P{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const s of t){if(s.status==="aborted")return x;s.status==="dirty"&&e.dirty(),r.push(s.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const s of t){const i=await s.key,a=await s.value;r.push({key:i,value:a})}return P.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const s of t){const{key:i,value:a}=s;if(i.status==="aborted"||a.status==="aborted")return x;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(r[i.value]=a.value)}return{status:e.value,value:r}}}const x=Object.freeze({status:"aborted"}),Ee=n=>({status:"dirty",value:n}),W=n=>({status:"valid",value:n}),Lt=n=>n.status==="aborted",Wt=n=>n.status==="dirty",Oe=n=>n.status==="valid",Xe=n=>typeof Promise<"u"&&n instanceof Promise;function _t(n,e,t,r){if(typeof e=="function"?n!==e||!0:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e.get(n)}function Dn(n,e,t,r,s){if(typeof e=="function"?n!==e||!0:!e.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(n,t),t}var v;(function(n){n.errToObj=e=>typeof e=="string"?{message:e}:e||{},n.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(v||(v={}));var Be,De;class K{constructor(e,t,r,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const yn=(n,e)=>{if(Oe(e))return{success:!0,data:e.value};if(!n.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 z(n.common.issues);return this._error=t,this._error}}};function _(n){if(!n)return{};const{errorMap:e,invalid_type_error:t,required_error:r,description:s}=n;if(e&&(t||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,o)=>{var c,l;const{message:p}=n;return a.code==="invalid_enum_value"?{message:p??o.defaultError}:typeof o.data>"u"?{message:(c=p??r)!==null&&c!==void 0?c:o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:(l=p??t)!==null&&l!==void 0?l:o.defaultError}},description:s}}class O{get description(){return this._def.description}_getType(e){return se(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:se(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new P,ctx:{common:e.parent.common,data:e.data,parsedType:se(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Xe(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 r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const s={common:{issues:[],async:(r=t==null?void 0:t.async)!==null&&r!==void 0?r:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:se(e)},i=this._parseSync({data:e,path:s.path,parent:s});return yn(s,i)}"~validate"(e){var t,r;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:se(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:s});return Oe(i)?{value:i.value}:{issues:s.common.issues}}catch(i){!((r=(t=i==null?void 0:i.message)===null||t===void 0?void 0:t.toLowerCase())===null||r===void 0)&&r.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:s}).then(i=>Oe(i)?{value:i.value}:{issues:s.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:se(e)},s=this._parse({data:e,path:r.path,parent:r}),i=await(Xe(s)?s:Promise.resolve(s));return yn(r,i)}refine(e,t){const r=s=>typeof t=="string"||typeof t>"u"?{message:t}:typeof t=="function"?t(s):t;return this._refinement((s,i)=>{const a=e(s),o=()=>i.addIssue({code:f.custom,...r(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(c=>c?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,t){return this._refinement((r,s)=>e(r)?!0:(s.addIssue(typeof t=="function"?t(r,s):t),!1))}_refinement(e){return new Y({schema:this,typeName:b.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:t=>this["~validate"](t)}}optional(){return X.create(this,this._def)}nullable(){return me.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return F.create(this)}promise(){return Re.create(this,this._def)}or(e){return tt.create([this,e],this._def)}and(e){return nt.create(this,e,this._def)}transform(e){return new Y({..._(this._def),schema:this,typeName:b.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t=typeof e=="function"?e:()=>e;return new ot({..._(this._def),innerType:this,defaultValue:t,typeName:b.ZodDefault})}brand(){return new en({typeName:b.ZodBranded,type:this,..._(this._def)})}catch(e){const t=typeof e=="function"?e:()=>e;return new ut({..._(this._def),innerType:this,catchValue:t,typeName:b.ZodCatch})}describe(e){const t=this.constructor;return new t({...this._def,description:e})}pipe(e){return ht.create(this,e)}readonly(){return ct.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const zr=/^c[^\s-]{8,}$/i,Vr=/^[0-9a-z]+$/,qr=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Fr=/^[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,Yr=/^[a-z0-9_-]{21}$/i,Gr=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Jr=/^[-+]?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)?)??$/,Hr=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xr="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Zt;const Kr=/^(?:(?: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])$/,Qr=/^(?:(?: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])$/,es=/^(([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]))$/,ts=/^(([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])$/,ns=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,rs=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Un="((\\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])))",ss=new RegExp(`^${Un}$`);function Pn(n){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return n.precision?e=`${e}\\.\\d{${n.precision}}`:n.precision==null&&(e=`${e}(\\.\\d+)?`),e}function is(n){return new RegExp(`^${Pn(n)}$`)}function Ln(n){let e=`${Un}T${Pn(n)}`;const t=[];return t.push(n.local?"Z?":"Z"),n.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function as(n,e){return!!((e==="v4"||!e)&&Kr.test(n)||(e==="v6"||!e)&&es.test(n))}function os(n,e){if(!Gr.test(n))return!1;try{const[t]=n.split("."),r=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),s=JSON.parse(atob(r));return!(typeof s!="object"||s===null||!s.typ||!s.alg||e&&s.alg!==e)}catch{return!1}}function us(n,e){return!!((e==="v4"||!e)&&Qr.test(n)||(e==="v6"||!e)&&ts.test(n))}class q extends O{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==y.string){const i=this._getOrReturnCtx(e);return m(i,{code:f.invalid_type,expected:y.string,received:i.parsedType}),x}const r=new P;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),m(s,{code:f.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),m(s,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const a=e.data.length>i.value,o=e.data.length<i.value;(a||o)&&(s=this._getOrReturnCtx(e,s),a?m(s,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&m(s,{code:f.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Hr.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"email",code:f.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Zt||(Zt=new RegExp(Xr,"u")),Zt.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"emoji",code:f.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Fr.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"uuid",code:f.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Yr.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"nanoid",code:f.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")zr.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"cuid",code:f.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")Vr.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"cuid2",code:f.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")qr.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"ulid",code:f.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),m(s,{validation:"url",code:f.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"regex",code:f.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),m(s,{code:f.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),m(s,{code:f.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),m(s,{code:f.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Ln(i).test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{code:f.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?ss.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{code:f.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?is(i).test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{code:f.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?Jr.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"duration",code:f.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?as(e.data,i.version)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"ip",code:f.invalid_string,message:i.message}),r.dirty()):i.kind==="jwt"?os(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"jwt",code:f.invalid_string,message:i.message}),r.dirty()):i.kind==="cidr"?us(e.data,i.version)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"cidr",code:f.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?ns.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"base64",code:f.invalid_string,message:i.message}),r.dirty()):i.kind==="base64url"?rs.test(e.data)||(s=this._getOrReturnCtx(e,s),m(s,{validation:"base64url",code:f.invalid_string,message:i.message}),r.dirty()):S.assertNever(i);return{status:r.value,value:e.data}}_regex(e,t,r){return this.refinement(s=>e.test(s),{validation:t,code:f.invalid_string,...v.errToObj(r)})}_addCheck(e){return new q({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...v.errToObj(e)})}url(e){return this._addCheck({kind:"url",...v.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...v.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...v.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...v.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...v.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...v.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...v.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...v.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...v.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...v.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...v.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...v.errToObj(e)})}datetime(e){var t,r;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!==null&&t!==void 0?t:!1,local:(r=e==null?void 0:e.local)!==null&&r!==void 0?r:!1,...v.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...v.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...v.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...v.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t==null?void 0:t.position,...v.errToObj(t==null?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...v.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...v.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...v.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...v.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...v.errToObj(t)})}nonempty(e){return this.min(1,v.errToObj(e))}trim(){return new q({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new q({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new q({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}q.create=n=>{var e;return new q({checks:[],typeName:b.ZodString,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,..._(n)})};function cs(n,e){const t=(n.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,s=t>r?t:r,i=parseInt(n.toFixed(s).replace(".","")),a=parseInt(e.toFixed(s).replace(".",""));return i%a/Math.pow(10,s)}class he extends O{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)!==y.number){const i=this._getOrReturnCtx(e);return m(i,{code:f.invalid_type,expected:y.number,received:i.parsedType}),x}let r;const s=new P;for(const i of this._def.checks)i.kind==="int"?S.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{code:f.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),m(r,{code:f.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),m(r,{code:f.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?cs(e.data,i.value)!==0&&(r=this._getOrReturnCtx(e,r),m(r,{code:f.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),m(r,{code:f.not_finite,message:i.message}),s.dirty()):S.assertNever(i);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,r,s){return new he({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:v.toString(s)}]})}_addCheck(e){return new he({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:v.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:v.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:v.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:v.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&S.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(t===null||r.value>t)&&(t=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}he.create=n=>new he({checks:[],typeName:b.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,..._(n)});class fe extends O{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)!==y.bigint)return this._getInvalidInput(e);let r;const s=new P;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(r=this._getOrReturnCtx(e,r),m(r,{code:f.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(r=this._getOrReturnCtx(e,r),m(r,{code:f.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),m(r,{code:f.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):S.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return m(t,{code:f.invalid_type,expected:y.bigint,received:t.parsedType}),x}gte(e,t){return this.setLimit("min",e,!0,v.toString(t))}gt(e,t){return this.setLimit("min",e,!1,v.toString(t))}lte(e,t){return this.setLimit("max",e,!0,v.toString(t))}lt(e,t){return this.setLimit("max",e,!1,v.toString(t))}setLimit(e,t,r,s){return new fe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:v.toString(s)}]})}_addCheck(e){return new fe({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:v.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:v.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:v.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:v.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:v.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}}fe.create=n=>{var e;return new fe({checks:[],typeName:b.ZodBigInt,coerce:(e=n==null?void 0:n.coerce)!==null&&e!==void 0?e:!1,..._(n)})};class Ke extends O{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==y.boolean){const r=this._getOrReturnCtx(e);return m(r,{code:f.invalid_type,expected:y.boolean,received:r.parsedType}),x}return W(e.data)}}Ke.create=n=>new Ke({typeName:b.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,..._(n)});class Se extends O{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==y.date){const i=this._getOrReturnCtx(e);return m(i,{code:f.invalid_type,expected:y.date,received:i.parsedType}),x}if(isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return m(i,{code:f.invalid_date}),x}const r=new P;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),m(s,{code:f.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),m(s,{code:f.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):S.assertNever(i);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Se({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:v.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:v.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}}Se.create=n=>new Se({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:b.ZodDate,..._(n)});class Tt extends O{_parse(e){if(this._getType(e)!==y.symbol){const r=this._getOrReturnCtx(e);return m(r,{code:f.invalid_type,expected:y.symbol,received:r.parsedType}),x}return W(e.data)}}Tt.create=n=>new Tt({typeName:b.ZodSymbol,..._(n)});class Qe extends O{_parse(e){if(this._getType(e)!==y.undefined){const r=this._getOrReturnCtx(e);return m(r,{code:f.invalid_type,expected:y.undefined,received:r.parsedType}),x}return W(e.data)}}Qe.create=n=>new Qe({typeName:b.ZodUndefined,..._(n)});class et extends O{_parse(e){if(this._getType(e)!==y.null){const r=this._getOrReturnCtx(e);return m(r,{code:f.invalid_type,expected:y.null,received:r.parsedType}),x}return W(e.data)}}et.create=n=>new et({typeName:b.ZodNull,..._(n)});class Me extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return W(e.data)}}Me.create=n=>new Me({typeName:b.ZodAny,..._(n)});class be extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return W(e.data)}}be.create=n=>new be({typeName:b.ZodUnknown,..._(n)});class ae extends O{_parse(e){const t=this._getOrReturnCtx(e);return m(t,{code:f.invalid_type,expected:y.never,received:t.parsedType}),x}}ae.create=n=>new ae({typeName:b.ZodNever,..._(n)});class Ot extends O{_parse(e){if(this._getType(e)!==y.undefined){const r=this._getOrReturnCtx(e);return m(r,{code:f.invalid_type,expected:y.void,received:r.parsedType}),x}return W(e.data)}}Ot.create=n=>new Ot({typeName:b.ZodVoid,..._(n)});class F extends O{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),s=this._def;if(t.parsedType!==y.array)return m(t,{code:f.invalid_type,expected:y.array,received:t.parsedType}),x;if(s.exactLength!==null){const a=t.data.length>s.exactLength.value,o=t.data.length<s.exactLength.value;(a||o)&&(m(t,{code:a?f.too_big:f.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&t.data.length<s.minLength.value&&(m(t,{code:f.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&t.data.length>s.maxLength.value&&(m(t,{code:f.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((a,o)=>s.type._parseAsync(new K(t,a,t.path,o)))).then(a=>P.mergeArray(r,a));const i=[...t.data].map((a,o)=>s.type._parseSync(new K(t,a,t.path,o)));return P.mergeArray(r,i)}get element(){return this._def.type}min(e,t){return new F({...this._def,minLength:{value:e,message:v.toString(t)}})}max(e,t){return new F({...this._def,maxLength:{value:e,message:v.toString(t)}})}length(e,t){return new F({...this._def,exactLength:{value:e,message:v.toString(t)}})}nonempty(e){return this.min(1,e)}}F.create=(n,e)=>new F({type:n,minLength:null,maxLength:null,exactLength:null,typeName:b.ZodArray,..._(e)});function Ae(n){if(n instanceof M){const e={};for(const t in n.shape){const r=n.shape[t];e[t]=X.create(Ae(r))}return new M({...n._def,shape:()=>e})}else return n instanceof F?new F({...n._def,type:Ae(n.element)}):n instanceof X?X.create(Ae(n.unwrap())):n instanceof me?me.create(Ae(n.unwrap())):n instanceof Q?Q.create(n.items.map(e=>Ae(e))):n}class M extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),t=S.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==y.object){const l=this._getOrReturnCtx(e);return m(l,{code:f.invalid_type,expected:y.object,received:l.parsedType}),x}const{status:r,ctx:s}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof ae&&this._def.unknownKeys==="strip"))for(const l in s.data)a.includes(l)||o.push(l);const c=[];for(const l of a){const p=i[l],g=s.data[l];c.push({key:{status:"valid",value:l},value:p._parse(new K(s,g,s.path,l)),alwaysSet:l in s.data})}if(this._def.catchall instanceof ae){const l=this._def.unknownKeys;if(l==="passthrough")for(const p of o)c.push({key:{status:"valid",value:p},value:{status:"valid",value:s.data[p]}});else if(l==="strict")o.length>0&&(m(s,{code:f.unrecognized_keys,keys:o}),r.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const l=this._def.catchall;for(const p of o){const g=s.data[p];c.push({key:{status:"valid",value:p},value:l._parse(new K(s,g,s.path,p)),alwaysSet:p in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const l=[];for(const p of c){const g=await p.key,j=await p.value;l.push({key:g,value:j,alwaysSet:p.alwaysSet})}return l}).then(l=>P.mergeObjectSync(r,l)):P.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return v.errToObj,new M({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,r)=>{var s,i,a,o;const c=(a=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,t,r).message)!==null&&a!==void 0?a:r.defaultError;return t.code==="unrecognized_keys"?{message:(o=v.errToObj(e).message)!==null&&o!==void 0?o:c}:{message:c}}}:{}})}strip(){return new M({...this._def,unknownKeys:"strip"})}passthrough(){return new M({...this._def,unknownKeys:"passthrough"})}extend(e){return new M({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new M({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:b.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new M({...this._def,catchall:e})}pick(e){const t={};return S.objectKeys(e).forEach(r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])}),new M({...this._def,shape:()=>t})}omit(e){const t={};return S.objectKeys(this.shape).forEach(r=>{e[r]||(t[r]=this.shape[r])}),new M({...this._def,shape:()=>t})}deepPartial(){return Ae(this)}partial(e){const t={};return S.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];e&&!e[r]?t[r]=s:t[r]=s.optional()}),new M({...this._def,shape:()=>t})}required(e){const t={};return S.objectKeys(this.shape).forEach(r=>{if(e&&!e[r])t[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof X;)i=i._def.innerType;t[r]=i}}),new M({...this._def,shape:()=>t})}keyof(){return Wn(S.objectKeys(this.shape))}}M.create=(n,e)=>new M({shape:()=>n,unknownKeys:"strip",catchall:ae.create(),typeName:b.ZodObject,..._(e)});M.strictCreate=(n,e)=>new M({shape:()=>n,unknownKeys:"strict",catchall:ae.create(),typeName:b.ZodObject,..._(e)});M.lazycreate=(n,e)=>new M({shape:n,unknownKeys:"strip",catchall:ae.create(),typeName:b.ZodObject,..._(e)});class tt extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;function s(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(o=>new z(o.ctx.common.issues));return m(t,{code:f.invalid_union,unionErrors:a}),x}if(t.common.async)return Promise.all(r.map(async i=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await i._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(s);{let i;const a=[];for(const c of r){const l={...t,common:{...t.common,issues:[]},parent:null},p=c._parseSync({data:t.data,path:t.path,parent:l});if(p.status==="valid")return p;p.status==="dirty"&&!i&&(i={result:p,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;const o=a.map(c=>new z(c));return m(t,{code:f.invalid_union,unionErrors:o}),x}}get options(){return this._def.options}}tt.create=(n,e)=>new tt({options:n,typeName:b.ZodUnion,..._(e)});const ne=n=>n instanceof st?ne(n.schema):n instanceof Y?ne(n.innerType()):n instanceof it?[n.value]:n instanceof pe?n.options:n instanceof at?S.objectValues(n.enum):n instanceof ot?ne(n._def.innerType):n instanceof Qe?[void 0]:n instanceof et?[null]:n instanceof X?[void 0,...ne(n.unwrap())]:n instanceof me?[null,...ne(n.unwrap())]:n instanceof en||n instanceof ct?ne(n.unwrap()):n instanceof ut?ne(n._def.innerType):[];class At extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.object)return m(t,{code:f.invalid_type,expected:y.object,received:t.parsedType}),x;const r=this.discriminator,s=t.data[r],i=this.optionsMap.get(s);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(m(t,{code:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const s=new Map;for(const i of t){const a=ne(i.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of a){if(s.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);s.set(o,i)}}return new At({typeName:b.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,..._(r)})}}function zt(n,e){const t=se(n),r=se(e);if(n===e)return{valid:!0,data:n};if(t===y.object&&r===y.object){const s=S.objectKeys(e),i=S.objectKeys(n).filter(o=>s.indexOf(o)!==-1),a={...n,...e};for(const o of i){const c=zt(n[o],e[o]);if(!c.valid)return{valid:!1};a[o]=c.data}return{valid:!0,data:a}}else if(t===y.array&&r===y.array){if(n.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<n.length;i++){const a=n[i],o=e[i],c=zt(a,o);if(!c.valid)return{valid:!1};s.push(c.data)}return{valid:!0,data:s}}else return t===y.date&&r===y.date&&+n==+e?{valid:!0,data:n}:{valid:!1}}class nt extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),s=(i,a)=>{if(Lt(i)||Lt(a))return x;const o=zt(i.value,a.value);return o.valid?((Wt(i)||Wt(a))&&t.dirty(),{status:t.value,value:o.data}):(m(r,{code:f.invalid_intersection_types}),x)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,a])=>s(i,a)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}nt.create=(n,e,t)=>new nt({left:n,right:e,typeName:b.ZodIntersection,..._(t)});class Q extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==y.array)return m(r,{code:f.invalid_type,expected:y.array,received:r.parsedType}),x;if(r.data.length<this._def.items.length)return m(r,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&r.data.length>this._def.items.length&&(m(r,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const i=[...r.data].map((a,o)=>{const c=this._def.items[o]||this._def.rest;return c?c._parse(new K(r,a,r.path,o)):null}).filter(a=>!!a);return r.common.async?Promise.all(i).then(a=>P.mergeArray(t,a)):P.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new Q({...this._def,rest:e})}}Q.create=(n,e)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Q({items:n,typeName:b.ZodTuple,rest:null,..._(e)})};class rt extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==y.object)return m(r,{code:f.invalid_type,expected:y.object,received:r.parsedType}),x;const s=[],i=this._def.keyType,a=this._def.valueType;for(const o in r.data)s.push({key:i._parse(new K(r,o,r.path,o)),value:a._parse(new K(r,r.data[o],r.path,o)),alwaysSet:o in r.data});return r.common.async?P.mergeObjectAsync(t,s):P.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,r){return t instanceof O?new rt({keyType:e,valueType:t,typeName:b.ZodRecord,..._(r)}):new rt({keyType:q.create(),valueType:e,typeName:b.ZodRecord,..._(t)})}}class St extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==y.map)return m(r,{code:f.invalid_type,expected:y.map,received:r.parsedType}),x;const s=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([o,c],l)=>({key:s._parse(new K(r,o,r.path,[l,"key"])),value:i._parse(new K(r,c,r.path,[l,"value"]))}));if(r.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const c of a){const l=await c.key,p=await c.value;if(l.status==="aborted"||p.status==="aborted")return x;(l.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(l.value,p.value)}return{status:t.value,value:o}})}else{const o=new Map;for(const c of a){const l=c.key,p=c.value;if(l.status==="aborted"||p.status==="aborted")return x;(l.status==="dirty"||p.status==="dirty")&&t.dirty(),o.set(l.value,p.value)}return{status:t.value,value:o}}}}St.create=(n,e,t)=>new St({valueType:e,keyType:n,typeName:b.ZodMap,..._(t)});class Ne extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==y.set)return m(r,{code:f.invalid_type,expected:y.set,received:r.parsedType}),x;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(m(r,{code:f.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(m(r,{code:f.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const i=this._def.valueType;function a(c){const l=new Set;for(const p of c){if(p.status==="aborted")return x;p.status==="dirty"&&t.dirty(),l.add(p.value)}return{status:t.value,value:l}}const o=[...r.data.values()].map((c,l)=>i._parse(new K(r,c,r.path,l)));return r.common.async?Promise.all(o).then(c=>a(c)):a(o)}min(e,t){return new Ne({...this._def,minSize:{value:e,message:v.toString(t)}})}max(e,t){return new Ne({...this._def,maxSize:{value:e,message:v.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Ne.create=(n,e)=>new Ne({valueType:n,minSize:null,maxSize:null,typeName:b.ZodSet,..._(e)});class $e extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.function)return m(t,{code:f.invalid_type,expected:y.function,received:t.parsedType}),x;function r(o,c){return xt({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,bt(),Ce].filter(l=>!!l),issueData:{code:f.invalid_arguments,argumentsError:c}})}function s(o,c){return xt({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,bt(),Ce].filter(l=>!!l),issueData:{code:f.invalid_return_type,returnTypeError:c}})}const i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Re){const o=this;return W(async function(...c){const l=new z([]),p=await o._def.args.parseAsync(c,i).catch(D=>{throw l.addIssue(r(c,D)),l}),g=await Reflect.apply(a,this,p);return await o._def.returns._def.type.parseAsync(g,i).catch(D=>{throw l.addIssue(s(g,D)),l})})}else{const o=this;return W(function(...c){const l=o._def.args.safeParse(c,i);if(!l.success)throw new z([r(c,l.error)]);const p=Reflect.apply(a,this,l.data),g=o._def.returns.safeParse(p,i);if(!g.success)throw new z([s(p,g.error)]);return g.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new $e({...this._def,args:Q.create(e).rest(be.create())})}returns(e){return new $e({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new $e({args:e||Q.create([]).rest(be.create()),returns:t||be.create(),typeName:b.ZodFunction,..._(r)})}}class st extends O{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})}}st.create=(n,e)=>new st({getter:n,typeName:b.ZodLazy,..._(e)});class it extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return m(t,{received:t.data,code:f.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}it.create=(n,e)=>new it({value:n,typeName:b.ZodLiteral,..._(e)});function Wn(n,e){return new pe({values:n,typeName:b.ZodEnum,..._(e)})}class pe extends O{constructor(){super(...arguments),Be.set(this,void 0)}_parse(e){if(typeof e.data!="string"){const t=this._getOrReturnCtx(e),r=this._def.values;return m(t,{expected:S.joinValues(r),received:t.parsedType,code:f.invalid_type}),x}if(_t(this,Be)||Dn(this,Be,new Set(this._def.values)),!_t(this,Be).has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return m(t,{received:t.data,code:f.invalid_enum_value,options:r}),x}return W(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 pe.create(e,{...this._def,...t})}exclude(e,t=this._def){return pe.create(this.options.filter(r=>!e.includes(r)),{...this._def,...t})}}Be=new WeakMap;pe.create=Wn;class at extends O{constructor(){super(...arguments),De.set(this,void 0)}_parse(e){const t=S.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==y.string&&r.parsedType!==y.number){const s=S.objectValues(t);return m(r,{expected:S.joinValues(s),received:r.parsedType,code:f.invalid_type}),x}if(_t(this,De)||Dn(this,De,new Set(S.getValidEnumValues(this._def.values))),!_t(this,De).has(e.data)){const s=S.objectValues(t);return m(r,{received:r.data,code:f.invalid_enum_value,options:s}),x}return W(e.data)}get enum(){return this._def.values}}De=new WeakMap;at.create=(n,e)=>new at({values:n,typeName:b.ZodNativeEnum,..._(e)});class Re extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==y.promise&&t.common.async===!1)return m(t,{code:f.invalid_type,expected:y.promise,received:t.parsedType}),x;const r=t.parsedType===y.promise?t.data:Promise.resolve(t.data);return W(r.then(s=>this._def.type.parseAsync(s,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Re.create=(n,e)=>new Re({type:n,typeName:b.ZodPromise,..._(e)});class Y extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===b.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:a=>{m(r,a),a.fatal?t.abort():t.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const a=s.transform(r.data,i);if(r.common.async)return Promise.resolve(a).then(async o=>{if(t.value==="aborted")return x;const c=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});return c.status==="aborted"?x:c.status==="dirty"||t.value==="dirty"?Ee(c.value):c});{if(t.value==="aborted")return x;const o=this._def.schema._parseSync({data:a,path:r.path,parent:r});return o.status==="aborted"?x:o.status==="dirty"||t.value==="dirty"?Ee(o.value):o}}if(s.type==="refinement"){const a=o=>{const c=s.refinement(o,i);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?x:(o.status==="dirty"&&t.dirty(),a(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>o.status==="aborted"?x:(o.status==="dirty"&&t.dirty(),a(o.value).then(()=>({status:t.value,value:o.value}))))}if(s.type==="transform")if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Oe(a))return a;const o=s.transform(a.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>Oe(a)?Promise.resolve(s.transform(a.value,i)).then(o=>({status:t.value,value:o})):a);S.assertNever(s)}}Y.create=(n,e,t)=>new Y({schema:n,typeName:b.ZodEffects,effect:e,..._(t)});Y.createWithPreprocess=(n,e,t)=>new Y({schema:e,effect:{type:"preprocess",transform:n},typeName:b.ZodEffects,..._(t)});class X extends O{_parse(e){return this._getType(e)===y.undefined?W(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}X.create=(n,e)=>new X({innerType:n,typeName:b.ZodOptional,..._(e)});class me extends O{_parse(e){return this._getType(e)===y.null?W(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}me.create=(n,e)=>new me({innerType:n,typeName:b.ZodNullable,..._(e)});class ot extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===y.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ot.create=(n,e)=>new ot({innerType:n,typeName:b.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,..._(e)});class ut extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Xe(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new z(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new z(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ut.create=(n,e)=>new ut({innerType:n,typeName:b.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,..._(e)});class Nt extends O{_parse(e){if(this._getType(e)!==y.nan){const r=this._getOrReturnCtx(e);return m(r,{code:f.invalid_type,expected:y.nan,received:r.parsedType}),x}return{status:"valid",value:e.data}}}Nt.create=n=>new Nt({typeName:b.ZodNaN,..._(n)});const ls=Symbol("zod_brand");class en extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class ht extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?x:i.status==="dirty"?(t.dirty(),Ee(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?x:s.status==="dirty"?(t.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(e,t){return new ht({in:e,out:t,typeName:b.ZodPipeline})}}class ct extends O{_parse(e){const t=this._def.innerType._parse(e),r=s=>(Oe(s)&&(s.value=Object.freeze(s.value)),s);return Xe(t)?t.then(s=>r(s)):r(t)}unwrap(){return this._def.innerType}}ct.create=(n,e)=>new ct({innerType:n,typeName:b.ZodReadonly,..._(e)});function vn(n,e){const t=typeof n=="function"?n(e):typeof n=="string"?{message:n}:n;return typeof t=="string"?{message:t}:t}function zn(n,e={},t){return n?Me.create().superRefine((r,s)=>{var i,a;const o=n(r);if(o instanceof Promise)return o.then(c=>{var l,p;if(!c){const g=vn(e,r),j=(p=(l=g.fatal)!==null&&l!==void 0?l:t)!==null&&p!==void 0?p:!0;s.addIssue({code:"custom",...g,fatal:j})}});if(!o){const c=vn(e,r),l=(a=(i=c.fatal)!==null&&i!==void 0?i:t)!==null&&a!==void 0?a:!0;s.addIssue({code:"custom",...c,fatal:l})}}):Me.create()}const ds={object:M.lazycreate};var b;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(b||(b={}));const hs=(n,e={message:`Input not instance of ${n.name}`})=>zn(t=>t instanceof n,e),Vn=q.create,qn=he.create,fs=Nt.create,ps=fe.create,Fn=Ke.create,ms=Se.create,gs=Tt.create,ys=Qe.create,vs=et.create,ws=Me.create,bs=be.create,xs=ae.create,_s=Ot.create,Ts=F.create,Os=M.create,Ss=M.strictCreate,Ns=tt.create,Is=At.create,ks=nt.create,As=Q.create,Es=rt.create,$s=St.create,Cs=Ne.create,Ms=$e.create,Rs=st.create,js=it.create,Zs=pe.create,Bs=at.create,Ds=Re.create,wn=Y.create,Us=X.create,Ps=me.create,Ls=Y.createWithPreprocess,Ws=ht.create,zs=()=>Vn().optional(),Vs=()=>qn().optional(),qs=()=>Fn().optional(),Fs={string:n=>q.create({...n,coerce:!0}),number:n=>he.create({...n,coerce:!0}),boolean:n=>Ke.create({...n,coerce:!0}),bigint:n=>fe.create({...n,coerce:!0}),date:n=>Se.create({...n,coerce:!0})},Ys=x;var u=Object.freeze({__proto__:null,defaultErrorMap:Ce,setErrorMap:Lr,getErrorMap:bt,makeIssue:xt,EMPTY_PATH:Wr,addIssueToContext:m,ParseStatus:P,INVALID:x,DIRTY:Ee,OK:W,isAborted:Lt,isDirty:Wt,isValid:Oe,isAsync:Xe,get util(){return S},get objectUtil(){return Pt},ZodParsedType:y,getParsedType:se,ZodType:O,datetimeRegex:Ln,ZodString:q,ZodNumber:he,ZodBigInt:fe,ZodBoolean:Ke,ZodDate:Se,ZodSymbol:Tt,ZodUndefined:Qe,ZodNull:et,ZodAny:Me,ZodUnknown:be,ZodNever:ae,ZodVoid:Ot,ZodArray:F,ZodObject:M,ZodUnion:tt,ZodDiscriminatedUnion:At,ZodIntersection:nt,ZodTuple:Q,ZodRecord:rt,ZodMap:St,ZodSet:Ne,ZodFunction:$e,ZodLazy:st,ZodLiteral:it,ZodEnum:pe,ZodNativeEnum:at,ZodPromise:Re,ZodEffects:Y,ZodTransformer:Y,ZodOptional:X,ZodNullable:me,ZodDefault:ot,ZodCatch:ut,ZodNaN:Nt,BRAND:ls,ZodBranded:en,ZodPipeline:ht,ZodReadonly:ct,custom:zn,Schema:O,ZodSchema:O,late:ds,get ZodFirstPartyTypeKind(){return b},coerce:Fs,any:ws,array:Ts,bigint:ps,boolean:Fn,date:ms,discriminatedUnion:Is,effect:wn,enum:Zs,function:Ms,instanceof:hs,intersection:ks,lazy:Rs,literal:js,map:$s,nan:fs,nativeEnum:Bs,never:xs,null:vs,nullable:Ps,number:qn,object:Os,oboolean:qs,onumber:Vs,optional:Us,ostring:zs,pipeline:Ws,preprocess:Ls,promise:Ds,record:Es,set:Cs,strictObject:Ss,string:Vn,symbol:gs,transformer:wn,tuple:As,undefined:ys,union:Ns,unknown:bs,void:_s,NEVER:Ys,ZodIssueCode:f,quotelessJson:Pr,ZodError:z});const Gs=n=>n!=null&&typeof n=="object"&&"toString"in n,Js=(n,e=!1)=>{const t=Gs(n)?"stringer":typeof n;let r;switch(t){case"string":r=(s,i)=>s.localeCompare(i);break;case"stringer":r=(s,i)=>s.toString().localeCompare(i.toString());break;case"number":r=(s,i)=>Number(s)-Number(i);break;case"bigint":r=(s,i)=>BigInt(s)-BigInt(i)>0n?1:-1;break;case"boolean":r=(s,i)=>Number(s)-Number(i);break;case"undefined":r=()=>0;break;default:return console.warn(`sortFunc: unknown type ${t}`),()=>-1}return e?Hs(r):r},Hs=n=>(e,t)=>n(t,e),Et=u.tuple([u.number(),u.number()]);u.tuple([u.bigint(),u.bigint()]);const tn=u.object({width:u.number(),height:u.number()}),Xs=u.object({signedWidth:u.number(),signedHeight:u.number()}),Ks=["width","height"];u.enum(Ks);const Qs=["start","center","end"],ei=["signedWidth","signedHeight"];u.enum(ei);const lt=u.object({x:u.number(),y:u.number()}),Yn=u.object({clientX:u.number(),clientY:u.number()}),Gn=["x","y"],Jn=u.enum(Gn),Hn=["top","right","bottom","left"];u.enum(Hn);const nn=["left","right"],Xn=u.enum(nn),rn=["top","bottom"],Kn=u.enum(rn),Qn=["center"],bn=u.enum(Qn),ti=[...Hn,...Qn],er=u.enum(ti);u.enum(Qs);const ni=["first","last"];u.enum(ni);const ri=u.object({lower:u.number(),upper:u.number()}),si=u.object({lower:u.bigint(),upper:u.bigint()});u.union([ri,Et]);u.union([si,Et]);u.enum([...Jn.options,...er.options]);u.union([Jn,er,u.instanceof(String)]);const ii=n=>typeof n=="bigint"||n instanceof BigInt,ke=(n,e)=>ii(n)?n.valueOf()*BigInt(e.valueOf()):n.valueOf()*Number(e.valueOf()),xe=(n,e)=>{const t={};if(typeof n=="number"||typeof n=="bigint")e!=null?(t.lower=n,t.upper=e):(t.lower=typeof n=="bigint"?0n:0,t.upper=n);else if(Array.isArray(n)){if(n.length!==2)throw new Error("bounds: expected array of length 2");[t.lower,t.upper]=n}else return xn(n);return xn(t)},xn=n=>n.lower>n.upper?{lower:n.upper,upper:n.lower}:n,_n=(n,e)=>{const t=xe(n);return e<t.lower?t.lower:e>=t.upper?t.upper-(typeof t.upper=="number"?1:1n):e},sn=n=>Gn.includes(n)?n:rn.includes(n)?"y":"x";u.object({x:Xn.or(bn),y:Kn.or(bn)});const ai=u.object({x:Xn,y:Kn}),an=Object.freeze({x:"left",y:"top"}),oi=Object.freeze({x:"right",y:"top"}),tr=Object.freeze({x:"left",y:"bottom"}),ui=Object.freeze({x:"right",y:"bottom"}),ci=Object.freeze({x:"center",y:"top"}),li=Object.freeze({x:"center",y:"bottom"}),di=Object.freeze({x:"right",y:"center"}),hi=Object.freeze({x:"left",y:"center"}),nr=(n,e)=>n.x===e.x&&n.y===e.y,fi=n=>[n.x,n.y],Vt=u.union([u.number(),lt,Et,tn,Xs,Yn]),E=(n,e)=>{if(typeof n=="string"){if(e===void 0)throw new Error("The y coordinate must be given.");return n==="x"?{x:e,y:0}:{x:0,y:e}}return typeof n=="number"?{x:n,y:e??n}:Array.isArray(n)?{x:n[0],y:n[1]}:"signedWidth"in n?{x:n.signedWidth,y:n.signedHeight}:"clientX"in n?{x:n.clientX,y:n.clientY}:"width"in n?{x:n.width,y:n.height}:{x:n.x,y:n.y}},ee=Object.freeze({x:0,y:0}),rr=Object.freeze({x:1,y:1}),pi=Object.freeze({x:1/0,y:1/0}),mi=Object.freeze({x:NaN,y:NaN}),It=(n,e,t=0)=>{const r=E(n),s=E(e);return t===0?r.x===s.x&&r.y===s.y:Math.abs(r.x-s.x)<=t&&Math.abs(r.y-s.y)<=t},gi=n=>It(n,ee),on=(n,e,t)=>{const r=E(n),s=E(e,t);return{x:r.x*s.x,y:r.y*s.y}},sr=(n,e)=>{const t=E(n);return{x:t.x+e,y:t.y}},ir=(n,e)=>{const t=E(n);return{x:t.x,y:t.y+e}},dt=(n,e,t,...r)=>typeof e=="string"&&typeof t=="number"?e==="x"?sr(n,t):ir(n,t):[n,e,t??ee,...r].reduce((s,i)=>{const a=E(i);return{x:s.x+a.x,y:s.y+a.y}},ee),yi=(n,e,t)=>{const r=E(n);return e==="x"?{x:t,y:r.y}:{x:r.x,y:t}},vi=(n,e)=>{const t=E(n),r=E(e);return Math.sqrt((t.x-r.x)**2+(t.y-r.y)**2)},wi=(n,e)=>{const t=E(n),r=E(e);return{x:r.x-t.x,y:r.y-t.y}},bi=n=>{const e=E(n);return Number.isNaN(e.x)||Number.isNaN(e.y)},xi=n=>{const e=E(n);return Number.isFinite(e.x)&&Number.isFinite(e.y)},_i=n=>{const e=E(n);return[e.x,e.y]},Ti=n=>{const e=E(n);return{left:e.x,top:e.y}},qt=(n,e=0)=>{const t=E(n);return{x:Number(t.x.toFixed(e)),y:Number(t.y.toFixed(e))}},Ue=(n,e)=>{const t=E(n),r=E(e);return{x:t.x-r.x,y:t.y-r.y}},Pe=n=>{const e=E(n),t=Math.hypot(e.x,e.y);return t===0?{x:0,y:0}:{x:-e.y/t,y:e.x/t}},ar=n=>{const e=E(n),t=Math.hypot(e.x,e.y);return t===0?{x:0,y:0}:{x:e.x/t,y:e.y/t}},or=(...n)=>{const e=n.reduce((t,r)=>dt(t,r),ee);return on(e,1/n.length)},Oi=(n,e)=>{const t=[];for(let r=0;r<n.length;r++){const s=n[r];let i,a,o,c;if(r===0){const l=n[r+1],p=Ue(l,s);a=Pe(p),o=a,c=e}else if(r===n.length-1){const l=n[r-1],p=Ue(s,l);i=Pe(p),o=i,c=e}else{const l=n[r-1],p=n[r+1],g=Ue(s,l),j=Ue(p,s);i=Pe(g),a=Pe(j);const D=Math.acos((g.x*j.x+g.y*j.y)/(Math.hypot(g.x,g.y)*Math.hypot(j.x,j.y))),je=Math.sin(D/2);je===0?c=e:c=e/je,o=ar(or(i,a))}t.push(on(o,c))}return t},Si=n=>{const e=E(n);return{x:e.y,y:e.x}},kt=Object.freeze(Object.defineProperty({__proto__:null,INFINITY:pi,NAN:mi,ONE:rr,ZERO:ee,average:or,calculateMiters:Oi,clientXY:Yn,construct:E,couple:_i,crudeZ:Vt,css:Ti,distance:vi,equals:It,isFinite:xi,isNan:bi,isZero:gi,normal:Pe,normalize:ar,scale:on,set:yi,sub:Ue,swap:Si,translate:dt,translateX:sr,translateY:ir,translation:wi,truncate:qt,xy:lt},Symbol.toStringTag,{value:"Module"})),ft=u.union([u.number(),u.string()]),Ni=u.object({top:ft,left:ft,width:ft,height:ft}),Ii=u.object({left:u.number(),top:u.number(),right:u.number(),bottom:u.number()}),ki=u.object({one:lt,two:lt,root:ai}),ur={one:ee,two:ee,root:an},Ai={one:ee,two:rr,root:tr},cr=(n,e)=>({one:n.one,two:n.two,root:e??n.root}),C=(n,e,t=0,r=0,s)=>{const i={one:{...ee},two:{...ee},root:s??an};if(typeof n=="number"){if(typeof e!="number")throw new Error("Box constructor called with invalid arguments");return i.one={x:n,y:e},i.two={x:i.one.x+t,y:i.one.y+r},i}return"one"in n&&"two"in n&&"root"in n?{...n,root:s??n.root}:("getBoundingClientRect"in n&&(n=n.getBoundingClientRect()),"left"in n?(i.one={x:n.left,y:n.top},i.two={x:n.right,y:n.bottom},i):(i.one=n,e==null?i.two={x:i.one.x+t,y:i.one.y+r}:typeof e=="number"?i.two={x:i.one.x+e,y:i.one.y+t}:"width"in e?i.two={x:i.one.x+e.width,y:i.one.y+e.height}:"signedWidth"in e?i.two={x:i.one.x+e.signedWidth,y:i.one.y+e.signedHeight}:i.two=e,i))},Ei=(n,e,t)=>{const r=C(n);if(typeof e=="string"){if(t==null)throw new Error("Invalid arguments for resize");const s=sn(e);return C(r.one,void 0,s==="x"?t:ge(r),s==="y"?t:ye(r),r.root)}return C(r.one,e,void 0,void 0,r.root)},$i=(n,e,t=!0)=>{const r=C(n);let s=(i,a)=>i<a;return t&&(s=(i,a)=>i<=a),"one"in e?s(le(r),le(e))&&s(_e(e),_e(r))&&s(de(r),de(e))&&s(Te(e),Te(r)):s(le(r),e.x)&&s(e.x,_e(r))&&s(de(r),e.y)&&s(e.y,Te(r))},Ci=(n,e)=>It(n.one,e.one)&&It(n.two,e.two)&&nr(n.root,e.root),lr=n=>({width:ge(n),height:ye(n)}),Mi=n=>({signedWidth:$t(n),signedHeight:Ct(n)}),Ri=n=>({top:de(n),left:le(n),width:ge(n),height:ye(n)}),un=(n,e,t=!1)=>{const r=sn(e)==="y"?Ct(n):$t(n);return t?r:Math.abs(r)},oe=(n,e)=>{const t=C(n);return{x:e.x==="center"?Ft(t).x:Ie(t,e.x),y:e.y==="center"?Ft(t).y:Ie(t,e.y)}},Ie=(n,e)=>{const t=C(n),r=fi(t.root).includes(e)?Math.min:Math.max;return nn.includes(e)?r(t.one.x,t.two.x):r(t.one.y,t.two.y)},ji=n=>n.one.x===n.two.x&&n.one.y===n.two.y,ge=n=>un(n,"x"),ye=n=>un(n,"y"),$t=n=>{const e=C(n);return e.two.x-e.one.x},Ct=n=>{const e=C(n);return e.two.y-e.one.y},dr=n=>oe(n,an),Zi=n=>oe(n,ci),Bi=n=>oe(n,oi),Di=n=>oe(n,tr),Ui=n=>oe(n,li),Pi=n=>oe(n,ui),Li=n=>oe(n,hi),Wi=n=>oe(n,di),_e=n=>Ie(n,"right"),Te=n=>Ie(n,"bottom"),le=n=>Ie(n,"left"),de=n=>Ie(n,"top"),Ft=n=>dt(dr(n),{x:$t(n)/2,y:Ct(n)/2}),cn=n=>{const e=C(n);return e.root.x==="left"?le(e):_e(e)},ln=n=>{const e=C(n);return e.root.y==="top"?de(e):Te(e)},zi=n=>({x:cn(n),y:ln(n)}),mt=n=>{const e=C(n);return{lower:e.one.x,upper:e.two.x}},gt=n=>{const e=C(n);return{lower:e.one.y,upper:e.two.y}},Vi=(n,e)=>cr(n,e),qi=(n,e)=>{const t=C(n),r=nn.includes(e)?"x":rn.includes(e)?"y":null;if(r===null)throw new Error(`Invalid location: ${e}`);const s=e==="top"||e==="left"?Math.min:Math.max,i={...t.one},a={...t.two};return i[r]=s(t.one[r],t.two[r]),a[r]=s(t.one[r],t.two[r]),[i,a]},Fi=(n,e)=>{const t=C(n),r=C(e),s=cn(r)+(ge(r)-ge(t))/2,i=ln(r)+(ye(r)-ye(t))/2;return C({x:s,y:i},lr(t))},hr=n=>typeof n!="object"||n==null?!1:"one"in n&&"two"in n&&"root"in n,Yi=n=>ge(n)/ye(n),Gi=(n,e,t)=>{if(typeof e=="string"){if(t==null)throw new Error("Undefined amount passed into box.translate");const s=sn(e);e=E(s,t)}const r=C(n);return C(dt(r.one,e),dt(r.two,e),void 0,void 0,r.root)},Ji=(n,e)=>{const t=Math.max(le(n),le(e)),r=Math.max(de(n),de(e)),s=Math.min(_e(n),_e(e)),i=Math.min(Te(n),Te(e));return t>s||r>i?ur:C({x:t,y:r},{x:s,y:i},void 0,void 0,n.root)},Hi=n=>ge(n)*ye(n),Xi=(n,e)=>{const t=C(n);return C(qt(t.one,e),qt(t.two,e),void 0,void 0,t.root)},Ki=(n,e,t,r,s,i)=>{const a={x:n,y:e},o={x:n+t,y:e+r};return s.x!==i.x&&(s.x==="center"?(a.x-=t/2,o.x-=t/2):(a.x-=t,o.x-=t)),s.y!==i.y&&(s.y==="center"?(a.y-=r/2,o.y-=r/2):(a.y-=r,o.y-=r)),C(a,o,void 0,void 0,i)},Le=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:Ai,ZERO:ur,area:Hi,areaIsZero:ji,aspect:Yi,bottom:Te,bottomCenter:Ui,bottomLeft:Di,bottomRight:Pi,box:ki,center:Ft,centerLeft:Li,centerRight:Wi,construct:C,constructWithAlternateRoot:Ki,contains:$i,copy:cr,css:Ri,cssBox:Ni,dim:un,dims:lr,domRect:Ii,edgePoints:qi,equals:Ci,height:ye,intersection:Ji,isBox:hr,left:le,loc:Ie,positionInCenter:Fi,reRoot:Vi,resize:Ei,right:_e,root:zi,signedDims:Mi,signedHeight:Ct,signedWidth:$t,top:de,topCenter:Zi,topLeft:dr,topRight:Bi,translate:Gi,truncate:Xi,width:ge,x:cn,xBounds:mt,xyLoc:oe,y:ln,yBounds:gt},Symbol.toStringTag,{value:"Module"})),fr=u.object({signedWidth:u.number(),signedHeight:u.number()}),Qi=u.union([tn,fr,lt,Et]),ea={width:0,height:0},ta={width:1,height:1},G=(n,e)=>typeof n=="number"?{width:n,height:e??n}:Array.isArray(n)?{width:n[0],height:n[1]}:"x"in n?{width:n.x,height:n.y}:"signedWidth"in n?{width:n.signedWidth,height:n.signedHeight}:{...n},na=(n,e)=>{if(e==null)return!1;const t=G(n),r=G(e);return t.width===r.width&&t.height===r.height},ra=n=>{const e=G(n);return{width:e.height,height:e.width}},sa=n=>{const e=G(n);return`0 0 ${e.width} ${e.height}`},ia=n=>{const e=G(n);return[e.width,e.height]},aa=n=>({width:Math.max(...n.map(e=>G(e).width)),height:Math.max(...n.map(e=>G(e).height))}),oa=n=>({width:Math.min(...n.map(e=>G(e).width)),height:Math.min(...n.map(e=>G(e).height))}),ua=(n,e)=>{const t=G(n);return{width:t.width*e,height:t.height*e}},yt=Object.freeze(Object.defineProperty({__proto__:null,DECIMAL:ta,ZERO:ea,construct:G,couple:ia,crude:Qi,dimensions:tn,equals:na,max:aa,min:oa,scale:ua,signed:fr,svgViewBox:sa,swap:ra},Symbol.toStringTag,{value:"Module"}));var ca=Object.defineProperty,la=(n,e,t)=>e in n?ca(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ie=(n,e,t)=>la(n,typeof e!="symbol"?e+"":e,t);const da=(n,e,t)=>e!==void 0&&n<e?e:t!==void 0&&n>t?t:n;u.object({offset:Vt,scale:Vt});u.object({offset:u.number(),scale:u.number()});const ha=n=>(e,t,r,s)=>t==="dimension"?[e,r]:[e,s?r-n:r+n],fa=n=>(e,t,r,s)=>[e,s?r/n:r*n],pa=n=>(e,t,r)=>{if(e===null)return[n,r];const{lower:s,upper:i}=e,{lower:a,upper:o}=n,c=i-s,l=o-a;if(t==="dimension")return[n,r*(l/c)];const p=(r-s)*(l/c)+a;return[n,p]},ma=n=>(e,t,r)=>[n,r],ga=()=>(n,e,t)=>{if(n===null)throw new Error("cannot invert without bounds");if(e==="dimension")return[n,t];const{lower:r,upper:s}=n;return[n,s-(t-r)]},ya=n=>(e,t,r)=>{const{lower:s,upper:i}=n;return r=da(r,s,i),[e,r]},Yt=class We{constructor(){ie(this,"ops",[]),ie(this,"currBounds",null),ie(this,"currType",null),ie(this,"reversed",!1),this.ops=[]}static translate(e){return new We().translate(e)}static magnify(e){return new We().magnify(e)}static scale(e,t){return new We().scale(e,t)}translate(e){const t=this.new(),r=ha(e);return r.type="translate",t.ops.push(r),t}magnify(e){const t=this.new(),r=fa(e);return r.type="magnify",t.ops.push(r),t}scale(e,t){const r=xe(e,t),s=this.new(),i=pa(r);return i.type="scale",s.ops.push(i),s}clamp(e,t){const r=xe(e,t),s=this.new(),i=ya(r);return i.type="clamp",s.ops.push(i),s}reBound(e,t){const r=xe(e,t),s=this.new(),i=ma(r);return i.type="re-bound",s.ops.push(i),s}invert(){const e=ga();e.type="invert";const t=this.new();return t.ops.push(e),t}pos(e){return this.exec("position",e)}dim(e){return this.exec("dimension",e)}new(){const e=new We;return e.ops=this.ops.slice(),e.reversed=this.reversed,e}exec(e,t){return this.currBounds=null,this.ops.reduce(([r,s],i)=>i(r,e,s,this.reversed),[null,t])[1]}reverse(){const e=this.new();e.ops.reverse();const t=[];return e.ops.forEach((r,s)=>{if(r.type==="scale"||t.some(([a,o])=>s>=a&&s<=o))return;const i=e.ops.findIndex((a,o)=>a.type==="scale"&&o>s);i!==-1&&t.push([s,i])}),t.forEach(([r,s])=>{const i=e.ops.slice(r,s);i.unshift(e.ops[s]),e.ops.splice(r,s-r+1,...i)}),e.reversed=!e.reversed,e}get transform(){return{scale:this.dim(1),offset:this.pos(0)}}};ie(Yt,"IDENTITY",new Yt);let Tn=Yt;const On=class re{constructor(e=new Tn,t=new Tn,r=null){ie(this,"x"),ie(this,"y"),ie(this,"currRoot"),this.x=e,this.y=t,this.currRoot=r}static translate(e,t){return new re().translate(e,t)}static translateX(e){return new re().translateX(e)}static translateY(e){return new re().translateY(e)}static clamp(e){return new re().clamp(e)}static magnify(e){return new re().magnify(e)}static scale(e){return new re().scale(e)}static reBound(e){return new re().reBound(e)}translate(e,t){const r=E(e,t),s=this.copy();return s.x=this.x.translate(r.x),s.y=this.y.translate(r.y),s}translateX(e){const t=this.copy();return t.x=this.x.translate(e),t}translateY(e){const t=this.copy();return t.y=this.y.translate(e),t}magnify(e){const t=this.copy();return t.x=this.x.magnify(e.x),t.y=this.y.magnify(e.y),t}scale(e){const t=this.copy();if(hr(e)){const r=this.currRoot;return t.currRoot=e.root,r!=null&&!nr(r,e.root)&&(r.x!==e.root.x&&(t.x=t.x.invert()),r.y!==e.root.y&&(t.y=t.y.invert())),t.x=t.x.scale(mt(e)),t.y=t.y.scale(gt(e)),t}return t.x=t.x.scale(e.width),t.y=t.y.scale(e.height),t}reBound(e){const t=this.copy();return t.x=this.x.reBound(mt(e)),t.y=this.y.reBound(gt(e)),t}clamp(e){const t=this.copy();return t.x=this.x.clamp(mt(e)),t.y=this.y.clamp(gt(e)),t}copy(){const e=new re;return e.currRoot=this.currRoot,e.x=this.x,e.y=this.y,e}reverse(){const e=this.copy();return e.x=this.x.reverse(),e.y=this.y.reverse(),e}pos(e){return{x:this.x.pos(e.x),y:this.y.pos(e.y)}}dim(e){return{x:this.x.dim(e.x),y:this.y.dim(e.y)}}box(e){return C(this.pos(e.one),this.pos(e.two),0,0,this.currRoot??e.root)}get transform(){return{scale:this.dim({x:1,y:1}),offset:this.pos({x:0,y:0})}}};ie(On,"IDENTITY",new On);var va=Object.defineProperty,wa=(n,e,t)=>e in n?va(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,h=(n,e,t)=>wa(n,typeof e!="symbol"?e+"":e,t);let ba=(n,e=21)=>(t=e)=>{let r="",s=t|0;for(;s--;)r+=n[Math.random()*n.length|0];return r};const xa="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",_a=ba(xa,11),pr=()=>_a(),Gt=Object.freeze(Object.defineProperty({__proto__:null,create:pr},Symbol.toStringTag,{value:"Module"})),Ta=u.enum(["static","dynamic"]),mr=(n,e)=>{const t=new $(e);if(![A.DAY,A.HOUR,A.MINUTE,A.SECOND,A.MILLISECOND,A.MICROSECOND,A.NANOSECOND].some(s=>s.equals(t)))throw new Error("Invalid argument for remainder. Must be an even TimeSpan or Timestamp");const r=n.valueOf()%t.valueOf();return n instanceof $?new $(r):new A(r)},N=class w{constructor(e,t="UTC"){if(h(this,"value"),h(this,"encodeValue",!0),e==null)this.value=w.now().valueOf();else if(e instanceof Date)this.value=BigInt(e.getTime())*w.MILLISECOND.valueOf();else if(typeof e=="string")this.value=w.parseDateTimeString(e,t).valueOf();else if(Array.isArray(e))this.value=w.parseDate(e);else{let r=BigInt(0);e instanceof Number&&(e=e.valueOf()),t==="local"&&(r=w.utcOffset.valueOf()),typeof e=="number"&&(isFinite(e)?e=Math.trunc(e):(isNaN(e)&&(e=0),e===1/0?e=w.MAX:e=w.MIN)),this.value=BigInt(e.valueOf())+r}}static parseDate([e=1970,t=1,r=1]){const s=new Date(e,t-1,r,0,0,0,0);return new w(BigInt(s.getTime())*w.MILLISECOND.valueOf()).truncate(w.DAY).valueOf()}encode(){return this.value.toString()}valueOf(){return this.value}static parseTimeString(e,t="UTC"){const[r,s,i]=e.split(":");let a="00",o="00";i!=null&&([a,o]=i.split("."));let c=w.hours(parseInt(r??"00")).add(w.minutes(parseInt(s??"00"))).add(w.seconds(parseInt(a??"00"))).add(w.milliseconds(parseInt(o??"00")));return t==="local"&&(c=c.add(w.utcOffset)),c.valueOf()}static parseDateTimeString(e,t="UTC"){if(!e.includes("/")&&!e.includes("-"))return w.parseTimeString(e,t);const r=new Date(e);return e.includes(":")||r.setUTCHours(0,0,0,0),new w(BigInt(r.getTime())*w.MILLISECOND.valueOf(),t).valueOf()}fString(e="ISO",t="UTC"){switch(e){case"ISODate":return this.toISOString(t).slice(0,10);case"ISOTime":return this.toISOString(t).slice(11,23);case"time":return this.timeString(!1,t);case"preciseTime":return this.timeString(!0,t);case"date":return this.dateString();case"preciseDate":return`${this.dateString()} ${this.timeString(!0,t)}`;case"dateTime":return`${this.dateString()} ${this.timeString(!1,t)}`;default:return this.toISOString(t)}}toISOString(e="UTC"){return e==="UTC"?this.date().toISOString():this.sub(w.utcOffset).date().toISOString()}timeString(e=!1,t="UTC"){const r=this.toISOString(t);return e?r.slice(11,23):r.slice(11,19)}dateString(){const e=this.date(),t=e.toLocaleString("default",{month:"short"}),r=e.toLocaleString("default",{day:"numeric"});return`${t} ${r}`}static get utcOffset(){return new A(BigInt(new Date().getTimezoneOffset())*w.MINUTE.valueOf())}static since(e){return new w().span(e)}date(){return new Date(this.milliseconds)}equals(e){return this.valueOf()===new w(e).valueOf()}span(e){return this.range(e).span}range(e){return new dn(this,e).makeValid()}spanRange(e){return this.range(this.add(e)).makeValid()}get isZero(){return this.valueOf()===BigInt(0)}after(e){return this.valueOf()>new w(e).valueOf()}afterEq(e){return this.valueOf()>=new w(e).valueOf()}before(e){return this.valueOf()<new w(e).valueOf()}beforeEq(e){return this.valueOf()<=new w(e).valueOf()}add(e){return new w(this.valueOf()+BigInt(e.valueOf()))}sub(e){return new w(this.valueOf()-BigInt(e.valueOf()))}get hours(){return Number(this.valueOf())/Number(A.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(A.MINUTE.valueOf())}get days(){return Number(this.valueOf())/Number(A.DAY.valueOf())}get seconds(){return Number(this.valueOf())/Number(A.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(w.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(w.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get year(){return this.date().getFullYear()}setYear(e){const t=this.date();return t.setFullYear(e),new w(t)}get month(){return this.date().getMonth()}setMonth(e){const t=this.date();return t.setMonth(e),new w(t)}get day(){return this.date().getDate()}setDay(e){const t=this.date();return t.setDate(e),new w(t)}get hour(){return this.date().getHours()}setHour(e){const t=this.date();return t.setHours(e),new w(t)}get minute(){return this.date().getMinutes()}setMinute(e){const t=this.date();return t.setMinutes(e),new w(t)}get second(){return this.date().getSeconds()}setSecond(e){const t=this.date();return t.setSeconds(e),new w(t)}get millisecond(){return this.date().getMilliseconds()}setMillisecond(e){const t=this.date();return t.setMilliseconds(e),new w(t)}toString(){return this.date().toISOString()}remainder(e){return mr(this,e)}get isToday(){return this.truncate(A.DAY).equals(w.now().truncate(A.DAY))}truncate(e){return this.sub(this.remainder(e))}static now(){return new w(new Date)}static max(...e){let t=w.MIN;for(const r of e){const s=new w(r);s.after(t)&&(t=s)}return t}static min(...e){let t=w.MAX;for(const r of e){const s=new w(r);s.before(t)&&(t=s)}return t}static nanoseconds(e){return new w(e)}static microseconds(e){return w.nanoseconds(e*1e3)}static milliseconds(e){return w.microseconds(e*1e3)}static seconds(e){return w.milliseconds(e*1e3)}static minutes(e){return w.seconds(e*60)}static hours(e){return w.minutes(e*60)}static days(e){return w.hours(e*24)}};h(N,"NANOSECOND",N.nanoseconds(1)),h(N,"MICROSECOND",N.microseconds(1)),h(N,"MILLISECOND",N.milliseconds(1)),h(N,"SECOND",N.seconds(1)),h(N,"MINUTE",N.minutes(1)),h(N,"HOUR",N.hours(1)),h(N,"DAY",N.days(1)),h(N,"MAX",new N((1n<<63n)-1n)),h(N,"MIN",new N(0)),h(N,"ZERO",new N(0)),h(N,"z",u.union([u.object({value:u.bigint()}).transform(n=>new N(n.value)),u.string().transform(n=>new N(BigInt(n))),u.instanceof(Number).transform(n=>new N(n)),u.number().transform(n=>new N(n)),u.instanceof(N)]));let $=N;const I=class T{constructor(e){h(this,"value"),h(this,"encodeValue",!0),typeof e=="number"&&(e=Math.trunc(e.valueOf())),this.value=BigInt(e.valueOf())}static fromSeconds(e){return e instanceof T?e:e instanceof Sn?e.period:e instanceof $?new T(e):["number","bigint"].includes(typeof e)?T.seconds(e):new T(e)}static fromMilliseconds(e){return e instanceof T?e:e instanceof Sn?e.period:e instanceof $?new T(e):["number","bigint"].includes(typeof e)?T.milliseconds(e):new T(e)}encode(){return this.value.toString()}valueOf(){return this.value}lessThan(e){return this.valueOf()<new T(e).valueOf()}greaterThan(e){return this.valueOf()>new T(e).valueOf()}lessThanOrEqual(e){return this.valueOf()<=new T(e).valueOf()}greaterThanOrEqual(e){return this.valueOf()>=new T(e).valueOf()}remainder(e){return mr(this,e)}truncate(e){return new T(BigInt(Math.trunc(Number(this.valueOf()/e.valueOf())))*e.valueOf())}toString(){const e=this.truncate(T.DAY),t=this.truncate(T.HOUR),r=this.truncate(T.MINUTE),s=this.truncate(T.SECOND),i=this.truncate(T.MILLISECOND),a=this.truncate(T.MICROSECOND),o=this.truncate(T.NANOSECOND),c=e,l=t.sub(e),p=r.sub(t),g=s.sub(r),j=i.sub(s),D=a.sub(i),je=o.sub(a);let ue="";return c.isZero||(ue+=`${c.days}d `),l.isZero||(ue+=`${l.hours}h `),p.isZero||(ue+=`${p.minutes}m `),g.isZero||(ue+=`${g.seconds}s `),j.isZero||(ue+=`${j.milliseconds}ms `),D.isZero||(ue+=`${D.microseconds}µs `),je.isZero||(ue+=`${je.nanoseconds}ns`),ue.trim()}mult(e){return new T(this.valueOf()*BigInt(e))}get days(){return Number(this.valueOf())/Number(T.DAY.valueOf())}get hours(){return Number(this.valueOf())/Number(T.HOUR.valueOf())}get minutes(){return Number(this.valueOf())/Number(T.MINUTE.valueOf())}get seconds(){return Number(this.valueOf())/Number(T.SECOND.valueOf())}get milliseconds(){return Number(this.valueOf())/Number(T.MILLISECOND.valueOf())}get microseconds(){return Number(this.valueOf())/Number(T.MICROSECOND.valueOf())}get nanoseconds(){return Number(this.valueOf())}get isZero(){return this.valueOf()===BigInt(0)}equals(e){return this.valueOf()===new T(e).valueOf()}add(e){return new T(this.valueOf()+new T(e).valueOf())}sub(e){return new T(this.valueOf()-new T(e).valueOf())}static nanoseconds(e=1){return new T(e)}static microseconds(e=1){return T.nanoseconds(ke(e,1e3))}static milliseconds(e=1){return T.microseconds(ke(e,1e3))}static seconds(e=1){return T.milliseconds(ke(e,1e3))}static minutes(e=1){return T.seconds(ke(e,60))}static hours(e){return T.minutes(ke(e,60))}static days(e){return T.hours(ke(e,24))}};h(I,"NANOSECOND",I.nanoseconds(1)),h(I,"MICROSECOND",I.microseconds(1)),h(I,"MILLISECOND",I.milliseconds(1)),h(I,"SECOND",I.seconds(1)),h(I,"MINUTE",I.minutes(1)),h(I,"HOUR",I.hours(1)),h(I,"DAY",I.days(1)),h(I,"MAX",new I((1n<<63n)-1n)),h(I,"MIN",new I(0)),h(I,"ZERO",new I(0)),h(I,"z",u.union([u.object({value:u.bigint()}).transform(n=>new I(n.value)),u.string().transform(n=>new I(BigInt(n))),u.instanceof(Number).transform(n=>new I(n)),u.number().transform(n=>new I(n)),u.instanceof(I)]));let A=I;const ze=class vt extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}toString(){return`${this.valueOf()} Hz`}equals(e){return this.valueOf()===new vt(e).valueOf()}get period(){return A.seconds(1/this.valueOf())}sampleCount(e){return new A(e).seconds*this.valueOf()}byteCount(e,t){return this.sampleCount(e)*new L(t).valueOf()}span(e){return A.seconds(e/this.valueOf())}byteSpan(e,t){return this.span(e.valueOf()/t.valueOf())}static hz(e){return new vt(e)}static khz(e){return vt.hz(e*1e3)}};h(ze,"z",u.union([u.number().transform(n=>new ze(n)),u.instanceof(Number).transform(n=>new ze(n)),u.instanceof(ze)]));let Sn=ze;const B=class extends Number{constructor(e){e instanceof Number?super(e.valueOf()):super(e)}length(e){return e.valueOf()/this.valueOf()}size(e){return new Jt(e*this.valueOf())}};h(B,"UNKNOWN",new B(0)),h(B,"BIT128",new B(16)),h(B,"BIT64",new B(8)),h(B,"BIT32",new B(4)),h(B,"BIT16",new B(2)),h(B,"BIT8",new B(1)),h(B,"z",u.union([u.number().transform(n=>new B(n)),u.instanceof(Number).transform(n=>new B(n)),u.instanceof(B)]));let L=B;const J=class wt{constructor(e,t){h(this,"start"),h(this,"end"),typeof e=="object"&&"start"in e?(this.start=new $(e.start),this.end=new $(e.end)):(this.start=new $(e),this.end=new $(t))}get span(){return new A(this.end.valueOf()-this.start.valueOf())}get isValid(){return this.start.valueOf()<=this.end.valueOf()}makeValid(){return this.isValid?this:this.swap()}get isZero(){return this.span.isZero}get numeric(){return{start:Number(this.start.valueOf()),end:Number(this.end.valueOf())}}swap(){return new wt(this.end,this.start)}equals(e){return this.start.equals(e.start)&&this.end.equals(e.end)}toString(){return`${this.start.toString()} - ${this.end.toString()}`}toPrettyString(){return`${this.start.fString("preciseDate")} - ${this.span.toString()}`}overlapsWith(e,t=A.ZERO){e=e.makeValid();const r=this.makeValid();if(this.equals(e))return!0;if(e.end.equals(r.start)||r.end.equals(e.start))return!1;const s=$.max(r.start,e.start),i=$.min(r.end,e.end);return i.before(s)?!1:new A(i.sub(s)).greaterThanOrEqual(t)}roughlyEquals(e,t){let r=this.start.sub(e.start).valueOf(),s=this.end.sub(e.end).valueOf();return r<0&&(r=-r),s<0&&(s=-s),r<=t.valueOf()&&s<=t.valueOf()}contains(e){return e instanceof wt?this.contains(e.start)&&this.contains(e.end):this.start.beforeEq(e)&&this.end.after(e)}boundBy(e){const t=new wt(this.start,this.end);return e.start.after(this.start)&&(t.start=e.start),e.start.after(this.end)&&(t.end=e.start),e.end.before(this.end)&&(t.end=e.end),e.end.before(this.start)&&(t.start=e.end),t}};h(J,"MAX",new J($.MIN,$.MAX)),h(J,"MIN",new J($.MAX,$.MIN)),h(J,"ZERO",new J($.ZERO,$.ZERO)),h(J,"z",u.union([u.object({start:$.z,end:$.z}).transform(n=>new J(n.start,n.end)),u.instanceof(J)]));let dn=J;const d=class R extends String{constructor(e){if(e instanceof R||typeof e=="string"||typeof e.valueOf()=="string"){super(e.valueOf());return}const t=R.ARRAY_CONSTRUCTOR_DATA_TYPES.get(e.constructor.name);if(t!=null){super(t.valueOf());return}throw super(R.UNKNOWN.valueOf()),new Error(`unable to find data type for ${e.toString()}`)}get Array(){const e=R.ARRAY_CONSTRUCTORS.get(this.toString());if(e==null)throw new Error(`unable to find array constructor for ${this.valueOf()}`);return e}equals(e){return this.valueOf()===e.valueOf()}matches(...e){return e.some(t=>this.equals(t))}toString(){return this.valueOf()}get isVariable(){return this.equals(R.JSON)||this.equals(R.STRING)}get isNumeric(){return!this.isVariable&&!this.equals(R.UUID)}get isInteger(){const e=this.toString();return e.startsWith("int")||e.startsWith("uint")}get isFloat(){return this.toString().startsWith("float")}get density(){const e=R.DENSITIES.get(this.toString());if(e==null)throw new Error(`unable to find density for ${this.valueOf()}`);return e}get isUnsigned(){return this.equals(R.UINT8)||this.equals(R.UINT16)||this.equals(R.UINT32)||this.equals(R.UINT64)}get isSigned(){return this.equals(R.INT8)||this.equals(R.INT16)||this.equals(R.INT32)||this.equals(R.INT64)}canSafelyCastTo(e){return this.equals(e)?!0:!this.isNumeric||!e.isNumeric||this.isVariable||e.isVariable||this.isUnsigned&&e.isSigned?!1:this.isFloat?e.isFloat&&this.density.valueOf()<=e.density.valueOf():this.equals(R.INT32)&&e.equals(R.FLOAT64)||this.equals(R.INT8)&&e.equals(R.FLOAT32)?!0:this.isInteger&&e.isInteger?this.density.valueOf()<=e.density.valueOf()&&this.isUnsigned===e.isUnsigned:!1}canCastTo(e){return this.isNumeric&&e.isNumeric?!0:this.equals(e)}checkArray(e){return e.constructor===this.Array}toJSON(){return this.toString()}get usesBigInt(){return R.BIG_INT_TYPES.some(e=>e.equals(this))}};h(d,"UNKNOWN",new d("unknown")),h(d,"FLOAT64",new d("float64")),h(d,"FLOAT32",new d("float32")),h(d,"INT64",new d("int64")),h(d,"INT32",new d("int32")),h(d,"INT16",new d("int16")),h(d,"INT8",new d("int8")),h(d,"UINT64",new d("uint64")),h(d,"UINT32",new d("uint32")),h(d,"UINT16",new d("uint16")),h(d,"UINT8",new d("uint8")),h(d,"BOOLEAN",d.UINT8),h(d,"TIMESTAMP",new d("timestamp")),h(d,"UUID",new d("uuid")),h(d,"STRING",new d("string")),h(d,"JSON",new d("json")),h(d,"ARRAY_CONSTRUCTORS",new Map([[d.UINT8.toString(),Uint8Array],[d.UINT16.toString(),Uint16Array],[d.UINT32.toString(),Uint32Array],[d.UINT64.toString(),BigUint64Array],[d.FLOAT32.toString(),Float32Array],[d.FLOAT64.toString(),Float64Array],[d.INT8.toString(),Int8Array],[d.INT16.toString(),Int16Array],[d.INT32.toString(),Int32Array],[d.INT64.toString(),BigInt64Array],[d.TIMESTAMP.toString(),BigInt64Array],[d.STRING.toString(),Uint8Array],[d.JSON.toString(),Uint8Array],[d.UUID.toString(),Uint8Array]])),h(d,"ARRAY_CONSTRUCTOR_DATA_TYPES",new Map([[Uint8Array.name,d.UINT8],[Uint16Array.name,d.UINT16],[Uint32Array.name,d.UINT32],[BigUint64Array.name,d.UINT64],[Float32Array.name,d.FLOAT32],[Float64Array.name,d.FLOAT64],[Int8Array.name,d.INT8],[Int16Array.name,d.INT16],[Int32Array.name,d.INT32],[BigInt64Array.name,d.INT64]])),h(d,"DENSITIES",new Map([[d.UINT8.toString(),L.BIT8],[d.UINT16.toString(),L.BIT16],[d.UINT32.toString(),L.BIT32],[d.UINT64.toString(),L.BIT64],[d.FLOAT32.toString(),L.BIT32],[d.FLOAT64.toString(),L.BIT64],[d.INT8.toString(),L.BIT8],[d.INT16.toString(),L.BIT16],[d.INT32.toString(),L.BIT32],[d.INT64.toString(),L.BIT64],[d.TIMESTAMP.toString(),L.BIT64],[d.STRING.toString(),L.UNKNOWN],[d.JSON.toString(),L.UNKNOWN],[d.UUID.toString(),L.BIT128]])),h(d,"ALL",[d.UNKNOWN,d.FLOAT64,d.FLOAT32,d.INT64,d.INT32,d.INT16,d.INT8,d.UINT64,d.UINT32,d.UINT16,d.UINT8,d.TIMESTAMP,d.UUID,d.STRING,d.JSON]),h(d,"BIG_INT_TYPES",[d.INT64,d.UINT64,d.TIMESTAMP]),h(d,"z",u.union([u.string().transform(n=>new d(n)),u.instanceof(d)]));let k=d;const U=class Z extends Number{constructor(e){super(e.valueOf())}largerThan(e){return this.valueOf()>e.valueOf()}smallerThan(e){return this.valueOf()<e.valueOf()}add(e){return Z.bytes(this.valueOf()+e.valueOf())}sub(e){return Z.bytes(this.valueOf()-e.valueOf())}truncate(e){return new Z(Math.trunc(this.valueOf()/e.valueOf())*e.valueOf())}remainder(e){return Z.bytes(this.valueOf()%e.valueOf())}get gigabytes(){return this.valueOf()/Z.GIGABYTE.valueOf()}get megabytes(){return this.valueOf()/Z.MEGABYTE.valueOf()}get kilobytes(){return this.valueOf()/Z.KILOBYTE.valueOf()}get terabytes(){return this.valueOf()/Z.TERABYTE.valueOf()}toString(){const e=this.truncate(Z.TERABYTE),t=this.truncate(Z.GIGABYTE),r=this.truncate(Z.MEGABYTE),s=this.truncate(Z.KILOBYTE),i=this.truncate(Z.BYTE),a=e,o=t.sub(e),c=r.sub(t),l=s.sub(r),p=i.sub(s);let g="";return a.isZero||(g+=`${a.terabytes}TB `),o.isZero||(g+=`${o.gigabytes}GB `),c.isZero||(g+=`${c.megabytes}MB `),l.isZero||(g+=`${l.kilobytes}KB `),(!p.isZero||g==="")&&(g+=`${p.valueOf()}B`),g.trim()}static bytes(e=1){return new Z(e)}static kilobytes(e=1){return Z.bytes(e.valueOf()*1e3)}static megabytes(e=1){return Z.kilobytes(e.valueOf()*1e3)}static gigabytes(e=1){return Z.megabytes(e.valueOf()*1e3)}static terabytes(e){return Z.gigabytes(e.valueOf()*1e3)}get isZero(){return this.valueOf()===0}};h(U,"BYTE",new U(1)),h(U,"KILOBYTE",U.kilobytes(1)),h(U,"MEGABYTE",U.megabytes(1)),h(U,"GIGABYTE",U.gigabytes(1)),h(U,"TERABYTE",U.terabytes(1)),h(U,"ZERO",new U(0)),h(U,"z",u.union([u.number().transform(n=>new U(n)),u.instanceof(U)]));let Jt=U;u.union([u.instanceof(Uint8Array),u.instanceof(Uint16Array),u.instanceof(Uint32Array),u.instanceof(BigUint64Array),u.instanceof(Float32Array),u.instanceof(Float64Array),u.instanceof(Int8Array),u.instanceof(Int16Array),u.instanceof(Int32Array),u.instanceof(BigInt64Array)]);const gr=n=>{const e=typeof n;return e==="string"||e==="number"||e==="boolean"||e==="bigint"||n instanceof $||n instanceof A||n instanceof Date},Oa=(n,e,t,r=0)=>n.usesBigInt&&!e.usesBigInt?Number(t)-Number(r):!n.usesBigInt&&e.usesBigInt?BigInt(t.valueOf())-BigInt(r.valueOf()):Ve(t,-r).valueOf(),Ve=(n,e)=>typeof n=="bigint"&&typeof e=="bigint"||typeof n=="number"&&typeof e=="number"?n+e:e===0?n:n===0?e:Number(n)+Number(e),Sa=n=>n==null?!1:Array.isArray(n)||n instanceof ArrayBuffer||ArrayBuffer.isView(n)&&!(n instanceof DataView)||n instanceof Aa?!0:gr(n),ce=-1,Na=u.string().transform(n=>new Uint8Array(atob(n).split("").map(e=>e.charCodeAt(0))).buffer),Ia=u.union([u.null(),u.undefined()]).transform(()=>new Uint8Array().buffer),Ht=10,ka=(n,e)=>{if(n==="string"&&!e.isVariable)throw new Error(`cannot convert series of type ${e.toString()} to string`);if(n==="number"&&!e.isNumeric)throw new Error(`cannot convert series of type ${e.toString()} to number`);if(n==="bigint"&&!e.usesBigInt)throw new Error(`cannot convert series of type ${e.toString()} to bigint`)},qe=class H{constructor(e){h(this,"key",""),h(this,"isSynnaxSeries",!0),h(this,"dataType"),h(this,"sampleOffset"),h(this,"gl"),h(this,"_data"),h(this,"_timeRange"),h(this,"alignment",0n),h(this,"_cachedMin"),h(this,"_cachedMax"),h(this,"writePos",ce),h(this,"_refCount",0),h(this,"_cachedLength"),h(this,"_cachedIndexes"),Sa(e)&&(e={data:e});const{dataType:t,timeRange:r,sampleOffset:s=0,glBufferUsage:i="static",alignment:a=0n,key:o=pr()}=e,c=e.data??[];if(c instanceof H||typeof c=="object"&&"isSynnaxSeries"in c&&c.isSynnaxSeries===!0){const g=c;this.key=g.key,this.dataType=g.dataType,this.sampleOffset=g.sampleOffset,this.gl=g.gl,this._data=g._data,this._timeRange=g._timeRange,this.alignment=g.alignment,this._cachedMin=g._cachedMin,this._cachedMax=g._cachedMax,this.writePos=g.writePos,this._refCount=g._refCount,this._cachedLength=g._cachedLength;return}const l=gr(c),p=Array.isArray(c);if(t!=null)this.dataType=new k(t);else{if(c instanceof ArrayBuffer)throw new Error("cannot infer data type from an ArrayBuffer instance when constructing a Series. Please provide a data type.");if(p||l){let g=c;if(!l){if(c.length===0)throw new Error("cannot infer data type from a zero length JS array when constructing a Series. Please provide a data type.");g=c[0]}if(typeof g=="string")this.dataType=k.STRING;else if(typeof g=="number")this.dataType=k.FLOAT64;else if(typeof g=="bigint")this.dataType=k.INT64;else if(typeof g=="boolean")this.dataType=k.BOOLEAN;else if(g instanceof $||g instanceof Date||g instanceof $)this.dataType=k.TIMESTAMP;else if(typeof g=="object")this.dataType=k.JSON;else throw new Error(`cannot infer data type of ${typeof g} when constructing a Series from a JS array`)}else this.dataType=new k(c)}if(!p&&!l)this._data=c;else{let g=l?[c]:c;const j=g[0];(j instanceof $||j instanceof Date||j instanceof A)&&(g=g.map(D=>new $(D).valueOf())),this.dataType.equals(k.STRING)?(this._cachedLength=g.length,this._data=new TextEncoder().encode(`${g.join(`
4
+ `)}
5
+ `).buffer):this.dataType.equals(k.JSON)?(this._cachedLength=g.length,this._data=new TextEncoder().encode(`${g.map(D=>pt.encodeString(D)).join(`
6
+ `)}
7
+ `).buffer):this.dataType.usesBigInt&&typeof j=="number"?this._data=new this.dataType.Array(g.map(D=>BigInt(Math.round(D)))).buffer:!this.dataType.usesBigInt&&typeof j=="bigint"?this._data=new this.dataType.Array(g.map(D=>Number(D))).buffer:this._data=new this.dataType.Array(g).buffer}this.key=o,this.alignment=a,this.sampleOffset=s??0,this._timeRange=r,this.gl={control:null,buffer:null,prevBuffer:0,bufferUsage:i}}static alloc({capacity:e,dataType:t,...r}){if(e===0)throw new Error("[Series] - cannot allocate an array of length 0");const s=new new k(t).Array(e),i=new H({data:s.buffer,dataType:t,...r});return i.writePos=0,i}static createTimestamps(e,t,r){const s=r.spanRange(t.span(e)),i=new BigInt64Array(e);for(let a=0;a<e;a++)i[a]=BigInt(r.add(t.span(a)).valueOf());return new H({data:i,dataType:k.TIMESTAMP,timeRange:s})}get refCount(){return this._refCount}static fromStrings(e,t){const r=new TextEncoder().encode(`${e.join(`
8
+ `)}
9
+ `);return new H({data:r,dataType:k.STRING,timeRange:t})}static fromJSON(e,t){const r=new TextEncoder().encode(`${e.map(s=>pt.encodeString(s)).join(`
10
+ `)}
11
+ `);return new H({data:r,dataType:k.JSON,timeRange:t})}acquire(e){this._refCount++,e!=null&&this.updateGLBuffer(e)}release(){if(this._refCount--,this._refCount===0&&this.gl.control!=null)this.maybeGarbageCollectGLBuffer(this.gl.control);else if(this._refCount<0)throw new Error("cannot release an array with a negative reference count")}write(e){if(!e.dataType.equals(this.dataType))throw new Error("buffer must be of the same type as this array");return this.dataType.isVariable?this.writeVariable(e):this.writeFixed(e)}writeVariable(e){if(this.writePos===ce)return 0;const t=this.byteCapacity.valueOf()-this.writePos,r=e.subBytes(0,t);return this.writeToUnderlyingData(r),this.writePos+=r.byteLength.valueOf(),this._cachedLength!=null&&(this._cachedLength+=r.length,this.calculateCachedLength()),r.length}writeFixed(e){if(this.writePos===ce)return 0;const t=this.capacity-this.writePos,r=e.sub(0,t);return this.writeToUnderlyingData(r),this._cachedLength=void 0,this.maybeRecomputeMinMax(r),this.writePos+=r.length,r.length}writeToUnderlyingData(e){this.underlyingData.set(e.data,this.writePos)}get buffer(){return typeof this._data=="object"&&"buffer"in this._data?this._data.buffer:this._data}get underlyingData(){return new this.dataType.Array(this._data)}get data(){return this.writePos===ce?this.underlyingData:new this.dataType.Array(this._data,0,this.writePos)}toStrings(){if(!this.dataType.matches(k.STRING,k.UUID))throw new Error("cannot convert non-string series to strings");return new TextDecoder().decode(this.underlyingData).split(`
12
+ `).slice(0,-1)}toUUIDs(){if(!this.dataType.equals(k.UUID))throw new Error("cannot convert non-uuid series to uuids");const e=k.UUID.density.valueOf(),t=Array(this.length);for(let r=0;r<this.length;r++){const s=this.underlyingData.slice(r*e,(r+1)*e),i=Array.from(new Uint8Array(s.buffer),a=>a.toString(16).padStart(2,"0")).join("").replace(/(.{8})(.{4})(.{4})(.{4})(.{12})/,"$1-$2-$3-$4-$5");t[r]=i}return t}parseJSON(e){if(!this.dataType.equals(k.JSON))throw new Error("cannot parse non-JSON series as JSON");return new TextDecoder().decode(this.underlyingData).split(`
13
+ `).slice(0,-1).map(t=>e.parse(pt.decodeString(t)))}get timeRange(){if(this._timeRange==null)throw new Error("time range not set on series");return this._timeRange}get byteCapacity(){return new Jt(this.underlyingData.byteLength)}get capacity(){return this.dataType.isVariable?this.byteCapacity.valueOf():this.dataType.density.length(this.byteCapacity)}get byteLength(){return this.writePos===ce?this.byteCapacity:this.dataType.isVariable?new Jt(this.writePos):this.dataType.density.size(this.writePos)}get length(){return this._cachedLength!=null?this._cachedLength:this.dataType.isVariable?this.calculateCachedLength():this.writePos===ce?this.data.length:this.writePos}calculateCachedLength(){if(!this.dataType.isVariable)throw new Error("cannot calculate length of a non-variable length data type");let e=0;const t=[0];return this.data.forEach((r,s)=>{r===Ht&&(e++,t.push(s+1))}),this._cachedIndexes=t,this._cachedLength=e,e}convert(e,t=0){if(this.dataType.equals(e))return this;const r=new e.Array(this.length);for(let s=0;s<this.length;s++)r[s]=Oa(this.dataType,e,this.data[s],t);return new H({data:r.buffer,dataType:e,timeRange:this._timeRange,sampleOffset:t,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment})}calcRawMax(){if(this.length===0)return-1/0;if(this.dataType.equals(k.TIMESTAMP))this._cachedMax=this.data[this.data.length-1];else if(this.dataType.usesBigInt){const e=this.data;this._cachedMax=e.reduce((t,r)=>t>r?t:r)}else{const e=this.data;this._cachedMax=e.reduce((t,r)=>t>r?t:r)}return this._cachedMax}get max(){if(this.dataType.isVariable)throw new Error("cannot calculate maximum on a variable length data type");return this.writePos===0?-1/0:(this._cachedMax??(this._cachedMax=this.calcRawMax()),Ve(this._cachedMax,this.sampleOffset))}calcRawMin(){if(this.length===0)return 1/0;if(this.dataType.equals(k.TIMESTAMP))this._cachedMin=this.data[0];else if(this.dataType.usesBigInt){const e=this.data;this._cachedMin=e.reduce((t,r)=>t<r?t:r)}else{const e=this.data;this._cachedMin=e.reduce((t,r)=>t<r?t:r)}return this._cachedMin}get min(){if(this.dataType.isVariable)throw new Error("cannot calculate minimum on a variable length data type");return this.writePos===0?1/0:(this._cachedMin??(this._cachedMin=this.calcRawMin()),Ve(this._cachedMin,this.sampleOffset))}get bounds(){return xe(Number(this.min),Number(this.max))}maybeRecomputeMinMax(e){if(this._cachedMin!=null){const t=e._cachedMin??e.calcRawMin();t<this._cachedMin&&(this._cachedMin=t)}if(this._cachedMax!=null){const t=e._cachedMax??e.calcRawMax();t>this._cachedMax&&(this._cachedMax=t)}}enrich(){this.max,this.min}get range(){return Ve(this.max,-this.min)}atAlignment(e,t){const r=Number(e-this.alignment);if(r<0||r>=this.length){if(t===!0)throw new Error(`[series] - no value at index ${r}`);return}return this.at(r,t)}at(e,t){if(this.dataType.isVariable)return this.atVariable(e,t??!1);e<0&&(e=this.length+e);const r=this.data[e];if(r==null){if(t===!0)throw new Error(`[series] - no value at index ${e}`);return}return Ve(r,this.sampleOffset)}atVariable(e,t){let r=0,s=0;if(this._cachedIndexes!=null)r=this._cachedIndexes[e],s=this._cachedIndexes[e+1]-1;else{e<0&&(e=this.length+e);for(let a=0;a<this.data.length;a++)if(this.data[a]===Ht){if(e===0){s=a;break}r=a+1,e--}if(s===0&&(s=this.data.length),r>=s||e>0){if(t)throw new Error(`[series] - no value at index ${e}`);return}}const i=this.data.slice(r,s);return this.dataType.equals(k.STRING)?new TextDecoder().decode(i):Zn(JSON.parse(new TextDecoder().decode(i)))}binarySearch(e){let t=0,r=this.length-1;const s=Js(e);for(;t<=r;){const i=Math.floor((t+r)/2),a=s(this.at(i,!0),e);if(a===0)return i;a<0?t=i+1:r=i-1}return t}updateGLBuffer(e){if(this.gl.control=e,!this.dataType.equals(k.FLOAT32)&&!this.dataType.equals(k.UINT8))throw new Error("Only FLOAT32 and UINT8 arrays can be used in WebGL");const{buffer:t,bufferUsage:r,prevBuffer:s}=this.gl;if(t==null&&(this.gl.buffer=e.createBuffer()),this.writePos!==s)if(e.bindBuffer(e.ARRAY_BUFFER,this.gl.buffer),this.writePos!==ce){s===0&&e.bufferData(e.ARRAY_BUFFER,this.byteCapacity.valueOf(),e.STATIC_DRAW);const i=this.dataType.density.size(s).valueOf(),a=this.underlyingData.slice(this.gl.prevBuffer,this.writePos);e.bufferSubData(e.ARRAY_BUFFER,i,a.buffer),this.gl.prevBuffer=this.writePos}else e.bufferData(e.ARRAY_BUFFER,this.buffer,r==="static"?e.STATIC_DRAW:e.DYNAMIC_DRAW),this.gl.prevBuffer=ce}as(e){return ka(e,this.dataType),this}get digest(){var e;return{key:this.key,dataType:this.dataType.toString(),sampleOffset:this.sampleOffset,alignment:{lower:$n(this.alignmentBounds.lower),upper:$n(this.alignmentBounds.upper)},timeRange:(e=this._timeRange)==null?void 0:e.toString(),length:this.length,capacity:this.capacity}}get memInfo(){return{key:this.key,length:this.length,byteLength:this.byteLength,glBuffer:this.gl.buffer!=null}}get alignmentBounds(){return xe(this.alignment,this.alignment+BigInt(this.length))}maybeGarbageCollectGLBuffer(e){this.gl.buffer!=null&&(e.deleteBuffer(this.gl.buffer),this.gl.buffer=null,this.gl.prevBuffer=0,this.gl.control=null)}get glBuffer(){if(this.gl.buffer==null)throw new Error("gl buffer not initialized");return this.gl.prevBuffer!==this.writePos&&console.warn("buffer not updated"),this.gl.buffer}[Symbol.iterator](){if(this.dataType.isVariable){const e=new Ea(this);return this.dataType.equals(k.JSON)?new $a(e):e}return new Ca(this)}slice(e,t){return this.sliceSub(!1,e,t)}sub(e,t){return this.sliceSub(!0,e,t)}subIterator(e,t){return new Nn(this,e,t??this.length)}subAlignmentIterator(e,t){return new Nn(this,Number(e-this.alignment),Number(t-this.alignment))}subBytes(e,t){if(e>=0&&(t==null||t>=this.byteLength.valueOf()))return this;const r=this.data.subarray(e,t);return new H({data:r,dataType:this.dataType,timeRange:this._timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(e)})}sliceSub(e,t,r){if(t<=0&&(r==null||r>=this.length))return this;let s;return e?s=this.data.subarray(t,r):s=this.data.slice(t,r),new H({data:s,dataType:this.dataType,timeRange:this._timeRange,sampleOffset:this.sampleOffset,glBufferUsage:this.gl.bufferUsage,alignment:this.alignment+BigInt(t)})}reAlign(e){return new H({data:this.buffer,dataType:this.dataType,timeRange:dn.ZERO,sampleOffset:this.sampleOffset,glBufferUsage:"static",alignment:e})}};h(qe,"crudeZ",u.object({timeRange:dn.z.optional(),dataType:k.z,alignment:u.coerce.bigint().optional(),data:u.union([Na,Ia,u.instanceof(ArrayBuffer),u.instanceof(Uint8Array)]),glBufferUsage:Ta.optional().default("static").optional()})),h(qe,"z",qe.crudeZ.transform(n=>new qe(n)));let Aa=qe;class Nn{constructor(e,t,r){h(this,"series"),h(this,"end"),h(this,"index"),this.series=e;const s=xe(0,e.length);this.end=_n(s,r),this.index=_n(s,t)}next(){return this.index>=this.end?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[Symbol.iterator](){return this}}class Ea{constructor(e){if(h(this,"series"),h(this,"index"),h(this,"decoder"),!e.dataType.isVariable)throw new Error("cannot create a variable series iterator for a non-variable series");this.series=e,this.index=0,this.decoder=new TextDecoder}next(){const e=this.index,t=this.series.data;for(;this.index<t.length&&t[this.index]!==Ht;)this.index++;const r=this.index;return e===r?{done:!0,value:void 0}:(this.index++,{done:!1,value:this.decoder.decode(this.series.buffer.slice(e,r))})}[Symbol.iterator](){return this}}var In,kn;class $a{constructor(e){h(this,"wrapped"),h(this,In,"JSONSeriesIterator"),this.wrapped=e}next(){const e=this.wrapped.next();return e.done===!0?{done:!0,value:void 0}:{done:!1,value:pt.decodeString(e.value)}}[(kn=Symbol.iterator,In=Symbol.toStringTag,kn)](){return this}}var An,En;class Ca{constructor(e){h(this,"series"),h(this,"index"),h(this,An,"SeriesIterator"),this.series=e,this.index=0}next(){return this.index>=this.series.length?{done:!0,value:void 0}:{done:!1,value:this.series.at(this.index++,!0)}}[(En=Symbol.iterator,An=Symbol.toStringTag,En)](){return this}}const $n=n=>{const e=n>>32n,t=n&0xffffffffn;return{domain:e,sample:t}},Ma=(n,e,t=".")=>{const r=n.split(t);return r.map((s,i)=>{const a=e(s,i,r);return a==null?null:typeof a=="string"?a:a.join(t)}).filter(s=>s!=null).join(t)},yr=(n,e,t={optional:!1,separator:"."})=>{t.separator??(t.separator=".");const{optional:r,getter:s=(o,c)=>o[c]}=t,i=e.split(t.separator);if(i.length===1&&i[0]==="")return n;let a=n;for(const o of i){const c=s(a,o);if(c==null){if(r)return null;throw new Error(`Path ${e} does not exist. ${o} is null`)}a=c}return a},Ra=(n,e,t)=>{const r=e.split(".");let s=n;for(let i=0;i<r.length-1;i++){const a=r[i];s[a]??(s[a]={}),s=s[a]}try{s[r[r.length-1]]=t}catch(i){throw console.error("failed to set value",t,"at path",e,"on object",n),i}},ja=(n,e)=>{const t=e.split(".");let r=n;for(let s=0;s<t.length-1;s++){const i=t[s];if(r[i]==null)return;r=r[i]}if(Array.isArray(r)){const s=parseInt(t[t.length-1]);if(isNaN(s))return;r.splice(s,1);return}delete r[t[t.length-1]]},Za=(n,e)=>{const t=n.split(".");return e<0?t[t.length+e]:t[e]},Ba=(n,e)=>{try{return yr(n,e),!0}catch{return!1}},Da=(n,e)=>{if(e.length===0)return!0;const t=n.split("."),r=e.split(".");if(r.length>t.length)return!1;for(let s=0;s<r.length;s++){const i=t[s],a=r[s];if(a!=="*"&&i!==a)return!1}return!0},Ua=n=>JSON.parse(JSON.stringify(n)),Pa=(n,...e)=>(e.forEach(t=>{let r=n;const s=t.split(".");s.forEach((i,a)=>{a===s.length-1?delete r[i]:i in r&&(r=r[i])})}),n),La=(n,e,t="")=>{const r={},s=(i,a,o)=>{if(typeof i!=typeof a||i===null||a===null){r[o]=[i,a];return}if(typeof i=="object"&&typeof a=="object")if(Array.isArray(i)&&Array.isArray(a)){if(i.length!==a.length){r[o]=[i,a];return}for(let c=0;c<i.length;c++)s(i[c],a[c],`${o}[${c}]`)}else new Set([...Object.keys(i),...Object.keys(a)]).forEach(c=>{s(i[c],a[c],o!==""?`${o}.${c}`:c)});else i!==a&&(r[o]=[i,a])};return s(n,e,t),r},Xt=(n,e)=>{const t=Array.isArray(n),r=Array.isArray(e);if(t!==r)return!1;if(t&&r){const a=n,o=e;if(a.length!==o.length)return!1;for(let c=0;c<a.length;c++)if(!Xt(a[c],o[c]))return!1;return!0}if(n==null||e==null||typeof n!="object"||typeof e!="object")return n===e;if("equals"in n)return n.equals(e);const s=Object.keys(n),i=Object.keys(e);if(s.length!==i.length)return!1;for(const a of s){const o=n[a],c=e[a];if(typeof o=="object"&&typeof c=="object"){if(!Xt(o,c))return!1}else if(o!==c)return!1}return!0},vr=(n,e)=>{if(typeof n!="object"||n==null)return n===e;const t=Object.keys(n),r=Object.keys(e);if(r.length>t.length)return!1;for(const s of r){const i=n[s],a=e[s];if(typeof i=="object"&&typeof a=="object"){if(!vr(i,a))return!1}else if(i!==a)return!1}return!0},Kt=(n,...e)=>{if(e.length===0)return n;const t=e.shift();if(Je(n)&&Je(t))for(const r in t)try{Je(t[r])?(r in n||Object.assign(n,{[r]:{}}),Kt(n[r],t[r])):Object.assign(n,{[r]:t[r]})}catch(s){throw s instanceof TypeError?new TypeError(`.${r}: ${s.message}`):s}return Kt(n,...e)},Wa=(n,e,t)=>{const r=(s,i,a)=>{for(const o in i){const c=i[o],l=wr(a);if(l!=null&&l[o]){const p=l[o].safeParse(c);p.success&&(s[o]=p.data)}else typeof c=="object"&&!Array.isArray(c)&&c!==null&&a&&a.shape&&a.shape[o]&&(s[o]||(s[o]={}),r(s[o],c,a.shape[o]))}return s};return r({...n},e,t)},wr=n=>{var e;return((e=n._def)==null?void 0:e.typeName)==="ZodEffects"?wr(n._def.schema):n==null?void 0:n.shape},hn=Object.freeze(Object.defineProperty({__proto__:null,copy:Ua,deleteD:Pa,difference:La,element:Za,equal:Xt,get:yr,has:Ba,override:Kt,overrideValidItems:Wa,partialEqual:vr,pathsMatch:Da,remove:ja,set:Ra,transformPath:Ma},Symbol.toStringTag,{value:"Module"}));u.object({key:u.string(),value:u.string()});u.record(u.union([u.number(),u.string(),u.symbol()]),u.unknown());const br=()=>typeof process<"u"&&process.versions!=null&&process.versions.node!=null?"node":typeof window>"u"||window.document===void 0?"webworker":"browser",za=br(),xr=["macOS","Windows","Linux"],Va=["macos","windows","linux"],qa={macos:"macOS",windows:"Windows",linux:"Linux"},Fa=u.enum(xr).or(u.enum(Va).transform(n=>qa[n])),Ya=()=>{if(typeof window>"u")return;const n=window.navigator.userAgent.toLowerCase();if(n.includes("mac"))return"macOS";if(n.includes("win"))return"Windows";if(n.includes("linux"))return"Linux"};let Bt;const Ga=(n={})=>{const{force:e,default:t}=n;return e??Bt??(Bt=Ya(),Bt??t)},Ja=Object.freeze(Object.defineProperty({__proto__:null,OPERATING_SYSTEMS:xr,RUNTIME:za,detect:br,getOS:Ga,osZ:Fa},Symbol.toStringTag,{value:"Module"}));var Ha=Object.defineProperty,Xa=(n,e,t)=>e in n?Ha(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Fe=(n,e,t)=>Xa(n,typeof e!="symbol"?e+"":e,t);const Ka=(...n)=>n.map(_r).join(""),_r=n=>(n.endsWith("/")||(n+="/"),n.startsWith("/")&&(n=n.slice(1)),n),Qa=n=>n.endsWith("/")?n.slice(0,-1):n,Cn=class Qt{constructor({host:e,port:t,protocol:r="",pathPrefix:s=""}){Fe(this,"protocol"),Fe(this,"host"),Fe(this,"port"),Fe(this,"path"),this.protocol=r,this.host=e,this.port=t,this.path=_r(s)}replace(e){return new Qt({host:e.host??this.host,port:e.port??this.port,protocol:e.protocol??this.protocol,pathPrefix:e.pathPrefix??this.path})}child(e){return new Qt({...this,pathPrefix:Ka(this.path,e)})}toString(){return Qa(`${this.protocol}://${this.host}:${this.port}/${this.path}`)}};Fe(Cn,"UNKNOWN",new Cn({host:"unknown",port:0}));const eo=-128,to=127;u.number().int().min(eo).max(to);const no=-32768,ro=32767;u.number().int().min(no).max(ro);const so=-2147483648,io=2147483647;u.number().int().min(so).max(io);const ao=-9223372036854775808n,oo=9223372036854775807n;u.bigint().min(ao).max(oo);const uo=255;u.number().int().min(0).max(uo);const co=65535;u.number().int().min(0).max(co);const lo=4294967295;u.number().int().min(0).max(lo);const ho=18446744073709551615n;u.bigint().min(0n).max(ho);var fo=Object.defineProperty,po=(n,e,t)=>e in n?fo(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Ye=(n,e,t)=>po(n,typeof e!="symbol"?e+"":e,t);u.object({interval:A.z.optional(),maxRetries:u.number().optional(),scale:u.number().optional()});const te=class extends Number{};Ye(te,"ABSOLUTE",255),Ye(te,"MINIMUM",0),Ye(te,"BOUNDS",{lower:te.MINIMUM,upper:te.ABSOLUTE+1}),Ye(te,"z",u.union([u.instanceof(te),u.number().int().min(0).max(255).transform(n=>new te(n)),u.instanceof(Number).transform(n=>new te(n))]));u.object({name:u.string(),key:u.string()});const Tr=class Ge extends Error{constructor(){super(Ge.MESSAGE)}matches(e){return typeof e=="string"?e.includes(Ge.MESSAGE):e instanceof Ge||e.message.includes(Ge.MESSAGE)}};Ye(Tr,"MESSAGE","canceled");let mo=Tr;new mo;u.string().regex(/^\d+\.\d+\.\d+$/);const go=["standard","scientific","engineering"];u.enum(go);const we="main",fn="prerender",Mt={stage:"creating",processCount:0,reserved:!1,focusCount:0,centerCount:0},Or={...Mt,key:fn,visible:!1},yo=u.object({key:u.string(),url:u.string().optional(),title:u.string().optional(),center:u.boolean().optional(),position:kt.xy.optional(),size:yt.dimensions.optional(),minSize:yt.dimensions.optional(),maxSize:yt.dimensions.optional(),resizable:u.boolean().optional(),fullscreen:u.boolean().optional(),focus:u.boolean().optional(),maximized:u.boolean().optional(),visible:u.boolean().optional(),minimized:u.boolean().optional(),decorations:u.boolean().optional(),skipTaskbar:u.boolean().optional(),fileDropEnabled:u.boolean().optional(),transparent:u.boolean().optional(),alwaysOnTop:u.boolean().optional()}),vo=A.milliseconds(50),Sr=()=>setTimeout(()=>window.location.reload(),vo.milliseconds),Nr={label:we,config:{enablePrerender:!0,debug:!1,defaultWindowProps:{}},windows:{main:{...Mt,key:we,reserved:!0}},labelKeys:{main:we},keyLabels:{main:we}},wo=(n,e)=>{if(n.type===kr.type)return e.label!==we||(n.payload.label=Gt.create(),n.payload.prerenderLabel=Gt.create()),n;if("label"in n.payload)return n;let t=e.label;const r=n.payload;return r.key!=null&&(r.key in e.windows?t=r.key:t=e.keyLabels[r.key]),n.payload={...n.payload,label:t},n},V=n=>(e,t)=>{if(!("label"in t.payload))throw new Error("Missing label");n(e,t)},ve=(n,e=!1)=>V((t,r)=>{let s=e;const i=t.windows[r.payload.label];if(i!=null){if(r.payload.value!=null)s=r.payload.value;else{const a=i[n];a!=null&&(s=!a)}t.windows[r.payload.label]={...i,[n]:s}}}),Rt=(n,e=!1)=>(t,r)=>{const s=t.windows[r.payload.label];s!=null&&(t.windows[r.payload.label]={...s,[n]:s[n]+(e?-1:1)})},bo=n=>Object.values(n.windows).some(e=>e.key===fn&&!e.reserved),pn="drift",xo=(n,e,t)=>n.position!=null&&n.size!=null&&e==null?Le.topLeft(Le.positionInCenter(Le.construct(kt.ZERO,t??kt.ZERO),Le.construct(n.position,n.size))):e,_o=(n,{payload:e})=>{if(e.key===fn)return;const{key:t,label:r,prerenderLabel:s}=e;if(r==null||s==null)throw new Error("[drift] - bug - missing label and prerender label");console.log(n.config.debug),Rn(n.config.debug,"reducer create window");const i=n.windows.main;if(e.position=xo(i,e.position,e.size),t in n.keyLabels){Ze(n.config.debug,"window already exists, un-minimize and focus it");const c=n.keyLabels[e.key];n.windows[c].visible=!0,n.windows[c].focusCount+=1,n.windows[c].minimized=!1,n.windows[c].position=e.position,Dt(n.config.debug);return}const[a,o]=Object.entries(n.windows).find(([,c])=>!c.reserved)??[null,null];a!=null?(Ze(n.config.debug,"using available pre-rendered window"),n.windows[a]={...o,visible:!0,reserved:!0,focusCount:1,focus:!0,...e},n.labelKeys[a]=e.key,n.keyLabels[e.key]=a):(Ze(n.config.debug,"creating new window"),n.windows[r]={...n.config.defaultWindowProps,...Mt,...e,reserved:!0},n.labelKeys[r]=t,n.keyLabels[t]=r),n.config.enablePrerender&&!bo(n)&&(Ze(n.config.debug,"creating pre-render window"),n.windows[s]=hn.copy({...n.config.defaultWindowProps,...Or})),Dt(n.config.debug)},To=V((n,e)=>{const t=n.windows[e.payload.label];t!=null&&(t.stage=e.payload.stage)}),Oo=V((n,{payload:{label:e}})=>{const t=n.windows[e];t==null||t.processCount>0||(t.stage="closing",delete n.windows[e],delete n.labelKeys[e],delete n.keyLabels[t.key])}),So=V((n,e)=>{const t=n.windows[e.payload.label];t==null||t.processCount>0||(t.stage="reloading",Sr())}),No=V(Rt("processCount")),Io=V((n,e)=>{Rt("processCount",!0)(n,e);const t=n.windows[e.payload.label];t!=null&&t.processCount===0&&(t.stage==="reloading"?Sr():(n.windows[e.payload.label].visible=!1,delete n.windows[e.payload.label],delete n.labelKeys[e.payload.label],delete n.keyLabels[t.key]))}),ko=(n,e)=>{const t=n.windows[e.payload.key];t!=null&&(t.error=e.payload.message)},Ao=V((n,e)=>{const t=n.windows[e.payload.label];t!=null&&(t.visible!==!0&&(t.visible=!0),Rt("focusCount")(n,e))}),Eo=ve("minimized"),$o=ve("maximized"),Co=ve("visible",!0),Mo=ve("fullscreen",!0),Ro=V(Rt("centerCount")),jo=V((n,e)=>{n.windows[e.payload.label].position=e.payload.position}),Zo=V((n,e)=>{n.windows[e.payload.label].size=e.payload.size}),Bo=V((n,e)=>{n.windows[e.payload.label].minSize=e.payload.size}),Do=V((n,e)=>{n.windows[e.payload.label].maxSize=e.payload.size}),Uo=ve("resizable"),Po=ve("skipTaskbar"),Lo=ve("alwaysOnTop"),Wo=V((n,e)=>{n.windows[e.payload.label].title=e.payload.title}),zo=ve("decorations"),Mn=(n,e)=>{const t=n.windows[e.payload.label];hn.partialEqual(t,e.payload)||(n.windows[e.payload.label]={...t,...e.payload})},Vo=(n,e)=>{if(n.config={...n.config,...e.payload},n.label=e.payload.label,n.label===we&&n.config.enablePrerender){const t=Gt.create();n.windows[t]={...n.config.defaultWindowProps,...Or}}},Ir=Er.createSlice({name:pn,initialState:Nr,reducers:{internalSetInitial:Vo,createWindow:_o,setWindowStage:To,closeWindow:Oo,registerProcess:No,completeProcess:Io,setWindowError:ko,focusWindow:Ao,reloadWindow:So,setWindowMinimized:Eo,setWindowMaximized:$o,setWindowVisible:Co,setWindowFullscreen:Mo,centerWindow:Ro,setWindowPosition:jo,setWindowSize:Zo,setWindowMinSize:Bo,setWindowMaxSize:Do,setWindowResizable:Uo,setWindowSkipTaskbar:Po,setWindowAlwaysOnTop:Lo,setWindowTitle:Wo,setWindowDecorations:zo,runtimeSetWindowProps:Mn,setWindowProps:Mn}}),{actions:{runtimeSetWindowProps:qo,setWindowProps:Fo,createWindow:kr,internalSetInitial:Ar,setWindowStage:Yo,closeWindow:Go,registerProcess:Jo,completeProcess:Ho,setWindowError:Xo,focusWindow:Ko,reloadWindow:Qo,setWindowMinimized:eu,setWindowMaximized:tu,setWindowVisible:nu,setWindowFullscreen:ru,centerWindow:_u,setWindowPosition:su,setWindowSize:iu,setWindowMinSize:au,setWindowMaxSize:ou,setWindowResizable:uu,setWindowSkipTaskbar:cu,setWindowAlwaysOnTop:lu,setWindowTitle:du,setWindowDecorations:hu}}=Ir,fu=Ir.reducer,pu=n=>n.startsWith(pn),mu=[Ar.type],gu=(n,e)=>!n&&!mu.includes(e);exports.$t=Le;exports.I=hn;exports.INITIAL_WINDOW_STATE=Mt;exports.J=kt;exports.MAIN_WINDOW=we;exports.S=Ja;exports.SLICE_NAME=pn;exports.ZERO_SLICE_STATE=Nr;exports._=yt;exports.assignLabel=wo;exports.closeWindow=Go;exports.completeProcess=Ho;exports.createWindow=kr;exports.focusWindow=Ko;exports.group=Rn;exports.groupEnd=Dt;exports.internalSetInitial=Ar;exports.isDriftAction=pu;exports.log=Ze;exports.reducer=fu;exports.registerProcess=Jo;exports.reloadWindow=Qo;exports.runtimeSetWindowProps=qo;exports.setWindowAlwaysOnTop=lu;exports.setWindowDecorations=hu;exports.setWindowError=Xo;exports.setWindowFullscreen=ru;exports.setWindowMaxSize=ou;exports.setWindowMaximized=tu;exports.setWindowMinSize=au;exports.setWindowMinimized=eu;exports.setWindowPosition=su;exports.setWindowProps=Fo;exports.setWindowResizable=uu;exports.setWindowSize=iu;exports.setWindowSkipTaskbar=cu;exports.setWindowStage=Yo;exports.setWindowTitle=du;exports.setWindowVisible=nu;exports.shouldEmit=gu;exports.w=A;exports.windowPropsZ=yo;
package/dist/tauri.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var X=Object.defineProperty;var ee=(t,e,i)=>e in t?X(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var W=(t,e,i)=>ee(t,typeof e!="symbol"?e+"":e,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./state-5JemPjJN.cjs"),ie=require("./debounce-BUAIXXZt.cjs");function te(t,e,i,n){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?n:i==="a"?n.call(t):n?n.value:e.get(t)}function ne(t,e,i,n,l){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,i),i}var O;const h="__TAURI_TO_IPC_KEY__";function se(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function s(t,e={},i){return window.__TAURI_INTERNALS__.invoke(t,e,i)}class le{get rid(){return te(this,O,"f")}constructor(e){O.set(this,void 0),ne(this,O,e)}async close(){return s("plugin:resources|close",{rid:this.rid})}}O=new WeakMap;var o;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"})(o||(o={}));async function U(t,e){await s("plugin:event|unlisten",{event:t,eventId:e})}async function f(t,e,i){var n;const l=typeof(i==null?void 0:i.target)=="string"?{kind:"AnyLabel",label:i.target}:(n=i==null?void 0:i.target)!==null&&n!==void 0?n:{kind:"Any"};return s("plugin:event|listen",{event:t,target:l,handler:se(e)}).then(r=>async()=>U(t,r))}async function A(t,e,i){return f(t,n=>{U(t,n.id),e(n)},i)}async function L(t,e){await s("plugin:event|emit",{event:t,payload:e})}async function H(t,e,i){await s("plugin:event|emit_to",{target:typeof t=="string"?{kind:"AnyLabel",label:t}:t,event:e,payload:i})}class _{constructor(...e){this.type="Logical",e.length===1?"Logical"in e[0]?(this.width=e[0].Logical.width,this.height=e[0].Logical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toPhysical(e){return new b(this.width*e,this.height*e)}[h](){return{width:this.width,height:this.height}}toJSON(){return this[h]()}}class b{constructor(...e){this.type="Physical",e.length===1?"Physical"in e[0]?(this.width=e[0].Physical.width,this.height=e[0].Physical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toLogical(e){return new _(this.width/e,this.height/e)}[h](){return{width:this.width,height:this.height}}toJSON(){return this[h]()}}class w{constructor(e){this.size=e}toLogical(e){return this.size instanceof _?this.size:this.size.toLogical(e)}toPhysical(e){return this.size instanceof b?this.size:this.size.toPhysical(e)}[h](){return{[`${this.size.type}`]:{width:this.size.width,height:this.size.height}}}toJSON(){return this[h]()}}class N{constructor(...e){this.type="Logical",e.length===1?"Logical"in e[0]?(this.x=e[0].Logical.x,this.y=e[0].Logical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toPhysical(e){return new u(this.x*e,this.y*e)}[h](){return{x:this.x,y:this.y}}toJSON(){return this[h]()}}class u{constructor(...e){this.type="Physical",e.length===1?"Physical"in e[0]?(this.x=e[0].Physical.x,this.y=e[0].Physical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toLogical(e){return new N(this.x/e,this.y/e)}[h](){return{x:this.x,y:this.y}}toJSON(){return this[h]()}}class y{constructor(e){this.position=e}toLogical(e){return this.position instanceof N?this.position:this.position.toLogical(e)}toPhysical(e){return this.position instanceof u?this.position:this.position.toPhysical(e)}[h](){return{[`${this.position.type}`]:{x:this.position.x,y:this.position.y}}}toJSON(){return this[h]()}}class v extends le{constructor(e){super(e)}static async new(e,i,n){return s("plugin:image|new",{rgba:S(e),width:i,height:n}).then(l=>new v(l))}static async fromBytes(e){return s("plugin:image|from_bytes",{bytes:S(e)}).then(i=>new v(i))}static async fromPath(e){return s("plugin:image|from_path",{path:e}).then(i=>new v(i))}async rgba(){return s("plugin:image|rgba",{rid:this.rid}).then(e=>new Uint8Array(e))}async size(){return s("plugin:image|size",{rid:this.rid})}}function S(t){return t==null?null:typeof t=="string"?t:t instanceof v?t.rid:t}var x;(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(x||(x={}));class ae{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}var C;(function(t){t.None="none",t.Normal="normal",t.Indeterminate="indeterminate",t.Paused="paused",t.Error="error"})(C||(C={}));function j(){return new E(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function I(){return s("plugin:window|get_all_windows").then(t=>t.map(e=>new E(e,{skip:!0})))}const R=["tauri://created","tauri://error"];class E{constructor(e,i={}){var n;this.label=e,this.listeners=Object.create(null),i!=null&&i.skip||s("plugin:window|create",{options:{...i,parent:typeof i.parent=="string"?i.parent:(n=i.parent)===null||n===void 0?void 0:n.label,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static async getByLabel(e){var i;return(i=(await I()).find(n=>n.label===e))!==null&&i!==void 0?i:null}static getCurrent(){return j()}static async getAll(){return I()}static async getFocusedWindow(){for(const e of await I())if(await e.isFocused())return e;return null}async listen(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:f(e,i,{target:{kind:"Window",label:this.label}})}async once(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:A(e,i,{target:{kind:"Window",label:this.label}})}async emit(e,i){if(R.includes(e)){for(const n of this.listeners[e]||[])n({event:e,id:-1,payload:i});return}return L(e,i)}async emitTo(e,i,n){if(R.includes(i)){for(const l of this.listeners[i]||[])l({event:i,id:-1,payload:n});return}return H(e,i,n)}_handleTauriEvent(e,i){return R.includes(e)?(e in this.listeners?this.listeners[e].push(i):this.listeners[e]=[i],!0):!1}async scaleFactor(){return s("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return s("plugin:window|inner_position",{label:this.label}).then(e=>new u(e))}async outerPosition(){return s("plugin:window|outer_position",{label:this.label}).then(e=>new u(e))}async innerSize(){return s("plugin:window|inner_size",{label:this.label}).then(e=>new b(e))}async outerSize(){return s("plugin:window|outer_size",{label:this.label}).then(e=>new b(e))}async isFullscreen(){return s("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return s("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return s("plugin:window|is_maximized",{label:this.label})}async isFocused(){return s("plugin:window|is_focused",{label:this.label})}async isDecorated(){return s("plugin:window|is_decorated",{label:this.label})}async isResizable(){return s("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return s("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return s("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return s("plugin:window|is_closable",{label:this.label})}async isVisible(){return s("plugin:window|is_visible",{label:this.label})}async title(){return s("plugin:window|title",{label:this.label})}async theme(){return s("plugin:window|theme",{label:this.label})}async center(){return s("plugin:window|center",{label:this.label})}async requestUserAttention(e){let i=null;return e&&(e===x.Critical?i={type:"Critical"}:i={type:"Informational"}),s("plugin:window|request_user_attention",{label:this.label,value:i})}async setResizable(e){return s("plugin:window|set_resizable",{label:this.label,value:e})}async setEnabled(e){return s("plugin:window|set_enabled",{label:this.label,value:e})}async isEnabled(){return s("plugin:window|is_enabled",{label:this.label})}async setMaximizable(e){return s("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return s("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return s("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return s("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return s("plugin:window|maximize",{label:this.label})}async unmaximize(){return s("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return s("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return s("plugin:window|minimize",{label:this.label})}async unminimize(){return s("plugin:window|unminimize",{label:this.label})}async show(){return s("plugin:window|show",{label:this.label})}async hide(){return s("plugin:window|hide",{label:this.label})}async close(){return s("plugin:window|close",{label:this.label})}async destroy(){return s("plugin:window|destroy",{label:this.label})}async setDecorations(e){return s("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return s("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return s("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return s("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return s("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return s("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return s("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){return s("plugin:window|set_size",{label:this.label,value:e instanceof w?e:new w(e)})}async setMinSize(e){return s("plugin:window|set_min_size",{label:this.label,value:e instanceof w?e:e?new w(e):null})}async setMaxSize(e){return s("plugin:window|set_max_size",{label:this.label,value:e instanceof w?e:e?new w(e):null})}async setSizeConstraints(e){function i(n){return n?{Logical:n}:null}return s("plugin:window|set_size_constraints",{label:this.label,value:{minWidth:i(e==null?void 0:e.minWidth),minHeight:i(e==null?void 0:e.minHeight),maxWidth:i(e==null?void 0:e.maxWidth),maxHeight:i(e==null?void 0:e.maxHeight)}})}async setPosition(e){return s("plugin:window|set_position",{label:this.label,value:e instanceof y?e:new y(e)})}async setFullscreen(e){return s("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return s("plugin:window|set_focus",{label:this.label})}async setIcon(e){return s("plugin:window|set_icon",{label:this.label,value:S(e)})}async setSkipTaskbar(e){return s("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return s("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return s("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return s("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setBackgroundColor(e){return s("plugin:window|set_background_color",{color:e})}async setCursorPosition(e){return s("plugin:window|set_cursor_position",{label:this.label,value:e instanceof y?e:new y(e)})}async setIgnoreCursorEvents(e){return s("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return s("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return s("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setBadgeCount(e){return s("plugin:window|set_badge_count",{label:this.label,value:e})}async setBadgeLabel(e){return s("plugin:window|set_badge_label",{label:this.label,value:e})}async setOverlayIcon(e){return s("plugin:window|set_overlay_icon",{label:this.label,value:e?S(e):void 0})}async setProgressBar(e){return s("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return s("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async setTitleBarStyle(e){return s("plugin:window|set_title_bar_style",{label:this.label,value:e})}async setTheme(e){return s("plugin:window|set_theme",{label:this.label,value:e})}async onResized(e){return this.listen(o.WINDOW_RESIZED,i=>{i.payload=new b(i.payload),e(i)})}async onMoved(e){return this.listen(o.WINDOW_MOVED,i=>{i.payload=new u(i.payload),e(i)})}async onCloseRequested(e){return this.listen(o.WINDOW_CLOSE_REQUESTED,async i=>{const n=new ae(i);await e(n),n.isPreventDefault()||await this.destroy()})}async onDragDropEvent(e){const i=await this.listen(o.DRAG_ENTER,a=>{e({...a,payload:{type:"enter",paths:a.payload.paths,position:new u(a.payload.position)}})}),n=await this.listen(o.DRAG_OVER,a=>{e({...a,payload:{type:"over",position:new u(a.payload.position)}})}),l=await this.listen(o.DRAG_DROP,a=>{e({...a,payload:{type:"drop",paths:a.payload.paths,position:new u(a.payload.position)}})}),r=await this.listen(o.DRAG_LEAVE,a=>{e({...a,payload:{type:"leave"}})});return()=>{i(),l(),n(),r()}}async onFocusChanged(e){const i=await this.listen(o.WINDOW_FOCUS,l=>{e({...l,payload:!0})}),n=await this.listen(o.WINDOW_BLUR,l=>{e({...l,payload:!1})});return()=>{i(),n()}}async onScaleChanged(e){return this.listen(o.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(o.WINDOW_THEME_CHANGED,e)}}var M;(function(t){t.Disabled="disabled",t.Throttle="throttle",t.Suspend="suspend"})(M||(M={}));var F;(function(t){t.AppearanceBased="appearanceBased",t.Light="light",t.Dark="dark",t.MediumLight="mediumLight",t.UltraDark="ultraDark",t.Titlebar="titlebar",t.Selection="selection",t.Menu="menu",t.Popover="popover",t.Sidebar="sidebar",t.HeaderView="headerView",t.Sheet="sheet",t.WindowBackground="windowBackground",t.HudWindow="hudWindow",t.FullScreenUI="fullScreenUI",t.Tooltip="tooltip",t.ContentBackground="contentBackground",t.UnderWindowBackground="underWindowBackground",t.UnderPageBackground="underPageBackground",t.Mica="mica",t.Blur="blur",t.Acrylic="acrylic",t.Tabbed="tabbed",t.TabbedDark="tabbedDark",t.TabbedLight="tabbedLight"})(F||(F={}));var B;(function(t){t.FollowsWindowActiveState="followsWindowActiveState",t.Active="active",t.Inactive="inactive"})(B||(B={}));function re(t){return t===null?null:{name:t.name,scaleFactor:t.scaleFactor,position:new u(t.position),size:new b(t.size)}}async function oe(){return s("plugin:window|available_monitors").then(t=>t.map(re))}function q(){return new T(j(),window.__TAURI_INTERNALS__.metadata.currentWebview.label,{skip:!0})}async function V(){return s("plugin:webview|get_all_webviews").then(t=>t.map(e=>new T(new E(e.windowLabel,{skip:!0}),e.label,{skip:!0})))}const k=["tauri://created","tauri://error"];class T{constructor(e,i,n){this.window=e,this.label=i,this.listeners=Object.create(null),n!=null&&n.skip||s("plugin:webview|create_webview",{windowLabel:e.label,label:i,options:n}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static async getByLabel(e){var i;return(i=(await V()).find(n=>n.label===e))!==null&&i!==void 0?i:null}static getCurrent(){return q()}static async getAll(){return V()}async listen(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:f(e,i,{target:{kind:"Webview",label:this.label}})}async once(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:A(e,i,{target:{kind:"Webview",label:this.label}})}async emit(e,i){if(k.includes(e)){for(const n of this.listeners[e]||[])n({event:e,id:-1,payload:i});return}return L(e,i)}async emitTo(e,i,n){if(k.includes(i)){for(const l of this.listeners[i]||[])l({event:i,id:-1,payload:n});return}return H(e,i,n)}_handleTauriEvent(e,i){return k.includes(e)?(e in this.listeners?this.listeners[e].push(i):this.listeners[e]=[i],!0):!1}async position(){return s("plugin:webview|webview_position",{label:this.label}).then(e=>new u(e))}async size(){return s("plugin:webview|webview_size",{label:this.label}).then(e=>new b(e))}async close(){return s("plugin:webview|close",{label:this.label})}async setSize(e){return s("plugin:webview|set_webview_size",{label:this.label,value:e instanceof w?e:new w(e)})}async setPosition(e){return s("plugin:webview|set_webview_position",{label:this.label,value:e instanceof y?e:new y(e)})}async setFocus(){return s("plugin:webview|set_webview_focus",{label:this.label})}async hide(){return s("plugin:webview|webview_hide",{label:this.label})}async show(){return s("plugin:webview|webview_show",{label:this.label})}async setZoom(e){return s("plugin:webview|set_webview_zoom",{label:this.label,value:e})}async reparent(e){return s("plugin:webview|reparent",{label:this.label,window:typeof e=="string"?e:e.label})}async clearAllBrowsingData(){return s("plugin:webview|clear_all_browsing_data")}async setBackgroundColor(e){return s("plugin:webview|set_webview_background_color",{color:e})}async onDragDropEvent(e){const i=await this.listen(o.DRAG_ENTER,a=>{e({...a,payload:{type:"enter",paths:a.payload.paths,position:new u(a.payload.position)}})}),n=await this.listen(o.DRAG_OVER,a=>{e({...a,payload:{type:"over",position:new u(a.payload.position)}})}),l=await this.listen(o.DRAG_DROP,a=>{e({...a,payload:{type:"drop",paths:a.payload.paths,position:new u(a.payload.position)}})}),r=await this.listen(o.DRAG_LEAVE,a=>{e({...a,payload:{type:"leave"}})});return()=>{i(),l(),n(),r()}}}function J(){const t=q();return new d(t.label,{skip:!0})}async function z(){return s("plugin:window|get_all_windows").then(t=>t.map(e=>new d(e,{skip:!0})))}class d{constructor(e,i={}){var n;this.label=e,this.listeners=Object.create(null),i!=null&&i.skip||s("plugin:webview|create_webview_window",{options:{...i,parent:typeof i.parent=="string"?i.parent:(n=i.parent)===null||n===void 0?void 0:n.label,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static async getByLabel(e){var i;const n=(i=(await z()).find(l=>l.label===e))!==null&&i!==void 0?i:null;return n?new d(n.label,{skip:!0}):null}static getCurrent(){return J()}static async getAll(){return z()}async listen(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:f(e,i,{target:{kind:"WebviewWindow",label:this.label}})}async once(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:A(e,i,{target:{kind:"WebviewWindow",label:this.label}})}async setBackgroundColor(e){return s("plugin:window|set_background_color",{color:e}).then(()=>s("plugin:webview|set_webview_background_color",{color:e}))}}ue(d,[E,T]);function ue(t,e){(Array.isArray(e)?e:[e]).forEach(i=>{Object.getOwnPropertyNames(i.prototype).forEach(n=>{var l;typeof t.prototype=="object"&&t.prototype&&n in t.prototype||Object.defineProperty(t.prototype,n,(l=Object.getOwnPropertyDescriptor(i.prototype,n))!==null&&l!==void 0?l:Object.create(null))})})}const ce=t=>JSON.stringify(t),he=t=>JSON.parse(t),D="drift://action",we="tauri://error",de="tauri://created",be=t=>new Error(`Window not found: ${t}`),p=250,ye=c.y.seconds(1),m=t=>{if(t!=null)return{width:Math.max(t.width,p),height:Math.max(t.height,p)}},pe=t=>{const{size:e,maxSize:i}=t;return{...t,maxSize:m(i),size:m(e)}},ge=async()=>(await oe()).map(e=>{const i=P(e.position,e.scaleFactor),n={width:e.size.width,height:e.size.height};return c.Mo.construct(i,n)}),G=async t=>(await ge()).some(i=>c.Mo.contains(i,t));class _e{constructor(e){W(this,"win");W(this,"unsubscribe");W(this,"fullscreenPoll",null);this.win=e??J(),this.unsubscribe={}}async configure(){await this.startFullscreenPoll()}async startFullscreenPoll(){if(c.S.getOS()!=="macOS")return;let e=(await this.getProps()).fullscreen;this.fullscreenPoll=setInterval(()=>{this.win.isFullscreen().then(i=>{i!==e&&(e=i,this.emit({action:c.runtimeSetWindowProps({label:this.win.label,fullscreen:i})},void 0,"WHITELIST").catch(console.error))}).catch(console.error)},ye.milliseconds)}label(){return this.win.label}isMain(){return this.win.label===c.MAIN_WINDOW}release(){Object.values(this.unsubscribe).forEach(e=>e==null?void 0:e()),this.fullscreenPoll!=null&&clearInterval(this.fullscreenPoll),this.unsubscribe={}}async emit(e,i,n=this.label()){const l=ce({...e,emitter:n});if(i==null)return await L(D,l);const r=await d.getByLabel(i);if(r==null)throw be(i);await r.emit(D,l)}async subscribe(e){this.release(),await this.startFullscreenPoll(),this.unsubscribe[D]=await f(D,n=>e(he(n.payload)));const i=ve();for(const{key:n,handler:l,debounce:r}of i)this.unsubscribe[n]=await this.win.listen(n,ie.o(()=>{l(this.win).then(a=>{a!=null&&this.emit({action:a},void 0,"WHITELIST").catch(console.error)}).catch(console.error)},r))}onCloseRequested(e){this.win.onCloseRequested(i=>{i.preventDefault(),e()})}async create(e,i){i=c.I.copy(i);const{size:n,minSize:l,maxSize:r,position:a,...$}=pe(i);(n==null?void 0:n.width)!=null&&(n.width=Math.max(n.width,p)),(n==null?void 0:n.height)!=null&&(n.height=Math.max(n.height,p)),(r==null?void 0:r.width)!=null&&(r.width=Math.max(r.width,p)),(r==null?void 0:r.height)!=null&&(r.height=Math.max(r.height,p)),a!=null&&(await G(a)||(a.x=0,a.y=0));try{const g=new d(e,{x:a==null?void 0:a.x,y:a==null?void 0:a.y,width:n==null?void 0:n.width,height:n==null?void 0:n.height,minWidth:l==null?void 0:l.width,minHeight:l==null?void 0:l.height,maxWidth:r==null?void 0:r.width,maxHeight:r==null?void 0:r.height,titleBarStyle:"overlay",dragDropEnabled:!1,...$});return await new Promise((Q,Y)=>{g.once(we,K=>Y(new Error(JSON.stringify(K.payload)))),g.once(de,()=>Q())})}catch(g){console.error(g)}}async close(e){const i=await d.getByLabel(e);if(i!=null)try{await i.destroy()}catch(n){console.error(n,e)}else{const n=await z();console.error("Window not found",e,n.map(l=>l.label))}}async listLabels(){return(await z()).map(i=>i.label)}async focus(){return await this.win.setFocus()}async setMinimized(e){return e?await this.win.minimize():await this.win.unminimize()}async setMaximized(e){return e?await this.win.maximize():await this.win.unmaximize()}async setVisible(e){return e?await this.win.show():await this.win.hide()}async setFullscreen(e){await this.win.setFullscreen(e)}async center(){return await this.win.center()}async setPosition(e){const i=new N(e.x,e.y);await G(e)||(i.x=0,i.y=0),await this.win.setPosition(i)}async setSize(e){e=m(e),await this.win.setSize(new _(e.width,e.height))}async setMinSize(e){e=m(e),await this.win.setMinSize(new _(e.width,e.height))}async setMaxSize(e){e=m(e),await this.win.setMaxSize(new _(e.width,e.height))}async setResizable(e){var i,n;return o.WINDOW_RESIZED in this.unsubscribe&&!e&&((n=(i=this.unsubscribe)[o.WINDOW_RESIZED])==null||n.call(i),delete this.unsubscribe[o.WINDOW_RESIZED]),await this.win.setResizable(e)}async setSkipTaskbar(e){return await this.win.setSkipTaskbar(e)}async setAlwaysOnTop(e){return await this.win.setAlwaysOnTop(e)}async setTitle(e){return await this.win.setTitle(e)}async setDecorations(e){return await this.win.setDecorations(e)}async getProps(){const e=await this.win.scaleFactor(),i=await this.win.isVisible();return{position:P(await this.win.innerPosition(),e),size:Z(await this.win.innerSize(),e),maximized:await this.win.isMaximized(),visible:i,fullscreen:await this.win.isFullscreen()}}}const ve=()=>[{key:o.WINDOW_RESIZED,debounce:200,handler:async t=>{const e=await t.scaleFactor(),i=await t.isVisible(),n={label:t.label,maximized:await t.isMaximized(),visible:i,minimized:!i,position:P(await t.innerPosition(),e),size:Z(await t.innerSize(),e)};return c.runtimeSetWindowProps(n)}},{key:o.WINDOW_MOVED,debounce:200,handler:async t=>{const e=await(t==null?void 0:t.scaleFactor());if(e==null)return null;const i=P(await t.innerPosition(),e),n=await t.isVisible(),l={label:t.label,visible:n,position:i};return c.runtimeSetWindowProps(l)}},{key:o.WINDOW_BLUR,debounce:0,handler:async t=>c.runtimeSetWindowProps({focus:!1,label:t.label})},{key:o.WINDOW_FOCUS,debounce:0,handler:async t=>c.runtimeSetWindowProps({focus:!0,visible:!0,minimized:!1,label:t.label})}],P=(t,e)=>c.G.scale(t,1/e),Z=(t,e)=>c._.scale(t,1/e);exports.TauriRuntime=_e;
1
+ "use strict";var X=Object.defineProperty;var ee=(t,e,i)=>e in t?X(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var W=(t,e,i)=>ee(t,typeof e!="symbol"?e+"":e,i);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./state-DliTJ_c2.cjs"),ie=require("./debounce-BUAIXXZt.cjs");function te(t,e,i,n){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return i==="m"?n:i==="a"?n.call(t):n?n.value:e.get(t)}function ne(t,e,i,n,l){if(typeof e=="function"?t!==e||!0:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return e.set(t,i),i}var O;const h="__TAURI_TO_IPC_KEY__";function se(t,e=!1){return window.__TAURI_INTERNALS__.transformCallback(t,e)}async function s(t,e={},i){return window.__TAURI_INTERNALS__.invoke(t,e,i)}class le{get rid(){return te(this,O,"f")}constructor(e){O.set(this,void 0),ne(this,O,e)}async close(){return s("plugin:resources|close",{rid:this.rid})}}O=new WeakMap;var o;(function(t){t.WINDOW_RESIZED="tauri://resize",t.WINDOW_MOVED="tauri://move",t.WINDOW_CLOSE_REQUESTED="tauri://close-requested",t.WINDOW_DESTROYED="tauri://destroyed",t.WINDOW_FOCUS="tauri://focus",t.WINDOW_BLUR="tauri://blur",t.WINDOW_SCALE_FACTOR_CHANGED="tauri://scale-change",t.WINDOW_THEME_CHANGED="tauri://theme-changed",t.WINDOW_CREATED="tauri://window-created",t.WEBVIEW_CREATED="tauri://webview-created",t.DRAG_ENTER="tauri://drag-enter",t.DRAG_OVER="tauri://drag-over",t.DRAG_DROP="tauri://drag-drop",t.DRAG_LEAVE="tauri://drag-leave"})(o||(o={}));async function G(t,e){await s("plugin:event|unlisten",{event:t,eventId:e})}async function f(t,e,i){var n;const l=typeof(i==null?void 0:i.target)=="string"?{kind:"AnyLabel",label:i.target}:(n=i==null?void 0:i.target)!==null&&n!==void 0?n:{kind:"Any"};return s("plugin:event|listen",{event:t,target:l,handler:se(e)}).then(r=>async()=>G(t,r))}async function x(t,e,i){return f(t,n=>{G(t,n.id),e(n)},i)}async function L(t,e){await s("plugin:event|emit",{event:t,payload:e})}async function H(t,e,i){await s("plugin:event|emit_to",{target:typeof t=="string"?{kind:"AnyLabel",label:t}:t,event:e,payload:i})}class _{constructor(...e){this.type="Logical",e.length===1?"Logical"in e[0]?(this.width=e[0].Logical.width,this.height=e[0].Logical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toPhysical(e){return new d(this.width*e,this.height*e)}[h](){return{width:this.width,height:this.height}}toJSON(){return this[h]()}}class d{constructor(...e){this.type="Physical",e.length===1?"Physical"in e[0]?(this.width=e[0].Physical.width,this.height=e[0].Physical.height):(this.width=e[0].width,this.height=e[0].height):(this.width=e[0],this.height=e[1])}toLogical(e){return new _(this.width/e,this.height/e)}[h](){return{width:this.width,height:this.height}}toJSON(){return this[h]()}}class w{constructor(e){this.size=e}toLogical(e){return this.size instanceof _?this.size:this.size.toLogical(e)}toPhysical(e){return this.size instanceof d?this.size:this.size.toPhysical(e)}[h](){return{[`${this.size.type}`]:{width:this.size.width,height:this.size.height}}}toJSON(){return this[h]()}}class N{constructor(...e){this.type="Logical",e.length===1?"Logical"in e[0]?(this.x=e[0].Logical.x,this.y=e[0].Logical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toPhysical(e){return new u(this.x*e,this.y*e)}[h](){return{x:this.x,y:this.y}}toJSON(){return this[h]()}}class u{constructor(...e){this.type="Physical",e.length===1?"Physical"in e[0]?(this.x=e[0].Physical.x,this.y=e[0].Physical.y):(this.x=e[0].x,this.y=e[0].y):(this.x=e[0],this.y=e[1])}toLogical(e){return new N(this.x/e,this.y/e)}[h](){return{x:this.x,y:this.y}}toJSON(){return this[h]()}}class y{constructor(e){this.position=e}toLogical(e){return this.position instanceof N?this.position:this.position.toLogical(e)}toPhysical(e){return this.position instanceof u?this.position:this.position.toPhysical(e)}[h](){return{[`${this.position.type}`]:{x:this.position.x,y:this.position.y}}}toJSON(){return this[h]()}}class v extends le{constructor(e){super(e)}static async new(e,i,n){return s("plugin:image|new",{rgba:S(e),width:i,height:n}).then(l=>new v(l))}static async fromBytes(e){return s("plugin:image|from_bytes",{bytes:S(e)}).then(i=>new v(i))}static async fromPath(e){return s("plugin:image|from_path",{path:e}).then(i=>new v(i))}async rgba(){return s("plugin:image|rgba",{rid:this.rid}).then(e=>new Uint8Array(e))}async size(){return s("plugin:image|size",{rid:this.rid})}}function S(t){return t==null?null:typeof t=="string"?t:t instanceof v?t.rid:t}var k;(function(t){t[t.Critical=1]="Critical",t[t.Informational=2]="Informational"})(k||(k={}));class ae{constructor(e){this._preventDefault=!1,this.event=e.event,this.id=e.id}preventDefault(){this._preventDefault=!0}isPreventDefault(){return this._preventDefault}}var C;(function(t){t.None="none",t.Normal="normal",t.Indeterminate="indeterminate",t.Paused="paused",t.Error="error"})(C||(C={}));function j(){return new E(window.__TAURI_INTERNALS__.metadata.currentWindow.label,{skip:!0})}async function I(){return s("plugin:window|get_all_windows").then(t=>t.map(e=>new E(e,{skip:!0})))}const R=["tauri://created","tauri://error"];class E{constructor(e,i={}){var n;this.label=e,this.listeners=Object.create(null),i!=null&&i.skip||s("plugin:window|create",{options:{...i,parent:typeof i.parent=="string"?i.parent:(n=i.parent)===null||n===void 0?void 0:n.label,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static async getByLabel(e){var i;return(i=(await I()).find(n=>n.label===e))!==null&&i!==void 0?i:null}static getCurrent(){return j()}static async getAll(){return I()}static async getFocusedWindow(){for(const e of await I())if(await e.isFocused())return e;return null}async listen(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:f(e,i,{target:{kind:"Window",label:this.label}})}async once(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:x(e,i,{target:{kind:"Window",label:this.label}})}async emit(e,i){if(R.includes(e)){for(const n of this.listeners[e]||[])n({event:e,id:-1,payload:i});return}return L(e,i)}async emitTo(e,i,n){if(R.includes(i)){for(const l of this.listeners[i]||[])l({event:i,id:-1,payload:n});return}return H(e,i,n)}_handleTauriEvent(e,i){return R.includes(e)?(e in this.listeners?this.listeners[e].push(i):this.listeners[e]=[i],!0):!1}async scaleFactor(){return s("plugin:window|scale_factor",{label:this.label})}async innerPosition(){return s("plugin:window|inner_position",{label:this.label}).then(e=>new u(e))}async outerPosition(){return s("plugin:window|outer_position",{label:this.label}).then(e=>new u(e))}async innerSize(){return s("plugin:window|inner_size",{label:this.label}).then(e=>new d(e))}async outerSize(){return s("plugin:window|outer_size",{label:this.label}).then(e=>new d(e))}async isFullscreen(){return s("plugin:window|is_fullscreen",{label:this.label})}async isMinimized(){return s("plugin:window|is_minimized",{label:this.label})}async isMaximized(){return s("plugin:window|is_maximized",{label:this.label})}async isFocused(){return s("plugin:window|is_focused",{label:this.label})}async isDecorated(){return s("plugin:window|is_decorated",{label:this.label})}async isResizable(){return s("plugin:window|is_resizable",{label:this.label})}async isMaximizable(){return s("plugin:window|is_maximizable",{label:this.label})}async isMinimizable(){return s("plugin:window|is_minimizable",{label:this.label})}async isClosable(){return s("plugin:window|is_closable",{label:this.label})}async isVisible(){return s("plugin:window|is_visible",{label:this.label})}async title(){return s("plugin:window|title",{label:this.label})}async theme(){return s("plugin:window|theme",{label:this.label})}async isAlwaysOnTop(){return s("plugin:window|is_always_on_top",{label:this.label})}async center(){return s("plugin:window|center",{label:this.label})}async requestUserAttention(e){let i=null;return e&&(e===k.Critical?i={type:"Critical"}:i={type:"Informational"}),s("plugin:window|request_user_attention",{label:this.label,value:i})}async setResizable(e){return s("plugin:window|set_resizable",{label:this.label,value:e})}async setEnabled(e){return s("plugin:window|set_enabled",{label:this.label,value:e})}async isEnabled(){return s("plugin:window|is_enabled",{label:this.label})}async setMaximizable(e){return s("plugin:window|set_maximizable",{label:this.label,value:e})}async setMinimizable(e){return s("plugin:window|set_minimizable",{label:this.label,value:e})}async setClosable(e){return s("plugin:window|set_closable",{label:this.label,value:e})}async setTitle(e){return s("plugin:window|set_title",{label:this.label,value:e})}async maximize(){return s("plugin:window|maximize",{label:this.label})}async unmaximize(){return s("plugin:window|unmaximize",{label:this.label})}async toggleMaximize(){return s("plugin:window|toggle_maximize",{label:this.label})}async minimize(){return s("plugin:window|minimize",{label:this.label})}async unminimize(){return s("plugin:window|unminimize",{label:this.label})}async show(){return s("plugin:window|show",{label:this.label})}async hide(){return s("plugin:window|hide",{label:this.label})}async close(){return s("plugin:window|close",{label:this.label})}async destroy(){return s("plugin:window|destroy",{label:this.label})}async setDecorations(e){return s("plugin:window|set_decorations",{label:this.label,value:e})}async setShadow(e){return s("plugin:window|set_shadow",{label:this.label,value:e})}async setEffects(e){return s("plugin:window|set_effects",{label:this.label,value:e})}async clearEffects(){return s("plugin:window|set_effects",{label:this.label,value:null})}async setAlwaysOnTop(e){return s("plugin:window|set_always_on_top",{label:this.label,value:e})}async setAlwaysOnBottom(e){return s("plugin:window|set_always_on_bottom",{label:this.label,value:e})}async setContentProtected(e){return s("plugin:window|set_content_protected",{label:this.label,value:e})}async setSize(e){return s("plugin:window|set_size",{label:this.label,value:e instanceof w?e:new w(e)})}async setMinSize(e){return s("plugin:window|set_min_size",{label:this.label,value:e instanceof w?e:e?new w(e):null})}async setMaxSize(e){return s("plugin:window|set_max_size",{label:this.label,value:e instanceof w?e:e?new w(e):null})}async setSizeConstraints(e){function i(n){return n?{Logical:n}:null}return s("plugin:window|set_size_constraints",{label:this.label,value:{minWidth:i(e==null?void 0:e.minWidth),minHeight:i(e==null?void 0:e.minHeight),maxWidth:i(e==null?void 0:e.maxWidth),maxHeight:i(e==null?void 0:e.maxHeight)}})}async setPosition(e){return s("plugin:window|set_position",{label:this.label,value:e instanceof y?e:new y(e)})}async setFullscreen(e){return s("plugin:window|set_fullscreen",{label:this.label,value:e})}async setFocus(){return s("plugin:window|set_focus",{label:this.label})}async setIcon(e){return s("plugin:window|set_icon",{label:this.label,value:S(e)})}async setSkipTaskbar(e){return s("plugin:window|set_skip_taskbar",{label:this.label,value:e})}async setCursorGrab(e){return s("plugin:window|set_cursor_grab",{label:this.label,value:e})}async setCursorVisible(e){return s("plugin:window|set_cursor_visible",{label:this.label,value:e})}async setCursorIcon(e){return s("plugin:window|set_cursor_icon",{label:this.label,value:e})}async setBackgroundColor(e){return s("plugin:window|set_background_color",{color:e})}async setCursorPosition(e){return s("plugin:window|set_cursor_position",{label:this.label,value:e instanceof y?e:new y(e)})}async setIgnoreCursorEvents(e){return s("plugin:window|set_ignore_cursor_events",{label:this.label,value:e})}async startDragging(){return s("plugin:window|start_dragging",{label:this.label})}async startResizeDragging(e){return s("plugin:window|start_resize_dragging",{label:this.label,value:e})}async setBadgeCount(e){return s("plugin:window|set_badge_count",{label:this.label,value:e})}async setBadgeLabel(e){return s("plugin:window|set_badge_label",{label:this.label,value:e})}async setOverlayIcon(e){return s("plugin:window|set_overlay_icon",{label:this.label,value:e?S(e):void 0})}async setProgressBar(e){return s("plugin:window|set_progress_bar",{label:this.label,value:e})}async setVisibleOnAllWorkspaces(e){return s("plugin:window|set_visible_on_all_workspaces",{label:this.label,value:e})}async setTitleBarStyle(e){return s("plugin:window|set_title_bar_style",{label:this.label,value:e})}async setTheme(e){return s("plugin:window|set_theme",{label:this.label,value:e})}async onResized(e){return this.listen(o.WINDOW_RESIZED,i=>{i.payload=new d(i.payload),e(i)})}async onMoved(e){return this.listen(o.WINDOW_MOVED,i=>{i.payload=new u(i.payload),e(i)})}async onCloseRequested(e){return this.listen(o.WINDOW_CLOSE_REQUESTED,async i=>{const n=new ae(i);await e(n),n.isPreventDefault()||await this.destroy()})}async onDragDropEvent(e){const i=await this.listen(o.DRAG_ENTER,a=>{e({...a,payload:{type:"enter",paths:a.payload.paths,position:new u(a.payload.position)}})}),n=await this.listen(o.DRAG_OVER,a=>{e({...a,payload:{type:"over",position:new u(a.payload.position)}})}),l=await this.listen(o.DRAG_DROP,a=>{e({...a,payload:{type:"drop",paths:a.payload.paths,position:new u(a.payload.position)}})}),r=await this.listen(o.DRAG_LEAVE,a=>{e({...a,payload:{type:"leave"}})});return()=>{i(),l(),n(),r()}}async onFocusChanged(e){const i=await this.listen(o.WINDOW_FOCUS,l=>{e({...l,payload:!0})}),n=await this.listen(o.WINDOW_BLUR,l=>{e({...l,payload:!1})});return()=>{i(),n()}}async onScaleChanged(e){return this.listen(o.WINDOW_SCALE_FACTOR_CHANGED,e)}async onThemeChanged(e){return this.listen(o.WINDOW_THEME_CHANGED,e)}}var M;(function(t){t.Disabled="disabled",t.Throttle="throttle",t.Suspend="suspend"})(M||(M={}));var F;(function(t){t.AppearanceBased="appearanceBased",t.Light="light",t.Dark="dark",t.MediumLight="mediumLight",t.UltraDark="ultraDark",t.Titlebar="titlebar",t.Selection="selection",t.Menu="menu",t.Popover="popover",t.Sidebar="sidebar",t.HeaderView="headerView",t.Sheet="sheet",t.WindowBackground="windowBackground",t.HudWindow="hudWindow",t.FullScreenUI="fullScreenUI",t.Tooltip="tooltip",t.ContentBackground="contentBackground",t.UnderWindowBackground="underWindowBackground",t.UnderPageBackground="underPageBackground",t.Mica="mica",t.Blur="blur",t.Acrylic="acrylic",t.Tabbed="tabbed",t.TabbedDark="tabbedDark",t.TabbedLight="tabbedLight"})(F||(F={}));var B;(function(t){t.FollowsWindowActiveState="followsWindowActiveState",t.Active="active",t.Inactive="inactive"})(B||(B={}));function re(t){return t===null?null:{name:t.name,scaleFactor:t.scaleFactor,position:new u(t.position),size:new d(t.size)}}async function oe(){return s("plugin:window|available_monitors").then(t=>t.map(re))}function J(){return new T(j(),window.__TAURI_INTERNALS__.metadata.currentWebview.label,{skip:!0})}async function V(){return s("plugin:webview|get_all_webviews").then(t=>t.map(e=>new T(new E(e.windowLabel,{skip:!0}),e.label,{skip:!0})))}const A=["tauri://created","tauri://error"];class T{constructor(e,i,n){this.window=e,this.label=i,this.listeners=Object.create(null),n!=null&&n.skip||s("plugin:webview|create_webview",{windowLabel:e.label,label:i,options:n}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static async getByLabel(e){var i;return(i=(await V()).find(n=>n.label===e))!==null&&i!==void 0?i:null}static getCurrent(){return J()}static async getAll(){return V()}async listen(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:f(e,i,{target:{kind:"Webview",label:this.label}})}async once(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:x(e,i,{target:{kind:"Webview",label:this.label}})}async emit(e,i){if(A.includes(e)){for(const n of this.listeners[e]||[])n({event:e,id:-1,payload:i});return}return L(e,i)}async emitTo(e,i,n){if(A.includes(i)){for(const l of this.listeners[i]||[])l({event:i,id:-1,payload:n});return}return H(e,i,n)}_handleTauriEvent(e,i){return A.includes(e)?(e in this.listeners?this.listeners[e].push(i):this.listeners[e]=[i],!0):!1}async position(){return s("plugin:webview|webview_position",{label:this.label}).then(e=>new u(e))}async size(){return s("plugin:webview|webview_size",{label:this.label}).then(e=>new d(e))}async close(){return s("plugin:webview|webview_close",{label:this.label})}async setSize(e){return s("plugin:webview|set_webview_size",{label:this.label,value:e instanceof w?e:new w(e)})}async setPosition(e){return s("plugin:webview|set_webview_position",{label:this.label,value:e instanceof y?e:new y(e)})}async setFocus(){return s("plugin:webview|set_webview_focus",{label:this.label})}async hide(){return s("plugin:webview|webview_hide",{label:this.label})}async show(){return s("plugin:webview|webview_show",{label:this.label})}async setZoom(e){return s("plugin:webview|set_webview_zoom",{label:this.label,value:e})}async reparent(e){return s("plugin:webview|reparent",{label:this.label,window:typeof e=="string"?e:e.label})}async clearAllBrowsingData(){return s("plugin:webview|clear_all_browsing_data")}async setBackgroundColor(e){return s("plugin:webview|set_webview_background_color",{color:e})}async onDragDropEvent(e){const i=await this.listen(o.DRAG_ENTER,a=>{e({...a,payload:{type:"enter",paths:a.payload.paths,position:new u(a.payload.position)}})}),n=await this.listen(o.DRAG_OVER,a=>{e({...a,payload:{type:"over",position:new u(a.payload.position)}})}),l=await this.listen(o.DRAG_DROP,a=>{e({...a,payload:{type:"drop",paths:a.payload.paths,position:new u(a.payload.position)}})}),r=await this.listen(o.DRAG_LEAVE,a=>{e({...a,payload:{type:"leave"}})});return()=>{i(),l(),n(),r()}}}function q(){const t=J();return new b(t.label,{skip:!0})}async function z(){return s("plugin:window|get_all_windows").then(t=>t.map(e=>new b(e,{skip:!0})))}class b{constructor(e,i={}){var n;this.label=e,this.listeners=Object.create(null),i!=null&&i.skip||s("plugin:webview|create_webview_window",{options:{...i,parent:typeof i.parent=="string"?i.parent:(n=i.parent)===null||n===void 0?void 0:n.label,label:e}}).then(async()=>this.emit("tauri://created")).catch(async l=>this.emit("tauri://error",l))}static async getByLabel(e){var i;const n=(i=(await z()).find(l=>l.label===e))!==null&&i!==void 0?i:null;return n?new b(n.label,{skip:!0}):null}static getCurrent(){return q()}static async getAll(){return z()}async listen(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:f(e,i,{target:{kind:"WebviewWindow",label:this.label}})}async once(e,i){return this._handleTauriEvent(e,i)?()=>{const n=this.listeners[e];n.splice(n.indexOf(i),1)}:x(e,i,{target:{kind:"WebviewWindow",label:this.label}})}async setBackgroundColor(e){return s("plugin:window|set_background_color",{color:e}).then(()=>s("plugin:webview|set_webview_background_color",{color:e}))}}ue(b,[E,T]);function ue(t,e){(Array.isArray(e)?e:[e]).forEach(i=>{Object.getOwnPropertyNames(i.prototype).forEach(n=>{var l;typeof t.prototype=="object"&&t.prototype&&n in t.prototype||Object.defineProperty(t.prototype,n,(l=Object.getOwnPropertyDescriptor(i.prototype,n))!==null&&l!==void 0?l:Object.create(null))})})}const ce=t=>JSON.stringify(t),he=t=>JSON.parse(t),D="drift://action",we="tauri://error",be="tauri://created",de=t=>new Error(`Window not found: ${t}`),p=250,ye=c.w.seconds(1),m=t=>{if(t!=null)return{width:Math.max(t.width,p),height:Math.max(t.height,p)}},pe=t=>{const{size:e,maxSize:i}=t;return{...t,maxSize:m(i),size:m(e)}},ge=async()=>(await oe()).map(e=>{const i=P(e.position,e.scaleFactor),n={width:e.size.width,height:e.size.height};return c.$t.construct(i,n)}),U=async t=>(await ge()).some(i=>c.$t.contains(i,t));class _e{constructor(e){W(this,"win");W(this,"unsubscribe");W(this,"fullscreenPoll",null);this.win=e??q(),this.unsubscribe={}}async configure(){await this.startFullscreenPoll()}async startFullscreenPoll(){if(c.S.getOS()!=="macOS")return;let e=(await this.getProps()).fullscreen;this.fullscreenPoll=setInterval(()=>{this.win.isFullscreen().then(i=>{i!==e&&(e=i,this.emit({action:c.runtimeSetWindowProps({label:this.win.label,fullscreen:i})},void 0,"WHITELIST").catch(console.error))}).catch(console.error)},ye.milliseconds)}label(){return this.win.label}isMain(){return this.win.label===c.MAIN_WINDOW}release(){Object.values(this.unsubscribe).forEach(e=>e==null?void 0:e()),this.fullscreenPoll!=null&&clearInterval(this.fullscreenPoll),this.unsubscribe={}}async emit(e,i,n=this.label()){const l=ce({...e,emitter:n});if(i==null)return await L(D,l);const r=await b.getByLabel(i);if(r==null)throw de(i);await r.emit(D,l)}async subscribe(e){this.release(),await this.startFullscreenPoll(),this.unsubscribe[D]=await f(D,n=>e(he(n.payload)));const i=ve();for(const{key:n,handler:l,debounce:r}of i)this.unsubscribe[n]=await this.win.listen(n,ie.o(()=>{l(this.win).then(a=>{a!=null&&this.emit({action:a},void 0,"WHITELIST").catch(console.error)}).catch(console.error)},r))}onCloseRequested(e){this.win.onCloseRequested(i=>{i.preventDefault(),e()})}async create(e,i){i=c.I.copy(i);const{size:n,minSize:l,maxSize:r,position:a,...$}=pe(i);(n==null?void 0:n.width)!=null&&(n.width=Math.max(n.width,p)),(n==null?void 0:n.height)!=null&&(n.height=Math.max(n.height,p)),(r==null?void 0:r.width)!=null&&(r.width=Math.max(r.width,p)),(r==null?void 0:r.height)!=null&&(r.height=Math.max(r.height,p)),a!=null&&(await U(a)||(a.x=0,a.y=0));try{const g=new b(e,{x:a==null?void 0:a.x,y:a==null?void 0:a.y,width:n==null?void 0:n.width,height:n==null?void 0:n.height,minWidth:l==null?void 0:l.width,minHeight:l==null?void 0:l.height,maxWidth:r==null?void 0:r.width,maxHeight:r==null?void 0:r.height,titleBarStyle:"overlay",dragDropEnabled:!1,...$});return await new Promise((Q,Y)=>{g.once(we,K=>Y(new Error(JSON.stringify(K.payload)))),g.once(be,()=>Q())})}catch(g){console.error(g)}}async close(e){const i=await b.getByLabel(e);if(i!=null)try{await i.destroy()}catch(n){console.error(n,e)}else{const n=await z();console.error("Window not found",e,n.map(l=>l.label))}}async listLabels(){return(await z()).map(i=>i.label)}async focus(){return await this.win.setFocus()}async setMinimized(e){return e?await this.win.minimize():await this.win.unminimize()}async setMaximized(e){return e?await this.win.maximize():await this.win.unmaximize()}async setVisible(e){return e?await this.win.show():await this.win.hide()}async setFullscreen(e){await this.win.setFullscreen(e)}async center(){return await this.win.center()}async setPosition(e){const i=new N(e.x,e.y);await U(e)||(i.x=0,i.y=0),await this.win.setPosition(i)}async setSize(e){e=m(e),await this.win.setSize(new _(e.width,e.height))}async setMinSize(e){e=m(e),await this.win.setMinSize(new _(e.width,e.height))}async setMaxSize(e){e=m(e),await this.win.setMaxSize(new _(e.width,e.height))}async setResizable(e){var i,n;return o.WINDOW_RESIZED in this.unsubscribe&&!e&&((n=(i=this.unsubscribe)[o.WINDOW_RESIZED])==null||n.call(i),delete this.unsubscribe[o.WINDOW_RESIZED]),await this.win.setResizable(e)}async setSkipTaskbar(e){return await this.win.setSkipTaskbar(e)}async setAlwaysOnTop(e){return await this.win.setAlwaysOnTop(e)}async setTitle(e){return await this.win.setTitle(e)}async setDecorations(e){return await this.win.setDecorations(e)}async getProps(){const e=await this.win.scaleFactor(),i=await this.win.isVisible();return{position:P(await this.win.innerPosition(),e),size:Z(await this.win.innerSize(),e),maximized:await this.win.isMaximized(),visible:i,fullscreen:await this.win.isFullscreen()}}}const ve=()=>[{key:o.WINDOW_RESIZED,debounce:200,handler:async t=>{const e=await t.scaleFactor(),i=await t.isVisible(),n={label:t.label,maximized:await t.isMaximized(),visible:i,minimized:!i,position:P(await t.innerPosition(),e),size:Z(await t.innerSize(),e)};return c.runtimeSetWindowProps(n)}},{key:o.WINDOW_MOVED,debounce:200,handler:async t=>{const e=await(t==null?void 0:t.scaleFactor());if(e==null)return null;const i=P(await t.innerPosition(),e),n=await t.isVisible(),l={label:t.label,visible:n,position:i};return c.runtimeSetWindowProps(l)}},{key:o.WINDOW_BLUR,debounce:0,handler:async t=>c.runtimeSetWindowProps({focus:!1,label:t.label})},{key:o.WINDOW_FOCUS,debounce:0,handler:async t=>c.runtimeSetWindowProps({focus:!0,visible:!0,minimized:!1,label:t.label})}],P=(t,e)=>c.J.scale(t,1/e),Z=(t,e)=>c._.scale(t,1/e);exports.TauriRuntime=_e;
package/dist/tauri.js CHANGED
@@ -1,7 +1,7 @@
1
1
  var ee = Object.defineProperty;
2
2
  var ie = (t, e, i) => e in t ? ee(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i;
3
3
  var D = (t, e, i) => ie(t, typeof e != "symbol" ? e + "" : e, i);
4
- import { H as te, J as ne, r as g, M as se, K as le, _ as ae, G as re, L as H } from "./state-B4NiJdX7.js";
4
+ import { G as te, H as ne, r as g, M as se, K as le, _ as ae, J as re, $ as H } from "./state-DO5anaj4.js";
5
5
  import { o as oe } from "./debounce-DOZKRZa9.js";
6
6
  function ue(t, e, i, n) {
7
7
  if (typeof e == "function" ? t !== e || !0 : !e.has(t)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
@@ -56,7 +56,7 @@ async function m(t, e, i) {
56
56
  handler: he(e)
57
57
  }).then((r) => async () => U(t, r));
58
58
  }
59
- async function A(t, e, i) {
59
+ async function k(t, e, i) {
60
60
  return m(t, (n) => {
61
61
  U(t, n.id), e(n);
62
62
  }, i);
@@ -306,10 +306,10 @@ class v extends we {
306
306
  function z(t) {
307
307
  return t == null ? null : typeof t == "string" ? t : t instanceof v ? t.rid : t;
308
308
  }
309
- var k;
309
+ var A;
310
310
  (function(t) {
311
311
  t[t.Critical = 1] = "Critical", t[t.Informational = 2] = "Informational";
312
- })(k || (k = {}));
312
+ })(A || (A = {}));
313
313
  class be {
314
314
  constructor(e) {
315
315
  this._preventDefault = !1, this.event = e.event, this.id = e.id;
@@ -459,7 +459,7 @@ class S {
459
459
  return this._handleTauriEvent(e, i) ? () => {
460
460
  const n = this.listeners[e];
461
461
  n.splice(n.indexOf(i), 1);
462
- } : A(e, i, {
462
+ } : k(e, i, {
463
463
  target: { kind: "Window", label: this.label }
464
464
  });
465
465
  }
@@ -788,6 +788,21 @@ class S {
788
788
  label: this.label
789
789
  });
790
790
  }
791
+ /**
792
+ * Whether the window is configured to be always on top of other windows or not.
793
+ * @example
794
+ * ```typescript
795
+ * import { getCurrentWindow } from '@tauri-apps/api/window';
796
+ * const alwaysOnTop = await getCurrentWindow().isAlwaysOnTop();
797
+ * ```
798
+ *
799
+ * @returns Whether the window is visible or not.
800
+ */
801
+ async isAlwaysOnTop() {
802
+ return s("plugin:window|is_always_on_top", {
803
+ label: this.label
804
+ });
805
+ }
791
806
  // Setters
792
807
  /**
793
808
  * Centers the window.
@@ -826,7 +841,7 @@ class S {
826
841
  */
827
842
  async requestUserAttention(e) {
828
843
  let i = null;
829
- return e && (e === k.Critical ? i = { type: "Critical" } : i = { type: "Informational" }), s("plugin:window|request_user_attention", {
844
+ return e && (e === A.Critical ? i = { type: "Critical" } : i = { type: "Informational" }), s("plugin:window|request_user_attention", {
830
845
  label: this.label,
831
846
  value: i
832
847
  });
@@ -2013,7 +2028,7 @@ class C {
2013
2028
  return this._handleTauriEvent(e, i) ? () => {
2014
2029
  const n = this.listeners[e];
2015
2030
  n.splice(n.indexOf(i), 1);
2016
- } : A(e, i, {
2031
+ } : k(e, i, {
2017
2032
  target: { kind: "Webview", label: this.label }
2018
2033
  });
2019
2034
  }
@@ -2114,7 +2129,7 @@ class C {
2114
2129
  * @returns A promise indicating the success or failure of the operation.
2115
2130
  */
2116
2131
  async close() {
2117
- return s("plugin:webview|close", {
2132
+ return s("plugin:webview|webview_close", {
2118
2133
  label: this.label
2119
2134
  });
2120
2135
  }
@@ -2441,7 +2456,7 @@ class w {
2441
2456
  return this._handleTauriEvent(e, i) ? () => {
2442
2457
  const n = this.listeners[e];
2443
2458
  n.splice(n.indexOf(i), 1);
2444
- } : A(e, i, {
2459
+ } : k(e, i, {
2445
2460
  target: { kind: "WebviewWindow", label: this.label }
2446
2461
  });
2447
2462
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synnaxlabs/drift",
3
- "version": "0.40.0",
3
+ "version": "0.41.0",
4
4
  "description": "State synchronization and Redux state synchronization for Tauri Apps",
5
5
  "repository": "https://github.com/synnaxlabs/synnax/tree/main/drift",
6
6
  "type": "module",
@@ -15,29 +15,28 @@
15
15
  ],
16
16
  "dependencies": {
17
17
  "@reduxjs/toolkit": "^2.6.1",
18
- "@tauri-apps/api": "^2.3.0",
18
+ "@tauri-apps/api": "^2.4.1",
19
19
  "async-mutex": "^0.5.0",
20
20
  "proxy-memoize": "2.0.3",
21
- "react": "^19.0.0",
22
- "react-dom": "^19.0.0",
21
+ "react": "^19.1.0",
22
+ "react-dom": "^19.1.0",
23
23
  "react-redux": "^9.2.0",
24
24
  "zod": "^3.24.2",
25
- "@synnaxlabs/x": "0.40.0"
25
+ "@synnaxlabs/x": "0.41.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@tauri-apps/api": "^2.1.1",
29
- "@types/react": "^19.0.10",
28
+ "@types/react": "^19.1.0",
30
29
  "@vitejs/plugin-react": "^4.3.4",
31
30
  "electron": "^33.4.4",
32
- "eslint": "^9.22.0",
33
- "react": "^19.0.0",
34
- "react-dom": "^19.0.0",
31
+ "eslint": "^9.24.0",
32
+ "react": "^19.1.0",
33
+ "react-dom": "^19.1.0",
35
34
  "react-redux": "^9.2.0",
36
- "typescript": "^5.8.2",
37
- "vite": "^6.2.1",
38
- "vitest": "^2.1.9",
39
- "@synnaxlabs/vite-plugin": "0.0.1",
35
+ "typescript": "^5.8.3",
36
+ "vite": "^6.2.5",
37
+ "vitest": "^3.1.1",
40
38
  "@synnaxlabs/tsconfig": "0.0.2",
39
+ "@synnaxlabs/vite-plugin": "0.0.1",
41
40
  "eslint-config-synnaxlabs": "0.0.1"
42
41
  },
43
42
  "files": [