@modelcontextprotocol/server-system-monitor 0.4.1

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,177 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta name="color-scheme" content="light dark">
7
+ <title>System Monitor</title>
8
+ <script type="module" crossorigin>var B_=Object.defineProperty;var V_=(e,t,i)=>t in e?B_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var O=(e,t,i)=>V_(e,typeof t!="symbol"?t+"":t,i);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const o of n)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function i(n){const o={};return n.integrity&&(o.integrity=n.integrity),n.referrerPolicy&&(o.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?o.credentials="include":n.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(n){if(n.ep)return;n.ep=!0;const o=i(n);fetch(n.href,o)}})();function k(e,t,i){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);const u=s.prototype,c=Object.keys(u);for(let d=0;d<c.length;d++){const f=c[d];f in a||(a[f]=u[f].bind(a))}}const n=(i==null?void 0:i.Parent)??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function s(a){var l;const u=i!=null&&i.Parent?new o:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(const c of u._zod.deferred)c();return u}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var l,u;return i!=null&&i.Parent&&a instanceof i.Parent?!0:(u=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}class $i extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class tf extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const nf={};function Mt(e){return nf}function rf(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,n])=>t.indexOf(+r)===-1).map(([r,n])=>n)}function Es(e,t){return typeof t=="bigint"?t.toString():t}function lo(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function ra(e){return e==null}function oa(e){const t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}function W_(e,t){const i=(e.toString().split(".")[1]||"").length,r=t.toString();let n=(r.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(r)){const l=r.match(/\d?e-(\d?)/);l!=null&&l[1]&&(n=Number.parseInt(l[1]))}const o=i>n?i:n,s=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return s%a/10**o}const Wu=Symbol("evaluating");function Q(e,t,i){let r;Object.defineProperty(e,t,{get(){if(r!==Wu)return r===void 0&&(r=Wu,r=i()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ci(e,t,i){Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}function Ut(...e){const t={};for(const i of e){const r=Object.getOwnPropertyDescriptors(i);Object.assign(t,r)}return Object.defineProperties({},t)}function Hu(e){return JSON.stringify(e)}function H_(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const of="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function un(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const J_=lo(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function wi(e){if(un(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const i=t.prototype;return!(un(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function sf(e){return wi(e)?{...e}:Array.isArray(e)?[...e]:e}const q_=new Set(["string","number","symbol"]);function Si(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Lt(e,t,i){const r=new e._zod.constr(t??e._zod.def);return(!t||i!=null&&i.parent)&&(r._zod.parent=e),r}function A(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function K_(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const X_={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function G_(e,t){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=Ut(e._zod.def,{get shape(){const s={};for(const a in t){if(!(a in i.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(s[a]=i.shape[a])}return ci(this,"shape",s),s},checks:[]});return Lt(e,o)}function Y_(e,t){const i=e._zod.def,r=i.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=Ut(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const a in t){if(!(a in i.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete s[a]}return ci(this,"shape",s),s},checks:[]});return Lt(e,o)}function Q_(e,t){if(!wi(t))throw new Error("Invalid input to extend: expected a plain object");const i=e._zod.def.checks;if(i&&i.length>0){const o=e._zod.def.shape;for(const s in t)if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const n=Ut(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return ci(this,"shape",o),o}});return Lt(e,n)}function ey(e,t){if(!wi(t))throw new Error("Invalid input to safeExtend: expected a plain object");const i=Ut(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return ci(this,"shape",r),r}});return Lt(e,i)}function ty(e,t){const i=Ut(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return ci(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Lt(e,i)}function iy(e,t,i){const n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const s=Ut(t._zod.def,{get shape(){const a=t._zod.def.shape,l={...a};if(i)for(const u in i){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);i[u]&&(l[u]=e?new e({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)l[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return ci(this,"shape",l),l},checks:[]});return Lt(t,s)}function ny(e,t,i){const r=Ut(t._zod.def,{get shape(){const n=t._zod.def.shape,o={...n};if(i)for(const s in i){if(!(s in o))throw new Error(`Unrecognized key: "${s}"`);i[s]&&(o[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(const s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return ci(this,"shape",o),o}});return Lt(t,r)}function yi(e,t=0){var i;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((i=e.issues[r])==null?void 0:i.continue)!==!0)return!0;return!1}function xi(e,t){return t.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function sr(e){return typeof e=="string"?e:e==null?void 0:e.message}function Nt(e,t,i){var n,o,s,a,l,u;const r={...e,path:e.path??[]};if(!e.message){const c=sr((s=(o=(n=e.inst)==null?void 0:n._zod.def)==null?void 0:o.error)==null?void 0:s.call(o,e))??sr((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??sr((l=i.customError)==null?void 0:l.call(i,e))??sr((u=i.localeError)==null?void 0:u.call(i,e))??"Invalid input";r.message=c}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function sa(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function cn(...e){const[t,i,r]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:r}:{...t}}const af=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Es,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},lf=k("$ZodError",af),uf=k("$ZodError",af,{Parent:Error});function ry(e,t=i=>i.message){const i={},r=[];for(const n of e.issues)n.path.length>0?(i[n.path[0]]=i[n.path[0]]||[],i[n.path[0]].push(t(n))):r.push(t(n));return{formErrors:r,fieldErrors:i}}function oy(e,t=i=>i.message){const i={_errors:[]},r=n=>{for(const o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>r({issues:s}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)i._errors.push(t(o));else{let s=i,a=0;for(;a<o.path.length;){const l=o.path[a];a===o.path.length-1?(s[l]=s[l]||{_errors:[]},s[l]._errors.push(t(o))):s[l]=s[l]||{_errors:[]},s=s[l],a++}}};return r(e),i}const aa=e=>(t,i,r,n)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:i,issues:[]},o);if(s instanceof Promise)throw new $i;if(s.issues.length){const a=new((n==null?void 0:n.Err)??e)(s.issues.map(l=>Nt(l,o,Mt())));throw of(a,n==null?void 0:n.callee),a}return s.value},la=e=>async(t,i,r,n)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:i,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const a=new((n==null?void 0:n.Err)??e)(s.issues.map(l=>Nt(l,o,Mt())));throw of(a,n==null?void 0:n.callee),a}return s.value},uo=e=>(t,i,r)=>{const n=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:i,issues:[]},n);if(o instanceof Promise)throw new $i;return o.issues.length?{success:!1,error:new(e??lf)(o.issues.map(s=>Nt(s,n,Mt())))}:{success:!0,data:o.value}},cf=uo(uf),co=e=>async(t,i,r)=>{const n=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:i,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>Nt(s,n,Mt())))}:{success:!0,data:o.value}},sy=co(uf),ay=e=>(t,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return aa(e)(t,i,n)},ly=e=>(t,i,r)=>aa(e)(t,i,r),uy=e=>async(t,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return la(e)(t,i,n)},cy=e=>async(t,i,r)=>la(e)(t,i,r),dy=e=>(t,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return uo(e)(t,i,n)},fy=e=>(t,i,r)=>uo(e)(t,i,r),hy=e=>async(t,i,r)=>{const n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return co(e)(t,i,n)},my=e=>async(t,i,r)=>co(e)(t,i,r),py=/^[cC][^\s-]{8,}$/,gy=/^[0-9a-z]+$/,vy=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,by=/^[0-9a-vA-V]{20}$/,_y=/^[A-Za-z0-9]{27}$/,yy=/^[a-zA-Z0-9_-]{21}$/,xy=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$y=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ju=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,ky=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,wy="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Sy(){return new RegExp(wy,"u")}const Iy=/^(?:(?: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])$/,zy=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Oy=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Py=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ty=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,df=/^[A-Za-z0-9_-]*$/,Dy=/^\+[1-9]\d{6,14}$/,ff="(?:(?:\\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])))",Ey=new RegExp(`^${ff}$`);function hf(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function My(e){return new RegExp(`^${hf(e)}$`)}function Ny(e){const t=hf({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${i.join("|")})`;return new RegExp(`^${ff}T(?:${r})$`)}const Ay=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Cy=/^-?\d+$/,mf=/^-?\d+(?:\.\d+)?$/,Ry=/^(?:true|false)$/i,jy=/^null$/i,Zy=/^[^A-Z]*$/,Uy=/^[^a-z]*$/,We=k("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),pf={number:"number",bigint:"bigint",object:"date"},gf=k("$ZodCheckLessThan",(e,t)=>{We.init(e,t);const i=pf[typeof t.value];e._zod.onattach.push(r=>{const n=r._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),vf=k("$ZodCheckGreaterThan",(e,t)=>{We.init(e,t);const i=pf[typeof t.value];e._zod.onattach.push(r=>{const n=r._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ly=k("$ZodCheckMultipleOf",(e,t)=>{We.init(e,t),e._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=i=>{if(typeof i.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%t.value===BigInt(0):W_(i.value,t.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:t.value,input:i.value,inst:e,continue:!t.abort})}}),Fy=k("$ZodCheckNumberFormat",(e,t)=>{var s;We.init(e,t),t.format=t.format||"float64";const i=(s=t.format)==null?void 0:s.includes("int"),r=i?"int":"number",[n,o]=X_[t.format];e._zod.onattach.push(a=>{const l=a._zod.bag;l.format=t.format,l.minimum=n,l.maximum=o,i&&(l.pattern=Cy)}),e._zod.check=a=>{const l=a.value;if(i){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}l<n&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),l>o&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),By=k("$ZodCheckMaxLength",(e,t)=>{var i;We.init(e,t),(i=e._zod.def).when??(i.when=r=>{const n=r.value;return!ra(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{const n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const n=r.value;if(n.length<=t.maximum)return;const s=sa(n);r.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Vy=k("$ZodCheckMinLength",(e,t)=>{var i;We.init(e,t),(i=e._zod.def).when??(i.when=r=>{const n=r.value;return!ra(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{const n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const n=r.value;if(n.length>=t.minimum)return;const s=sa(n);r.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Wy=k("$ZodCheckLengthEquals",(e,t)=>{var i;We.init(e,t),(i=e._zod.def).when??(i.when=r=>{const n=r.value;return!ra(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{const n=r._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=r=>{const n=r.value,o=n.length;if(o===t.length)return;const s=sa(n),a=o>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),fo=k("$ZodCheckStringFormat",(e,t)=>{var i,r;We.init(e,t),e._zod.onattach.push(n=>{const o=n._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Hy=k("$ZodCheckRegex",(e,t)=>{fo.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Jy=k("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Zy),fo.init(e,t)}),qy=k("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Uy),fo.init(e,t)}),Ky=k("$ZodCheckIncludes",(e,t)=>{We.init(e,t);const i=Si(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=r,e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Xy=k("$ZodCheckStartsWith",(e,t)=>{We.init(e,t);const i=new RegExp(`^${Si(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(r=>{const n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),Gy=k("$ZodCheckEndsWith",(e,t)=>{We.init(e,t);const i=new RegExp(`.*${Si(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(r=>{const n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),Yy=k("$ZodCheckOverwrite",(e,t)=>{We.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}});class Qy{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
9
+ `).filter(s=>s),n=Math.min(...r.map(s=>s.length-s.trimStart().length)),o=r.map(s=>s.slice(n)).map(s=>" ".repeat(this.indent*2)+s);for(const s of o)this.content.push(s)}compile(){const t=Function,i=this==null?void 0:this.args,n=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...i,n.join(`
10
+ `))}}const ex={major:4,minor:3,patch:5},he=k("$ZodType",(e,t)=>{var n;var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=ex;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const s of o._zod.onattach)s(e);if(r.length===0)(i=e._zod).deferred??(i.deferred=[]),(n=e._zod.deferred)==null||n.push(()=>{e._zod.run=e._zod.parse});else{const o=(a,l,u)=>{let c=yi(a),d;for(const f of l){if(f._zod.def.when){if(!f._zod.def.when(a))continue}else if(c)continue;const h=a.issues.length,m=f._zod.check(a);if(m instanceof Promise&&(u==null?void 0:u.async)===!1)throw new $i;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,a.issues.length!==h&&(c||(c=yi(a,h)))});else{if(a.issues.length===h)continue;c||(c=yi(a,h))}}return d?d.then(()=>a):a},s=(a,l,u)=>{if(yi(a))return a.aborted=!0,a;const c=o(l,r,u);if(c instanceof Promise){if(u.async===!1)throw new $i;return c.then(d=>e._zod.parse(d,u))}return e._zod.parse(c,u)};e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){const c=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return c instanceof Promise?c.then(d=>s(d,a,l)):s(c,a,l)}const u=e._zod.parse(a,l);if(u instanceof Promise){if(l.async===!1)throw new $i;return u.then(c=>o(c,r,l))}return o(u,r,l)}}Q(e,"~standard",()=>({validate:o=>{var s;try{const a=cf(e,o);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return sy(e,o).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),ua=k("$ZodString",(e,t)=>{var i;he.init(e,t),e._zod.pattern=[...((i=e==null?void 0:e._zod.bag)==null?void 0:i.patterns)??[]].pop()??Ay(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),me=k("$ZodStringFormat",(e,t)=>{fo.init(e,t),ua.init(e,t)}),tx=k("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=$y),me.init(e,t)}),ix=k("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ju(r))}else t.pattern??(t.pattern=Ju());me.init(e,t)}),nx=k("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=ky),me.init(e,t)}),rx=k("$ZodURL",(e,t)=>{me.init(e,t),e._zod.check=i=>{try{const r=i.value.trim(),n=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),t.normalize?i.value=n.href:i.value=r;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),ox=k("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Sy()),me.init(e,t)}),sx=k("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=yy),me.init(e,t)}),ax=k("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=py),me.init(e,t)}),lx=k("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=gy),me.init(e,t)}),ux=k("$ZodULID",(e,t)=>{t.pattern??(t.pattern=vy),me.init(e,t)}),cx=k("$ZodXID",(e,t)=>{t.pattern??(t.pattern=by),me.init(e,t)}),dx=k("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=_y),me.init(e,t)}),fx=k("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ny(t)),me.init(e,t)}),hx=k("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ey),me.init(e,t)}),mx=k("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=My(t)),me.init(e,t)}),px=k("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=xy),me.init(e,t)}),gx=k("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Iy),me.init(e,t),e._zod.bag.format="ipv4"}),vx=k("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=zy),me.init(e,t),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),bx=k("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Oy),me.init(e,t)}),_x=k("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Py),me.init(e,t),e._zod.check=i=>{const r=i.value.split("/");try{if(r.length!==2)throw new Error;const[n,o]=r;if(!o)throw new Error;const s=Number(o);if(`${s}`!==o)throw new Error;if(s<0||s>128)throw new Error;new URL(`http://[${n}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!t.abort})}}});function bf(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const yx=k("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ty),me.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{bf(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!t.abort})}});function xx(e){if(!df.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=t.padEnd(Math.ceil(t.length/4)*4,"=");return bf(i)}const $x=k("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=df),me.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{xx(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!t.abort})}}),kx=k("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Dy),me.init(e,t)});function wx(e,t=null){try{const i=e.split(".");if(i.length!==3)return!1;const[r]=i;if(!r)return!1;const n=JSON.parse(atob(r));return!("typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}const Sx=k("$ZodJWT",(e,t)=>{me.init(e,t),e._zod.check=i=>{wx(i.value,t.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!t.abort})}}),_f=k("$ZodNumber",(e,t)=>{he.init(e,t),e._zod.pattern=e._zod.bag.pattern??mf,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}const n=i.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return i;const o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),i}}),Ix=k("$ZodNumberFormat",(e,t)=>{Fy.init(e,t),_f.init(e,t)}),zx=k("$ZodBoolean",(e,t)=>{he.init(e,t),e._zod.pattern=Ry,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=!!i.value}catch{}const n=i.value;return typeof n=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),i}}),Ox=k("$ZodNull",(e,t)=>{he.init(e,t),e._zod.pattern=jy,e._zod.values=new Set([null]),e._zod.parse=(i,r)=>{const n=i.value;return n===null||i.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),i}}),Px=k("$ZodUnknown",(e,t)=>{he.init(e,t),e._zod.parse=i=>i}),Tx=k("$ZodNever",(e,t)=>{he.init(e,t),e._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)});function qu(e,t,i){e.issues.length&&t.issues.push(...xi(i,e.issues)),t.value[i]=e.value}const Dx=k("$ZodArray",(e,t)=>{he.init(e,t),e._zod.parse=(i,r)=>{const n=i.value;if(!Array.isArray(n))return i.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),i;i.value=Array(n.length);const o=[];for(let s=0;s<n.length;s++){const a=n[s],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?o.push(l.then(u=>qu(u,i,s))):qu(l,i,s)}return o.length?Promise.all(o).then(()=>i):i}});function Zr(e,t,i,r,n){if(e.issues.length){if(n&&!(i in r))return;t.issues.push(...xi(i,e.issues))}e.value===void 0?i in r&&(t.value[i]=void 0):t.value[i]=e.value}function yf(e){var r,n,o,s;const t=Object.keys(e.shape);for(const a of t)if(!((s=(o=(n=(r=e.shape)==null?void 0:r[a])==null?void 0:n._zod)==null?void 0:o.traits)!=null&&s.has("$ZodType")))throw new Error(`Invalid element at key "${a}": expected a Zod schema`);const i=K_(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function xf(e,t,i,r,n,o){const s=[],a=n.keySet,l=n.catchall._zod,u=l.def.type,c=l.optout==="optional";for(const d in t){if(a.has(d))continue;if(u==="never"){s.push(d);continue}const f=l.run({value:t[d],issues:[]},r);f instanceof Promise?e.push(f.then(h=>Zr(h,i,d,t,c))):Zr(f,i,d,t,c)}return s.length&&i.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>i):i}const Ex=k("$ZodObject",(e,t)=>{he.init(e,t);const i=Object.getOwnPropertyDescriptor(t,"shape");if(!(i!=null&&i.get)){const a=t.shape;Object.defineProperty(t,"shape",{get:()=>{const l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}const r=lo(()=>yf(t));Q(e._zod,"propValues",()=>{const a=t.shape,l={};for(const u in a){const c=a[u]._zod;if(c.values){l[u]??(l[u]=new Set);for(const d of c.values)l[u].add(d)}}return l});const n=un,o=t.catchall;let s;e._zod.parse=(a,l)=>{s??(s=r.value);const u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};const c=[],d=s.shape;for(const f of s.keys){const h=d[f],m=h._zod.optout==="optional",p=h._zod.run({value:u[f],issues:[]},l);p instanceof Promise?c.push(p.then(g=>Zr(g,a,f,u,m))):Zr(p,a,f,u,m)}return o?xf(c,u,a,l,r.value,e):c.length?Promise.all(c).then(()=>a):a}}),Mx=k("$ZodObjectJIT",(e,t)=>{Ex.init(e,t);const i=e._zod.parse,r=lo(()=>yf(t)),n=f=>{var S;const h=new Qy(["shape","payload","ctx"]),m=r.value,p=w=>{const x=Hu(w);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};h.write("const input = payload.value;");const g=Object.create(null);let b=0;for(const w of m.keys)g[w]=`key_${b++}`;h.write("const newResult = {};");for(const w of m.keys){const x=g[w],I=Hu(w),z=f[w],D=((S=z==null?void 0:z._zod)==null?void 0:S.optout)==="optional";h.write(`const ${x} = ${p(w)};`),D?h.write(`
11
+ if (${x}.issues.length) {
12
+ if (${I} in input) {
13
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
14
+ ...iss,
15
+ path: iss.path ? [${I}, ...iss.path] : [${I}]
16
+ })));
17
+ }
18
+ }
19
+
20
+ if (${x}.value === undefined) {
21
+ if (${I} in input) {
22
+ newResult[${I}] = undefined;
23
+ }
24
+ } else {
25
+ newResult[${I}] = ${x}.value;
26
+ }
27
+
28
+ `):h.write(`
29
+ if (${x}.issues.length) {
30
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
31
+ ...iss,
32
+ path: iss.path ? [${I}, ...iss.path] : [${I}]
33
+ })));
34
+ }
35
+
36
+ if (${x}.value === undefined) {
37
+ if (${I} in input) {
38
+ newResult[${I}] = undefined;
39
+ }
40
+ } else {
41
+ newResult[${I}] = ${x}.value;
42
+ }
43
+
44
+ `)}h.write("payload.value = newResult;"),h.write("return payload;");const y=h.compile();return(w,x)=>y(f,w,x)};let o;const s=un,a=!nf.jitless,u=a&&J_.value,c=t.catchall;let d;e._zod.parse=(f,h)=>{d??(d=r.value);const m=f.value;return s(m)?a&&u&&(h==null?void 0:h.async)===!1&&h.jitless!==!0?(o||(o=n(t.shape)),f=o(f,h),c?xf([],m,f,h,d,e):f):i(f,h):(f.issues.push({expected:"object",code:"invalid_type",input:m,inst:e}),f)}});function Ku(e,t,i,r){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const n=e.filter(o=>!yi(o));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(o=>o.issues.map(s=>Nt(s,r,Mt())))}),t)}const $f=k("$ZodUnion",(e,t)=>{he.init(e,t),Q(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Q(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Q(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),Q(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){const n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>oa(o.source)).join("|")})$`)}});const i=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(i)return r(n,o);let s=!1;const a=[];for(const l of t.options){const u=l._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(l=>Ku(l,n,e,o)):Ku(a,n,e,o)}}),Nx=k("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,$f.init(e,t);const i=e._zod.parse;Q(e._zod,"propValues",()=>{const n={};for(const o of t.options){const s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[a,l]of Object.entries(s)){n[a]||(n[a]=new Set);for(const u of l)n[a].add(u)}}return n});const r=lo(()=>{var s;const n=t.options,o=new Map;for(const a of n){const l=(s=a._zod.propValues)==null?void 0:s[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const u of l){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,a)}}return o});e._zod.parse=(n,o)=>{const s=n.value;if(!un(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;const a=r.value.get(s==null?void 0:s[t.discriminator]);return a?a._zod.run(n,o):t.unionFallback?i(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),n)}}),Ax=k("$ZodIntersection",(e,t)=>{he.init(e,t),e._zod.parse=(i,r)=>{const n=i.value,o=t.left._zod.run({value:n,issues:[]},r),s=t.right._zod.run({value:n,issues:[]},r);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([l,u])=>Xu(i,l,u)):Xu(i,o,s)}});function Ms(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(wi(e)&&wi(t)){const i=Object.keys(t),r=Object.keys(e).filter(o=>i.indexOf(o)!==-1),n={...e,...t};for(const o of r){const s=Ms(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const i=[];for(let r=0;r<e.length;r++){const n=e[r],o=t[r],s=Ms(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};i.push(s.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function Xu(e,t,i){const r=new Map;let n;for(const a of t.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(a);for(const a of i.issues)if(a.code==="unrecognized_keys")for(const l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(a);const o=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&n&&e.issues.push({...n,keys:o}),yi(e))return e;const s=Ms(t.value,i.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Cx=k("$ZodRecord",(e,t)=>{he.init(e,t),e._zod.parse=(i,r)=>{const n=i.value;if(!wi(n))return i.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),i;const o=[],s=t.keyType._zod.values;if(s){i.value={};const a=new Set;for(const u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const c=t.valueType._zod.run({value:n[u],issues:[]},r);c instanceof Promise?o.push(c.then(d=>{d.issues.length&&i.issues.push(...xi(u,d.issues)),i.value[u]=d.value})):(c.issues.length&&i.issues.push(...xi(u,c.issues)),i.value[u]=c.value)}let l;for(const u in n)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{i.value={};for(const a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&mf.test(a)&&l.issues.length&&l.issues.some(d=>d.code==="invalid_type"&&d.expected==="number")){const d=t.keyType._zod.run({value:Number(a),issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(l=d)}if(l.issues.length){t.mode==="loose"?i.value[a]=n[a]:i.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(d=>Nt(d,r,Mt())),input:a,path:[a],inst:e});continue}const c=t.valueType._zod.run({value:n[a],issues:[]},r);c instanceof Promise?o.push(c.then(d=>{d.issues.length&&i.issues.push(...xi(a,d.issues)),i.value[l.value]=d.value})):(c.issues.length&&i.issues.push(...xi(a,c.issues)),i.value[l.value]=c.value)}}return o.length?Promise.all(o).then(()=>i):i}}),Rx=k("$ZodEnum",(e,t)=>{he.init(e,t);const i=rf(t.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(n=>q_.has(typeof n)).map(n=>typeof n=="string"?Si(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{const s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:i,input:s,inst:e}),n}}),jx=k("$ZodLiteral",(e,t)=>{if(he.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const i=new Set(t.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Si(r):r?Si(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{const o=r.value;return i.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),Zx=k("$ZodTransform",(e,t)=>{he.init(e,t),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new tf(e.constructor.name);const n=t.transform(i.value,i);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(s=>(i.value=s,i));if(n instanceof Promise)throw new $i;return i.value=n,i}});function Gu(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const kf=k("$ZodOptional",(e,t)=>{he.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Q(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${oa(i.source)})?$`):void 0}),e._zod.parse=(i,r)=>{if(t.innerType._zod.optin==="optional"){const n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>Gu(o,i.value)):Gu(n,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,r)}}),Ux=k("$ZodExactOptional",(e,t)=>{kf.init(e,t),Q(e._zod,"values",()=>t.innerType._zod.values),Q(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,r)=>t.innerType._zod.run(i,r)}),Lx=k("$ZodNullable",(e,t)=>{he.init(e,t),Q(e._zod,"optin",()=>t.innerType._zod.optin),Q(e._zod,"optout",()=>t.innerType._zod.optout),Q(e._zod,"pattern",()=>{const i=t.innerType._zod.pattern;return i?new RegExp(`^(${oa(i.source)}|null)$`):void 0}),Q(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,r)=>i.value===null?i:t.innerType._zod.run(i,r)}),Fx=k("$ZodDefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);if(i.value===void 0)return i.value=t.defaultValue,i;const n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>Yu(o,t)):Yu(n,t)}});function Yu(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Bx=k("$ZodPrefault",(e,t)=>{he.init(e,t),e._zod.optin="optional",Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>(r.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,r))}),Vx=k("$ZodNonOptional",(e,t)=>{he.init(e,t),Q(e._zod,"values",()=>{const i=t.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(i,r)=>{const n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>Qu(o,e)):Qu(n,e)}});function Qu(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Wx=k("$ZodCatch",(e,t)=>{he.init(e,t),Q(e._zod,"optin",()=>t.innerType._zod.optin),Q(e._zod,"optout",()=>t.innerType._zod.optout),Q(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);const n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>(i.value=o.value,o.issues.length&&(i.value=t.catchValue({...i,error:{issues:o.issues.map(s=>Nt(s,r,Mt()))},input:i.value}),i.issues=[]),i)):(i.value=n.value,n.issues.length&&(i.value=t.catchValue({...i,error:{issues:n.issues.map(o=>Nt(o,r,Mt()))},input:i.value}),i.issues=[]),i)}}),Hx=k("$ZodPipe",(e,t)=>{he.init(e,t),Q(e._zod,"values",()=>t.in._zod.values),Q(e._zod,"optin",()=>t.in._zod.optin),Q(e._zod,"optout",()=>t.out._zod.optout),Q(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,r)=>{if(r.direction==="backward"){const o=t.out._zod.run(i,r);return o instanceof Promise?o.then(s=>ar(s,t.in,r)):ar(o,t.in,r)}const n=t.in._zod.run(i,r);return n instanceof Promise?n.then(o=>ar(o,t.out,r)):ar(n,t.out,r)}});function ar(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}const Jx=k("$ZodReadonly",(e,t)=>{he.init(e,t),Q(e._zod,"propValues",()=>t.innerType._zod.propValues),Q(e._zod,"values",()=>t.innerType._zod.values),Q(e._zod,"optin",()=>{var i,r;return(r=(i=t.innerType)==null?void 0:i._zod)==null?void 0:r.optin}),Q(e._zod,"optout",()=>{var i,r;return(r=(i=t.innerType)==null?void 0:i._zod)==null?void 0:r.optout}),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);const n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(ec):ec(n)}});function ec(e){return e.value=Object.freeze(e.value),e}const qx=k("$ZodCustom",(e,t)=>{We.init(e,t),he.init(e,t),e._zod.parse=(i,r)=>i,e._zod.check=i=>{const r=i.value,n=t.fn(r);if(n instanceof Promise)return n.then(o=>tc(o,i,r,e));tc(n,i,r,e)}});function tc(e,t,i,r){if(!e){const n={code:"custom",input:i,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),t.issues.push(cn(n))}}var ic;class Kx{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){const r=i[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){const i=t._zod.parent;if(i){const r={...this.get(i)??{}};delete r.id;const n={...r,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Xx(){return new Kx}(ic=globalThis).__zod_globalRegistry??(ic.__zod_globalRegistry=Xx());const Ki=globalThis.__zod_globalRegistry;function Gx(e,t){return new e({type:"string",...A(t)})}function Yx(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...A(t)})}function nc(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...A(t)})}function Qx(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...A(t)})}function e$(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...A(t)})}function t$(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...A(t)})}function i$(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...A(t)})}function n$(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...A(t)})}function r$(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...A(t)})}function o$(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...A(t)})}function s$(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...A(t)})}function a$(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...A(t)})}function l$(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...A(t)})}function u$(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...A(t)})}function c$(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...A(t)})}function d$(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...A(t)})}function f$(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...A(t)})}function h$(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...A(t)})}function m$(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...A(t)})}function p$(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...A(t)})}function g$(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...A(t)})}function v$(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...A(t)})}function b$(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...A(t)})}function _$(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...A(t)})}function y$(e,t){return new e({type:"string",format:"date",check:"string_format",...A(t)})}function x$(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...A(t)})}function $$(e,t){return new e({type:"string",format:"duration",check:"string_format",...A(t)})}function k$(e,t){return new e({type:"number",checks:[],...A(t)})}function w$(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...A(t)})}function S$(e,t){return new e({type:"boolean",...A(t)})}function I$(e,t){return new e({type:"null",...A(t)})}function z$(e){return new e({type:"unknown"})}function O$(e,t){return new e({type:"never",...A(t)})}function rc(e,t){return new gf({check:"less_than",...A(t),value:e,inclusive:!1})}function ps(e,t){return new gf({check:"less_than",...A(t),value:e,inclusive:!0})}function oc(e,t){return new vf({check:"greater_than",...A(t),value:e,inclusive:!1})}function gs(e,t){return new vf({check:"greater_than",...A(t),value:e,inclusive:!0})}function sc(e,t){return new Ly({check:"multiple_of",...A(t),value:e})}function wf(e,t){return new By({check:"max_length",...A(t),maximum:e})}function Ur(e,t){return new Vy({check:"min_length",...A(t),minimum:e})}function Sf(e,t){return new Wy({check:"length_equals",...A(t),length:e})}function P$(e,t){return new Hy({check:"string_format",format:"regex",...A(t),pattern:e})}function T$(e){return new Jy({check:"string_format",format:"lowercase",...A(e)})}function D$(e){return new qy({check:"string_format",format:"uppercase",...A(e)})}function E$(e,t){return new Ky({check:"string_format",format:"includes",...A(t),includes:e})}function M$(e,t){return new Xy({check:"string_format",format:"starts_with",...A(t),prefix:e})}function N$(e,t){return new Gy({check:"string_format",format:"ends_with",...A(t),suffix:e})}function Ri(e){return new Yy({check:"overwrite",tx:e})}function A$(e){return Ri(t=>t.normalize(e))}function C$(){return Ri(e=>e.trim())}function R$(){return Ri(e=>e.toLowerCase())}function j$(){return Ri(e=>e.toUpperCase())}function Z$(){return Ri(e=>H_(e))}function U$(e,t,i){return new e({type:"array",element:t,...A(i)})}function L$(e,t,i){const r=A(i);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function F$(e,t,i){return new e({type:"custom",check:"custom",fn:t,...A(i)})}function B$(e){const t=V$(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(cn(r,i.value,t._zod.def));else{const n=r;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=i.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),i.issues.push(cn(n))}},e(i.value,i)));return t}function V$(e,t){const i=new We({check:"custom",...A(t)});return i._zod.check=e,i}function If(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Ki,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function we(e,t,i={path:[],schemaPath:[]}){var c,d;var r;const n=e._zod.def,o=t.seen.get(e);if(o)return o.count++,i.schemaPath.includes(e)&&(o.cycle=i.path),o.schema;const s={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,s);const a=(d=(c=e._zod).toJSONSchema)==null?void 0:d.call(c);if(a)s.schema=a;else{const f={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,f);else{const m=s.schema,p=t.processors[n.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);p(e,t,m,f)}const h=e._zod.parent;h&&(s.ref||(s.ref=h),we(h,t,f),t.seen.get(h).isParent=!0)}const l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Ze(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function zf(e,t){var s,a,l,u;const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const c of e.seen.entries()){const d=(s=e.metadataRegistry.get(c[0]))==null?void 0:s.id;if(d){const f=r.get(d);if(f&&f!==c[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(d,c[0])}}const n=c=>{var p;const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=(p=e.external.registry.get(c[0]))==null?void 0:p.id,b=e.external.uri??(S=>S);if(g)return{ref:b(g)};const y=c[1].defId??c[1].schema.id??`schema${e.counter++}`;return c[1].defId=y,{defId:y,ref:`${b("__shared")}#/${d}/${y}`}}if(c[1]===i)return{ref:"#"};const h=`#/${d}/`,m=c[1].schema.id??`__schema${e.counter++}`;return{defId:m,ref:h+m}},o=c=>{if(c[1].schema.$ref)return;const d=c[1],{ref:f,defId:h}=n(c);d.def={...d.schema},h&&(d.defId=h);const m=d.schema;for(const p in m)delete m[p];m.$ref=f};if(e.cycles==="throw")for(const c of e.seen.entries()){const d=c[1];if(d.cycle)throw new Error(`Cycle detected: #/${(a=d.cycle)==null?void 0:a.join("/")}/<root>
45
+
46
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const c of e.seen.entries()){const d=c[1];if(t===c[0]){o(c);continue}if(e.external){const h=(l=e.external.registry.get(c[0]))==null?void 0:l.id;if(t!==c[0]&&h){o(c);continue}}if((u=e.metadataRegistry.get(c[0]))==null?void 0:u.id){o(c);continue}if(d.cycle){o(c);continue}if(d.count>1&&e.reused==="ref"){o(c);continue}}}function Of(e,t){var s,a,l;const i=e.seen.get(t);if(!i)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const c=e.seen.get(u);if(c.ref===null)return;const d=c.def??c.schema,f={...d},h=c.ref;if(c.ref=null,h){r(h);const p=e.seen.get(h),g=p.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(g)):Object.assign(d,g),Object.assign(d,f),u._zod.parent===h)for(const y in d)y==="$ref"||y==="allOf"||y in f||delete d[y];if(g.$ref)for(const y in d)y==="$ref"||y==="allOf"||y in p.def&&JSON.stringify(d[y])===JSON.stringify(p.def[y])&&delete d[y]}const m=u._zod.parent;if(m&&m!==h){r(m);const p=e.seen.get(m);if(p!=null&&p.schema.$ref&&(d.$ref=p.schema.$ref,p.def))for(const g in d)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(d[g])===JSON.stringify(p.def[g])&&delete d[g]}e.override({zodSchema:u,jsonSchema:d,path:c.path??[]})};for(const u of[...e.seen.entries()].reverse())r(u[0]);const n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,(s=e.external)!=null&&s.uri){const u=(a=e.external.registry.get(t))==null?void 0:a.id;if(!u)throw new Error("Schema is missing an `id` property");n.$id=e.external.uri(u)}Object.assign(n,i.def??i.schema);const o=((l=e.external)==null?void 0:l.defs)??{};for(const u of e.seen.entries()){const c=u[1];c.def&&c.defId&&(o[c.defId]=c.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{const u=JSON.parse(JSON.stringify(n));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:Lr(t,"input",e.processors),output:Lr(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Ze(e,t){const i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Ze(r.element,i);if(r.type==="set")return Ze(r.valueType,i);if(r.type==="lazy")return Ze(r.getter(),i);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Ze(r.innerType,i);if(r.type==="intersection")return Ze(r.left,i)||Ze(r.right,i);if(r.type==="record"||r.type==="map")return Ze(r.keyType,i)||Ze(r.valueType,i);if(r.type==="pipe")return Ze(r.in,i)||Ze(r.out,i);if(r.type==="object"){for(const n in r.shape)if(Ze(r.shape[n],i))return!0;return!1}if(r.type==="union"){for(const n of r.options)if(Ze(n,i))return!0;return!1}if(r.type==="tuple"){for(const n of r.items)if(Ze(n,i))return!0;return!!(r.rest&&Ze(r.rest,i))}return!1}const W$=(e,t={})=>i=>{const r=If({...i,processors:t});return we(e,r),zf(r,e),Of(r,e)},Lr=(e,t,i={})=>r=>{const{libraryOptions:n,target:o}=r??{},s=If({...n??{},target:o,io:t,processors:i});return we(e,s),zf(s,e),Of(s,e)},H$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},J$=(e,t,i,r)=>{const n=i;n.type="string";const{minimum:o,maximum:s,format:a,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof s=="number"&&(n.maxLength=s),a&&(n.format=H$[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){const c=[...l];c.length===1?n.pattern=c[0].source:c.length>1&&(n.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},q$=(e,t,i,r)=>{const n=i,{minimum:o,maximum:s,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=c,n.exclusiveMinimum=!0):n.exclusiveMinimum=c),typeof o=="number"&&(n.minimum=o,typeof c=="number"&&t.target!=="draft-04"&&(c>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u),typeof s=="number"&&(n.maximum=s,typeof u=="number"&&t.target!=="draft-04"&&(u<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof l=="number"&&(n.multipleOf=l)},K$=(e,t,i,r)=>{i.type="boolean"},X$=(e,t,i,r)=>{t.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},G$=(e,t,i,r)=>{i.not={}},Y$=(e,t,i,r)=>{},Q$=(e,t,i,r)=>{const n=e._zod.def,o=rf(n.entries);o.every(s=>typeof s=="number")&&(i.type="number"),o.every(s=>typeof s=="string")&&(i.type="string"),i.enum=o},ek=(e,t,i,r)=>{const n=e._zod.def,o=[];for(const s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){const s=o[0];i.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?i.enum=[s]:i.const=s}else o.every(s=>typeof s=="number")&&(i.type="number"),o.every(s=>typeof s=="string")&&(i.type="string"),o.every(s=>typeof s=="boolean")&&(i.type="boolean"),o.every(s=>s===null)&&(i.type="null"),i.enum=o},tk=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ik=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},nk=(e,t,i,r)=>{const n=i,o=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=we(o.element,t,{...r,path:[...r.path,"items"]})},rk=(e,t,i,r)=>{var u;const n=i,o=e._zod.def;n.type="object",n.properties={};const s=o.shape;for(const c in s)n.properties[c]=we(s[c],t,{...r,path:[...r.path,"properties",c]});const a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{const d=o.shape[c]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(n.required=Array.from(l)),((u=o.catchall)==null?void 0:u._zod.def.type)==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=we(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},ok=(e,t,i,r)=>{const n=e._zod.def,o=n.inclusive===!1,s=n.options.map((a,l)=>we(a,t,{...r,path:[...r.path,o?"oneOf":"anyOf",l]}));o?i.oneOf=s:i.anyOf=s},sk=(e,t,i,r)=>{const n=e._zod.def,o=we(n.left,t,{...r,path:[...r.path,"allOf",0]}),s=we(n.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];i.allOf=l},ak=(e,t,i,r)=>{const n=i,o=e._zod.def;n.type="object";const s=o.keyType,a=s._zod.bag,l=a==null?void 0:a.patterns;if(o.mode==="loose"&&l&&l.size>0){const c=we(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(const d of l)n.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=we(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=we(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=s._zod.values;if(u){const c=[...u].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(n.required=c)}},lk=(e,t,i,r)=>{const n=e._zod.def,o=we(n.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,i.nullable=!0):i.anyOf=[o,{type:"null"}]},uk=(e,t,i,r)=>{const n=e._zod.def;we(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType},ck=(e,t,i,r)=>{const n=e._zod.def;we(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType,i.default=JSON.parse(JSON.stringify(n.defaultValue))},dk=(e,t,i,r)=>{const n=e._zod.def;we(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},fk=(e,t,i,r)=>{const n=e._zod.def;we(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}i.default=s},hk=(e,t,i,r)=>{const n=e._zod.def,o=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;we(o,t,r);const s=t.seen.get(e);s.ref=o},mk=(e,t,i,r)=>{const n=e._zod.def;we(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType,i.readOnly=!0},Pf=(e,t,i,r)=>{const n=e._zod.def;we(n.innerType,t,r);const o=t.seen.get(e);o.ref=n.innerType};function ca(e){return!!e._zod}function Tf(e,t){return ca(e)?cf(e,t):e.safeParse(t)}function pk(e){var i,r;if(!e)return;let t;if(ca(e)?t=(r=(i=e._zod)==null?void 0:i.def)==null?void 0:r.shape:t=e.shape,!!t){if(typeof t=="function")try{return t()}catch{return}return t}}function gk(e){var n;if(ca(e)){const s=(n=e._zod)==null?void 0:n.def;if(s){if(s.value!==void 0)return s.value;if(Array.isArray(s.values)&&s.values.length>0)return s.values[0]}}const i=e._def;if(i){if(i.value!==void 0)return i.value;if(Array.isArray(i.values)&&i.values.length>0)return i.values[0]}const r=e.value;if(r!==void 0)return r}const vk=k("ZodISODateTime",(e,t)=>{fx.init(e,t),_e.init(e,t)});function Df(e){return _$(vk,e)}const bk=k("ZodISODate",(e,t)=>{hx.init(e,t),_e.init(e,t)});function _k(e){return y$(bk,e)}const yk=k("ZodISOTime",(e,t)=>{mx.init(e,t),_e.init(e,t)});function xk(e){return x$(yk,e)}const $k=k("ZodISODuration",(e,t)=>{px.init(e,t),_e.init(e,t)});function kk(e){return $$($k,e)}const wk=(e,t)=>{lf.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>oy(e,i)},flatten:{value:i=>ry(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Es,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Es,2)}},isEmpty:{get(){return e.issues.length===0}}})},it=k("ZodError",wk,{Parent:Error}),Sk=aa(it),Ik=la(it),zk=uo(it),Ok=co(it),Pk=ay(it),Tk=ly(it),Dk=uy(it),Ek=cy(it),Mk=dy(it),Nk=fy(it),Ak=hy(it),Ck=my(it),pe=k("ZodType",(e,t)=>(he.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Lr(e,"input"),output:Lr(e,"output")}}),e.toJSONSchema=W$(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(Ut(t,{checks:[...t.checks??[],...i.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(i,r)=>Lt(e,i,r),e.brand=()=>e,e.register=((i,r)=>(i.add(e,r),e)),e.parse=(i,r)=>Sk(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>zk(e,i,r),e.parseAsync=async(i,r)=>Ik(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>Ok(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>Pk(e,i,r),e.decode=(i,r)=>Tk(e,i,r),e.encodeAsync=async(i,r)=>Dk(e,i,r),e.decodeAsync=async(i,r)=>Ek(e,i,r),e.safeEncode=(i,r)=>Mk(e,i,r),e.safeDecode=(i,r)=>Nk(e,i,r),e.safeEncodeAsync=async(i,r)=>Ak(e,i,r),e.safeDecodeAsync=async(i,r)=>Ck(e,i,r),e.refine=(i,r)=>e.check(z0(i,r)),e.superRefine=i=>e.check(O0(i)),e.overwrite=i=>e.check(Ri(i)),e.optional=()=>xe(e),e.exactOptional=()=>m0(e),e.nullable=()=>uc(e),e.nullish=()=>xe(uc(e)),e.nonoptional=i=>y0(e,i),e.array=()=>X(e),e.or=i=>ue([e,i]),e.and=i=>da(e,i),e.transform=i=>As(e,jf(i)),e.default=i=>v0(e,i),e.prefault=i=>_0(e,i),e.catch=i=>$0(e,i),e.pipe=i=>As(e,i),e.readonly=()=>S0(e),e.describe=i=>{const r=e.clone();return Ki.add(r,{description:i}),r},Object.defineProperty(e,"description",{get(){var i;return(i=Ki.get(e))==null?void 0:i.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Ki.get(e);const r=e.clone();return Ki.add(r,i[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),Ef=k("_ZodString",(e,t)=>{ua.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>J$(e,r,n);const i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...r)=>e.check(P$(...r)),e.includes=(...r)=>e.check(E$(...r)),e.startsWith=(...r)=>e.check(M$(...r)),e.endsWith=(...r)=>e.check(N$(...r)),e.min=(...r)=>e.check(Ur(...r)),e.max=(...r)=>e.check(wf(...r)),e.length=(...r)=>e.check(Sf(...r)),e.nonempty=(...r)=>e.check(Ur(1,...r)),e.lowercase=r=>e.check(T$(r)),e.uppercase=r=>e.check(D$(r)),e.trim=()=>e.check(C$()),e.normalize=(...r)=>e.check(A$(...r)),e.toLowerCase=()=>e.check(R$()),e.toUpperCase=()=>e.check(j$()),e.slugify=()=>e.check(Z$())}),Rk=k("ZodString",(e,t)=>{ua.init(e,t),Ef.init(e,t),e.email=i=>e.check(Yx(jk,i)),e.url=i=>e.check(n$(Zk,i)),e.jwt=i=>e.check(b$(e0,i)),e.emoji=i=>e.check(r$(Uk,i)),e.guid=i=>e.check(nc(ac,i)),e.uuid=i=>e.check(Qx(lr,i)),e.uuidv4=i=>e.check(e$(lr,i)),e.uuidv6=i=>e.check(t$(lr,i)),e.uuidv7=i=>e.check(i$(lr,i)),e.nanoid=i=>e.check(o$(Lk,i)),e.guid=i=>e.check(nc(ac,i)),e.cuid=i=>e.check(s$(Fk,i)),e.cuid2=i=>e.check(a$(Bk,i)),e.ulid=i=>e.check(l$(Vk,i)),e.base64=i=>e.check(p$(Gk,i)),e.base64url=i=>e.check(g$(Yk,i)),e.xid=i=>e.check(u$(Wk,i)),e.ksuid=i=>e.check(c$(Hk,i)),e.ipv4=i=>e.check(d$(Jk,i)),e.ipv6=i=>e.check(f$(qk,i)),e.cidrv4=i=>e.check(h$(Kk,i)),e.cidrv6=i=>e.check(m$(Xk,i)),e.e164=i=>e.check(v$(Qk,i)),e.datetime=i=>e.check(Df(i)),e.date=i=>e.check(_k(i)),e.time=i=>e.check(xk(i)),e.duration=i=>e.check(kk(i))});function $(e){return Gx(Rk,e)}const _e=k("ZodStringFormat",(e,t)=>{me.init(e,t),Ef.init(e,t)}),jk=k("ZodEmail",(e,t)=>{nx.init(e,t),_e.init(e,t)}),ac=k("ZodGUID",(e,t)=>{tx.init(e,t),_e.init(e,t)}),lr=k("ZodUUID",(e,t)=>{ix.init(e,t),_e.init(e,t)}),Zk=k("ZodURL",(e,t)=>{rx.init(e,t),_e.init(e,t)}),Uk=k("ZodEmoji",(e,t)=>{ox.init(e,t),_e.init(e,t)}),Lk=k("ZodNanoID",(e,t)=>{sx.init(e,t),_e.init(e,t)}),Fk=k("ZodCUID",(e,t)=>{ax.init(e,t),_e.init(e,t)}),Bk=k("ZodCUID2",(e,t)=>{lx.init(e,t),_e.init(e,t)}),Vk=k("ZodULID",(e,t)=>{ux.init(e,t),_e.init(e,t)}),Wk=k("ZodXID",(e,t)=>{cx.init(e,t),_e.init(e,t)}),Hk=k("ZodKSUID",(e,t)=>{dx.init(e,t),_e.init(e,t)}),Jk=k("ZodIPv4",(e,t)=>{gx.init(e,t),_e.init(e,t)}),qk=k("ZodIPv6",(e,t)=>{vx.init(e,t),_e.init(e,t)}),Kk=k("ZodCIDRv4",(e,t)=>{bx.init(e,t),_e.init(e,t)}),Xk=k("ZodCIDRv6",(e,t)=>{_x.init(e,t),_e.init(e,t)}),Gk=k("ZodBase64",(e,t)=>{yx.init(e,t),_e.init(e,t)}),Yk=k("ZodBase64URL",(e,t)=>{$x.init(e,t),_e.init(e,t)}),Qk=k("ZodE164",(e,t)=>{kx.init(e,t),_e.init(e,t)}),e0=k("ZodJWT",(e,t)=>{Sx.init(e,t),_e.init(e,t)}),Mf=k("ZodNumber",(e,t)=>{_f.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>q$(e,r,n),e.gt=(r,n)=>e.check(oc(r,n)),e.gte=(r,n)=>e.check(gs(r,n)),e.min=(r,n)=>e.check(gs(r,n)),e.lt=(r,n)=>e.check(rc(r,n)),e.lte=(r,n)=>e.check(ps(r,n)),e.max=(r,n)=>e.check(ps(r,n)),e.int=r=>e.check(lc(r)),e.safe=r=>e.check(lc(r)),e.positive=r=>e.check(oc(0,r)),e.nonnegative=r=>e.check(gs(0,r)),e.negative=r=>e.check(rc(0,r)),e.nonpositive=r=>e.check(ps(0,r)),e.multipleOf=(r,n)=>e.check(sc(r,n)),e.step=(r,n)=>e.check(sc(r,n)),e.finite=()=>e;const i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function ne(e){return k$(Mf,e)}const t0=k("ZodNumberFormat",(e,t)=>{Ix.init(e,t),Mf.init(e,t)});function lc(e){return w$(t0,e)}const i0=k("ZodBoolean",(e,t)=>{zx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>K$(e,i,r)});function Oe(e){return S$(i0,e)}const n0=k("ZodNull",(e,t)=>{Ox.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>X$(e,i,r)});function Nf(e){return I$(n0,e)}const r0=k("ZodUnknown",(e,t)=>{Px.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Y$()});function ve(){return z$(r0)}const o0=k("ZodNever",(e,t)=>{Tx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>G$(e,i,r)});function s0(e){return O$(o0,e)}const a0=k("ZodArray",(e,t)=>{Dx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>nk(e,i,r,n),e.element=t.element,e.min=(i,r)=>e.check(Ur(i,r)),e.nonempty=i=>e.check(Ur(1,i)),e.max=(i,r)=>e.check(wf(i,r)),e.length=(i,r)=>e.check(Sf(i,r)),e.unwrap=()=>e.element});function X(e,t){return U$(a0,e,t)}const Af=k("ZodObject",(e,t)=>{Mx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>rk(e,i,r,n),Q(e,"shape",()=>t.shape),e.keyof=()=>qe(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ve()}),e.loose=()=>e.clone({...e._zod.def,catchall:ve()}),e.strict=()=>e.clone({...e._zod.def,catchall:s0()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>Q_(e,i),e.safeExtend=i=>ey(e,i),e.merge=i=>ty(e,i),e.pick=i=>G_(e,i),e.omit=i=>Y_(e,i),e.partial=(...i)=>iy(Zf,e,i[0]),e.required=(...i)=>ny(Uf,e,i[0])});function M(e,t){const i={type:"object",shape:e??{},...A(t)};return new Af(i)}function Ve(e,t){return new Af({type:"object",shape:e,catchall:ve(),...A(t)})}const Cf=k("ZodUnion",(e,t)=>{$f.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>ok(e,i,r,n),e.options=t.options});function ue(e,t){return new Cf({type:"union",options:e,...A(t)})}const l0=k("ZodDiscriminatedUnion",(e,t)=>{Cf.init(e,t),Nx.init(e,t)});function Rf(e,t,i){return new l0({type:"union",options:t,discriminator:e,...A(i)})}const u0=k("ZodIntersection",(e,t)=>{Ax.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>sk(e,i,r,n)});function da(e,t){return new u0({type:"intersection",left:e,right:t})}const c0=k("ZodRecord",(e,t)=>{Cx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>ak(e,i,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function be(e,t,i){return new c0({type:"record",keyType:e,valueType:t,...A(i)})}const Ns=k("ZodEnum",(e,t)=>{Rx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Q$(e,r,n),e.enum=t.entries,e.options=Object.values(t.entries);const i=new Set(Object.keys(t.entries));e.extract=(r,n)=>{const o={};for(const s of r)if(i.has(s))o[s]=t.entries[s];else throw new Error(`Key ${s} not found in enum`);return new Ns({...t,checks:[],...A(n),entries:o})},e.exclude=(r,n)=>{const o={...t.entries};for(const s of r)if(i.has(s))delete o[s];else throw new Error(`Key ${s} not found in enum`);return new Ns({...t,checks:[],...A(n),entries:o})}});function qe(e,t){const i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Ns({type:"enum",entries:i,...A(t)})}const d0=k("ZodLiteral",(e,t)=>{jx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>ek(e,i,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function C(e,t){return new d0({type:"literal",values:Array.isArray(e)?e:[e],...A(t)})}const f0=k("ZodTransform",(e,t)=>{Zx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>ik(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new tf(e.constructor.name);i.addIssue=o=>{if(typeof o=="string")i.issues.push(cn(o,i.value,t));else{const s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=e),i.issues.push(cn(s))}};const n=t.transform(i.value,i);return n instanceof Promise?n.then(o=>(i.value=o,i)):(i.value=n,i)}});function jf(e){return new f0({type:"transform",transform:e})}const Zf=k("ZodOptional",(e,t)=>{kf.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Pf(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function xe(e){return new Zf({type:"optional",innerType:e})}const h0=k("ZodExactOptional",(e,t)=>{Ux.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Pf(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function m0(e){return new h0({type:"optional",innerType:e})}const p0=k("ZodNullable",(e,t)=>{Lx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>lk(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function uc(e){return new p0({type:"nullable",innerType:e})}const g0=k("ZodDefault",(e,t)=>{Fx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>ck(e,i,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function v0(e,t){return new g0({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():sf(t)}})}const b0=k("ZodPrefault",(e,t)=>{Bx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>dk(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function _0(e,t){return new b0({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():sf(t)}})}const Uf=k("ZodNonOptional",(e,t)=>{Vx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>uk(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function y0(e,t){return new Uf({type:"nonoptional",innerType:e,...A(t)})}const x0=k("ZodCatch",(e,t)=>{Wx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>fk(e,i,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $0(e,t){return new x0({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const k0=k("ZodPipe",(e,t)=>{Hx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>hk(e,i,r,n),e.in=t.in,e.out=t.out});function As(e,t){return new k0({type:"pipe",in:e,out:t})}const w0=k("ZodReadonly",(e,t)=>{Jx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>mk(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function S0(e){return new w0({type:"readonly",innerType:e})}const Lf=k("ZodCustom",(e,t)=>{qx.init(e,t),pe.init(e,t),e._zod.processJSONSchema=(i,r,n)=>tk(e,i)});function I0(e,t){return L$(Lf,e??(()=>!0),t)}function z0(e,t={}){return F$(Lf,e,t)}function O0(e){return B$(e)}function Ff(e,t){return As(jf(e),t)}const Gt="io.modelcontextprotocol/related-task",ho="2.0",Pe=I0(e=>e!==null&&(typeof e=="object"||typeof e=="function")),Bf=ue([$(),ne().int()]),Vf=$();Ve({ttl:ue([ne(),Nf()]).optional(),pollInterval:ne().optional()});const P0=M({ttl:ne().optional()}),T0=M({taskId:$()}),fa=Ve({progressToken:Bf.optional(),[Gt]:T0.optional()}),Ke=M({_meta:fa.optional()}),In=Ke.extend({task:P0.optional()}),D0=e=>In.safeParse(e).success,Te=M({method:$(),params:Ke.loose().optional()}),nt=M({_meta:fa.optional()}),rt=M({method:$(),params:nt.loose().optional()}),De=Ve({_meta:fa.optional()}),zn=ue([$(),ne().int()]),Wf=M({jsonrpc:C(ho),id:zn,...Te.shape}).strict(),cc=e=>Wf.safeParse(e).success,Hf=M({jsonrpc:C(ho),...rt.shape}).strict(),E0=e=>Hf.safeParse(e).success,ha=M({jsonrpc:C(ho),id:zn,result:De}).strict(),ur=e=>ha.safeParse(e).success;var ie;(function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(ie||(ie={}));const ma=M({jsonrpc:C(ho),id:zn.optional(),error:M({code:ne().int(),message:$(),data:ve().optional()})}).strict(),M0=e=>ma.safeParse(e).success,N0=ue([Wf,Hf,ha,ma]);ue([ha,ma]);const pa=De.strict(),A0=nt.extend({requestId:zn.optional(),reason:$().optional()}),ga=rt.extend({method:C("notifications/cancelled"),params:A0}),C0=M({src:$(),mimeType:$().optional(),sizes:X($()).optional(),theme:qe(["light","dark"]).optional()}),On=M({icons:X(C0).optional()}),Ii=M({name:$(),title:$().optional()}),mo=Ii.extend({...Ii.shape,...On.shape,version:$(),websiteUrl:$().optional(),description:$().optional()}),R0=da(M({applyDefaults:Oe().optional()}),be($(),ve())),j0=Ff(e=>e&&typeof e=="object"&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,da(M({form:R0.optional(),url:Pe.optional()}),be($(),ve()).optional())),Z0=Ve({list:Pe.optional(),cancel:Pe.optional(),requests:Ve({sampling:Ve({createMessage:Pe.optional()}).optional(),elicitation:Ve({create:Pe.optional()}).optional()}).optional()}),U0=Ve({list:Pe.optional(),cancel:Pe.optional(),requests:Ve({tools:Ve({call:Pe.optional()}).optional()}).optional()}),L0=M({experimental:be($(),Pe).optional(),sampling:M({context:Pe.optional(),tools:Pe.optional()}).optional(),elicitation:j0.optional(),roots:M({listChanged:Oe().optional()}).optional(),tasks:Z0.optional()}),F0=Ke.extend({protocolVersion:$(),capabilities:L0,clientInfo:mo}),B0=Te.extend({method:C("initialize"),params:F0}),V0=M({experimental:be($(),Pe).optional(),logging:Pe.optional(),completions:Pe.optional(),prompts:M({listChanged:Oe().optional()}).optional(),resources:M({subscribe:Oe().optional(),listChanged:Oe().optional()}).optional(),tools:M({listChanged:Oe().optional()}).optional(),tasks:U0.optional()}),W0=De.extend({protocolVersion:$(),capabilities:V0,serverInfo:mo,instructions:$().optional()}),H0=rt.extend({method:C("notifications/initialized"),params:nt.optional()}),po=Te.extend({method:C("ping"),params:Ke.optional()}),J0=M({progress:ne(),total:xe(ne()),message:xe($())}),q0=M({...nt.shape,...J0.shape,progressToken:Bf}),va=rt.extend({method:C("notifications/progress"),params:q0}),K0=Ke.extend({cursor:Vf.optional()}),Pn=Te.extend({params:K0.optional()}),Tn=De.extend({nextCursor:Vf.optional()}),X0=qe(["working","input_required","completed","failed","cancelled"]),Dn=M({taskId:$(),status:X0,ttl:ue([ne(),Nf()]),createdAt:$(),lastUpdatedAt:$(),pollInterval:xe(ne()),statusMessage:xe($())}),ba=De.extend({task:Dn}),G0=nt.merge(Dn),Fr=rt.extend({method:C("notifications/tasks/status"),params:G0}),_a=Te.extend({method:C("tasks/get"),params:Ke.extend({taskId:$()})}),ya=De.merge(Dn),xa=Te.extend({method:C("tasks/result"),params:Ke.extend({taskId:$()})});De.loose();const $a=Pn.extend({method:C("tasks/list")}),ka=Tn.extend({tasks:X(Dn)}),wa=Te.extend({method:C("tasks/cancel"),params:Ke.extend({taskId:$()})}),Y0=De.merge(Dn),Jf=M({uri:$(),mimeType:xe($()),_meta:be($(),ve()).optional()}),qf=Jf.extend({text:$()}),Sa=$().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),Kf=Jf.extend({blob:Sa}),En=qe(["user","assistant"]),ji=M({audience:X(En).optional(),priority:ne().min(0).max(1).optional(),lastModified:Df({offset:!0}).optional()}),Xf=M({...Ii.shape,...On.shape,uri:$(),description:xe($()),mimeType:xe($()),annotations:ji.optional(),_meta:xe(Ve({}))}),Q0=M({...Ii.shape,...On.shape,uriTemplate:$(),description:xe($()),mimeType:xe($()),annotations:ji.optional(),_meta:xe(Ve({}))}),ew=Pn.extend({method:C("resources/list")}),tw=Tn.extend({resources:X(Xf)}),iw=Pn.extend({method:C("resources/templates/list")}),nw=Tn.extend({resourceTemplates:X(Q0)}),Ia=Ke.extend({uri:$()}),rw=Ia,ow=Te.extend({method:C("resources/read"),params:rw}),sw=De.extend({contents:X(ue([qf,Kf]))}),aw=rt.extend({method:C("notifications/resources/list_changed"),params:nt.optional()}),lw=Ia,uw=Te.extend({method:C("resources/subscribe"),params:lw}),cw=Ia,dw=Te.extend({method:C("resources/unsubscribe"),params:cw}),fw=nt.extend({uri:$()}),hw=rt.extend({method:C("notifications/resources/updated"),params:fw}),mw=M({name:$(),description:xe($()),required:xe(Oe())}),pw=M({...Ii.shape,...On.shape,description:xe($()),arguments:xe(X(mw)),_meta:xe(Ve({}))}),gw=Pn.extend({method:C("prompts/list")}),vw=Tn.extend({prompts:X(pw)}),bw=Ke.extend({name:$(),arguments:be($(),$()).optional()}),_w=Te.extend({method:C("prompts/get"),params:bw}),za=M({type:C("text"),text:$(),annotations:ji.optional(),_meta:be($(),ve()).optional()}),Oa=M({type:C("image"),data:Sa,mimeType:$(),annotations:ji.optional(),_meta:be($(),ve()).optional()}),Pa=M({type:C("audio"),data:Sa,mimeType:$(),annotations:ji.optional(),_meta:be($(),ve()).optional()}),yw=M({type:C("tool_use"),name:$(),id:$(),input:be($(),ve()),_meta:be($(),ve()).optional()}),xw=M({type:C("resource"),resource:ue([qf,Kf]),annotations:ji.optional(),_meta:be($(),ve()).optional()}),$w=Xf.extend({type:C("resource_link")}),Mn=ue([za,Oa,Pa,$w,xw]),kw=M({role:En,content:Mn}),ww=De.extend({description:$().optional(),messages:X(kw)}),Sw=rt.extend({method:C("notifications/prompts/list_changed"),params:nt.optional()}),Iw=M({title:$().optional(),readOnlyHint:Oe().optional(),destructiveHint:Oe().optional(),idempotentHint:Oe().optional(),openWorldHint:Oe().optional()}),zw=M({taskSupport:qe(["required","optional","forbidden"]).optional()}),Ta=M({...Ii.shape,...On.shape,description:$().optional(),inputSchema:M({type:C("object"),properties:be($(),Pe).optional(),required:X($()).optional()}).catchall(ve()),outputSchema:M({type:C("object"),properties:be($(),Pe).optional(),required:X($()).optional()}).catchall(ve()).optional(),annotations:Iw.optional(),execution:zw.optional(),_meta:be($(),ve()).optional()}),Gf=Pn.extend({method:C("tools/list")}),Ow=Tn.extend({tools:X(Ta)}),go=De.extend({content:X(Mn).default([]),structuredContent:be($(),ve()).optional(),isError:Oe().optional()});go.or(De.extend({toolResult:ve()}));const Pw=In.extend({name:$(),arguments:be($(),ve()).optional()}),Yf=Te.extend({method:C("tools/call"),params:Pw}),Tw=rt.extend({method:C("notifications/tools/list_changed"),params:nt.optional()});M({autoRefresh:Oe().default(!0),debounceMs:ne().int().nonnegative().default(300)});const Qf=qe(["debug","info","notice","warning","error","critical","alert","emergency"]),Dw=Ke.extend({level:Qf}),Ew=Te.extend({method:C("logging/setLevel"),params:Dw}),Mw=nt.extend({level:Qf,logger:$().optional(),data:ve()}),Nw=rt.extend({method:C("notifications/message"),params:Mw}),Aw=M({name:$().optional()}),Cw=M({hints:X(Aw).optional(),costPriority:ne().min(0).max(1).optional(),speedPriority:ne().min(0).max(1).optional(),intelligencePriority:ne().min(0).max(1).optional()}),Rw=M({mode:qe(["auto","required","none"]).optional()}),jw=M({type:C("tool_result"),toolUseId:$().describe("The unique identifier for the corresponding tool call."),content:X(Mn).default([]),structuredContent:M({}).loose().optional(),isError:Oe().optional(),_meta:be($(),ve()).optional()}),Zw=Rf("type",[za,Oa,Pa]),Br=Rf("type",[za,Oa,Pa,yw,jw]),Uw=M({role:En,content:ue([Br,X(Br)]),_meta:be($(),ve()).optional()}),Lw=In.extend({messages:X(Uw),modelPreferences:Cw.optional(),systemPrompt:$().optional(),includeContext:qe(["none","thisServer","allServers"]).optional(),temperature:ne().optional(),maxTokens:ne().int(),stopSequences:X($()).optional(),metadata:Pe.optional(),tools:X(Ta).optional(),toolChoice:Rw.optional()}),Fw=Te.extend({method:C("sampling/createMessage"),params:Lw}),Bw=De.extend({model:$(),stopReason:xe(qe(["endTurn","stopSequence","maxTokens"]).or($())),role:En,content:Zw}),Vw=De.extend({model:$(),stopReason:xe(qe(["endTurn","stopSequence","maxTokens","toolUse"]).or($())),role:En,content:ue([Br,X(Br)])}),Ww=M({type:C("boolean"),title:$().optional(),description:$().optional(),default:Oe().optional()}),Hw=M({type:C("string"),title:$().optional(),description:$().optional(),minLength:ne().optional(),maxLength:ne().optional(),format:qe(["email","uri","date","date-time"]).optional(),default:$().optional()}),Jw=M({type:qe(["number","integer"]),title:$().optional(),description:$().optional(),minimum:ne().optional(),maximum:ne().optional(),default:ne().optional()}),qw=M({type:C("string"),title:$().optional(),description:$().optional(),enum:X($()),default:$().optional()}),Kw=M({type:C("string"),title:$().optional(),description:$().optional(),oneOf:X(M({const:$(),title:$()})),default:$().optional()}),Xw=M({type:C("string"),title:$().optional(),description:$().optional(),enum:X($()),enumNames:X($()).optional(),default:$().optional()}),Gw=ue([qw,Kw]),Yw=M({type:C("array"),title:$().optional(),description:$().optional(),minItems:ne().optional(),maxItems:ne().optional(),items:M({type:C("string"),enum:X($())}),default:X($()).optional()}),Qw=M({type:C("array"),title:$().optional(),description:$().optional(),minItems:ne().optional(),maxItems:ne().optional(),items:M({anyOf:X(M({const:$(),title:$()}))}),default:X($()).optional()}),eS=ue([Yw,Qw]),tS=ue([Xw,Gw,eS]),iS=ue([tS,Ww,Hw,Jw]),nS=In.extend({mode:C("form").optional(),message:$(),requestedSchema:M({type:C("object"),properties:be($(),iS),required:X($()).optional()})}),rS=In.extend({mode:C("url"),message:$(),elicitationId:$(),url:$().url()}),oS=ue([nS,rS]),sS=Te.extend({method:C("elicitation/create"),params:oS}),aS=nt.extend({elicitationId:$()}),lS=rt.extend({method:C("notifications/elicitation/complete"),params:aS}),uS=De.extend({action:qe(["accept","decline","cancel"]),content:Ff(e=>e===null?void 0:e,be($(),ue([$(),ne(),Oe(),X($())])).optional())}),cS=M({type:C("ref/resource"),uri:$()}),dS=M({type:C("ref/prompt"),name:$()}),fS=Ke.extend({ref:ue([dS,cS]),argument:M({name:$(),value:$()}),context:M({arguments:be($(),$()).optional()}).optional()}),hS=Te.extend({method:C("completion/complete"),params:fS}),mS=De.extend({completion:Ve({values:X($()).max(100),total:xe(ne().int()),hasMore:xe(Oe())})}),pS=M({uri:$().startsWith("file://"),name:$().optional(),_meta:be($(),ve()).optional()}),gS=Te.extend({method:C("roots/list"),params:Ke.optional()}),vS=De.extend({roots:X(pS)}),bS=rt.extend({method:C("notifications/roots/list_changed"),params:nt.optional()});ue([po,B0,hS,Ew,_w,gw,ew,iw,ow,uw,dw,Yf,Gf,_a,xa,$a,wa]);ue([ga,va,H0,bS,Fr]);ue([pa,Bw,Vw,uS,vS,ya,ka,ba]);ue([po,Fw,sS,gS,_a,xa,$a,wa]);ue([ga,va,Nw,hw,aw,Tw,Sw,Fr,lS]);ue([pa,W0,mS,ww,vw,tw,nw,sw,go,Ow,ya,ka,ba]);class G extends Error{constructor(t,i,r){super(`MCP error ${t}: ${i}`),this.code=t,this.data=r,this.name="McpError"}static fromError(t,i,r){if(t===ie.UrlElicitationRequired&&r){const n=r;if(n.elicitations)return new _S(n.elicitations,i)}return new G(t,i,r)}}class _S extends G{constructor(t,i=`URL elicitation${t.length>1?"s":""} required`){super(ie.UrlElicitationRequired,i,{elicitations:t})}get elicitations(){var t;return((t=this.data)==null?void 0:t.elicitations)??[]}}function Ht(e){return e==="completed"||e==="failed"||e==="cancelled"}new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function dc(e){const t=pk(e),i=t==null?void 0:t.method;if(!i)throw new Error("Schema is missing a method literal");const r=gk(i);if(typeof r!="string")throw new Error("Schema method literal must be a string");return r}function fc(e,t){const i=Tf(e,t);if(!i.success)throw i.error;return i.data}const yS=6e4;class xS{constructor(t){this._options=t,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(ga,i=>{this._oncancel(i)}),this.setNotificationHandler(va,i=>{this._onprogress(i)}),this.setRequestHandler(po,i=>({})),this._taskStore=t==null?void 0:t.taskStore,this._taskMessageQueue=t==null?void 0:t.taskMessageQueue,this._taskStore&&(this.setRequestHandler(_a,async(i,r)=>{const n=await this._taskStore.getTask(i.params.taskId,r.sessionId);if(!n)throw new G(ie.InvalidParams,"Failed to retrieve task: Task not found");return{...n}}),this.setRequestHandler(xa,async(i,r)=>{const n=async()=>{var a;const o=i.params.taskId;if(this._taskMessageQueue){let l;for(;l=await this._taskMessageQueue.dequeue(o,r.sessionId);){if(l.type==="response"||l.type==="error"){const u=l.message,c=u.id,d=this._requestResolvers.get(c);if(d)if(this._requestResolvers.delete(c),l.type==="response")d(u);else{const f=u,h=new G(f.error.code,f.error.message,f.error.data);d(h)}else{const f=l.type==="response"?"Response":"Error";this._onerror(new Error(`${f} handler missing for request ${c}`))}continue}await((a=this._transport)==null?void 0:a.send(l.message,{relatedRequestId:r.requestId}))}}const s=await this._taskStore.getTask(o,r.sessionId);if(!s)throw new G(ie.InvalidParams,`Task not found: ${o}`);if(!Ht(s.status))return await this._waitForTaskUpdate(o,r.signal),await n();if(Ht(s.status)){const l=await this._taskStore.getTaskResult(o,r.sessionId);return this._clearTaskQueue(o),{...l,_meta:{...l._meta,[Gt]:{taskId:o}}}}return await n()};return await n()}),this.setRequestHandler($a,async(i,r)=>{var n;try{const{tasks:o,nextCursor:s}=await this._taskStore.listTasks((n=i.params)==null?void 0:n.cursor,r.sessionId);return{tasks:o,nextCursor:s,_meta:{}}}catch(o){throw new G(ie.InvalidParams,`Failed to list tasks: ${o instanceof Error?o.message:String(o)}`)}}),this.setRequestHandler(wa,async(i,r)=>{try{const n=await this._taskStore.getTask(i.params.taskId,r.sessionId);if(!n)throw new G(ie.InvalidParams,`Task not found: ${i.params.taskId}`);if(Ht(n.status))throw new G(ie.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(i.params.taskId,"cancelled","Client cancelled task execution.",r.sessionId),this._clearTaskQueue(i.params.taskId);const o=await this._taskStore.getTask(i.params.taskId,r.sessionId);if(!o)throw new G(ie.InvalidParams,`Task not found after cancellation: ${i.params.taskId}`);return{_meta:{},...o}}catch(n){throw n instanceof G?n:new G(ie.InvalidRequest,`Failed to cancel task: ${n instanceof Error?n.message:String(n)}`)}}))}async _oncancel(t){if(!t.params.requestId)return;const i=this._requestHandlerAbortControllers.get(t.params.requestId);i==null||i.abort(t.params.reason)}_setupTimeout(t,i,r,n,o=!1){this._timeoutInfo.set(t,{timeoutId:setTimeout(n,i),startTime:Date.now(),timeout:i,maxTotalTimeout:r,resetTimeoutOnProgress:o,onTimeout:n})}_resetTimeout(t){const i=this._timeoutInfo.get(t);if(!i)return!1;const r=Date.now()-i.startTime;if(i.maxTotalTimeout&&r>=i.maxTotalTimeout)throw this._timeoutInfo.delete(t),G.fromError(ie.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:r});return clearTimeout(i.timeoutId),i.timeoutId=setTimeout(i.onTimeout,i.timeout),!0}_cleanupTimeout(t){const i=this._timeoutInfo.get(t);i&&(clearTimeout(i.timeoutId),this._timeoutInfo.delete(t))}async connect(t){var o,s,a;this._transport=t;const i=(o=this.transport)==null?void 0:o.onclose;this._transport.onclose=()=>{i==null||i(),this._onclose()};const r=(s=this.transport)==null?void 0:s.onerror;this._transport.onerror=l=>{r==null||r(l),this._onerror(l)};const n=(a=this._transport)==null?void 0:a.onmessage;this._transport.onmessage=(l,u)=>{n==null||n(l,u),ur(l)||M0(l)?this._onresponse(l):cc(l)?this._onrequest(l,u):E0(l)?this._onnotification(l):this._onerror(new Error(`Unknown message type: ${JSON.stringify(l)}`))},await this._transport.start()}_onclose(){var r;const t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();const i=G.fromError(ie.ConnectionClosed,"Connection closed");this._transport=void 0,(r=this.onclose)==null||r.call(this);for(const n of t.values())n(i)}_onerror(t){var i;(i=this.onerror)==null||i.call(this,t)}_onnotification(t){const i=this._notificationHandlers.get(t.method)??this.fallbackNotificationHandler;i!==void 0&&Promise.resolve().then(()=>i(t)).catch(r=>this._onerror(new Error(`Uncaught error in notification handler: ${r}`)))}_onrequest(t,i){var c,d,f,h;const r=this._requestHandlers.get(t.method)??this.fallbackRequestHandler,n=this._transport,o=(f=(d=(c=t.params)==null?void 0:c._meta)==null?void 0:d[Gt])==null?void 0:f.taskId;if(r===void 0){const m={jsonrpc:"2.0",id:t.id,error:{code:ie.MethodNotFound,message:"Method not found"}};o&&this._taskMessageQueue?this._enqueueTaskMessage(o,{type:"error",message:m,timestamp:Date.now()},n==null?void 0:n.sessionId).catch(p=>this._onerror(new Error(`Failed to enqueue error response: ${p}`))):n==null||n.send(m).catch(p=>this._onerror(new Error(`Failed to send an error response: ${p}`)));return}const s=new AbortController;this._requestHandlerAbortControllers.set(t.id,s);const a=D0(t.params)?t.params.task:void 0,l=this._taskStore?this.requestTaskStore(t,n==null?void 0:n.sessionId):void 0,u={signal:s.signal,sessionId:n==null?void 0:n.sessionId,_meta:(h=t.params)==null?void 0:h._meta,sendNotification:async m=>{const p={relatedRequestId:t.id};o&&(p.relatedTask={taskId:o}),await this.notification(m,p)},sendRequest:async(m,p,g)=>{var S;const b={...g,relatedRequestId:t.id};o&&!b.relatedTask&&(b.relatedTask={taskId:o});const y=((S=b.relatedTask)==null?void 0:S.taskId)??o;return y&&l&&await l.updateTaskStatus(y,"input_required"),await this.request(m,p,b)},authInfo:i==null?void 0:i.authInfo,requestId:t.id,requestInfo:i==null?void 0:i.requestInfo,taskId:o,taskStore:l,taskRequestedTtl:a==null?void 0:a.ttl,closeSSEStream:i==null?void 0:i.closeSSEStream,closeStandaloneSSEStream:i==null?void 0:i.closeStandaloneSSEStream};Promise.resolve().then(()=>{a&&this.assertTaskHandlerCapability(t.method)}).then(()=>r(t,u)).then(async m=>{if(s.signal.aborted)return;const p={result:m,jsonrpc:"2.0",id:t.id};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"response",message:p,timestamp:Date.now()},n==null?void 0:n.sessionId):await(n==null?void 0:n.send(p))},async m=>{if(s.signal.aborted)return;const p={jsonrpc:"2.0",id:t.id,error:{code:Number.isSafeInteger(m.code)?m.code:ie.InternalError,message:m.message??"Internal error",...m.data!==void 0&&{data:m.data}}};o&&this._taskMessageQueue?await this._enqueueTaskMessage(o,{type:"error",message:p,timestamp:Date.now()},n==null?void 0:n.sessionId):await(n==null?void 0:n.send(p))}).catch(m=>this._onerror(new Error(`Failed to send response: ${m}`))).finally(()=>{this._requestHandlerAbortControllers.delete(t.id)})}_onprogress(t){const{progressToken:i,...r}=t.params,n=Number(i),o=this._progressHandlers.get(n);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(t)}`));return}const s=this._responseHandlers.get(n),a=this._timeoutInfo.get(n);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(n)}catch(l){this._responseHandlers.delete(n),this._progressHandlers.delete(n),this._cleanupTimeout(n),s(l);return}o(r)}_onresponse(t){const i=Number(t.id),r=this._requestResolvers.get(i);if(r){if(this._requestResolvers.delete(i),ur(t))r(t);else{const s=new G(t.error.code,t.error.message,t.error.data);r(s)}return}const n=this._responseHandlers.get(i);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(t)}`));return}this._responseHandlers.delete(i),this._cleanupTimeout(i);let o=!1;if(ur(t)&&t.result&&typeof t.result=="object"){const s=t.result;if(s.task&&typeof s.task=="object"){const a=s.task;typeof a.taskId=="string"&&(o=!0,this._taskProgressTokens.set(a.taskId,i))}}if(o||this._progressHandlers.delete(i),ur(t))n(t);else{const s=G.fromError(t.error.code,t.error.message,t.error.data);n(s)}}get transport(){return this._transport}async close(){var t;await((t=this._transport)==null?void 0:t.close())}async*requestStream(t,i,r){var s,a;const{task:n}=r??{};if(!n){try{yield{type:"result",result:await this.request(t,i,r)}}catch(l){yield{type:"error",error:l instanceof G?l:new G(ie.InternalError,String(l))}}return}let o;try{const l=await this.request(t,ba,r);if(l.task)o=l.task.taskId,yield{type:"taskCreated",task:l.task};else throw new G(ie.InternalError,"Task creation did not return a task");for(;;){const u=await this.getTask({taskId:o},r);if(yield{type:"taskStatus",task:u},Ht(u.status)){u.status==="completed"?yield{type:"result",result:await this.getTaskResult({taskId:o},i,r)}:u.status==="failed"?yield{type:"error",error:new G(ie.InternalError,`Task ${o} failed`)}:u.status==="cancelled"&&(yield{type:"error",error:new G(ie.InternalError,`Task ${o} was cancelled`)});return}if(u.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:o},i,r)};return}const c=u.pollInterval??((s=this._options)==null?void 0:s.defaultTaskPollInterval)??1e3;await new Promise(d=>setTimeout(d,c)),(a=r==null?void 0:r.signal)==null||a.throwIfAborted()}}catch(l){yield{type:"error",error:l instanceof G?l:new G(ie.InternalError,String(l))}}}request(t,i,r){const{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s,task:a,relatedTask:l}=r??{};return new Promise((u,c)=>{var y,S,w,x,I;const d=z=>{c(z)};if(!this._transport){d(new Error("Not connected"));return}if(((y=this._options)==null?void 0:y.enforceStrictCapabilities)===!0)try{this.assertCapabilityForMethod(t.method),a&&this.assertTaskCapability(t.method)}catch(z){d(z);return}(S=r==null?void 0:r.signal)==null||S.throwIfAborted();const f=this._requestMessageId++,h={...t,jsonrpc:"2.0",id:f};r!=null&&r.onprogress&&(this._progressHandlers.set(f,r.onprogress),h.params={...t.params,_meta:{...((w=t.params)==null?void 0:w._meta)||{},progressToken:f}}),a&&(h.params={...h.params,task:a}),l&&(h.params={...h.params,_meta:{...((x=h.params)==null?void 0:x._meta)||{},[Gt]:l}});const m=z=>{var N;this._responseHandlers.delete(f),this._progressHandlers.delete(f),this._cleanupTimeout(f),(N=this._transport)==null||N.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:f,reason:String(z)}},{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s}).catch(F=>this._onerror(new Error(`Failed to send cancellation: ${F}`)));const D=z instanceof G?z:new G(ie.RequestTimeout,String(z));c(D)};this._responseHandlers.set(f,z=>{var D;if(!((D=r==null?void 0:r.signal)!=null&&D.aborted)){if(z instanceof Error)return c(z);try{const N=Tf(i,z.result);N.success?u(N.data):c(N.error)}catch(N){c(N)}}}),(I=r==null?void 0:r.signal)==null||I.addEventListener("abort",()=>{var z;m((z=r==null?void 0:r.signal)==null?void 0:z.reason)});const p=(r==null?void 0:r.timeout)??yS,g=()=>m(G.fromError(ie.RequestTimeout,"Request timed out",{timeout:p}));this._setupTimeout(f,p,r==null?void 0:r.maxTotalTimeout,g,(r==null?void 0:r.resetTimeoutOnProgress)??!1);const b=l==null?void 0:l.taskId;if(b){const z=D=>{const N=this._responseHandlers.get(f);N?N(D):this._onerror(new Error(`Response handler missing for side-channeled request ${f}`))};this._requestResolvers.set(f,z),this._enqueueTaskMessage(b,{type:"request",message:h,timestamp:Date.now()}).catch(D=>{this._cleanupTimeout(f),c(D)})}else this._transport.send(h,{relatedRequestId:n,resumptionToken:o,onresumptiontoken:s}).catch(z=>{this._cleanupTimeout(f),c(z)})})}async getTask(t,i){return this.request({method:"tasks/get",params:t},ya,i)}async getTaskResult(t,i,r){return this.request({method:"tasks/result",params:t},i,r)}async listTasks(t,i){return this.request({method:"tasks/list",params:t},ka,i)}async cancelTask(t,i){return this.request({method:"tasks/cancel",params:t},Y0,i)}async notification(t,i){var a,l,u,c;if(!this._transport)throw new Error("Not connected");this.assertNotificationCapability(t.method);const r=(a=i==null?void 0:i.relatedTask)==null?void 0:a.taskId;if(r){const d={...t,jsonrpc:"2.0",params:{...t.params,_meta:{...((l=t.params)==null?void 0:l._meta)||{},[Gt]:i.relatedTask}}};await this._enqueueTaskMessage(r,{type:"notification",message:d,timestamp:Date.now()});return}if((((u=this._options)==null?void 0:u.debouncedNotificationMethods)??[]).includes(t.method)&&!t.params&&!(i!=null&&i.relatedRequestId)&&!(i!=null&&i.relatedTask)){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{var f,h;if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;let d={...t,jsonrpc:"2.0"};i!=null&&i.relatedTask&&(d={...d,params:{...d.params,_meta:{...((f=d.params)==null?void 0:f._meta)||{},[Gt]:i.relatedTask}}}),(h=this._transport)==null||h.send(d,i).catch(m=>this._onerror(m))});return}let s={...t,jsonrpc:"2.0"};i!=null&&i.relatedTask&&(s={...s,params:{...s.params,_meta:{...((c=s.params)==null?void 0:c._meta)||{},[Gt]:i.relatedTask}}}),await this._transport.send(s,i)}setRequestHandler(t,i){const r=dc(t);this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(n,o)=>{const s=fc(t,n);return Promise.resolve(i(s,o))})}removeRequestHandler(t){this._requestHandlers.delete(t)}assertCanSetRequestHandler(t){if(this._requestHandlers.has(t))throw new Error(`A request handler for ${t} already exists, which would be overridden`)}setNotificationHandler(t,i){const r=dc(t);this._notificationHandlers.set(r,n=>{const o=fc(t,n);return Promise.resolve(i(o))})}removeNotificationHandler(t){this._notificationHandlers.delete(t)}_cleanupTaskProgressHandler(t){const i=this._taskProgressTokens.get(t);i!==void 0&&(this._progressHandlers.delete(i),this._taskProgressTokens.delete(t))}async _enqueueTaskMessage(t,i,r){var o;if(!this._taskStore||!this._taskMessageQueue)throw new Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");const n=(o=this._options)==null?void 0:o.maxTaskQueueSize;await this._taskMessageQueue.enqueue(t,i,r,n)}async _clearTaskQueue(t,i){if(this._taskMessageQueue){const r=await this._taskMessageQueue.dequeueAll(t,i);for(const n of r)if(n.type==="request"&&cc(n.message)){const o=n.message.id,s=this._requestResolvers.get(o);s?(s(new G(ie.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(o)):this._onerror(new Error(`Resolver missing for request ${o} during task ${t} cleanup`))}}}async _waitForTaskUpdate(t,i){var n,o;let r=((n=this._options)==null?void 0:n.defaultTaskPollInterval)??1e3;try{const s=await((o=this._taskStore)==null?void 0:o.getTask(t));s!=null&&s.pollInterval&&(r=s.pollInterval)}catch{}return new Promise((s,a)=>{if(i.aborted){a(new G(ie.InvalidRequest,"Request cancelled"));return}const l=setTimeout(s,r);i.addEventListener("abort",()=>{clearTimeout(l),a(new G(ie.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore(t,i){const r=this._taskStore;if(!r)throw new Error("No task store configured");return{createTask:async n=>{if(!t)throw new Error("No request provided");return await r.createTask(n,t.id,{method:t.method,params:t.params},i)},getTask:async n=>{const o=await r.getTask(n,i);if(!o)throw new G(ie.InvalidParams,"Failed to retrieve task: Task not found");return o},storeTaskResult:async(n,o,s)=>{await r.storeTaskResult(n,o,s,i);const a=await r.getTask(n,i);if(a){const l=Fr.parse({method:"notifications/tasks/status",params:a});await this.notification(l),Ht(a.status)&&this._cleanupTaskProgressHandler(n)}},getTaskResult:n=>r.getTaskResult(n,i),updateTaskStatus:async(n,o,s)=>{const a=await r.getTask(n,i);if(!a)throw new G(ie.InvalidParams,`Task "${n}" not found - it may have been cleaned up`);if(Ht(a.status))throw new G(ie.InvalidParams,`Cannot update task "${n}" from terminal status "${a.status}" to "${o}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await r.updateTaskStatus(n,o,s,i);const l=await r.getTask(n,i);if(l){const u=Fr.parse({method:"notifications/tasks/status",params:l});await this.notification(u),Ht(l.status)&&this._cleanupTaskProgressHandler(n)}},listTasks:n=>r.listTasks(n,i)}}}var $S=Object.defineProperty,wt=(e,t)=>{for(var i in t)$S(e,i,{get:t[i],enumerable:!0,configurable:!0,set:r=>t[i]=()=>r})};class kS{constructor(t=window.parent,i){O(this,"eventTarget");O(this,"eventSource");O(this,"messageListener");O(this,"onclose");O(this,"onerror");O(this,"onmessage");O(this,"sessionId");O(this,"setProtocolVersion");this.eventTarget=t,this.eventSource=i,this.messageListener=r=>{var o,s;if(i&&r.source!==this.eventSource){console.debug("Ignoring message from unknown source",r);return}let n=N0.safeParse(r.data);n.success?(console.debug("Parsed message",n.data),(o=this.onmessage)==null||o.call(this,n.data)):(console.error("Failed to parse message",n.error.message,r),(s=this.onerror)==null||s.call(this,Error("Invalid JSON-RPC message received: "+n.error.message)))}}async start(){window.addEventListener("message",this.messageListener)}async send(t,i){console.debug("Sending message",t),this.eventTarget.postMessage(t,"*")}async close(){var t;window.removeEventListener("message",this.messageListener),(t=this.onclose)==null||t.call(this)}}var wS="2025-11-21",v={};wt(v,{xor:()=>gb,xid:()=>Zv,void:()=>cb,uuidv7:()=>Dv,uuidv6:()=>Tv,uuidv4:()=>Pv,uuid:()=>Ov,util:()=>W,url:()=>Ev,uppercase:()=>So,unknown:()=>ai,union:()=>ts,undefined:()=>lb,ulid:()=>jv,uint64:()=>sb,uint32:()=>nb,tuple:()=>Yl,trim:()=>Do,treeifyError:()=>mh,transform:()=>ns,toUpperCase:()=>Mo,toLowerCase:()=>Eo,toJSONSchema:()=>sv,templateLiteral:()=>Pb,symbol:()=>ab,superRefine:()=>Su,success:()=>Ib,stringbool:()=>Cb,stringFormat:()=>Xv,string:()=>Xr,strictObject:()=>mb,startsWith:()=>zo,slugify:()=>No,size:()=>Bn,setErrorMap:()=>WO,set:()=>xb,safeParseAsync:()=>vv,safeParse:()=>gv,safeEncodeAsync:()=>wv,safeEncode:()=>$v,safeDecodeAsync:()=>Sv,safeDecode:()=>kv,registry:()=>il,regexes:()=>fi,regex:()=>ko,refine:()=>wu,record:()=>Ql,readonly:()=>bu,property:()=>zl,promise:()=>Tb,prettifyError:()=>gh,preprocess:()=>jb,prefault:()=>du,positive:()=>kl,pipe:()=>pn,partialRecord:()=>bb,parseAsync:()=>pv,parse:()=>mv,overwrite:()=>It,optional:()=>hn,object:()=>hb,number:()=>Cl,nullish:()=>Sb,nullable:()=>mn,null:()=>Ll,normalize:()=>To,nonpositive:()=>Sl,nonoptional:()=>fu,nonnegative:()=>Il,never:()=>Qo,negative:()=>wl,nativeEnum:()=>$b,nanoid:()=>Av,nan:()=>zb,multipleOf:()=>Pi,minSize:()=>Rt,minLength:()=>si,mime:()=>Po,meta:()=>Nb,maxSize:()=>Zi,maxLength:()=>Vn,map:()=>yb,mac:()=>Fv,lte:()=>et,lt:()=>At,lowercase:()=>wo,looseRecord:()=>_b,looseObject:()=>pb,locales:()=>tl,literal:()=>kb,length:()=>Wn,lazy:()=>xu,ksuid:()=>Uv,keyof:()=>fb,jwt:()=>Kv,json:()=>Rb,iso:()=>Tl,ipv6:()=>Bv,ipv4:()=>Lv,intersection:()=>Xl,int64:()=>ob,int32:()=>ib,int:()=>Gr,instanceof:()=>Ab,includes:()=>Io,httpUrl:()=>Mv,hostname:()=>Gv,hex:()=>Yv,hash:()=>Qv,guid:()=>zv,gte:()=>Fe,gt:()=>Ct,globalRegistry:()=>Qe,getErrorMap:()=>HO,function:()=>Yr,fromJSONSchema:()=>XO,formatError:()=>Aa,float64:()=>tb,float32:()=>eb,flattenError:()=>Na,file:()=>wb,exactOptional:()=>su,enum:()=>is,endsWith:()=>Oo,encodeAsync:()=>yv,encode:()=>bv,emoji:()=>Nv,email:()=>Iv,e164:()=>qv,discriminatedUnion:()=>vb,describe:()=>Mb,decodeAsync:()=>xv,decode:()=>_v,date:()=>db,custom:()=>Eb,cuid2:()=>Rv,cuid:()=>Cv,core:()=>eh,config:()=>Re,coerce:()=>Ub,codec:()=>Ob,clone:()=>ot,cidrv6:()=>Wv,cidrv4:()=>Vv,check:()=>Db,catch:()=>pu,boolean:()=>Rl,bigint:()=>rb,base64url:()=>Jv,base64:()=>Hv,array:()=>Yn,any:()=>ub,_function:()=>Yr,_default:()=>uu,_ZodString:()=>Ao,ZodXor:()=>Jl,ZodXID:()=>Fo,ZodVoid:()=>Wl,ZodUnknown:()=>Bl,ZodUnion:()=>er,ZodUndefined:()=>Zl,ZodUUID:()=>ht,ZodURL:()=>qn,ZodULID:()=>Lo,ZodType:()=>L,ZodTuple:()=>Gl,ZodTransform:()=>ru,ZodTemplateLiteral:()=>_u,ZodSymbol:()=>jl,ZodSuccess:()=>hu,ZodStringFormat:()=>se,ZodString:()=>Jn,ZodSet:()=>tu,ZodRecord:()=>tr,ZodRealError:()=>Ge,ZodReadonly:()=>vu,ZodPromise:()=>$u,ZodPrefault:()=>cu,ZodPipe:()=>ss,ZodOptional:()=>rs,ZodObject:()=>Qn,ZodNumberFormat:()=>hi,ZodNumber:()=>Kn,ZodNullable:()=>au,ZodNull:()=>Ul,ZodNonOptional:()=>os,ZodNever:()=>Vl,ZodNanoID:()=>jo,ZodNaN:()=>gu,ZodMap:()=>eu,ZodMAC:()=>Al,ZodLiteral:()=>iu,ZodLazy:()=>yu,ZodKSUID:()=>Bo,ZodJWT:()=>Go,ZodIssueCode:()=>VO,ZodIntersection:()=>Kl,ZodISOTime:()=>Ml,ZodISODuration:()=>Nl,ZodISODateTime:()=>Dl,ZodISODate:()=>El,ZodIPv6:()=>Wo,ZodIPv4:()=>Vo,ZodGUID:()=>fn,ZodFunction:()=>ku,ZodFirstPartyTypeKind:()=>Ls,ZodFile:()=>nu,ZodExactOptional:()=>ou,ZodError:()=>BO,ZodEnum:()=>Mi,ZodEmoji:()=>Ro,ZodEmail:()=>Co,ZodE164:()=>Xo,ZodDiscriminatedUnion:()=>ql,ZodDefault:()=>lu,ZodDate:()=>es,ZodCustomStringFormat:()=>Ui,ZodCustom:()=>ir,ZodCodec:()=>as,ZodCatch:()=>mu,ZodCUID2:()=>Uo,ZodCUID:()=>Zo,ZodCIDRv6:()=>Jo,ZodCIDRv4:()=>Ho,ZodBoolean:()=>Xn,ZodBigIntFormat:()=>Yo,ZodBigInt:()=>Gn,ZodBase64URL:()=>Ko,ZodBase64:()=>qo,ZodArray:()=>Hl,ZodAny:()=>Fl,TimePrecision:()=>Zp,NEVER:()=>th,$output:()=>Mp,$input:()=>Np,$brand:()=>ih});var eh={};wt(eh,{version:()=>gm,util:()=>W,treeifyError:()=>mh,toJSONSchema:()=>sv,toDotPath:()=>ph,safeParseAsync:()=>bh,safeParse:()=>vh,safeEncodeAsync:()=>nI,safeEncode:()=>tI,safeDecodeAsync:()=>rI,safeDecode:()=>iI,registry:()=>il,regexes:()=>fi,process:()=>re,prettifyError:()=>gh,parseAsync:()=>js,parse:()=>Rs,meta:()=>yg,locales:()=>tl,isValidJWT:()=>Lm,isValidBase64URL:()=>jm,isValidBase64:()=>qa,initializeContext:()=>Ti,globalRegistry:()=>Qe,globalConfig:()=>Vr,formatError:()=>Aa,flattenError:()=>Na,finalize:()=>Ei,extractDefs:()=>Di,encodeAsync:()=>QS,encode:()=>GS,describe:()=>_g,decodeAsync:()=>eI,decode:()=>YS,createToJSONSchemaMethod:()=>$g,createStandardJSONSchemaMethod:()=>dn,config:()=>Re,clone:()=>ot,_xor:()=>bO,_xid:()=>hl,_void:()=>ug,_uuidv7:()=>al,_uuidv6:()=>sl,_uuidv4:()=>ol,_uuid:()=>rl,_url:()=>$o,_uppercase:()=>So,_unknown:()=>ag,_union:()=>vO,_undefined:()=>rg,_ulid:()=>fl,_uint64:()=>ig,_uint32:()=>Xp,_tuple:()=>xO,_trim:()=>Do,_transform:()=>OO,_toUpperCase:()=>Mo,_toLowerCase:()=>Eo,_templateLiteral:()=>RO,_symbol:()=>ng,_superRefine:()=>vg,_success:()=>MO,_stringbool:()=>xg,_stringFormat:()=>Hn,_string:()=>Cp,_startsWith:()=>zo,_slugify:()=>No,_size:()=>Bn,_set:()=>wO,_safeParseAsync:()=>jn,_safeParse:()=>Rn,_safeEncodeAsync:()=>Fa,_safeEncode:()=>Ua,_safeDecodeAsync:()=>Ba,_safeDecode:()=>La,_regex:()=>ko,_refine:()=>gg,_record:()=>$O,_readonly:()=>CO,_property:()=>zl,_promise:()=>ZO,_positive:()=>kl,_pipe:()=>AO,_parseAsync:()=>Cn,_parse:()=>An,_overwrite:()=>It,_optional:()=>PO,_number:()=>Vp,_nullable:()=>TO,_null:()=>og,_normalize:()=>To,_nonpositive:()=>Sl,_nonoptional:()=>EO,_nonnegative:()=>Il,_never:()=>lg,_negative:()=>wl,_nativeEnum:()=>IO,_nanoid:()=>ul,_nan:()=>fg,_multipleOf:()=>Pi,_minSize:()=>Rt,_minLength:()=>si,_min:()=>Fe,_mime:()=>Po,_maxSize:()=>Zi,_maxLength:()=>Vn,_max:()=>et,_map:()=>kO,_mac:()=>jp,_lte:()=>et,_lt:()=>At,_lowercase:()=>wo,_literal:()=>zO,_length:()=>Wn,_lazy:()=>jO,_ksuid:()=>ml,_jwt:()=>$l,_isoTime:()=>Fp,_isoDuration:()=>Bp,_isoDateTime:()=>Up,_isoDate:()=>Lp,_ipv6:()=>gl,_ipv4:()=>pl,_intersection:()=>yO,_int64:()=>tg,_int32:()=>Kp,_int:()=>Hp,_includes:()=>Io,_guid:()=>Kr,_gte:()=>Fe,_gt:()=>Ct,_float64:()=>qp,_float32:()=>Jp,_file:()=>mg,_enum:()=>SO,_endsWith:()=>Oo,_encodeAsync:()=>ja,_encode:()=>Ca,_emoji:()=>ll,_email:()=>nl,_e164:()=>xl,_discriminatedUnion:()=>_O,_default:()=>DO,_decodeAsync:()=>Za,_decode:()=>Ra,_date:()=>cg,_custom:()=>pg,_cuid2:()=>dl,_cuid:()=>cl,_coercedString:()=>Rp,_coercedNumber:()=>Wp,_coercedDate:()=>dg,_coercedBoolean:()=>Yp,_coercedBigint:()=>eg,_cidrv6:()=>bl,_cidrv4:()=>vl,_check:()=>bg,_catch:()=>NO,_boolean:()=>Gp,_bigint:()=>Qp,_base64url:()=>yl,_base64:()=>_l,_array:()=>hg,_any:()=>sg,TimePrecision:()=>Zp,NEVER:()=>th,JSONSchemaGenerator:()=>LO,JSONSchema:()=>FO,Doc:()=>pm,$output:()=>Mp,$input:()=>Np,$constructor:()=>_,$brand:()=>ih,$ZodXor:()=>op,$ZodXID:()=>Im,$ZodVoid:()=>Ym,$ZodUnknown:()=>Xm,$ZodUnion:()=>xo,$ZodUndefined:()=>Jm,$ZodUUID:()=>bm,$ZodURL:()=>ym,$ZodULID:()=>Sm,$ZodType:()=>U,$ZodTuple:()=>Ya,$ZodTransform:()=>mp,$ZodTemplateLiteral:()=>Sp,$ZodSymbol:()=>Hm,$ZodSuccess:()=>yp,$ZodStringFormat:()=>oe,$ZodString:()=>Fn,$ZodSet:()=>cp,$ZodRegistry:()=>Ap,$ZodRecord:()=>lp,$ZodRealError:()=>Xe,$ZodReadonly:()=>wp,$ZodPromise:()=>zp,$ZodPrefault:()=>bp,$ZodPipe:()=>kp,$ZodOptional:()=>Qa,$ZodObjectJIT:()=>rp,$ZodObject:()=>np,$ZodNumberFormat:()=>Vm,$ZodNumber:()=>Ka,$ZodNullable:()=>gp,$ZodNull:()=>qm,$ZodNonOptional:()=>_p,$ZodNever:()=>Gm,$ZodNanoID:()=>$m,$ZodNaN:()=>$p,$ZodMap:()=>up,$ZodMAC:()=>Nm,$ZodLiteral:()=>fp,$ZodLazy:()=>Op,$ZodKSUID:()=>zm,$ZodJWT:()=>Fm,$ZodIntersection:()=>ap,$ZodISOTime:()=>Tm,$ZodISODuration:()=>Dm,$ZodISODateTime:()=>Om,$ZodISODate:()=>Pm,$ZodIPv6:()=>Mm,$ZodIPv4:()=>Em,$ZodGUID:()=>vm,$ZodFunction:()=>Ip,$ZodFile:()=>hp,$ZodExactOptional:()=>pp,$ZodError:()=>Ma,$ZodEnum:()=>dp,$ZodEncodeError:()=>vo,$ZodEmoji:()=>xm,$ZodEmail:()=>_m,$ZodE164:()=>Um,$ZodDiscriminatedUnion:()=>sp,$ZodDefault:()=>vp,$ZodDate:()=>Qm,$ZodCustomStringFormat:()=>Bm,$ZodCustom:()=>Pp,$ZodCodec:()=>el,$ZodCheckUpperCase:()=>lm,$ZodCheckStringFormat:()=>Ln,$ZodCheckStartsWith:()=>cm,$ZodCheckSizeEquals:()=>im,$ZodCheckRegex:()=>sm,$ZodCheckProperty:()=>fm,$ZodCheckOverwrite:()=>mm,$ZodCheckNumberFormat:()=>Yh,$ZodCheckMultipleOf:()=>Gh,$ZodCheckMinSize:()=>tm,$ZodCheckMinLength:()=>rm,$ZodCheckMimeType:()=>hm,$ZodCheckMaxSize:()=>em,$ZodCheckMaxLength:()=>nm,$ZodCheckLowerCase:()=>am,$ZodCheckLessThan:()=>Ha,$ZodCheckLengthEquals:()=>om,$ZodCheckIncludes:()=>um,$ZodCheckGreaterThan:()=>Ja,$ZodCheckEndsWith:()=>dm,$ZodCheckBigIntFormat:()=>Qh,$ZodCheck:()=>ge,$ZodCatch:()=>xp,$ZodCUID2:()=>wm,$ZodCUID:()=>km,$ZodCIDRv6:()=>Cm,$ZodCIDRv4:()=>Am,$ZodBoolean:()=>Xa,$ZodBigIntFormat:()=>Wm,$ZodBigInt:()=>Ga,$ZodBase64URL:()=>Zm,$ZodBase64:()=>Rm,$ZodAsyncError:()=>ii,$ZodArray:()=>ep,$ZodAny:()=>Km});var th=Object.freeze({status:"aborted"});function _(e,t,i){function r(a,l){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:l,constr:s,traits:new Set},enumerable:!1}),a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,l);let u=s.prototype,c=Object.keys(u);for(let d=0;d<c.length;d++){let f=c[d];f in a||(a[f]=u[f].bind(a))}}let n=(i==null?void 0:i.Parent)??Object;class o extends n{}Object.defineProperty(o,"name",{value:e});function s(a){var l;let u=i!=null&&i.Parent?new o:this;r(u,a),(l=u._zod).deferred??(l.deferred=[]);for(let c of u._zod.deferred)c();return u}return Object.defineProperty(s,"init",{value:r}),Object.defineProperty(s,Symbol.hasInstance,{value:a=>{var l,u;return i!=null&&i.Parent&&a instanceof i.Parent?!0:(u=(l=a==null?void 0:a._zod)==null?void 0:l.traits)==null?void 0:u.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}var ih=Symbol("zod_brand");class ii extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class vo extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}var Vr={};function Re(e){return e&&Object.assign(Vr,e),Vr}var W={};wt(W,{unwrapMessage:()=>Xi,uint8ArrayToHex:()=>KS,uint8ArrayToBase64url:()=>JS,uint8ArrayToBase64:()=>fh,stringifyPrimitive:()=>R,slugify:()=>rh,shallowClone:()=>sh,safeExtend:()=>LS,required:()=>VS,randomString:()=>NS,propertyKeyTypes:()=>Hr,promiseAllObject:()=>MS,primitiveTypes:()=>ah,prefixIssues:()=>at,pick:()=>jS,partial:()=>BS,parsedType:()=>j,optionalKeys:()=>lh,omit:()=>ZS,objectClone:()=>TS,numKeys:()=>AS,nullish:()=>di,normalizeParams:()=>T,mergeDefs:()=>St,merge:()=>FS,jsonStringifyReplacer:()=>Wr,joinValues:()=>P,issue:()=>Jr,isPlainObject:()=>oi,isObject:()=>zi,hexToUint8Array:()=>qS,getSizableOrigin:()=>_o,getParsedType:()=>CS,getLengthableOrigin:()=>yo,getEnumValues:()=>Da,getElementAtPath:()=>ES,floatSafeRemainder:()=>nh,finalizeIssue:()=>tt,extend:()=>US,escapeRegex:()=>kt,esc:()=>Cs,defineLazy:()=>V,createTransparentProxy:()=>RS,cloneDef:()=>DS,clone:()=>ot,cleanRegex:()=>bo,cleanEnum:()=>WS,captureStackTrace:()=>Ea,cached:()=>Nn,base64urlToUint8Array:()=>HS,base64ToUint8Array:()=>dh,assignProp:()=>Ft,assertNotEqual:()=>IS,assertNever:()=>OS,assertIs:()=>zS,assertEqual:()=>SS,assert:()=>PS,allowsEval:()=>oh,aborted:()=>ei,NUMBER_FORMAT_RANGES:()=>uh,Class:()=>XS,BIGINT_FORMAT_RANGES:()=>ch});function SS(e){return e}function IS(e){return e}function zS(e){}function OS(e){throw Error("Unexpected value in exhaustive check")}function PS(e){}function Da(e){let t=Object.values(e).filter(i=>typeof i=="number");return Object.entries(e).filter(([i,r])=>t.indexOf(+i)===-1).map(([i,r])=>r)}function P(e,t="|"){return e.map(i=>R(i)).join(t)}function Wr(e,t){return typeof t=="bigint"?t.toString():t}function Nn(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function di(e){return e==null}function bo(e){let t=e.startsWith("^")?1:0,i=e.endsWith("$")?e.length-1:e.length;return e.slice(t,i)}function nh(e,t){let i=(e.toString().split(".")[1]||"").length,r=t.toString(),n=(r.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(r)){let l=r.match(/\d?e-(\d?)/);l!=null&&l[1]&&(n=Number.parseInt(l[1]))}let o=i>n?i:n,s=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return s%a/10**o}var hc=Symbol("evaluating");function V(e,t,i){let r;Object.defineProperty(e,t,{get(){if(r!==hc)return r===void 0&&(r=hc,r=i()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function TS(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function Ft(e,t,i){Object.defineProperty(e,t,{value:i,writable:!0,enumerable:!0,configurable:!0})}function St(...e){let t={};for(let i of e){let r=Object.getOwnPropertyDescriptors(i);Object.assign(t,r)}return Object.defineProperties({},t)}function DS(e){return St(e._zod.def)}function ES(e,t){return t?t.reduce((i,r)=>i==null?void 0:i[r],e):e}function MS(e){let t=Object.keys(e),i=t.map(r=>e[r]);return Promise.all(i).then(r=>{let n={};for(let o=0;o<t.length;o++)n[t[o]]=r[o];return n})}function NS(e=10){let t="";for(let i=0;i<e;i++)t+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return t}function Cs(e){return JSON.stringify(e)}function rh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Ea="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function zi(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var oh=Nn(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{return new Function(""),!0}catch{return!1}});function oi(e){if(zi(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let i=t.prototype;return!(zi(i)===!1||Object.prototype.hasOwnProperty.call(i,"isPrototypeOf")===!1)}function sh(e){return oi(e)?{...e}:Array.isArray(e)?[...e]:e}function AS(e){let t=0;for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&t++;return t}var CS=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw Error(`Unknown data type: ${t}`)}},Hr=new Set(["string","number","symbol"]),ah=new Set(["string","number","bigint","boolean","symbol","undefined"]);function kt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ot(e,t,i){let r=new e._zod.constr(t??e._zod.def);return(!t||i!=null&&i.parent)&&(r._zod.parent=e),r}function T(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function RS(e){let t;return new Proxy({},{get(i,r,n){return t??(t=e()),Reflect.get(t,r,n)},set(i,r,n,o){return t??(t=e()),Reflect.set(t,r,n,o)},has(i,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(i,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(i){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(i,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(i,r,n){return t??(t=e()),Reflect.defineProperty(t,r,n)}})}function R(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function lh(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var uh={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ch={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function jS(e,t){let i=e._zod.def,r=i.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let n=St(e._zod.def,{get shape(){let o={};for(let s in t){if(!(s in i.shape))throw Error(`Unrecognized key: "${s}"`);t[s]&&(o[s]=i.shape[s])}return Ft(this,"shape",o),o},checks:[]});return ot(e,n)}function ZS(e,t){let i=e._zod.def,r=i.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let n=St(e._zod.def,{get shape(){let o={...e._zod.def.shape};for(let s in t){if(!(s in i.shape))throw Error(`Unrecognized key: "${s}"`);t[s]&&delete o[s]}return Ft(this,"shape",o),o},checks:[]});return ot(e,n)}function US(e,t){if(!oi(t))throw Error("Invalid input to extend: expected a plain object");let i=e._zod.def.checks;if(i&&i.length>0){let n=e._zod.def.shape;for(let o in t)if(Object.getOwnPropertyDescriptor(n,o)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let r=St(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return Ft(this,"shape",n),n}});return ot(e,r)}function LS(e,t){if(!oi(t))throw Error("Invalid input to safeExtend: expected a plain object");let i=St(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return Ft(this,"shape",r),r}});return ot(e,i)}function FS(e,t){let i=St(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return Ft(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return ot(e,i)}function BS(e,t,i){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let n=St(t._zod.def,{get shape(){let o=t._zod.def.shape,s={...o};if(i)for(let a in i){if(!(a in o))throw Error(`Unrecognized key: "${a}"`);i[a]&&(s[a]=e?new e({type:"optional",innerType:o[a]}):o[a])}else for(let a in o)s[a]=e?new e({type:"optional",innerType:o[a]}):o[a];return Ft(this,"shape",s),s},checks:[]});return ot(t,n)}function VS(e,t,i){let r=St(t._zod.def,{get shape(){let n=t._zod.def.shape,o={...n};if(i)for(let s in i){if(!(s in o))throw Error(`Unrecognized key: "${s}"`);i[s]&&(o[s]=new e({type:"nonoptional",innerType:n[s]}))}else for(let s in n)o[s]=new e({type:"nonoptional",innerType:n[s]});return Ft(this,"shape",o),o}});return ot(t,r)}function ei(e,t=0){var i;if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(((i=e.issues[r])==null?void 0:i.continue)!==!0)return!0;return!1}function at(e,t){return t.map(i=>{var r;return(r=i).path??(r.path=[]),i.path.unshift(e),i})}function Xi(e){return typeof e=="string"?e:e==null?void 0:e.message}function tt(e,t,i){var n,o,s,a,l,u;let r={...e,path:e.path??[]};if(!e.message){let c=Xi((s=(o=(n=e.inst)==null?void 0:n._zod.def)==null?void 0:o.error)==null?void 0:s.call(o,e))??Xi((a=t==null?void 0:t.error)==null?void 0:a.call(t,e))??Xi((l=i.customError)==null?void 0:l.call(i,e))??Xi((u=i.localeError)==null?void 0:u.call(i,e))??"Invalid input";r.message=c}return delete r.inst,delete r.continue,!(t!=null&&t.reportInput)&&delete r.input,r}function _o(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function yo(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function j(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let i=e;if(i&&Object.getPrototypeOf(i)!==Object.prototype&&"constructor"in i&&i.constructor)return i.constructor.name}}return t}function Jr(...e){let[t,i,r]=e;return typeof t=="string"?{message:t,code:"custom",input:i,inst:r}:{...t}}function WS(e){return Object.entries(e).filter(([t,i])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function dh(e){let t=atob(e),i=new Uint8Array(t.length);for(let r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return i}function fh(e){let t="";for(let i=0;i<e.length;i++)t+=String.fromCharCode(e[i]);return btoa(t)}function HS(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),i="=".repeat((4-t.length%4)%4);return dh(t+i)}function JS(e){return fh(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function qS(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw Error("Invalid hex string length");let i=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)i[r/2]=Number.parseInt(t.slice(r,r+2),16);return i}function KS(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class XS{constructor(...t){}}var hh=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Wr,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Ma=_("$ZodError",hh),Xe=_("$ZodError",hh,{Parent:Error});function Na(e,t=i=>i.message){let i={},r=[];for(let n of e.issues)n.path.length>0?(i[n.path[0]]=i[n.path[0]]||[],i[n.path[0]].push(t(n))):r.push(t(n));return{formErrors:r,fieldErrors:i}}function Aa(e,t=i=>i.message){let i={_errors:[]},r=n=>{for(let o of n.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(s=>r({issues:s}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)i._errors.push(t(o));else{let s=i,a=0;for(;a<o.path.length;){let l=o.path[a];a!==o.path.length-1?s[l]=s[l]||{_errors:[]}:(s[l]=s[l]||{_errors:[]},s[l]._errors.push(t(o))),s=s[l],a++}}};return r(e),i}function mh(e,t=i=>i.message){let i={errors:[]},r=(n,o=[])=>{var s,a;for(let l of n.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(u=>r({issues:u},l.path));else if(l.code==="invalid_key")r({issues:l.issues},l.path);else if(l.code==="invalid_element")r({issues:l.issues},l.path);else{let u=[...o,...l.path];if(u.length===0){i.errors.push(t(l));continue}let c=i,d=0;for(;d<u.length;){let f=u[d],h=d===u.length-1;typeof f=="string"?(c.properties??(c.properties={}),(s=c.properties)[f]??(s[f]={errors:[]}),c=c.properties[f]):(c.items??(c.items=[]),(a=c.items)[f]??(a[f]={errors:[]}),c=c.items[f]),h&&c.errors.push(t(l)),d++}}};return r(e),i}function ph(e){let t=[],i=e.map(r=>typeof r=="object"?r.key:r);for(let r of i)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function gh(e){var r;let t=[],i=[...e.issues].sort((n,o)=>(n.path??[]).length-(o.path??[]).length);for(let n of i)t.push(`✖ ${n.message}`),(r=n.path)!=null&&r.length&&t.push(` → at ${ph(n.path)}`);return t.join(`
47
+ `)}var An=e=>(t,i,r,n)=>{let o=r?Object.assign(r,{async:!1}):{async:!1},s=t._zod.run({value:i,issues:[]},o);if(s instanceof Promise)throw new ii;if(s.issues.length){let a=new((n==null?void 0:n.Err)??e)(s.issues.map(l=>tt(l,o,Re())));throw Ea(a,n==null?void 0:n.callee),a}return s.value},Rs=An(Xe),Cn=e=>async(t,i,r,n)=>{let o=r?Object.assign(r,{async:!0}):{async:!0},s=t._zod.run({value:i,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let a=new((n==null?void 0:n.Err)??e)(s.issues.map(l=>tt(l,o,Re())));throw Ea(a,n==null?void 0:n.callee),a}return s.value},js=Cn(Xe),Rn=e=>(t,i,r)=>{let n=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:i,issues:[]},n);if(o instanceof Promise)throw new ii;return o.issues.length?{success:!1,error:new(e??Ma)(o.issues.map(s=>tt(s,n,Re())))}:{success:!0,data:o.value}},vh=Rn(Xe),jn=e=>async(t,i,r)=>{let n=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:i,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(s=>tt(s,n,Re())))}:{success:!0,data:o.value}},bh=jn(Xe),Ca=e=>(t,i,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return An(e)(t,i,n)},GS=Ca(Xe),Ra=e=>(t,i,r)=>An(e)(t,i,r),YS=Ra(Xe),ja=e=>async(t,i,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Cn(e)(t,i,n)},QS=ja(Xe),Za=e=>async(t,i,r)=>Cn(e)(t,i,r),eI=Za(Xe),Ua=e=>(t,i,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Rn(e)(t,i,n)},tI=Ua(Xe),La=e=>(t,i,r)=>Rn(e)(t,i,r),iI=La(Xe),Fa=e=>async(t,i,r)=>{let n=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return jn(e)(t,i,n)},nI=Fa(Xe),Ba=e=>async(t,i,r)=>jn(e)(t,i,r),rI=Ba(Xe),fi={};wt(fi,{xid:()=>$h,uuid7:()=>lI,uuid6:()=>aI,uuid4:()=>sI,uuid:()=>Oi,uppercase:()=>Kh,unicodeEmail:()=>Oh,undefined:()=>Jh,ulid:()=>xh,time:()=>Uh,string:()=>Fh,sha512_hex:()=>PI,sha512_base64url:()=>DI,sha512_base64:()=>TI,sha384_hex:()=>II,sha384_base64url:()=>OI,sha384_base64:()=>zI,sha256_hex:()=>kI,sha256_base64url:()=>SI,sha256_base64:()=>wI,sha1_hex:()=>yI,sha1_base64url:()=>$I,sha1_base64:()=>xI,rfc5322Email:()=>cI,number:()=>Wa,null:()=>Hh,nanoid:()=>wh,md5_hex:()=>vI,md5_base64url:()=>_I,md5_base64:()=>bI,mac:()=>Eh,lowercase:()=>qh,ksuid:()=>kh,ipv6:()=>Dh,ipv4:()=>Th,integer:()=>Vh,idnEmail:()=>dI,html5Email:()=>uI,hostname:()=>mI,hex:()=>gI,guid:()=>Ih,extendedDuration:()=>oI,emoji:()=>Ph,email:()=>zh,e164:()=>Ch,duration:()=>Sh,domain:()=>pI,datetime:()=>Lh,date:()=>jh,cuid2:()=>yh,cuid:()=>_h,cidrv6:()=>Nh,cidrv4:()=>Mh,browserEmail:()=>fI,boolean:()=>Wh,bigint:()=>Bh,base64url:()=>Va,base64:()=>Ah});var _h=/^[cC][^\s-]{8,}$/,yh=/^[0-9a-z]+$/,xh=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,$h=/^[0-9a-vA-V]{20}$/,kh=/^[A-Za-z0-9]{27}$/,wh=/^[a-zA-Z0-9_-]{21}$/,Sh=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,oI=/^[-+]?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)?)??$/,Ih=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Oi=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,sI=Oi(4),aI=Oi(6),lI=Oi(7),zh=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,uI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,cI=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Oh=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,dI=Oh,fI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,hI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Ph(){return new RegExp(hI,"u")}var Th=/^(?:(?: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])$/,Dh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Eh=e=>{let t=kt(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Mh=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Nh=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ah=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Va=/^[A-Za-z0-9_-]*$/,mI=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,pI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ch=/^\+[1-9]\d{6,14}$/,Rh="(?:(?:\\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])))",jh=new RegExp(`^${Rh}$`);function Zh(e){return typeof e.precision=="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Uh(e){return new RegExp(`^${Zh(e)}$`)}function Lh(e){let t=Zh({precision:e.precision}),i=["Z"];e.local&&i.push(""),e.offset&&i.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${i.join("|")})`;return new RegExp(`^${Rh}T(?:${r})$`)}var Fh=e=>{let t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Bh=/^-?\d+n?$/,Vh=/^-?\d+$/,Wa=/^-?\d+(?:\.\d+)?$/,Wh=/^(?:true|false)$/i,Hh=/^null$/i,Jh=/^undefined$/i,qh=/^[^A-Z]*$/,Kh=/^[^a-z]*$/,gI=/^[0-9a-fA-F]*$/;function Zn(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Un(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var vI=/^[0-9a-fA-F]{32}$/,bI=Zn(22,"=="),_I=Un(22),yI=/^[0-9a-fA-F]{40}$/,xI=Zn(27,"="),$I=Un(27),kI=/^[0-9a-fA-F]{64}$/,wI=Zn(43,"="),SI=Un(43),II=/^[0-9a-fA-F]{96}$/,zI=Zn(64,""),OI=Un(64),PI=/^[0-9a-fA-F]{128}$/,TI=Zn(86,"=="),DI=Un(86),ge=_("$ZodCheck",(e,t)=>{var i;e._zod??(e._zod={}),e._zod.def=t,(i=e._zod).onattach??(i.onattach=[])}),Xh={number:"number",bigint:"bigint",object:"date"},Ha=_("$ZodCheckLessThan",(e,t)=>{ge.init(e,t);let i=Xh[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,o=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:i,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ja=_("$ZodCheckGreaterThan",(e,t)=>{ge.init(e,t);let i=Xh[typeof t.value];e._zod.onattach.push(r=>{let n=r._zod.bag,o=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:i,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Gh=_("$ZodCheckMultipleOf",(e,t)=>{ge.init(e,t),e._zod.onattach.push(i=>{var r;(r=i._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=i=>{if(typeof i.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");(typeof i.value=="bigint"?i.value%t.value===BigInt(0):nh(i.value,t.value)===0)||i.issues.push({origin:typeof i.value,code:"not_multiple_of",divisor:t.value,input:i.value,inst:e,continue:!t.abort})}}),Yh=_("$ZodCheckNumberFormat",(e,t)=>{var s;ge.init(e,t),t.format=t.format||"float64";let i=(s=t.format)==null?void 0:s.includes("int"),r=i?"int":"number",[n,o]=uh[t.format];e._zod.onattach.push(a=>{let l=a._zod.bag;l.format=t.format,l.minimum=n,l.maximum=o,i&&(l.pattern=Vh)}),e._zod.check=a=>{let l=a.value;if(i){if(!Number.isInteger(l)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?a.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}l<n&&a.issues.push({origin:"number",input:l,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),l>o&&a.issues.push({origin:"number",input:l,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Qh=_("$ZodCheckBigIntFormat",(e,t)=>{ge.init(e,t);let[i,r]=ch[t.format];e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,o.minimum=i,o.maximum=r}),e._zod.check=n=>{let o=n.value;o<i&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),o>r&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),em=_("$ZodCheckMaxSize",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!di(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:_o(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),tm=_("$ZodCheckMinSize",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!di(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:_o(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),im=_("$ZodCheckSizeEquals",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!di(n)&&n.size!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=r=>{let n=r.value,o=n.size;if(o===t.size)return;let s=o>t.size;r.issues.push({origin:_o(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),nm=_("$ZodCheckMaxLength",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!di(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let o=yo(n);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),rm=_("$ZodCheckMinLength",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!di(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let o=yo(n);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),om=_("$ZodCheckLengthEquals",(e,t)=>{var i;ge.init(e,t),(i=e._zod.def).when??(i.when=r=>{let n=r.value;return!di(n)&&n.length!==void 0}),e._zod.onattach.push(r=>{let n=r._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=r=>{let n=r.value,o=n.length;if(o===t.length)return;let s=yo(n),a=o>t.length;r.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ln=_("$ZodCheckStringFormat",(e,t)=>{var i,r;ge.init(e,t),e._zod.onattach.push(n=>{let o=n._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(i=e._zod).check??(i.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),sm=_("$ZodCheckRegex",(e,t)=>{Ln.init(e,t),e._zod.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:"regex",input:i.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),am=_("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=qh),Ln.init(e,t)}),lm=_("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Kh),Ln.init(e,t)}),um=_("$ZodCheckIncludes",(e,t)=>{ge.init(e,t);let i=kt(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${i}`:i);t.pattern=r,e._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),cm=_("$ZodCheckStartsWith",(e,t)=>{ge.init(e,t);let i=new RegExp(`^${kt(t.prefix)}.*`);t.pattern??(t.pattern=i),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),dm=_("$ZodCheckEndsWith",(e,t)=>{ge.init(e,t);let i=new RegExp(`.*${kt(t.suffix)}$`);t.pattern??(t.pattern=i),e._zod.onattach.push(r=>{let n=r._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(i)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function mc(e,t,i){e.issues.length&&t.issues.push(...at(i,e.issues))}var fm=_("$ZodCheckProperty",(e,t)=>{ge.init(e,t),e._zod.check=i=>{let r=t.schema._zod.run({value:i.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(n=>mc(n,i,t.property));mc(r,i,t.property)}}),hm=_("$ZodCheckMimeType",(e,t)=>{ge.init(e,t);let i=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{i.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),mm=_("$ZodCheckOverwrite",(e,t)=>{ge.init(e,t),e._zod.check=i=>{i.value=t.tx(i.value)}});class pm{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let i=t.split(`
48
+ `).filter(o=>o),r=Math.min(...i.map(o=>o.length-o.trimStart().length)),n=i.map(o=>o.slice(r)).map(o=>" ".repeat(this.indent*2)+o);for(let o of n)this.content.push(o)}compile(){let t=Function,i=this==null?void 0:this.args,r=[...((this==null?void 0:this.content)??[""]).map(n=>` ${n}`)];return new t(...i,r.join(`
49
+ `))}}var gm={major:4,minor:3,patch:5},U=_("$ZodType",(e,t)=>{var n;var i;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gm;let r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(let o of r)for(let s of o._zod.onattach)s(e);if(r.length===0)(i=e._zod).deferred??(i.deferred=[]),(n=e._zod.deferred)==null||n.push(()=>{e._zod.run=e._zod.parse});else{let o=(a,l,u)=>{let c=ei(a),d;for(let f of l){if(f._zod.def.when){if(!f._zod.def.when(a))continue}else if(c)continue;let h=a.issues.length,m=f._zod.check(a);if(m instanceof Promise&&(u==null?void 0:u.async)===!1)throw new ii;if(d||m instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await m,a.issues.length!==h&&(c||(c=ei(a,h)))});else{if(a.issues.length===h)continue;c||(c=ei(a,h))}}return d?d.then(()=>a):a},s=(a,l,u)=>{if(ei(a))return a.aborted=!0,a;let c=o(l,r,u);if(c instanceof Promise){if(u.async===!1)throw new ii;return c.then(d=>e._zod.parse(d,u))}return e._zod.parse(c,u)};e._zod.run=(a,l)=>{if(l.skipChecks)return e._zod.parse(a,l);if(l.direction==="backward"){let c=e._zod.parse({value:a.value,issues:[]},{...l,skipChecks:!0});return c instanceof Promise?c.then(d=>s(d,a,l)):s(c,a,l)}let u=e._zod.parse(a,l);if(u instanceof Promise){if(l.async===!1)throw new ii;return u.then(c=>o(c,r,l))}return o(u,r,l)}}V(e,"~standard",()=>({validate:o=>{var s;try{let a=vh(e,o);return a.success?{value:a.data}:{issues:(s=a.error)==null?void 0:s.issues}}catch{return bh(e,o).then(l=>{var u;return l.success?{value:l.data}:{issues:(u=l.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),Fn=_("$ZodString",(e,t)=>{var i;U.init(e,t),e._zod.pattern=[...((i=e==null?void 0:e._zod.bag)==null?void 0:i.patterns)??[]].pop()??Fh(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),oe=_("$ZodStringFormat",(e,t)=>{Ln.init(e,t),Fn.init(e,t)}),vm=_("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ih),oe.init(e,t)}),bm=_("$ZodUUID",(e,t)=>{if(t.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(i===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Oi(i))}else t.pattern??(t.pattern=Oi());oe.init(e,t)}),_m=_("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=zh),oe.init(e,t)}),ym=_("$ZodURL",(e,t)=>{oe.init(e,t),e._zod.check=i=>{try{let r=i.value.trim(),n=new URL(r);t.hostname&&(t.hostname.lastIndex=0,!t.hostname.test(n.hostname)&&i.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:i.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,!t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)&&i.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:i.value,inst:e,continue:!t.abort})),t.normalize?i.value=n.href:i.value=r;return}catch{i.issues.push({code:"invalid_format",format:"url",input:i.value,inst:e,continue:!t.abort})}}}),xm=_("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Ph()),oe.init(e,t)}),$m=_("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=wh),oe.init(e,t)}),km=_("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=_h),oe.init(e,t)}),wm=_("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=yh),oe.init(e,t)}),Sm=_("$ZodULID",(e,t)=>{t.pattern??(t.pattern=xh),oe.init(e,t)}),Im=_("$ZodXID",(e,t)=>{t.pattern??(t.pattern=$h),oe.init(e,t)}),zm=_("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=kh),oe.init(e,t)}),Om=_("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Lh(t)),oe.init(e,t)}),Pm=_("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=jh),oe.init(e,t)}),Tm=_("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Uh(t)),oe.init(e,t)}),Dm=_("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Sh),oe.init(e,t)}),Em=_("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Th),oe.init(e,t),e._zod.bag.format="ipv4"}),Mm=_("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Dh),oe.init(e,t),e._zod.bag.format="ipv6",e._zod.check=i=>{try{new URL(`http://[${i.value}]`)}catch{i.issues.push({code:"invalid_format",format:"ipv6",input:i.value,inst:e,continue:!t.abort})}}}),Nm=_("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Eh(t.delimiter)),oe.init(e,t),e._zod.bag.format="mac"}),Am=_("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Mh),oe.init(e,t)}),Cm=_("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Nh),oe.init(e,t),e._zod.check=i=>{let r=i.value.split("/");try{if(r.length!==2)throw Error();let[n,o]=r;if(!o)throw Error();let s=Number(o);if(`${s}`!==o||s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{i.issues.push({code:"invalid_format",format:"cidrv6",input:i.value,inst:e,continue:!t.abort})}}});function qa(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var Rm=_("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Ah),oe.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=i=>{qa(i.value)||i.issues.push({code:"invalid_format",format:"base64",input:i.value,inst:e,continue:!t.abort})}});function jm(e){if(!Va.test(e))return!1;let t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),i=t.padEnd(Math.ceil(t.length/4)*4,"=");return qa(i)}var Zm=_("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Va),oe.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=i=>{jm(i.value)||i.issues.push({code:"invalid_format",format:"base64url",input:i.value,inst:e,continue:!t.abort})}}),Um=_("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ch),oe.init(e,t)});function Lm(e,t=null){try{let i=e.split(".");if(i.length!==3)return!1;let[r]=i;if(!r)return!1;let n=JSON.parse(atob(r));return!("typ"in n&&(n==null?void 0:n.typ)!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}var Fm=_("$ZodJWT",(e,t)=>{oe.init(e,t),e._zod.check=i=>{Lm(i.value,t.alg)||i.issues.push({code:"invalid_format",format:"jwt",input:i.value,inst:e,continue:!t.abort})}}),Bm=_("$ZodCustomStringFormat",(e,t)=>{oe.init(e,t),e._zod.check=i=>{t.fn(i.value)||i.issues.push({code:"invalid_format",format:t.format,input:i.value,inst:e,continue:!t.abort})}}),Ka=_("$ZodNumber",(e,t)=>{U.init(e,t),e._zod.pattern=e._zod.bag.pattern??Wa,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=Number(i.value)}catch{}let n=i.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return i;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return i.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...o?{received:o}:{}}),i}}),Vm=_("$ZodNumberFormat",(e,t)=>{Yh.init(e,t),Ka.init(e,t)}),Xa=_("$ZodBoolean",(e,t)=>{U.init(e,t),e._zod.pattern=Wh,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=!!i.value}catch{}let n=i.value;return typeof n=="boolean"||i.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),i}}),Ga=_("$ZodBigInt",(e,t)=>{U.init(e,t),e._zod.pattern=Bh,e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=BigInt(i.value)}catch{}return typeof i.value=="bigint"||i.issues.push({expected:"bigint",code:"invalid_type",input:i.value,inst:e}),i}}),Wm=_("$ZodBigIntFormat",(e,t)=>{Qh.init(e,t),Ga.init(e,t)}),Hm=_("$ZodSymbol",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;return typeof n=="symbol"||i.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),i}}),Jm=_("$ZodUndefined",(e,t)=>{U.init(e,t),e._zod.pattern=Jh,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(i,r)=>{let n=i.value;return typeof n>"u"||i.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),i}}),qm=_("$ZodNull",(e,t)=>{U.init(e,t),e._zod.pattern=Hh,e._zod.values=new Set([null]),e._zod.parse=(i,r)=>{let n=i.value;return n===null||i.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),i}}),Km=_("$ZodAny",(e,t)=>{U.init(e,t),e._zod.parse=i=>i}),Xm=_("$ZodUnknown",(e,t)=>{U.init(e,t),e._zod.parse=i=>i}),Gm=_("$ZodNever",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>(i.issues.push({expected:"never",code:"invalid_type",input:i.value,inst:e}),i)}),Ym=_("$ZodVoid",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;return typeof n>"u"||i.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),i}}),Qm=_("$ZodDate",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>{if(t.coerce)try{i.value=new Date(i.value)}catch{}let n=i.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||i.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:e}),i}});function pc(e,t,i){e.issues.length&&t.issues.push(...at(i,e.issues)),t.value[i]=e.value}var ep=_("$ZodArray",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;if(!Array.isArray(n))return i.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),i;i.value=Array(n.length);let o=[];for(let s=0;s<n.length;s++){let a=n[s],l=t.element._zod.run({value:a,issues:[]},r);l instanceof Promise?o.push(l.then(u=>pc(u,i,s))):pc(l,i,s)}return o.length?Promise.all(o).then(()=>i):i}});function qr(e,t,i,r,n){if(e.issues.length){if(n&&!(i in r))return;t.issues.push(...at(i,e.issues))}e.value===void 0?i in r&&(t.value[i]=void 0):t.value[i]=e.value}function tp(e){var r,n,o,s;let t=Object.keys(e.shape);for(let a of t)if(!((s=(o=(n=(r=e.shape)==null?void 0:r[a])==null?void 0:n._zod)==null?void 0:o.traits)!=null&&s.has("$ZodType")))throw Error(`Invalid element at key "${a}": expected a Zod schema`);let i=lh(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(i)}}function ip(e,t,i,r,n,o){let s=[],a=n.keySet,l=n.catchall._zod,u=l.def.type,c=l.optout==="optional";for(let d in t){if(a.has(d))continue;if(u==="never"){s.push(d);continue}let f=l.run({value:t[d],issues:[]},r);f instanceof Promise?e.push(f.then(h=>qr(h,i,d,t,c))):qr(f,i,d,t,c)}return s.length&&i.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>i):i}var np=_("$ZodObject",(e,t)=>{var s;if(U.init(e,t),!((s=Object.getOwnPropertyDescriptor(t,"shape"))!=null&&s.get)){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let l={...a};return Object.defineProperty(t,"shape",{value:l}),l}})}let i=Nn(()=>tp(t));V(e._zod,"propValues",()=>{let a=t.shape,l={};for(let u in a){let c=a[u]._zod;if(c.values){l[u]??(l[u]=new Set);for(let d of c.values)l[u].add(d)}}return l});let r=zi,n=t.catchall,o;e._zod.parse=(a,l)=>{o??(o=i.value);let u=a.value;if(!r(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let c=[],d=o.shape;for(let f of o.keys){let h=d[f],m=h._zod.optout==="optional",p=h._zod.run({value:u[f],issues:[]},l);p instanceof Promise?c.push(p.then(g=>qr(g,a,f,u,m))):qr(p,a,f,u,m)}return n?ip(c,u,a,l,i.value,e):c.length?Promise.all(c).then(()=>a):a}}),rp=_("$ZodObjectJIT",(e,t)=>{np.init(e,t);let i=e._zod.parse,r=Nn(()=>tp(t)),n=d=>{var y,S;let f=new pm(["shape","payload","ctx"]),h=r.value,m=w=>{let x=Cs(w);return`shape[${x}]._zod.run({ value: input[${x}], issues: [] }, ctx)`};f.write("const input = payload.value;");let p=Object.create(null),g=0;for(let w of h.keys)p[w]=`key_${g++}`;f.write("const newResult = {};");for(let w of h.keys){let x=p[w],I=Cs(w),z=((S=(y=d[w])==null?void 0:y._zod)==null?void 0:S.optout)==="optional";f.write(`const ${x} = ${m(w)};`),z?f.write(`
50
+ if (${x}.issues.length) {
51
+ if (${I} in input) {
52
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
53
+ ...iss,
54
+ path: iss.path ? [${I}, ...iss.path] : [${I}]
55
+ })));
56
+ }
57
+ }
58
+
59
+ if (${x}.value === undefined) {
60
+ if (${I} in input) {
61
+ newResult[${I}] = undefined;
62
+ }
63
+ } else {
64
+ newResult[${I}] = ${x}.value;
65
+ }
66
+
67
+ `):f.write(`
68
+ if (${x}.issues.length) {
69
+ payload.issues = payload.issues.concat(${x}.issues.map(iss => ({
70
+ ...iss,
71
+ path: iss.path ? [${I}, ...iss.path] : [${I}]
72
+ })));
73
+ }
74
+
75
+ if (${x}.value === undefined) {
76
+ if (${I} in input) {
77
+ newResult[${I}] = undefined;
78
+ }
79
+ } else {
80
+ newResult[${I}] = ${x}.value;
81
+ }
82
+
83
+ `)}f.write("payload.value = newResult;"),f.write("return payload;");let b=f.compile();return(w,x)=>b(d,w,x)},o,s=zi,a=!Vr.jitless,l=a&&oh.value,u=t.catchall,c;e._zod.parse=(d,f)=>{c??(c=r.value);let h=d.value;return s(h)?a&&l&&(f==null?void 0:f.async)===!1&&f.jitless!==!0?(o||(o=n(t.shape)),d=o(d,f),u?ip([],h,d,f,c,e):d):i(d,f):(d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d)}});function gc(e,t,i,r){for(let o of e)if(o.issues.length===0)return t.value=o.value,t;let n=e.filter(o=>!ei(o));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(o=>o.issues.map(s=>tt(s,r,Re())))}),t)}var xo=_("$ZodUnion",(e,t)=>{U.init(e,t),V(e._zod,"optin",()=>t.options.some(n=>n._zod.optin==="optional")?"optional":void 0),V(e._zod,"optout",()=>t.options.some(n=>n._zod.optout==="optional")?"optional":void 0),V(e._zod,"values",()=>{if(t.options.every(n=>n._zod.values))return new Set(t.options.flatMap(n=>Array.from(n._zod.values)))}),V(e._zod,"pattern",()=>{if(t.options.every(n=>n._zod.pattern)){let n=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>bo(o.source)).join("|")})$`)}});let i=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(i)return r(n,o);let s=!1,a=[];for(let l of t.options){let u=l._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)a.push(u),s=!0;else{if(u.issues.length===0)return u;a.push(u)}}return s?Promise.all(a).then(l=>gc(l,n,e,o)):gc(a,n,e,o)}});function vc(e,t,i,r){let n=e.filter(o=>o.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:e.map(o=>o.issues.map(s=>tt(s,r,Re())))}):t.issues.push({code:"invalid_union",input:t.value,inst:i,errors:[],inclusive:!1}),t)}var op=_("$ZodXor",(e,t)=>{xo.init(e,t),t.inclusive=!1;let i=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(n,o)=>{if(i)return r(n,o);let s=!1,a=[];for(let l of t.options){let u=l._zod.run({value:n.value,issues:[]},o);u instanceof Promise?(a.push(u),s=!0):a.push(u)}return s?Promise.all(a).then(l=>vc(l,n,e,o)):vc(a,n,e,o)}}),sp=_("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xo.init(e,t);let i=e._zod.parse;V(e._zod,"propValues",()=>{let n={};for(let o of t.options){let s=o._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(let[a,l]of Object.entries(s)){n[a]||(n[a]=new Set);for(let u of l)n[a].add(u)}}return n});let r=Nn(()=>{var s;let n=t.options,o=new Map;for(let a of n){let l=(s=a._zod.propValues)==null?void 0:s[t.discriminator];if(!l||l.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(let u of l){if(o.has(u))throw Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,a)}}return o});e._zod.parse=(n,o)=>{let s=n.value;if(!zi(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let a=r.value.get(s==null?void 0:s[t.discriminator]);return a?a._zod.run(n,o):t.unionFallback?i(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),n)}}),ap=_("$ZodIntersection",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>{let n=i.value,o=t.left._zod.run({value:n,issues:[]},r),s=t.right._zod.run({value:n,issues:[]},r);return o instanceof Promise||s instanceof Promise?Promise.all([o,s]).then(([a,l])=>bc(i,a,l)):bc(i,o,s)}});function Zs(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(oi(e)&&oi(t)){let i=Object.keys(t),r=Object.keys(e).filter(o=>i.indexOf(o)!==-1),n={...e,...t};for(let o of r){let s=Zs(e[o],t[o]);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};n[o]=s.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let i=[];for(let r=0;r<e.length;r++){let n=e[r],o=t[r],s=Zs(n,o);if(!s.valid)return{valid:!1,mergeErrorPath:[r,...s.mergeErrorPath]};i.push(s.data)}return{valid:!0,data:i}}return{valid:!1,mergeErrorPath:[]}}function bc(e,t,i){let r=new Map,n;for(let a of t.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let l of a.keys)r.has(l)||r.set(l,{}),r.get(l).l=!0}else e.issues.push(a);for(let a of i.issues)if(a.code==="unrecognized_keys")for(let l of a.keys)r.has(l)||r.set(l,{}),r.get(l).r=!0;else e.issues.push(a);let o=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(o.length&&n&&e.issues.push({...n,keys:o}),ei(e))return e;let s=Zs(t.value,i.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}var Ya=_("$ZodTuple",(e,t)=>{U.init(e,t);let i=t.items;e._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),r;r.value=[];let s=[],a=[...i].reverse().findIndex(c=>c._zod.optin!=="optional"),l=a===-1?0:i.length-a;if(!t.rest){let c=o.length>i.length,d=o.length<l-1;if(c||d)return r.issues.push({...c?{code:"too_big",maximum:i.length,inclusive:!0}:{code:"too_small",minimum:i.length},input:o,inst:e,origin:"array"}),r}let u=-1;for(let c of i){if(u++,u>=o.length&&u>=l)continue;let d=c._zod.run({value:o[u],issues:[]},n);d instanceof Promise?s.push(d.then(f=>cr(f,r,u))):cr(d,r,u)}if(t.rest){let c=o.slice(i.length);for(let d of c){u++;let f=t.rest._zod.run({value:d,issues:[]},n);f instanceof Promise?s.push(f.then(h=>cr(h,r,u))):cr(f,r,u)}}return s.length?Promise.all(s).then(()=>r):r}});function cr(e,t,i){e.issues.length&&t.issues.push(...at(i,e.issues)),t.value[i]=e.value}var lp=_("$ZodRecord",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;if(!oi(n))return i.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),i;let o=[],s=t.keyType._zod.values;if(s){i.value={};let a=new Set;for(let u of s)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);let c=t.valueType._zod.run({value:n[u],issues:[]},r);c instanceof Promise?o.push(c.then(d=>{d.issues.length&&i.issues.push(...at(u,d.issues)),i.value[u]=d.value})):(c.issues.length&&i.issues.push(...at(u,c.issues)),i.value[u]=c.value)}let l;for(let u in n)a.has(u)||(l=l??[],l.push(u));l&&l.length>0&&i.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:l})}else{i.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let l=t.keyType._zod.run({value:a,issues:[]},r);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&Wa.test(a)&&l.issues.length&&l.issues.some(c=>c.code==="invalid_type"&&c.expected==="number")){let c=t.keyType._zod.run({value:Number(a),issues:[]},r);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");c.issues.length===0&&(l=c)}if(l.issues.length){t.mode==="loose"?i.value[a]=n[a]:i.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map(c=>tt(c,r,Re())),input:a,path:[a],inst:e});continue}let u=t.valueType._zod.run({value:n[a],issues:[]},r);u instanceof Promise?o.push(u.then(c=>{c.issues.length&&i.issues.push(...at(a,c.issues)),i.value[l.value]=c.value})):(u.issues.length&&i.issues.push(...at(a,u.issues)),i.value[l.value]=u.value)}}return o.length?Promise.all(o).then(()=>i):i}}),up=_("$ZodMap",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;if(!(n instanceof Map))return i.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),i;let o=[];i.value=new Map;for(let[s,a]of n){let l=t.keyType._zod.run({value:s,issues:[]},r),u=t.valueType._zod.run({value:a,issues:[]},r);l instanceof Promise||u instanceof Promise?o.push(Promise.all([l,u]).then(([c,d])=>{_c(c,d,i,s,n,e,r)})):_c(l,u,i,s,n,e,r)}return o.length?Promise.all(o).then(()=>i):i}});function _c(e,t,i,r,n,o,s){e.issues.length&&(Hr.has(typeof r)?i.issues.push(...at(r,e.issues)):i.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:e.issues.map(a=>tt(a,s,Re()))})),t.issues.length&&(Hr.has(typeof r)?i.issues.push(...at(r,t.issues)):i.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:r,issues:t.issues.map(a=>tt(a,s,Re()))})),i.value.set(e.value,t.value)}var cp=_("$ZodSet",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;if(!(n instanceof Set))return i.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),i;let o=[];i.value=new Set;for(let s of n){let a=t.valueType._zod.run({value:s,issues:[]},r);a instanceof Promise?o.push(a.then(l=>yc(l,i))):yc(a,i)}return o.length?Promise.all(o).then(()=>i):i}});function yc(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}var dp=_("$ZodEnum",(e,t)=>{U.init(e,t);let i=Da(t.entries),r=new Set(i);e._zod.values=r,e._zod.pattern=new RegExp(`^(${i.filter(n=>Hr.has(typeof n)).map(n=>typeof n=="string"?kt(n):n.toString()).join("|")})$`),e._zod.parse=(n,o)=>{let s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:i,input:s,inst:e}),n}}),fp=_("$ZodLiteral",(e,t)=>{if(U.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let i=new Set(t.values);e._zod.values=i,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?kt(r):r?kt(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,n)=>{let o=r.value;return i.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),r}}),hp=_("$ZodFile",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>{let n=i.value;return n instanceof File||i.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),i}}),mp=_("$ZodTransform",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new vo(e.constructor.name);let n=t.transform(i.value,i);if(r.async)return(n instanceof Promise?n:Promise.resolve(n)).then(o=>(i.value=o,i));if(n instanceof Promise)throw new ii;return i.value=n,i}});function xc(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Qa=_("$ZodOptional",(e,t)=>{U.init(e,t),e._zod.optin="optional",e._zod.optout="optional",V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),V(e._zod,"pattern",()=>{let i=t.innerType._zod.pattern;return i?new RegExp(`^(${bo(i.source)})?$`):void 0}),e._zod.parse=(i,r)=>{if(t.innerType._zod.optin==="optional"){let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>xc(o,i.value)):xc(n,i.value)}return i.value===void 0?i:t.innerType._zod.run(i,r)}}),pp=_("$ZodExactOptional",(e,t)=>{Qa.init(e,t),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(i,r)=>t.innerType._zod.run(i,r)}),gp=_("$ZodNullable",(e,t)=>{U.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"pattern",()=>{let i=t.innerType._zod.pattern;return i?new RegExp(`^(${bo(i.source)}|null)$`):void 0}),V(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(i,r)=>i.value===null?i:t.innerType._zod.run(i,r)}),vp=_("$ZodDefault",(e,t)=>{U.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);if(i.value===void 0)return i.value=t.defaultValue,i;let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>$c(o,t)):$c(n,t)}});function $c(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var bp=_("$ZodPrefault",(e,t)=>{U.init(e,t),e._zod.optin="optional",V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>(r.direction==="backward"||i.value===void 0&&(i.value=t.defaultValue),t.innerType._zod.run(i,r))}),_p=_("$ZodNonOptional",(e,t)=>{U.init(e,t),V(e._zod,"values",()=>{let i=t.innerType._zod.values;return i?new Set([...i].filter(r=>r!==void 0)):void 0}),e._zod.parse=(i,r)=>{let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>kc(o,e)):kc(n,e)}});function kc(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}var yp=_("$ZodSuccess",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new vo("ZodSuccess");let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>(i.value=o.issues.length===0,i)):(i.value=n.issues.length===0,i)}}),xp=_("$ZodCatch",(e,t)=>{U.init(e,t),V(e._zod,"optin",()=>t.innerType._zod.optin),V(e._zod,"optout",()=>t.innerType._zod.optout),V(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(o=>(i.value=o.value,o.issues.length&&(i.value=t.catchValue({...i,error:{issues:o.issues.map(s=>tt(s,r,Re()))},input:i.value}),i.issues=[]),i)):(i.value=n.value,n.issues.length&&(i.value=t.catchValue({...i,error:{issues:n.issues.map(o=>tt(o,r,Re()))},input:i.value}),i.issues=[]),i)}}),$p=_("$ZodNaN",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>((typeof i.value!="number"||!Number.isNaN(i.value))&&i.issues.push({input:i.value,inst:e,expected:"nan",code:"invalid_type"}),i)}),kp=_("$ZodPipe",(e,t)=>{U.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,r)=>{if(r.direction==="backward"){let o=t.out._zod.run(i,r);return o instanceof Promise?o.then(s=>dr(s,t.in,r)):dr(o,t.in,r)}let n=t.in._zod.run(i,r);return n instanceof Promise?n.then(o=>dr(o,t.out,r)):dr(n,t.out,r)}});function dr(e,t,i){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},i)}var el=_("$ZodCodec",(e,t)=>{U.init(e,t),V(e._zod,"values",()=>t.in._zod.values),V(e._zod,"optin",()=>t.in._zod.optin),V(e._zod,"optout",()=>t.out._zod.optout),V(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(i,r)=>{if((r.direction||"forward")==="forward"){let n=t.in._zod.run(i,r);return n instanceof Promise?n.then(o=>fr(o,t,r)):fr(n,t,r)}else{let n=t.out._zod.run(i,r);return n instanceof Promise?n.then(o=>fr(o,t,r)):fr(n,t,r)}}});function fr(e,t,i){if(e.issues.length)return e.aborted=!0,e;if((i.direction||"forward")==="forward"){let r=t.transform(e.value,e);return r instanceof Promise?r.then(n=>hr(e,n,t.out,i)):hr(e,r,t.out,i)}else{let r=t.reverseTransform(e.value,e);return r instanceof Promise?r.then(n=>hr(e,n,t.in,i)):hr(e,r,t.in,i)}}function hr(e,t,i,r){return e.issues.length?(e.aborted=!0,e):i._zod.run({value:t,issues:e.issues},r)}var wp=_("$ZodReadonly",(e,t)=>{U.init(e,t),V(e._zod,"propValues",()=>t.innerType._zod.propValues),V(e._zod,"values",()=>t.innerType._zod.values),V(e._zod,"optin",()=>{var i,r;return(r=(i=t.innerType)==null?void 0:i._zod)==null?void 0:r.optin}),V(e._zod,"optout",()=>{var i,r;return(r=(i=t.innerType)==null?void 0:i._zod)==null?void 0:r.optout}),e._zod.parse=(i,r)=>{if(r.direction==="backward")return t.innerType._zod.run(i,r);let n=t.innerType._zod.run(i,r);return n instanceof Promise?n.then(wc):wc(n)}});function wc(e){return e.value=Object.freeze(e.value),e}var Sp=_("$ZodTemplateLiteral",(e,t)=>{U.init(e,t);let i=[];for(let r of t.parts)if(typeof r=="object"&&r!==null){if(!r._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...r._zod.traits].shift()}`);let n=r._zod.pattern instanceof RegExp?r._zod.pattern.source:r._zod.pattern;if(!n)throw Error(`Invalid template literal part: ${r._zod.traits}`);let o=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;i.push(n.slice(o,s))}else if(r===null||ah.has(typeof r))i.push(kt(`${r}`));else throw Error(`Invalid template literal part: ${r}`);e._zod.pattern=new RegExp(`^${i.join("")}$`),e._zod.parse=(r,n)=>typeof r.value!="string"?(r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}),r):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),r)}),Ip=_("$ZodFunction",(e,t)=>(U.init(e,t),e._def=t,e._zod.def=t,e.implement=i=>{if(typeof i!="function")throw Error("implement() must be called with a function");return function(...r){let n=e._def.input?Rs(e._def.input,r):r,o=Reflect.apply(i,this,n);return e._def.output?Rs(e._def.output,o):o}},e.implementAsync=i=>{if(typeof i!="function")throw Error("implementAsync() must be called with a function");return async function(...r){let n=e._def.input?await js(e._def.input,r):r,o=await Reflect.apply(i,this,n);return e._def.output?await js(e._def.output,o):o}},e._zod.parse=(i,r)=>typeof i.value!="function"?(i.issues.push({code:"invalid_type",expected:"function",input:i.value,inst:e}),i):(e._def.output&&e._def.output._zod.def.type==="promise"?i.value=e.implementAsync(i.value):i.value=e.implement(i.value),i),e.input=(...i)=>{let r=e.constructor;return Array.isArray(i[0])?new r({type:"function",input:new Ya({type:"tuple",items:i[0],rest:i[1]}),output:e._def.output}):new r({type:"function",input:i[0],output:e._def.output})},e.output=i=>new e.constructor({type:"function",input:e._def.input,output:i}),e)),zp=_("$ZodPromise",(e,t)=>{U.init(e,t),e._zod.parse=(i,r)=>Promise.resolve(i.value).then(n=>t.innerType._zod.run({value:n,issues:[]},r))}),Op=_("$ZodLazy",(e,t)=>{U.init(e,t),V(e._zod,"innerType",()=>t.getter()),V(e._zod,"pattern",()=>{var i,r;return(r=(i=e._zod.innerType)==null?void 0:i._zod)==null?void 0:r.pattern}),V(e._zod,"propValues",()=>{var i,r;return(r=(i=e._zod.innerType)==null?void 0:i._zod)==null?void 0:r.propValues}),V(e._zod,"optin",()=>{var i,r;return((r=(i=e._zod.innerType)==null?void 0:i._zod)==null?void 0:r.optin)??void 0}),V(e._zod,"optout",()=>{var i,r;return((r=(i=e._zod.innerType)==null?void 0:i._zod)==null?void 0:r.optout)??void 0}),e._zod.parse=(i,r)=>e._zod.innerType._zod.run(i,r)}),Pp=_("$ZodCustom",(e,t)=>{ge.init(e,t),U.init(e,t),e._zod.parse=(i,r)=>i,e._zod.check=i=>{let r=i.value,n=t.fn(r);if(n instanceof Promise)return n.then(o=>Sc(o,i,r,e));Sc(n,i,r,e)}});function Sc(e,t,i,r){if(!e){let n={code:"custom",input:i,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(n.params=r._zod.def.params),t.issues.push(Jr(n))}}var tl={};wt(tl,{zhTW:()=>mO,zhCN:()=>fO,yo:()=>gO,vi:()=>cO,uz:()=>lO,ur:()=>sO,uk:()=>Ep,ua:()=>rO,tr:()=>iO,th:()=>eO,ta:()=>Yz,sv:()=>Xz,sl:()=>qz,ru:()=>Hz,pt:()=>Vz,ps:()=>Uz,pl:()=>Fz,ota:()=>jz,no:()=>Cz,nl:()=>Nz,ms:()=>Ez,mk:()=>Tz,lt:()=>Oz,ko:()=>Iz,km:()=>Dp,kh:()=>wz,ka:()=>$z,ja:()=>yz,it:()=>bz,is:()=>gz,id:()=>mz,hy:()=>fz,hu:()=>cz,he:()=>lz,frCA:()=>sz,fr:()=>rz,fi:()=>iz,fa:()=>ez,es:()=>YI,eo:()=>XI,en:()=>Tp,de:()=>JI,da:()=>WI,cs:()=>BI,ca:()=>LI,bg:()=>ZI,be:()=>RI,az:()=>AI,ar:()=>MI});var EI=()=>{let e={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function t(n){return e[n]??null}let i={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`مدخلات غير مقبولة: يفترض إدخال instanceof ${n.expected}، ولكن تم إدخال ${a}`:`مدخلات غير مقبولة: يفترض إدخال ${o}، ولكن تم إدخال ${a}`}case"invalid_value":return n.values.length===1?`مدخلات غير مقبولة: يفترض إدخال ${R(n.values[0])}`:`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?` أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()} ${s.unit??"عنصر"}`:`أكبر من اللازم: يفترض أن تكون ${n.origin??"القيمة"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()} ${s.unit}`:`أصغر من اللازم: يفترض لـ ${n.origin} أن يكون ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`نَص غير مقبول: يجب أن يبدأ بـ "${n.prefix}"`:o.format==="ends_with"?`نَص غير مقبول: يجب أن ينتهي بـ "${o.suffix}"`:o.format==="includes"?`نَص غير مقبول: يجب أن يتضمَّن "${o.includes}"`:o.format==="regex"?`نَص غير مقبول: يجب أن يطابق النمط ${o.pattern}`:`${i[o.format]??n.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${n.divisor}`;case"unrecognized_keys":return`معرف${n.keys.length>1?"ات":""} غريب${n.keys.length>1?"ة":""}: ${P(n.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${n.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${n.origin}`;default:return"مدخل غير مقبول"}}};function MI(){return{localeError:EI()}}var NI=()=>{let e={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function t(n){return e[n]??null}let i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Yanlış dəyər: gözlənilən instanceof ${n.expected}, daxil olan ${a}`:`Yanlış dəyər: gözlənilən ${o}, daxil olan ${a}`}case"invalid_value":return n.values.length===1?`Yanlış dəyər: gözlənilən ${R(n.values[0])}`:`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()} ${s.unit??"element"}`:`Çox böyük: gözlənilən ${n.origin??"dəyər"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`Çox kiçik: gözlənilən ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanlış mətn: "${o.prefix}" ilə başlamalıdır`:o.format==="ends_with"?`Yanlış mətn: "${o.suffix}" ilə bitməlidir`:o.format==="includes"?`Yanlış mətn: "${o.includes}" daxil olmalıdır`:o.format==="regex"?`Yanlış mətn: ${o.pattern} şablonuna uyğun olmalıdır`:`Yanlış ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanlış ədəd: ${n.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${n.keys.length>1?"lar":""}: ${P(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${n.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function AI(){return{localeError:NI()}}function Ic(e,t,i,r){let n=Math.abs(e),o=n%10,s=n%100;return s>=11&&s<=19?r:o===1?t:o>=2&&o<=4?i:r}var CI=()=>{let e={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function t(n){return e[n]??null}let i={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},r={nan:"NaN",number:"лік",array:"масіў"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Няправільны ўвод: чакаўся instanceof ${n.expected}, атрымана ${a}`:`Няправільны ўвод: чакаўся ${o}, атрымана ${a}`}case"invalid_value":return n.values.length===1?`Няправільны ўвод: чакалася ${R(n.values[0])}`:`Няправільны варыянт: чакаўся адзін з ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),l=Ic(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна ${s.verb} ${o}${n.maximum.toString()} ${l}`}return`Занадта вялікі: чакалася, што ${n.origin??"значэнне"} павінна быць ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),l=Ic(a,s.unit.one,s.unit.few,s.unit.many);return`Занадта малы: чакалася, што ${n.origin} павінна ${s.verb} ${o}${n.minimum.toString()} ${l}`}return`Занадта малы: чакалася, што ${n.origin} павінна быць ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Няправільны радок: павінен пачынацца з "${o.prefix}"`:o.format==="ends_with"?`Няправільны радок: павінен заканчвацца на "${o.suffix}"`:o.format==="includes"?`Няправільны радок: павінен змяшчаць "${o.includes}"`:o.format==="regex"?`Няправільны радок: павінен адпавядаць шаблону ${o.pattern}`:`Няправільны ${i[o.format]??n.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${n.keys.length>1?"ключы":"ключ"}: ${P(n.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${n.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${n.origin}`;default:return"Няправільны ўвод"}}};function RI(){return{localeError:CI()}}var jI=()=>{let e={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function t(n){return e[n]??null}let i={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},r={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Невалиден вход: очакван instanceof ${n.expected}, получен ${a}`:`Невалиден вход: очакван ${o}, получен ${a}`}case"invalid_value":return n.values.length===1?`Невалиден вход: очакван ${R(n.values[0])}`:`Невалидна опция: очаквано едно от ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Твърде голямо: очаква се ${n.origin??"стойност"} да съдържа ${o}${n.maximum.toString()} ${s.unit??"елемента"}`:`Твърде голямо: очаква се ${n.origin??"стойност"} да бъде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Твърде малко: очаква се ${n.origin} да съдържа ${o}${n.minimum.toString()} ${s.unit}`:`Твърде малко: очаква се ${n.origin} да бъде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;if(o.format==="starts_with")return`Невалиден низ: трябва да започва с "${o.prefix}"`;if(o.format==="ends_with")return`Невалиден низ: трябва да завършва с "${o.suffix}"`;if(o.format==="includes")return`Невалиден низ: трябва да включва "${o.includes}"`;if(o.format==="regex")return`Невалиден низ: трябва да съвпада с ${o.pattern}`;let s="Невалиден";return o.format==="emoji"&&(s="Невалидно"),o.format==="datetime"&&(s="Невалидно"),o.format==="date"&&(s="Невалидна"),o.format==="time"&&(s="Невалидно"),o.format==="duration"&&(s="Невалидна"),`${s} ${i[o.format]??n.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${n.divisor}`;case"unrecognized_keys":return`Неразпознат${n.keys.length>1?"и":""} ключ${n.keys.length>1?"ове":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${n.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${n.origin}`;default:return"Невалиден вход"}}};function ZI(){return{localeError:jI()}}var UI=()=>{let e={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let i={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Tipus invàlid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`:`Tipus invàlid: s'esperava ${o}, s'ha rebut ${a}`}case"invalid_value":return n.values.length===1?`Valor invàlid: s'esperava ${R(n.values[0])}`:`Opció invàlida: s'esperava una de ${P(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a màxim":"menys de",s=t(n.origin);return s?`Massa gran: s'esperava que ${n.origin??"el valor"} contingués ${o} ${n.maximum.toString()} ${s.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a mínim":"més de",s=t(n.origin);return s?`Massa petit: s'esperava que ${n.origin} contingués ${o} ${n.minimum.toString()} ${s.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format invàlid: ha de començar amb "${o.prefix}"`:o.format==="ends_with"?`Format invàlid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format invàlid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format invàlid: ha de coincidir amb el patró ${o.pattern}`:`Format invàlid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${n.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${n.origin}`;default:return"Entrada invàlida"}}};function LI(){return{localeError:UI()}}var FI=()=>{let e={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function t(n){return e[n]??null}let i={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},r={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Neplatný vstup: očekáváno instanceof ${n.expected}, obdrženo ${a}`:`Neplatný vstup: očekáváno ${o}, obdrženo ${a}`}case"invalid_value":return n.values.length===1?`Neplatný vstup: očekáváno ${R(n.values[0])}`:`Neplatná možnost: očekávána jedna z hodnot ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Hodnota je příliš velká: ${n.origin??"hodnota"} musí mít ${o}${n.maximum.toString()} ${s.unit??"prvků"}`:`Hodnota je příliš velká: ${n.origin??"hodnota"} musí být ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Hodnota je příliš malá: ${n.origin??"hodnota"} musí mít ${o}${n.minimum.toString()} ${s.unit??"prvků"}`:`Hodnota je příliš malá: ${n.origin??"hodnota"} musí být ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatný řetězec: musí začínat na "${o.prefix}"`:o.format==="ends_with"?`Neplatný řetězec: musí končit na "${o.suffix}"`:o.format==="includes"?`Neplatný řetězec: musí obsahovat "${o.includes}"`:o.format==="regex"?`Neplatný řetězec: musí odpovídat vzoru ${o.pattern}`:`Neplatný formát ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${n.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${P(n.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${n.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${n.origin}`;default:return"Neplatný vstup"}}};function BI(){return{localeError:FI()}}var VI=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let i={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`:`Ugyldigt input: forventede ${o}, fik ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig værdi: forventede ${R(n.values[0])}`:`Ugyldigt valg: forventede en af følgende ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),a=r[n.origin]??n.origin;return s?`For stor: forventede ${a??"value"} ${s.verb} ${o} ${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor: forventede ${a??"value"} havde ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),a=r[n.origin]??n.origin;return s?`For lille: forventede ${a} ${s.verb} ${o} ${n.minimum.toString()} ${s.unit}`:`For lille: forventede ${a} havde ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: skal starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: skal ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: skal indeholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: skal matche mønsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${P(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${n.origin}`;default:return"Ugyldigt input"}}};function WI(){return{localeError:VI()}}var HI=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},r={nan:"NaN",number:"Zahl",array:"Array"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ungültige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`:`Ungültige Eingabe: erwartet ${o}, erhalten ${a}`}case"invalid_value":return n.values.length===1?`Ungültige Eingabe: erwartet ${R(n.values[0])}`:`Ungültige Option: erwartet eine von ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${s.unit??"Elemente"} hat`:`Zu groß: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${s.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ungültiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ungültiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ungültiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ungültiger String: muss dem Muster ${o.pattern} entsprechen`:`Ungültig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${P(n.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${n.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${n.origin}`;default:return"Ungültige Eingabe"}}};function JI(){return{localeError:HI()}}var qI=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return`Invalid input: expected ${o}, received ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${R(n.values[0])}`:`Invalid option: expected one of ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${s.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${s.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};function Tp(){return{localeError:qI()}}var KI=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let i={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},r={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Nevalida enigo: atendiĝis instanceof ${n.expected}, riceviĝis ${a}`:`Nevalida enigo: atendiĝis ${o}, riceviĝis ${a}`}case"invalid_value":return n.values.length===1?`Nevalida enigo: atendiĝis ${R(n.values[0])}`:`Nevalida opcio: atendiĝis unu el ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${s.unit??"elementojn"}`:`Tro granda: atendiĝis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Tro malgranda: atendiĝis ke ${n.origin} havu ${o}${n.minimum.toString()} ${s.unit}`:`Tro malgranda: atendiĝis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenciĝi per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas finiĝi per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${i[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} ŝlosilo${n.keys.length>1?"j":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};function XI(){return{localeError:KI()}}var GI=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let i={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Entrada inválida: se esperaba instanceof ${n.expected}, recibido ${a}`:`Entrada inválida: se esperaba ${o}, recibido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inválida: se esperaba ${R(n.values[0])}`:`Opción inválida: se esperaba una de ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),a=r[n.origin]??n.origin;return s?`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Demasiado grande: se esperaba que ${a??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),a=r[n.origin]??n.origin;return s?`Demasiado pequeño: se esperaba que ${a} tuviera ${o}${n.minimum.toString()} ${s.unit}`:`Demasiado pequeño: se esperaba que ${a} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inválida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inválida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inválida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inválida: debe coincidir con el patrón ${o.pattern}`:`Inválido ${i[o.format]??n.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Llave inválida en ${r[n.origin]??n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${r[n.origin]??n.origin}`;default:return"Entrada inválida"}}};function YI(){return{localeError:GI()}}var QI=()=>{let e={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function t(n){return e[n]??null}let i={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},r={nan:"NaN",number:"عدد",array:"آرایه"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`ورودی نامعتبر: می‌بایست instanceof ${n.expected} می‌بود، ${a} دریافت شد`:`ورودی نامعتبر: می‌بایست ${o} می‌بود، ${a} دریافت شد`}case"invalid_value":return n.values.length===1?`ورودی نامعتبر: می‌بایست ${R(n.values[0])} می‌بود`:`گزینه نامعتبر: می‌بایست یکی از ${P(n.values,"|")} می‌بود`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصر"} باشد`:`خیلی بزرگ: ${n.origin??"مقدار"} باید ${o}${n.maximum.toString()} باشد`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} باشد`:`خیلی کوچک: ${n.origin} باید ${o}${n.minimum.toString()} باشد`}case"invalid_format":{let o=n;return o.format==="starts_with"?`رشته نامعتبر: باید با "${o.prefix}" شروع شود`:o.format==="ends_with"?`رشته نامعتبر: باید با "${o.suffix}" تمام شود`:o.format==="includes"?`رشته نامعتبر: باید شامل "${o.includes}" باشد`:o.format==="regex"?`رشته نامعتبر: باید با الگوی ${o.pattern} مطابقت داشته باشد`:`${i[o.format]??n.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${n.divisor} باشد`;case"unrecognized_keys":return`کلید${n.keys.length>1?"های":""} ناشناس: ${P(n.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${n.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${n.origin}`;default:return"ورودی نامعتبر"}}};function ez(){return{localeError:QI()}}var tz=()=>{let e={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function t(n){return e[n]??null}let i={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`:`Virheellinen tyyppi: odotettiin ${o}, oli ${a}`}case"invalid_value":return n.values.length===1?`Virheellinen syöte: täytyy olla ${R(n.values[0])}`:`Virheellinen valinta: täytyy olla yksi seuraavista: ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Liian suuri: ${s.subject} täytyy olla ${o}${n.maximum.toString()} ${s.unit}`.trim():`Liian suuri: arvon täytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Liian pieni: ${s.subject} täytyy olla ${o}${n.minimum.toString()} ${s.unit}`.trim():`Liian pieni: arvon täytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen syöte: täytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen syöte: täytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen syöte: täytyy sisältää "${o.includes}"`:o.format==="regex"?`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${P(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function iz(){return{localeError:tz()}}var nz=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}let i={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},r={nan:"NaN",number:"nombre",array:"tableau"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Entrée invalide : instanceof ${n.expected} attendu, ${a} reçu`:`Entrée invalide : ${o} attendu, ${a} reçu`}case"invalid_value":return n.values.length===1?`Entrée invalide : ${R(n.values[0])} attendu`:`Option invalide : une valeur parmi ${P(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Trop grand : ${n.origin??"valeur"} doit ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"élément(s)"}`:`Trop grand : ${n.origin??"valeur"} doit être ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Trop petit : ${n.origin} doit ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : ${n.origin} doit être ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au modèle ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${P(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function rz(){return{localeError:nz()}}var oz=()=>{let e={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function t(n){return e[n]??null}let i={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Entrée invalide : attendu instanceof ${n.expected}, reçu ${a}`:`Entrée invalide : attendu ${o}, reçu ${a}`}case"invalid_value":return n.values.length===1?`Entrée invalide : attendu ${R(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"≤":"<",s=t(n.origin);return s?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${s.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"≥":">",s=t(n.origin);return s?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${s.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chaîne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Chaîne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Chaîne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Chaîne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${n.divisor}`;case"unrecognized_keys":return`Clé${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${P(n.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${n.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entrée invalide"}}};function sz(){return{localeError:oz()}}var az=()=>{let e={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},t={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},i=u=>u?e[u]:void 0,r=u=>{let c=i(u);return c?c.label:u??e.unknown.label},n=u=>`ה${r(u)}`,o=u=>{var c;return(((c=i(u))==null?void 0:c.gender)??"m")==="f"?"צריכה להיות":"צריך להיות"},s=u=>u?t[u]??null:null,a={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},l={nan:"NaN"};return u=>{var c;switch(u.code){case"invalid_type":{let d=u.expected,f=l[d??""]??r(d),h=j(u.input),m=l[h]??((c=e[h])==null?void 0:c.label)??h;return/^[A-Z]/.test(u.expected)?`קלט לא תקין: צריך להיות instanceof ${u.expected}, התקבל ${m}`:`קלט לא תקין: צריך להיות ${f}, התקבל ${m}`}case"invalid_value":{if(u.values.length===1)return`ערך לא תקין: הערך חייב להיות ${R(u.values[0])}`;let d=u.values.map(h=>R(h));if(u.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${d[0]} או ${d[1]}`;let f=d[d.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${d.slice(0,-1).join(", ")} או ${f}`}case"too_big":{let d=s(u.origin),f=n(u.origin??"value");if(u.origin==="string")return`${(d==null?void 0:d.longLabel)??"ארוך"} מדי: ${f} צריכה להכיל ${u.maximum.toString()} ${(d==null?void 0:d.unit)??""} ${u.inclusive?"או פחות":"לכל היותר"}`.trim();if(u.origin==="number"){let p=u.inclusive?`קטן או שווה ל-${u.maximum}`:`קטן מ-${u.maximum}`;return`גדול מדי: ${f} צריך להיות ${p}`}if(u.origin==="array"||u.origin==="set"){let p=u.origin==="set"?"צריכה":"צריך",g=u.inclusive?`${u.maximum} ${(d==null?void 0:d.unit)??""} או פחות`:`פחות מ-${u.maximum} ${(d==null?void 0:d.unit)??""}`;return`גדול מדי: ${f} ${p} להכיל ${g}`.trim()}let h=u.inclusive?"<=":"<",m=o(u.origin??"value");return d!=null&&d.unit?`${d.longLabel} מדי: ${f} ${m} ${h}${u.maximum.toString()} ${d.unit}`:`${(d==null?void 0:d.longLabel)??"גדול"} מדי: ${f} ${m} ${h}${u.maximum.toString()}`}case"too_small":{let d=s(u.origin),f=n(u.origin??"value");if(u.origin==="string")return`${(d==null?void 0:d.shortLabel)??"קצר"} מדי: ${f} צריכה להכיל ${u.minimum.toString()} ${(d==null?void 0:d.unit)??""} ${u.inclusive?"או יותר":"לפחות"}`.trim();if(u.origin==="number"){let p=u.inclusive?`גדול או שווה ל-${u.minimum}`:`גדול מ-${u.minimum}`;return`קטן מדי: ${f} צריך להיות ${p}`}if(u.origin==="array"||u.origin==="set"){let p=u.origin==="set"?"צריכה":"צריך";if(u.minimum===1&&u.inclusive){let b=(u.origin==="set","לפחות פריט אחד");return`קטן מדי: ${f} ${p} להכיל ${b}`}let g=u.inclusive?`${u.minimum} ${(d==null?void 0:d.unit)??""} או יותר`:`יותר מ-${u.minimum} ${(d==null?void 0:d.unit)??""}`;return`קטן מדי: ${f} ${p} להכיל ${g}`.trim()}let h=u.inclusive?">=":">",m=o(u.origin??"value");return d!=null&&d.unit?`${d.shortLabel} מדי: ${f} ${m} ${h}${u.minimum.toString()} ${d.unit}`:`${(d==null?void 0:d.shortLabel)??"קטן"} מדי: ${f} ${m} ${h}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${d.prefix}"`;if(d.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${d.suffix}"`;if(d.format==="includes")return`המחרוזת חייבת לכלול "${d.includes}"`;if(d.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${d.pattern}`;let f=a[d.format],h=(f==null?void 0:f.label)??d.format,m=((f==null?void 0:f.gender)??"m")==="f"?"תקינה":"תקין";return`${h} לא ${m}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${u.divisor}`;case"unrecognized_keys":return`מפתח${u.keys.length>1?"ות":""} לא מזוה${u.keys.length>1?"ים":"ה"}: ${P(u.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${n(u.origin??"array")}`;default:return"קלט לא תקין"}}};function lz(){return{localeError:az()}}var uz=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let i={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},r={nan:"NaN",number:"szám",array:"tömb"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Érvénytelen bemenet: a várt érték instanceof ${n.expected}, a kapott érték ${a}`:`Érvénytelen bemenet: a várt érték ${o}, a kapott érték ${a}`}case"invalid_value":return n.values.length===1?`Érvénytelen bemenet: a várt érték ${R(n.values[0])}`:`Érvénytelen opció: valamelyik érték várt ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Túl nagy: ${n.origin??"érték"} mérete túl nagy ${o}${n.maximum.toString()} ${s.unit??"elem"}`:`Túl nagy: a bemeneti érték ${n.origin??"érték"} túl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Túl kicsi: a bemeneti érték ${n.origin} mérete túl kicsi ${o}${n.minimum.toString()} ${s.unit}`:`Túl kicsi: a bemeneti érték ${n.origin} túl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Érvénytelen string: "${o.prefix}" értékkel kell kezdődnie`:o.format==="ends_with"?`Érvénytelen string: "${o.suffix}" értékkel kell végződnie`:o.format==="includes"?`Érvénytelen string: "${o.includes}" értéket kell tartalmaznia`:o.format==="regex"?`Érvénytelen string: ${o.pattern} mintának kell megfelelnie`:`Érvénytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`Érvénytelen szám: ${n.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${n.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${n.origin}`;default:return"Érvénytelen bemenet"}}};function cz(){return{localeError:uz()}}function zc(e,t,i){return Math.abs(e)===1?t:i}function vi(e){if(!e)return"";let t=["ա","ե","ը","ի","ո","ու","օ"],i=e[e.length-1];return e+(t.includes(i)?"ն":"ը")}var dz=()=>{let e={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function t(n){return e[n]??null}let i={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},r={nan:"NaN",number:"թիվ",array:"զանգված"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Սխալ մուտքագրում․ սպասվում էր instanceof ${n.expected}, ստացվել է ${a}`:`Սխալ մուտքագրում․ սպասվում էր ${o}, ստացվել է ${a}`}case"invalid_value":return n.values.length===1?`Սխալ մուտքագրում․ սպասվում էր ${R(n.values[1])}`:`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),l=zc(a,s.unit.one,s.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${vi(n.origin??"արժեք")} կունենա ${o}${n.maximum.toString()} ${l}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${vi(n.origin??"արժեք")} լինի ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),l=zc(a,s.unit.one,s.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${vi(n.origin)} կունենա ${o}${n.minimum.toString()} ${l}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${vi(n.origin)} լինի ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Սխալ տող․ պետք է սկսվի "${o.prefix}"-ով`:o.format==="ends_with"?`Սխալ տող․ պետք է ավարտվի "${o.suffix}"-ով`:o.format==="includes"?`Սխալ տող․ պետք է պարունակի "${o.includes}"`:o.format==="regex"?`Սխալ տող․ պետք է համապատասխանի ${o.pattern} ձևաչափին`:`Սխալ ${i[o.format]??n.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${n.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${n.keys.length>1?"ներ":""}. ${P(n.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${vi(n.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${vi(n.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function fz(){return{localeError:dz()}}var hz=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`:`Input tidak valid: diharapkan ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${R(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function mz(){return{localeError:hz()}}var pz=()=>{let e={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function t(n){return e[n]??null}let i={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},r={nan:"NaN",number:"númer",array:"fylki"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Rangt gildi: Þú slóst inn ${a} þar sem á að vera instanceof ${n.expected}`:`Rangt gildi: Þú slóst inn ${a} þar sem á að vera ${o}`}case"invalid_value":return n.values.length===1?`Rangt gildi: gert ráð fyrir ${R(n.values[0])}`:`Ógilt val: má vera eitt af eftirfarandi ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} hafi ${o}${n.maximum.toString()} ${s.unit??"hluti"}`:`Of stórt: gert er ráð fyrir að ${n.origin??"gildi"} sé ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Of lítið: gert er ráð fyrir að ${n.origin} hafi ${o}${n.minimum.toString()} ${s.unit}`:`Of lítið: gert er ráð fyrir að ${n.origin} sé ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ógildur strengur: verður að byrja á "${o.prefix}"`:o.format==="ends_with"?`Ógildur strengur: verður að enda á "${o.suffix}"`:o.format==="includes"?`Ógildur strengur: verður að innihalda "${o.includes}"`:o.format==="regex"?`Ógildur strengur: verður að fylgja mynstri ${o.pattern}`:`Rangt ${i[o.format]??n.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`Óþekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${P(n.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${n.origin}`;default:return"Rangt gildi"}}};function gz(){return{localeError:pz()}}var vz=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"numero",array:"vettore"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`:`Input non valido: atteso ${o}, ricevuto ${a}`}case"invalid_value":return n.values.length===1?`Input non valido: atteso ${R(n.values[0])}`:`Opzione non valida: atteso uno tra ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${s.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${s.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${P(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function bz(){return{localeError:vz()}}var _z=()=>{let e={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function t(n){return e[n]??null}let i={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},r={nan:"NaN",number:"数値",array:"配列"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`無効な入力: instanceof ${n.expected}が期待されましたが、${a}が入力されました`:`無効な入力: ${o}が期待されましたが、${a}が入力されました`}case"invalid_value":return n.values.length===1?`無効な入力: ${R(n.values[0])}が期待されました`:`無効な選択: ${P(n.values,"、")}のいずれかである必要があります`;case"too_big":{let o=n.inclusive?"以下である":"より小さい",s=t(n.origin);return s?`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${s.unit??"要素"}${o}必要があります`:`大きすぎる値: ${n.origin??"値"}は${n.maximum.toString()}${o}必要があります`}case"too_small":{let o=n.inclusive?"以上である":"より大きい",s=t(n.origin);return s?`小さすぎる値: ${n.origin}は${n.minimum.toString()}${s.unit}${o}必要があります`:`小さすぎる値: ${n.origin}は${n.minimum.toString()}${o}必要があります`}case"invalid_format":{let o=n;return o.format==="starts_with"?`無効な文字列: "${o.prefix}"で始まる必要があります`:o.format==="ends_with"?`無効な文字列: "${o.suffix}"で終わる必要があります`:o.format==="includes"?`無効な文字列: "${o.includes}"を含む必要があります`:o.format==="regex"?`無効な文字列: パターン${o.pattern}に一致する必要があります`:`無効な${i[o.format]??n.format}`}case"not_multiple_of":return`無効な数値: ${n.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${n.keys.length>1?"群":""}: ${P(n.keys,"、")}`;case"invalid_key":return`${n.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${n.origin}内の無効な値`;default:return"無効な入力"}}};function yz(){return{localeError:_z()}}var xz=()=>{let e={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function t(n){return e[n]??null}let i={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},r={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`არასწორი შეყვანა: მოსალოდნელი instanceof ${n.expected}, მიღებული ${a}`:`არასწორი შეყვანა: მოსალოდნელი ${o}, მიღებული ${a}`}case"invalid_value":return n.values.length===1?`არასწორი შეყვანა: მოსალოდნელი ${R(n.values[0])}`:`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${P(n.values,"|")}-დან`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit}`:`ზედმეტად დიდი: მოსალოდნელი ${n.origin??"მნიშვნელობა"} იყოს ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`ზედმეტად პატარა: მოსალოდნელი ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`ზედმეტად პატარა: მოსალოდნელი ${n.origin} იყოს ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`არასწორი სტრინგი: უნდა იწყებოდეს "${o.prefix}"-ით`:o.format==="ends_with"?`არასწორი სტრინგი: უნდა მთავრდებოდეს "${o.suffix}"-ით`:o.format==="includes"?`არასწორი სტრინგი: უნდა შეიცავდეს "${o.includes}"-ს`:o.format==="regex"?`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${o.pattern}`:`არასწორი ${i[o.format]??n.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${n.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${n.keys.length>1?"ები":"ი"}: ${P(n.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${n.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${n.origin}-ში`;default:return"არასწორი შეყვანა"}}};function $z(){return{localeError:xz()}}var kz=()=>{let e={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function t(n){return e[n]??null}let i={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},r={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${n.expected} ប៉ុន្តែទទួលបាន ${a}`:`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${o} ប៉ុន្តែទទួលបាន ${a}`}case"invalid_value":return n.values.length===1?`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${R(n.values[0])}`:`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()} ${s.unit??"ធាតុ"}`:`ធំពេក៖ ត្រូវការ ${n.origin??"តម្លៃ"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()} ${s.unit}`:`តូចពេក៖ ត្រូវការ ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${o.prefix}"`:o.format==="ends_with"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${o.suffix}"`:o.format==="includes"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${o.includes}"`:o.format==="regex"?`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${o.pattern}`:`មិនត្រឹមត្រូវ៖ ${i[o.format]??n.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${n.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${P(n.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${n.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function Dp(){return{localeError:kz()}}function wz(){return Dp()}var Sz=()=>{let e={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function t(n){return e[n]??null}let i={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`잘못된 입력: 예상 타입은 instanceof ${n.expected}, 받은 타입은 ${a}입니다`:`잘못된 입력: 예상 타입은 ${o}, 받은 타입은 ${a}입니다`}case"invalid_value":return n.values.length===1?`잘못된 입력: 값은 ${R(n.values[0])} 이어야 합니다`:`잘못된 옵션: ${P(n.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let o=n.inclusive?"이하":"미만",s=o==="미만"?"이어야 합니다":"여야 합니다",a=t(n.origin),l=(a==null?void 0:a.unit)??"요소";return a?`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()}${l} ${o}${s}`:`${n.origin??"값"}이 너무 큽니다: ${n.maximum.toString()} ${o}${s}`}case"too_small":{let o=n.inclusive?"이상":"초과",s=o==="이상"?"이어야 합니다":"여야 합니다",a=t(n.origin),l=(a==null?void 0:a.unit)??"요소";return a?`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()}${l} ${o}${s}`:`${n.origin??"값"}이 너무 작습니다: ${n.minimum.toString()} ${o}${s}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`잘못된 문자열: "${o.prefix}"(으)로 시작해야 합니다`:o.format==="ends_with"?`잘못된 문자열: "${o.suffix}"(으)로 끝나야 합니다`:o.format==="includes"?`잘못된 문자열: "${o.includes}"을(를) 포함해야 합니다`:o.format==="regex"?`잘못된 문자열: 정규식 ${o.pattern} 패턴과 일치해야 합니다`:`잘못된 ${i[o.format]??n.format}`}case"not_multiple_of":return`잘못된 숫자: ${n.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${P(n.keys,", ")}`;case"invalid_key":return`잘못된 키: ${n.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${n.origin}`;default:return"잘못된 입력"}}};function Iz(){return{localeError:Sz()}}var Bi=e=>e.charAt(0).toUpperCase()+e.slice(1);function Oc(e){let t=Math.abs(e),i=t%10,r=t%100;return r>=11&&r<=19||i===0?"many":i===1?"one":"few"}var zz=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function t(n,o,s,a){let l=e[n]??null;return l===null?l:{unit:l.unit[o],verb:l.verb[a][s?"inclusive":"notInclusive"]}}let i={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},r={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Gautas tipas ${a}, o tikėtasi - instanceof ${n.expected}`:`Gautas tipas ${a}, o tikėtasi - ${o}`}case"invalid_value":return n.values.length===1?`Privalo būti ${R(n.values[0])}`:`Privalo būti vienas iš ${P(n.values,"|")} pasirinkimų`;case"too_big":{let o=r[n.origin]??n.origin,s=t(n.origin,Oc(Number(n.maximum)),n.inclusive??!1,"smaller");if(s!=null&&s.verb)return`${Bi(o??n.origin??"reikšmė")} ${s.verb} ${n.maximum.toString()} ${s.unit??"elementų"}`;let a=n.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${Bi(o??n.origin??"reikšmė")} turi būti ${a} ${n.maximum.toString()} ${s==null?void 0:s.unit}`}case"too_small":{let o=r[n.origin]??n.origin,s=t(n.origin,Oc(Number(n.minimum)),n.inclusive??!1,"bigger");if(s!=null&&s.verb)return`${Bi(o??n.origin??"reikšmė")} ${s.verb} ${n.minimum.toString()} ${s.unit??"elementų"}`;let a=n.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${Bi(o??n.origin??"reikšmė")} turi būti ${a} ${n.minimum.toString()} ${s==null?void 0:s.unit}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Eilutė privalo prasidėti "${o.prefix}"`:o.format==="ends_with"?`Eilutė privalo pasibaigti "${o.suffix}"`:o.format==="includes"?`Eilutė privalo įtraukti "${o.includes}"`:o.format==="regex"?`Eilutė privalo atitikti ${o.pattern}`:`Neteisingas ${i[o.format]??n.format}`}case"not_multiple_of":return`Skaičius privalo būti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${P(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let o=r[n.origin]??n.origin;return`${Bi(o??n.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function Oz(){return{localeError:zz()}}var Pz=()=>{let e={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function t(n){return e[n]??null}let i={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},r={nan:"NaN",number:"број",array:"низа"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Грешен внес: се очекува instanceof ${n.expected}, примено ${a}`:`Грешен внес: се очекува ${o}, примено ${a}`}case"invalid_value":return n.values.length===1?`Invalid input: expected ${R(n.values[0])}`:`Грешана опција: се очекува една ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Премногу голем: се очекува ${n.origin??"вредноста"} да има ${o}${n.maximum.toString()} ${s.unit??"елементи"}`:`Премногу голем: се очекува ${n.origin??"вредноста"} да биде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Премногу мал: се очекува ${n.origin} да има ${o}${n.minimum.toString()} ${s.unit}`:`Премногу мал: се очекува ${n.origin} да биде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Неважечка низа: мора да започнува со "${o.prefix}"`:o.format==="ends_with"?`Неважечка низа: мора да завршува со "${o.suffix}"`:o.format==="includes"?`Неважечка низа: мора да вклучува "${o.includes}"`:o.format==="regex"?`Неважечка низа: мора да одгоара на патернот ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${P(n.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${n.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${n.origin}`;default:return"Грешен внес"}}};function Tz(){return{localeError:Pz()}}var Dz=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"nombor"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`:`Input tidak sah: dijangka ${o}, diterima ${a}`}case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${R(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${P(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function Ez(){return{localeError:Dz()}}var Mz=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},r={nan:"NaN",number:"getal"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`:`Ongeldige invoer: verwacht ${o}, ontving ${a}`}case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${R(n.values[0])}`:`Ongeldige optie: verwacht één van ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";return s?`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";return s?`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Te ${a}: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function Nz(){return{localeError:Mz()}}var Az=()=>{let e={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function t(n){return e[n]??null}let i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"tall",array:"liste"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`:`Ugyldig input: forventet ${o}, fikk ${a}`}case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${R(n.values[0])}`:`Ugyldig valg: forventet en av ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()} ${s.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til å ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()} ${s.unit}`:`For lite(n): forventet ${n.origin} til å ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: må starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: må ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: må inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: må matche mønsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${P(n.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function Cz(){return{localeError:Az()}}var Rz=()=>{let e={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function t(n){return e[n]??null}let i={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},r={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Fâsit giren: umulan instanceof ${n.expected}, alınan ${a}`:`Fâsit giren: umulan ${o}, alınan ${a}`}case"invalid_value":return n.values.length===1?`Fâsit giren: umulan ${R(n.values[0])}`:`Fâsit tercih: mûteberler ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${s.unit??"elements"} sahip olmalıydı.`:`Fazla büyük: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmalıydı.`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} ${s.unit} sahip olmalıydı.`:`Fazla küçük: ${n.origin}, ${o}${n.minimum.toString()} olmalıydı.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Fâsit metin: "${o.prefix}" ile başlamalı.`:o.format==="ends_with"?`Fâsit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`Fâsit metin: "${o.includes}" ihtivâ etmeli.`:o.format==="regex"?`Fâsit metin: ${o.pattern} nakşına uymalı.`:`Fâsit ${i[o.format]??n.format}`}case"not_multiple_of":return`Fâsit sayı: ${n.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`${n.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${n.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function jz(){return{localeError:Rz()}}var Zz=()=>{let e={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function t(n){return e[n]??null}let i={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},r={nan:"NaN",number:"عدد",array:"ارې"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`ناسم ورودي: باید instanceof ${n.expected} وای, مګر ${a} ترلاسه شو`:`ناسم ورودي: باید ${o} وای, مګر ${a} ترلاسه شو`}case"invalid_value":return n.values.length===1?`ناسم ورودي: باید ${R(n.values[0])} وای`:`ناسم انتخاب: باید یو له ${P(n.values,"|")} څخه وای`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} ${s.unit??"عنصرونه"} ولري`:`ډیر لوی: ${n.origin??"ارزښت"} باید ${o}${n.maximum.toString()} وي`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} ${s.unit} ولري`:`ډیر کوچنی: ${n.origin} باید ${o}${n.minimum.toString()} وي`}case"invalid_format":{let o=n;return o.format==="starts_with"?`ناسم متن: باید د "${o.prefix}" سره پیل شي`:o.format==="ends_with"?`ناسم متن: باید د "${o.suffix}" سره پای ته ورسيږي`:o.format==="includes"?`ناسم متن: باید "${o.includes}" ولري`:o.format==="regex"?`ناسم متن: باید د ${o.pattern} سره مطابقت ولري`:`${i[o.format]??n.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${n.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${n.keys.length>1?"کلیډونه":"کلیډ"}: ${P(n.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${n.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${n.origin} کې`;default:return"ناسمه ورودي"}}};function Uz(){return{localeError:Zz()}}var Lz=()=>{let e={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function t(n){return e[n]??null}let i={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},r={nan:"NaN",number:"liczba",array:"tablica"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`:`Nieprawidłowe dane wejściowe: oczekiwano ${o}, otrzymano ${a}`}case"invalid_value":return n.values.length===1?`Nieprawidłowe dane wejściowe: oczekiwano ${R(n.values[0])}`:`Nieprawidłowa opcja: oczekiwano jednej z wartości ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Za duża wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.maximum.toString()} ${s.unit??"elementów"}`:`Zbyt duż(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Za mała wartość: oczekiwano, że ${n.origin??"wartość"} będzie mieć ${o}${n.minimum.toString()} ${s.unit??"elementów"}`:`Zbyt mał(y/a/e): oczekiwano, że ${n.origin??"wartość"} będzie wynosić ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawidłowy ciąg znaków: musi zaczynać się od "${o.prefix}"`:o.format==="ends_with"?`Nieprawidłowy ciąg znaków: musi kończyć się na "${o.suffix}"`:o.format==="includes"?`Nieprawidłowy ciąg znaków: musi zawierać "${o.includes}"`:o.format==="regex"?`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${o.pattern}`:`Nieprawidłow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${n.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${n.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Fz(){return{localeError:Lz()}}var Bz=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let i={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},r={nan:"NaN",number:"número",null:"nulo"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Tipo inválido: esperado instanceof ${n.expected}, recebido ${a}`:`Tipo inválido: esperado ${o}, recebido ${a}`}case"invalid_value":return n.values.length===1?`Entrada inválida: esperado ${R(n.values[0])}`:`Opção inválida: esperada uma das ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${s.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${s.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inválido: deve começar com "${o.prefix}"`:o.format==="ends_with"?`Texto inválido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inválido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inválido: deve corresponder ao padrão ${o.pattern}`:`${i[o.format]??n.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Chave inválida em ${n.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${n.origin}`;default:return"Campo inválido"}}};function Vz(){return{localeError:Bz()}}function Pc(e,t,i,r){let n=Math.abs(e),o=n%10,s=n%100;return s>=11&&s<=19?r:o===1?t:o>=2&&o<=4?i:r}var Wz=()=>{let e={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function t(n){return e[n]??null}let i={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},r={nan:"NaN",number:"число",array:"массив"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Неверный ввод: ожидалось instanceof ${n.expected}, получено ${a}`:`Неверный ввод: ожидалось ${o}, получено ${a}`}case"invalid_value":return n.values.length===1?`Неверный ввод: ожидалось ${R(n.values[0])}`:`Неверный вариант: ожидалось одно из ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),l=Pc(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет иметь ${o}${n.maximum.toString()} ${l}`}return`Слишком большое значение: ожидалось, что ${n.origin??"значение"} будет ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),l=Pc(a,s.unit.one,s.unit.few,s.unit.many);return`Слишком маленькое значение: ожидалось, что ${n.origin} будет иметь ${o}${n.minimum.toString()} ${l}`}return`Слишком маленькое значение: ожидалось, что ${n.origin} будет ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Неверная строка: должна начинаться с "${o.prefix}"`:o.format==="ends_with"?`Неверная строка: должна заканчиваться на "${o.suffix}"`:o.format==="includes"?`Неверная строка: должна содержать "${o.includes}"`:o.format==="regex"?`Неверная строка: должна соответствовать шаблону ${o.pattern}`:`Неверный ${i[o.format]??n.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${n.divisor}`;case"unrecognized_keys":return`Нераспознанн${n.keys.length>1?"ые":"ый"} ключ${n.keys.length>1?"и":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${n.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${n.origin}`;default:return"Неверные входные данные"}}};function Hz(){return{localeError:Wz()}}var Jz=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let i={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},r={nan:"NaN",number:"število",array:"tabela"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Neveljaven vnos: pričakovano instanceof ${n.expected}, prejeto ${a}`:`Neveljaven vnos: pričakovano ${o}, prejeto ${a}`}case"invalid_value":return n.values.length===1?`Neveljaven vnos: pričakovano ${R(n.values[0])}`:`Neveljavna možnost: pričakovano eno izmed ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${s.unit??"elementov"}`:`Preveliko: pričakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Premajhno: pričakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${s.unit}`:`Premajhno: pričakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se začeti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se končati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i ključi":" ključ"}: ${P(n.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function qz(){return{localeError:Jz()}}var Kz=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function t(n){return e[n]??null}let i={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},r={nan:"NaN",number:"antal",array:"lista"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ogiltig inmatning: förväntat instanceof ${n.expected}, fick ${a}`:`Ogiltig inmatning: förväntat ${o}, fick ${a}`}case"invalid_value":return n.values.length===1?`Ogiltig inmatning: förväntat ${R(n.values[0])}`:`Ogiltigt val: förväntade en av ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`För stor(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()} ${s.unit??"element"}`:`För stor(t): förväntat ${n.origin??"värdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()} ${s.unit}`:`För lite(t): förväntade ${n.origin??"värdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig sträng: måste börja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig sträng: måste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig sträng: måste innehålla "${o.includes}"`:o.format==="regex"?`Ogiltig sträng: måste matcha mönstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${P(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${n.origin??"värdet"}`;default:return"Ogiltig input"}}};function Xz(){return{localeError:Kz()}}var Gz=()=>{let e={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function t(n){return e[n]??null}let i={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},r={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${n.expected}, பெறப்பட்டது ${a}`:`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${o}, பெறப்பட்டது ${a}`}case"invalid_value":return n.values.length===1?`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${R(n.values[0])}`:`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${P(n.values,"|")} இல் ஒன்று`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ${s.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`:`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${n.origin??"மதிப்பு"} ${o}${n.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ஆக இருக்க வேண்டும்`:`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${n.origin} ${o}${n.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let o=n;return o.format==="starts_with"?`தவறான சரம்: "${o.prefix}" இல் தொடங்க வேண்டும்`:o.format==="ends_with"?`தவறான சரம்: "${o.suffix}" இல் முடிவடைய வேண்டும்`:o.format==="includes"?`தவறான சரம்: "${o.includes}" ஐ உள்ளடக்க வேண்டும்`:o.format==="regex"?`தவறான சரம்: ${o.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`:`தவறான ${i[o.format]??n.format}`}case"not_multiple_of":return`தவறான எண்: ${n.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${n.keys.length>1?"கள்":""}: ${P(n.keys,", ")}`;case"invalid_key":return`${n.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${n.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function Yz(){return{localeError:Gz()}}var Qz=()=>{let e={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function t(n){return e[n]??null}let i={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},r={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${n.expected} แต่ได้รับ ${a}`:`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${o} แต่ได้รับ ${a}`}case"invalid_value":return n.values.length===1?`ค่าไม่ถูกต้อง: ควรเป็น ${R(n.values[0])}`:`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"ไม่เกิน":"น้อยกว่า",s=t(n.origin);return s?`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()} ${s.unit??"รายการ"}`:`เกินกำหนด: ${n.origin??"ค่า"} ควรมี${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"อย่างน้อย":"มากกว่า",s=t(n.origin);return s?`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()} ${s.unit}`:`น้อยกว่ากำหนด: ${n.origin} ควรมี${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${o.prefix}"`:o.format==="ends_with"?`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${o.suffix}"`:o.format==="includes"?`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${o.includes}" อยู่ในข้อความ`:o.format==="regex"?`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${o.pattern}`:`รูปแบบไม่ถูกต้อง: ${i[o.format]??n.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${n.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${P(n.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${n.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${n.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function eO(){return{localeError:Qz()}}var tO=()=>{let e={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function t(n){return e[n]??null}let i={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Geçersiz değer: beklenen instanceof ${n.expected}, alınan ${a}`:`Geçersiz değer: beklenen ${o}, alınan ${a}`}case"invalid_value":return n.values.length===1?`Geçersiz değer: beklenen ${R(n.values[0])}`:`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()} ${s.unit??"öğe"}`:`Çok büyük: beklenen ${n.origin??"değer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`Çok küçük: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Geçersiz metin: "${o.prefix}" ile başlamalı`:o.format==="ends_with"?`Geçersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Geçersiz metin: "${o.includes}" içermeli`:o.format==="regex"?`Geçersiz metin: ${o.pattern} desenine uymalı`:`Geçersiz ${i[o.format]??n.format}`}case"not_multiple_of":return`Geçersiz sayı: ${n.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${n.keys.length>1?"lar":""}: ${P(n.keys,", ")}`;case"invalid_key":return`${n.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${n.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function iO(){return{localeError:tO()}}var nO=()=>{let e={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function t(n){return e[n]??null}let i={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},r={nan:"NaN",number:"число",array:"масив"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Неправильні вхідні дані: очікується instanceof ${n.expected}, отримано ${a}`:`Неправильні вхідні дані: очікується ${o}, отримано ${a}`}case"invalid_value":return n.values.length===1?`Неправильні вхідні дані: очікується ${R(n.values[0])}`:`Неправильна опція: очікується одне з ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Занадто велике: очікується, що ${n.origin??"значення"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"елементів"}`:`Занадто велике: очікується, що ${n.origin??"значення"} буде ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Занадто мале: очікується, що ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Занадто мале: очікується, що ${n.origin} буде ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Неправильний рядок: повинен починатися з "${o.prefix}"`:o.format==="ends_with"?`Неправильний рядок: повинен закінчуватися на "${o.suffix}"`:o.format==="includes"?`Неправильний рядок: повинен містити "${o.includes}"`:o.format==="regex"?`Неправильний рядок: повинен відповідати шаблону ${o.pattern}`:`Неправильний ${i[o.format]??n.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${n.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${n.keys.length>1?"і":""}: ${P(n.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${n.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${n.origin}`;default:return"Неправильні вхідні дані"}}};function Ep(){return{localeError:nO()}}function rO(){return Ep()}var oO=()=>{let e={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function t(n){return e[n]??null}let i={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},r={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`غلط ان پٹ: instanceof ${n.expected} متوقع تھا، ${a} موصول ہوا`:`غلط ان پٹ: ${o} متوقع تھا، ${a} موصول ہوا`}case"invalid_value":return n.values.length===1?`غلط ان پٹ: ${R(n.values[0])} متوقع تھا`:`غلط آپشن: ${P(n.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`بہت بڑا: ${n.origin??"ویلیو"} کے ${o}${n.maximum.toString()} ${s.unit??"عناصر"} ہونے متوقع تھے`:`بہت بڑا: ${n.origin??"ویلیو"} کا ${o}${n.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`بہت چھوٹا: ${n.origin} کے ${o}${n.minimum.toString()} ${s.unit} ہونے متوقع تھے`:`بہت چھوٹا: ${n.origin} کا ${o}${n.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let o=n;return o.format==="starts_with"?`غلط سٹرنگ: "${o.prefix}" سے شروع ہونا چاہیے`:o.format==="ends_with"?`غلط سٹرنگ: "${o.suffix}" پر ختم ہونا چاہیے`:o.format==="includes"?`غلط سٹرنگ: "${o.includes}" شامل ہونا چاہیے`:o.format==="regex"?`غلط سٹرنگ: پیٹرن ${o.pattern} سے میچ ہونا چاہیے`:`غلط ${i[o.format]??n.format}`}case"not_multiple_of":return`غلط نمبر: ${n.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${n.keys.length>1?"ز":""}: ${P(n.keys,"، ")}`;case"invalid_key":return`${n.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${n.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function sO(){return{localeError:oO()}}var aO=()=>{let e={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function t(n){return e[n]??null}let i={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},r={nan:"NaN",number:"raqam",array:"massiv"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Noto‘g‘ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`:`Noto‘g‘ri kirish: kutilgan ${o}, qabul qilingan ${a}`}case"invalid_value":return n.values.length===1?`Noto‘g‘ri kirish: kutilgan ${R(n.values[0])}`:`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()} ${s.unit} ${s.verb}`:`Juda katta: kutilgan ${n.origin??"qiymat"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()} ${s.unit} ${s.verb}`:`Juda kichik: kutilgan ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Noto‘g‘ri satr: "${o.prefix}" bilan boshlanishi kerak`:o.format==="ends_with"?`Noto‘g‘ri satr: "${o.suffix}" bilan tugashi kerak`:o.format==="includes"?`Noto‘g‘ri satr: "${o.includes}" ni o‘z ichiga olishi kerak`:o.format==="regex"?`Noto‘g‘ri satr: ${o.pattern} shabloniga mos kelishi kerak`:`Noto‘g‘ri ${i[o.format]??n.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${n.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${n.keys.length>1?"lar":""}: ${P(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${n.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function lO(){return{localeError:aO()}}var uO=()=>{let e={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function t(n){return e[n]??null}let i={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},r={nan:"NaN",number:"số",array:"mảng"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Đầu vào không hợp lệ: mong đợi instanceof ${n.expected}, nhận được ${a}`:`Đầu vào không hợp lệ: mong đợi ${o}, nhận được ${a}`}case"invalid_value":return n.values.length===1?`Đầu vào không hợp lệ: mong đợi ${R(n.values[0])}`:`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Quá lớn: mong đợi ${n.origin??"giá trị"} ${s.verb} ${o}${n.maximum.toString()} ${s.unit??"phần tử"}`:`Quá lớn: mong đợi ${n.origin??"giá trị"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Quá nhỏ: mong đợi ${n.origin} ${s.verb} ${o}${n.minimum.toString()} ${s.unit}`:`Quá nhỏ: mong đợi ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chuỗi không hợp lệ: phải bắt đầu bằng "${o.prefix}"`:o.format==="ends_with"?`Chuỗi không hợp lệ: phải kết thúc bằng "${o.suffix}"`:o.format==="includes"?`Chuỗi không hợp lệ: phải bao gồm "${o.includes}"`:o.format==="regex"?`Chuỗi không hợp lệ: phải khớp với mẫu ${o.pattern}`:`${i[o.format]??n.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${n.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${P(n.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${n.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${n.origin}`;default:return"Đầu vào không hợp lệ"}}};function cO(){return{localeError:uO()}}var dO=()=>{let e={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function t(n){return e[n]??null}let i={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},r={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`无效输入:期望 instanceof ${n.expected},实际接收 ${a}`:`无效输入:期望 ${o},实际接收 ${a}`}case"invalid_value":return n.values.length===1?`无效输入:期望 ${R(n.values[0])}`:`无效选项:期望以下之一 ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()} ${s.unit??"个元素"}`:`数值过大:期望 ${n.origin??"值"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()} ${s.unit}`:`数值过小:期望 ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`无效字符串:必须以 "${o.prefix}" 开头`:o.format==="ends_with"?`无效字符串:必须以 "${o.suffix}" 结尾`:o.format==="includes"?`无效字符串:必须包含 "${o.includes}"`:o.format==="regex"?`无效字符串:必须满足正则表达式 ${o.pattern}`:`无效${i[o.format]??n.format}`}case"not_multiple_of":return`无效数字:必须是 ${n.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${P(n.keys,", ")}`;case"invalid_key":return`${n.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${n.origin} 中包含无效值(value)`;default:return"无效输入"}}};function fO(){return{localeError:dO()}}var hO=()=>{let e={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function t(n){return e[n]??null}let i={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},r={nan:"NaN"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`無效的輸入值:預期為 instanceof ${n.expected},但收到 ${a}`:`無效的輸入值:預期為 ${o},但收到 ${a}`}case"invalid_value":return n.values.length===1?`無效的輸入值:預期為 ${R(n.values[0])}`:`無效的選項:預期為以下其中之一 ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()} ${s.unit??"個元素"}`:`數值過大:預期 ${n.origin??"值"} 應為 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()} ${s.unit}`:`數值過小:預期 ${n.origin} 應為 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`無效的字串:必須以 "${o.prefix}" 開頭`:o.format==="ends_with"?`無效的字串:必須以 "${o.suffix}" 結尾`:o.format==="includes"?`無效的字串:必須包含 "${o.includes}"`:o.format==="regex"?`無效的字串:必須符合格式 ${o.pattern}`:`無效的 ${i[o.format]??n.format}`}case"not_multiple_of":return`無效的數字:必須為 ${n.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${n.keys.length>1?"們":""}:${P(n.keys,"、")}`;case"invalid_key":return`${n.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${n.origin} 中有無效的值`;default:return"無效的輸入值"}}};function mO(){return{localeError:hO()}}var pO=()=>{let e={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function t(n){return e[n]??null}let i={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},r={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return n=>{switch(n.code){case"invalid_type":{let o=r[n.expected]??n.expected,s=j(n.input),a=r[s]??s;return/^[A-Z]/.test(n.expected)?`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${n.expected}, àmọ̀ a rí ${a}`:`Ìbáwọlé aṣìṣe: a ní láti fi ${o}, àmọ̀ a rí ${a}`}case"invalid_value":return n.values.length===1?`Ìbáwọlé aṣìṣe: a ní láti fi ${R(n.values[0])}`:`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${P(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",s=t(n.origin);return s?`Tó pọ̀ jù: a ní láti jẹ́ pé ${n.origin??"iye"} ${s.verb} ${o}${n.maximum} ${s.unit}`:`Tó pọ̀ jù: a ní láti jẹ́ ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",s=t(n.origin);return s?`Kéré ju: a ní láti jẹ́ pé ${n.origin} ${s.verb} ${o}${n.minimum} ${s.unit}`:`Kéré ju: a ní láti jẹ́ ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${o.prefix}"`:o.format==="ends_with"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${o.suffix}"`:o.format==="includes"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${o.includes}"`:o.format==="regex"?`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${o.pattern}`:`Aṣìṣe: ${i[o.format]??n.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${n.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${P(n.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${n.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${n.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function gO(){return{localeError:pO()}}var Tc,Mp=Symbol("ZodOutput"),Np=Symbol("ZodInput");class Ap{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...i){let r=i[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let i=this._map.get(t);return i&&typeof i=="object"&&"id"in i&&this._idmap.delete(i.id),this._map.delete(t),this}get(t){let i=t._zod.parent;if(i){let r={...this.get(i)??{}};delete r.id;let n={...r,...this._map.get(t)};return Object.keys(n).length?n:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function il(){return new Ap}(Tc=globalThis).__zod_globalRegistry??(Tc.__zod_globalRegistry=il());var Qe=globalThis.__zod_globalRegistry;function Cp(e,t){return new e({type:"string",...T(t)})}function Rp(e,t){return new e({type:"string",coerce:!0,...T(t)})}function nl(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...T(t)})}function Kr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...T(t)})}function rl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...T(t)})}function ol(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(t)})}function sl(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(t)})}function al(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(t)})}function $o(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...T(t)})}function ll(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...T(t)})}function ul(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(t)})}function cl(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...T(t)})}function dl(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(t)})}function fl(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...T(t)})}function hl(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...T(t)})}function ml(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(t)})}function pl(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(t)})}function gl(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(t)})}function jp(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...T(t)})}function vl(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(t)})}function bl(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(t)})}function _l(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...T(t)})}function yl(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...T(t)})}function xl(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...T(t)})}function $l(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...T(t)})}var Zp={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function Up(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(t)})}function Lp(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}function Fp(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}function Bp(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}function Vp(e,t){return new e({type:"number",checks:[],...T(t)})}function Wp(e,t){return new e({type:"number",coerce:!0,checks:[],...T(t)})}function Hp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...T(t)})}function Jp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...T(t)})}function qp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...T(t)})}function Kp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...T(t)})}function Xp(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...T(t)})}function Gp(e,t){return new e({type:"boolean",...T(t)})}function Yp(e,t){return new e({type:"boolean",coerce:!0,...T(t)})}function Qp(e,t){return new e({type:"bigint",...T(t)})}function eg(e,t){return new e({type:"bigint",coerce:!0,...T(t)})}function tg(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...T(t)})}function ig(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...T(t)})}function ng(e,t){return new e({type:"symbol",...T(t)})}function rg(e,t){return new e({type:"undefined",...T(t)})}function og(e,t){return new e({type:"null",...T(t)})}function sg(e){return new e({type:"any"})}function ag(e){return new e({type:"unknown"})}function lg(e,t){return new e({type:"never",...T(t)})}function ug(e,t){return new e({type:"void",...T(t)})}function cg(e,t){return new e({type:"date",...T(t)})}function dg(e,t){return new e({type:"date",coerce:!0,...T(t)})}function fg(e,t){return new e({type:"nan",...T(t)})}function At(e,t){return new Ha({check:"less_than",...T(t),value:e,inclusive:!1})}function et(e,t){return new Ha({check:"less_than",...T(t),value:e,inclusive:!0})}function Ct(e,t){return new Ja({check:"greater_than",...T(t),value:e,inclusive:!1})}function Fe(e,t){return new Ja({check:"greater_than",...T(t),value:e,inclusive:!0})}function kl(e){return Ct(0,e)}function wl(e){return At(0,e)}function Sl(e){return et(0,e)}function Il(e){return Fe(0,e)}function Pi(e,t){return new Gh({check:"multiple_of",...T(t),value:e})}function Zi(e,t){return new em({check:"max_size",...T(t),maximum:e})}function Rt(e,t){return new tm({check:"min_size",...T(t),minimum:e})}function Bn(e,t){return new im({check:"size_equals",...T(t),size:e})}function Vn(e,t){return new nm({check:"max_length",...T(t),maximum:e})}function si(e,t){return new rm({check:"min_length",...T(t),minimum:e})}function Wn(e,t){return new om({check:"length_equals",...T(t),length:e})}function ko(e,t){return new sm({check:"string_format",format:"regex",...T(t),pattern:e})}function wo(e){return new am({check:"string_format",format:"lowercase",...T(e)})}function So(e){return new lm({check:"string_format",format:"uppercase",...T(e)})}function Io(e,t){return new um({check:"string_format",format:"includes",...T(t),includes:e})}function zo(e,t){return new cm({check:"string_format",format:"starts_with",...T(t),prefix:e})}function Oo(e,t){return new dm({check:"string_format",format:"ends_with",...T(t),suffix:e})}function zl(e,t,i){return new fm({check:"property",property:e,schema:t,...T(i)})}function Po(e,t){return new hm({check:"mime_type",mime:e,...T(t)})}function It(e){return new mm({check:"overwrite",tx:e})}function To(e){return It(t=>t.normalize(e))}function Do(){return It(e=>e.trim())}function Eo(){return It(e=>e.toLowerCase())}function Mo(){return It(e=>e.toUpperCase())}function No(){return It(e=>rh(e))}function hg(e,t,i){return new e({type:"array",element:t,...T(i)})}function vO(e,t,i){return new e({type:"union",options:t,...T(i)})}function bO(e,t,i){return new e({type:"union",options:t,inclusive:!1,...T(i)})}function _O(e,t,i,r){return new e({type:"union",options:i,discriminator:t,...T(r)})}function yO(e,t,i){return new e({type:"intersection",left:t,right:i})}function xO(e,t,i,r){let n=i instanceof U;return new e({type:"tuple",items:t,rest:n?i:null,...T(n?r:i)})}function $O(e,t,i,r){return new e({type:"record",keyType:t,valueType:i,...T(r)})}function kO(e,t,i,r){return new e({type:"map",keyType:t,valueType:i,...T(r)})}function wO(e,t,i){return new e({type:"set",valueType:t,...T(i)})}function SO(e,t,i){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new e({type:"enum",entries:r,...T(i)})}function IO(e,t,i){return new e({type:"enum",entries:t,...T(i)})}function zO(e,t,i){return new e({type:"literal",values:Array.isArray(t)?t:[t],...T(i)})}function mg(e,t){return new e({type:"file",...T(t)})}function OO(e,t){return new e({type:"transform",transform:t})}function PO(e,t){return new e({type:"optional",innerType:t})}function TO(e,t){return new e({type:"nullable",innerType:t})}function DO(e,t,i){return new e({type:"default",innerType:t,get defaultValue(){return typeof i=="function"?i():sh(i)}})}function EO(e,t,i){return new e({type:"nonoptional",innerType:t,...T(i)})}function MO(e,t){return new e({type:"success",innerType:t})}function NO(e,t,i){return new e({type:"catch",innerType:t,catchValue:typeof i=="function"?i:()=>i})}function AO(e,t,i){return new e({type:"pipe",in:t,out:i})}function CO(e,t){return new e({type:"readonly",innerType:t})}function RO(e,t,i){return new e({type:"template_literal",parts:t,...T(i)})}function jO(e,t){return new e({type:"lazy",getter:t})}function ZO(e,t){return new e({type:"promise",innerType:t})}function pg(e,t,i){let r=T(i);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function gg(e,t,i){return new e({type:"custom",check:"custom",fn:t,...T(i)})}function vg(e){let t=bg(i=>(i.addIssue=r=>{if(typeof r=="string")i.issues.push(Jr(r,i.value,t._zod.def));else{let n=r;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=i.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),i.issues.push(Jr(n))}},e(i.value,i)));return t}function bg(e,t){let i=new ge({check:"custom",...T(t)});return i._zod.check=e,i}function _g(e){let t=new ge({check:"describe"});return t._zod.onattach=[i=>{let r=Qe.get(i)??{};Qe.add(i,{...r,description:e})}],t._zod.check=()=>{},t}function yg(e){let t=new ge({check:"meta"});return t._zod.onattach=[i=>{let r=Qe.get(i)??{};Qe.add(i,{...r,...e})}],t._zod.check=()=>{},t}function xg(e,t){let i=T(t),r=i.truthy??["true","1","yes","on","y","enabled"],n=i.falsy??["false","0","no","off","n","disabled"];i.case!=="sensitive"&&(r=r.map(f=>typeof f=="string"?f.toLowerCase():f),n=n.map(f=>typeof f=="string"?f.toLowerCase():f));let o=new Set(r),s=new Set(n),a=e.Codec??el,l=e.Boolean??Xa,u=new(e.String??Fn)({type:"string",error:i.error}),c=new l({type:"boolean",error:i.error}),d=new a({type:"pipe",in:u,out:c,transform:(f,h)=>{let m=f;return i.case!=="sensitive"&&(m=m.toLowerCase()),o.has(m)?!0:s.has(m)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:h.value,inst:d,continue:!1}),{})},reverseTransform:(f,h)=>f===!0?r[0]||"true":n[0]||"false",error:i.error});return d}function Hn(e,t,i,r={}){let n=T(r),o={...T(r),check:"string_format",type:"string",format:t,fn:typeof i=="function"?i:s=>i.test(s),...n};return i instanceof RegExp&&(o.pattern=i),new e(o)}function Ti(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??Qe,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function re(e,t,i={path:[],schemaPath:[]}){var u,c;var r;let n=e._zod.def,o=t.seen.get(e);if(o)return o.count++,i.schemaPath.includes(e)&&(o.cycle=i.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:i.path};t.seen.set(e,s);let a=(c=(u=e._zod).toJSONSchema)==null?void 0:c.call(u);if(a)s.schema=a;else{let d={...i,schemaPath:[...i.schemaPath,e],path:i.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{let h=s.schema,m=t.processors[n.type];if(!m)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);m(e,t,h,d)}let f=e._zod.parent;f&&(s.ref||(s.ref=f),re(f,t,d),t.seen.get(f).isParent=!0)}let l=t.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),t.io==="input"&&Ue(e)&&(delete s.schema.examples,delete s.schema.default),t.io==="input"&&s.schema._prefault&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function Di(e,t){var s,a,l,u;let i=e.seen.get(t);if(!i)throw Error("Unprocessed schema. This is a bug in Zod.");let r=new Map;for(let c of e.seen.entries()){let d=(s=e.metadataRegistry.get(c[0]))==null?void 0:s.id;if(d){let f=r.get(d);if(f&&f!==c[0])throw Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(d,c[0])}}let n=c=>{var m;let d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let p=(m=e.external.registry.get(c[0]))==null?void 0:m.id,g=e.external.uri??(y=>y);if(p)return{ref:g(p)};let b=c[1].defId??c[1].schema.id??`schema${e.counter++}`;return c[1].defId=b,{defId:b,ref:`${g("__shared")}#/${d}/${b}`}}if(c[1]===i)return{ref:"#"};let f=`#/${d}/`,h=c[1].schema.id??`__schema${e.counter++}`;return{defId:h,ref:f+h}},o=c=>{if(c[1].schema.$ref)return;let d=c[1],{ref:f,defId:h}=n(c);d.def={...d.schema},h&&(d.defId=h);let m=d.schema;for(let p in m)delete m[p];m.$ref=f};if(e.cycles==="throw")for(let c of e.seen.entries()){let d=c[1];if(d.cycle)throw Error(`Cycle detected: #/${(a=d.cycle)==null?void 0:a.join("/")}/<root>
84
+
85
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let c of e.seen.entries()){let d=c[1];if(t===c[0]){o(c);continue}if(e.external){let f=(l=e.external.registry.get(c[0]))==null?void 0:l.id;if(t!==c[0]&&f){o(c);continue}}if((u=e.metadataRegistry.get(c[0]))!=null&&u.id){o(c);continue}if(d.cycle){o(c);continue}if(d.count>1&&e.reused==="ref"){o(c);continue}}}function Ei(e,t){var s,a,l;let i=e.seen.get(t);if(!i)throw Error("Unprocessed schema. This is a bug in Zod.");let r=u=>{let c=e.seen.get(u);if(c.ref===null)return;let d=c.def??c.schema,f={...d},h=c.ref;if(c.ref=null,h){r(h);let p=e.seen.get(h),g=p.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(g)):Object.assign(d,g),Object.assign(d,f),u._zod.parent===h)for(let b in d)b==="$ref"||b==="allOf"||b in f||delete d[b];if(g.$ref)for(let b in d)b==="$ref"||b==="allOf"||b in p.def&&JSON.stringify(d[b])===JSON.stringify(p.def[b])&&delete d[b]}let m=u._zod.parent;if(m&&m!==h){r(m);let p=e.seen.get(m);if(p!=null&&p.schema.$ref&&(d.$ref=p.schema.$ref,p.def))for(let g in d)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(d[g])===JSON.stringify(p.def[g])&&delete d[g]}e.override({zodSchema:u,jsonSchema:d,path:c.path??[]})};for(let u of[...e.seen.entries()].reverse())r(u[0]);let n={};if(e.target==="draft-2020-12"?n.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?n.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?n.$schema="http://json-schema.org/draft-04/schema#":e.target,(s=e.external)!=null&&s.uri){let u=(a=e.external.registry.get(t))==null?void 0:a.id;if(!u)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(u)}Object.assign(n,i.def??i.schema);let o=((l=e.external)==null?void 0:l.defs)??{};for(let u of e.seen.entries()){let c=u[1];c.def&&c.defId&&(o[c.defId]=c.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?n.$defs=o:n.definitions=o);try{let u=JSON.parse(JSON.stringify(n));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:dn(t,"input",e.processors),output:dn(t,"output",e.processors)}},enumerable:!1,writable:!1}),u}catch{throw Error("Error converting schema to JSON.")}}function Ue(e,t){let i=t??{seen:new Set};if(i.seen.has(e))return!1;i.seen.add(e);let r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Ue(r.element,i);if(r.type==="set")return Ue(r.valueType,i);if(r.type==="lazy")return Ue(r.getter(),i);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Ue(r.innerType,i);if(r.type==="intersection")return Ue(r.left,i)||Ue(r.right,i);if(r.type==="record"||r.type==="map")return Ue(r.keyType,i)||Ue(r.valueType,i);if(r.type==="pipe")return Ue(r.in,i)||Ue(r.out,i);if(r.type==="object"){for(let n in r.shape)if(Ue(r.shape[n],i))return!0;return!1}if(r.type==="union"){for(let n of r.options)if(Ue(n,i))return!0;return!1}if(r.type==="tuple"){for(let n of r.items)if(Ue(n,i))return!0;return!!(r.rest&&Ue(r.rest,i))}return!1}var $g=(e,t={})=>i=>{let r=Ti({...i,processors:t});return re(e,r),Di(r,e),Ei(r,e)},dn=(e,t,i={})=>r=>{let{libraryOptions:n,target:o}=r??{},s=Ti({...n??{},target:o,io:t,processors:i});return re(e,s),Di(s,e),Ei(s,e)},UO={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},kg=(e,t,i,r)=>{let n=i;n.type="string";let{minimum:o,maximum:s,format:a,patterns:l,contentEncoding:u}=e._zod.bag;if(typeof o=="number"&&(n.minLength=o),typeof s=="number"&&(n.maxLength=s),a&&(n.format=UO[a]??a,n.format===""&&delete n.format,a==="time"&&delete n.format),u&&(n.contentEncoding=u),l&&l.size>0){let c=[...l];c.length===1?n.pattern=c[0].source:c.length>1&&(n.allOf=[...c.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},wg=(e,t,i,r)=>{let n=i,{minimum:o,maximum:s,format:a,multipleOf:l,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;typeof a=="string"&&a.includes("int")?n.type="integer":n.type="number",typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.minimum=c,n.exclusiveMinimum=!0):n.exclusiveMinimum=c),typeof o=="number"&&(n.minimum=o,typeof c=="number"&&t.target!=="draft-04"&&(c>=o?delete n.minimum:delete n.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(n.maximum=u,n.exclusiveMaximum=!0):n.exclusiveMaximum=u),typeof s=="number"&&(n.maximum=s,typeof u=="number"&&t.target!=="draft-04"&&(u<=s?delete n.maximum:delete n.exclusiveMaximum)),typeof l=="number"&&(n.multipleOf=l)},Sg=(e,t,i,r)=>{i.type="boolean"},Ig=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},zg=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},Og=(e,t,i,r)=>{t.target==="openapi-3.0"?(i.type="string",i.nullable=!0,i.enum=[null]):i.type="null"},Pg=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},Tg=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},Dg=(e,t,i,r)=>{i.not={}},Eg=(e,t,i,r)=>{},Mg=(e,t,i,r)=>{},Ng=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},Ag=(e,t,i,r)=>{let n=e._zod.def,o=Da(n.entries);o.every(s=>typeof s=="number")&&(i.type="number"),o.every(s=>typeof s=="string")&&(i.type="string"),i.enum=o},Cg=(e,t,i,r)=>{let n=e._zod.def,o=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s=="bigint"){if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(s))}else o.push(s);if(o.length!==0)if(o.length===1){let s=o[0];i.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0"?i.enum=[s]:i.const=s}else o.every(s=>typeof s=="number")&&(i.type="number"),o.every(s=>typeof s=="string")&&(i.type="string"),o.every(s=>typeof s=="boolean")&&(i.type="boolean"),o.every(s=>s===null)&&(i.type="null"),i.enum=o},Rg=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},jg=(e,t,i,r)=>{let n=i,o=e._zod.pattern;if(!o)throw Error("Pattern not found in template literal");n.type="string",n.pattern=o.source},Zg=(e,t,i,r)=>{let n=i,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:l}=e._zod.bag;s!==void 0&&(o.minLength=s),a!==void 0&&(o.maxLength=a),l?l.length===1?(o.contentMediaType=l[0],Object.assign(n,o)):(Object.assign(n,o),n.anyOf=l.map(u=>({contentMediaType:u}))):Object.assign(n,o)},Ug=(e,t,i,r)=>{i.type="boolean"},Lg=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},Fg=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},Bg=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},Vg=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},Wg=(e,t,i,r)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},Hg=(e,t,i,r)=>{let n=i,o=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;typeof s=="number"&&(n.minItems=s),typeof a=="number"&&(n.maxItems=a),n.type="array",n.items=re(o.element,t,{...r,path:[...r.path,"items"]})},Jg=(e,t,i,r)=>{var u;let n=i,o=e._zod.def;n.type="object",n.properties={};let s=o.shape;for(let c in s)n.properties[c]=re(s[c],t,{...r,path:[...r.path,"properties",c]});let a=new Set(Object.keys(s)),l=new Set([...a].filter(c=>{let d=o.shape[c]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));l.size>0&&(n.required=Array.from(l)),((u=o.catchall)==null?void 0:u._zod.def.type)==="never"?n.additionalProperties=!1:o.catchall?o.catchall&&(n.additionalProperties=re(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(n.additionalProperties=!1)},Ol=(e,t,i,r)=>{let n=e._zod.def,o=n.inclusive===!1,s=n.options.map((a,l)=>re(a,t,{...r,path:[...r.path,o?"oneOf":"anyOf",l]}));o?i.oneOf=s:i.anyOf=s},qg=(e,t,i,r)=>{let n=e._zod.def,o=re(n.left,t,{...r,path:[...r.path,"allOf",0]}),s=re(n.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,l=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];i.allOf=l},Kg=(e,t,i,r)=>{let n=i,o=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",l=o.items.map((f,h)=>re(f,t,{...r,path:[...r.path,s,h]})),u=o.rest?re(o.rest,t,{...r,path:[...r.path,a,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(n.prefixItems=l,u&&(n.items=u)):t.target==="openapi-3.0"?(n.items={anyOf:l},u&&n.items.anyOf.push(u),n.minItems=l.length,!u&&(n.maxItems=l.length)):(n.items=l,u&&(n.additionalItems=u));let{minimum:c,maximum:d}=e._zod.bag;typeof c=="number"&&(n.minItems=c),typeof d=="number"&&(n.maxItems=d)},Xg=(e,t,i,r)=>{var u;let n=i,o=e._zod.def;n.type="object";let s=o.keyType,a=(u=s._zod.bag)==null?void 0:u.patterns;if(o.mode==="loose"&&a&&a.size>0){let c=re(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});n.patternProperties={};for(let d of a)n.patternProperties[d.source]=c}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(n.propertyNames=re(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),n.additionalProperties=re(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});let l=s._zod.values;if(l){let c=[...l].filter(d=>typeof d=="string"||typeof d=="number");c.length>0&&(n.required=c)}},Gg=(e,t,i,r)=>{let n=e._zod.def,o=re(n.innerType,t,r),s=t.seen.get(e);t.target==="openapi-3.0"?(s.ref=n.innerType,i.nullable=!0):i.anyOf=[o,{type:"null"}]},Yg=(e,t,i,r)=>{let n=e._zod.def;re(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType},Qg=(e,t,i,r)=>{let n=e._zod.def;re(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType,i.default=JSON.parse(JSON.stringify(n.defaultValue))},ev=(e,t,i,r)=>{let n=e._zod.def;re(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType,t.io==="input"&&(i._prefault=JSON.parse(JSON.stringify(n.defaultValue)))},tv=(e,t,i,r)=>{let n=e._zod.def;re(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}i.default=s},iv=(e,t,i,r)=>{let n=e._zod.def,o=t.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;re(o,t,r);let s=t.seen.get(e);s.ref=o},nv=(e,t,i,r)=>{let n=e._zod.def;re(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType,i.readOnly=!0},rv=(e,t,i,r)=>{let n=e._zod.def;re(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType},Pl=(e,t,i,r)=>{let n=e._zod.def;re(n.innerType,t,r);let o=t.seen.get(e);o.ref=n.innerType},ov=(e,t,i,r)=>{let n=e._zod.innerType;re(n,t,r);let o=t.seen.get(e);o.ref=n},Us={string:kg,number:wg,boolean:Sg,bigint:Ig,symbol:zg,null:Og,undefined:Pg,void:Tg,never:Dg,any:Eg,unknown:Mg,date:Ng,enum:Ag,literal:Cg,nan:Rg,template_literal:jg,file:Zg,success:Ug,custom:Lg,function:Fg,transform:Bg,map:Vg,set:Wg,array:Hg,object:Jg,union:Ol,intersection:qg,tuple:Kg,record:Xg,nullable:Gg,nonoptional:Yg,default:Qg,prefault:ev,catch:tv,pipe:iv,readonly:nv,promise:rv,optional:Pl,lazy:ov};function sv(e,t){if("_idmap"in e){let r=e,n=Ti({...t,processors:Us}),o={};for(let l of r._idmap.entries()){let[u,c]=l;re(c,n)}let s={},a={registry:r,uri:t==null?void 0:t.uri,defs:o};n.external=a;for(let l of r._idmap.entries()){let[u,c]=l;Di(n,c),s[u]=Ei(n,c)}if(Object.keys(o).length>0){let l=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[l]:o}}return{schemas:s}}let i=Ti({...t,processors:Us});return re(e,i),Di(i,e),Ei(i,e)}class LO{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(t){this.ctx.counter=t}get seen(){return this.ctx.seen}constructor(t){let i=(t==null?void 0:t.target)??"draft-2020-12";i==="draft-4"&&(i="draft-04"),i==="draft-7"&&(i="draft-07"),this.ctx=Ti({processors:Us,target:i,...(t==null?void 0:t.metadata)&&{metadata:t.metadata},...(t==null?void 0:t.unrepresentable)&&{unrepresentable:t.unrepresentable},...(t==null?void 0:t.override)&&{override:t.override},...(t==null?void 0:t.io)&&{io:t.io}})}process(t,i={path:[],schemaPath:[]}){return re(t,this.ctx,i)}emit(t,i){i&&(i.cycles&&(this.ctx.cycles=i.cycles),i.reused&&(this.ctx.reused=i.reused),i.external&&(this.ctx.external=i.external)),Di(this.ctx,t);let r=Ei(this.ctx,t),{"~standard":n,...o}=r;return o}}var FO={},av={};wt(av,{xor:()=>gb,xid:()=>Zv,void:()=>cb,uuidv7:()=>Dv,uuidv6:()=>Tv,uuidv4:()=>Pv,uuid:()=>Ov,url:()=>Ev,unknown:()=>ai,union:()=>ts,undefined:()=>lb,ulid:()=>jv,uint64:()=>sb,uint32:()=>nb,tuple:()=>Yl,transform:()=>ns,templateLiteral:()=>Pb,symbol:()=>ab,superRefine:()=>Su,success:()=>Ib,stringbool:()=>Cb,stringFormat:()=>Xv,string:()=>Xr,strictObject:()=>mb,set:()=>xb,refine:()=>wu,record:()=>Ql,readonly:()=>bu,promise:()=>Tb,preprocess:()=>jb,prefault:()=>du,pipe:()=>pn,partialRecord:()=>bb,optional:()=>hn,object:()=>hb,number:()=>Cl,nullish:()=>Sb,nullable:()=>mn,null:()=>Ll,nonoptional:()=>fu,never:()=>Qo,nativeEnum:()=>$b,nanoid:()=>Av,nan:()=>zb,meta:()=>Nb,map:()=>yb,mac:()=>Fv,looseRecord:()=>_b,looseObject:()=>pb,literal:()=>kb,lazy:()=>xu,ksuid:()=>Uv,keyof:()=>fb,jwt:()=>Kv,json:()=>Rb,ipv6:()=>Bv,ipv4:()=>Lv,intersection:()=>Xl,int64:()=>ob,int32:()=>ib,int:()=>Gr,instanceof:()=>Ab,httpUrl:()=>Mv,hostname:()=>Gv,hex:()=>Yv,hash:()=>Qv,guid:()=>zv,function:()=>Yr,float64:()=>tb,float32:()=>eb,file:()=>wb,exactOptional:()=>su,enum:()=>is,emoji:()=>Nv,email:()=>Iv,e164:()=>qv,discriminatedUnion:()=>vb,describe:()=>Mb,date:()=>db,custom:()=>Eb,cuid2:()=>Rv,cuid:()=>Cv,codec:()=>Ob,cidrv6:()=>Wv,cidrv4:()=>Vv,check:()=>Db,catch:()=>pu,boolean:()=>Rl,bigint:()=>rb,base64url:()=>Jv,base64:()=>Hv,array:()=>Yn,any:()=>ub,_function:()=>Yr,_default:()=>uu,_ZodString:()=>Ao,ZodXor:()=>Jl,ZodXID:()=>Fo,ZodVoid:()=>Wl,ZodUnknown:()=>Bl,ZodUnion:()=>er,ZodUndefined:()=>Zl,ZodUUID:()=>ht,ZodURL:()=>qn,ZodULID:()=>Lo,ZodType:()=>L,ZodTuple:()=>Gl,ZodTransform:()=>ru,ZodTemplateLiteral:()=>_u,ZodSymbol:()=>jl,ZodSuccess:()=>hu,ZodStringFormat:()=>se,ZodString:()=>Jn,ZodSet:()=>tu,ZodRecord:()=>tr,ZodReadonly:()=>vu,ZodPromise:()=>$u,ZodPrefault:()=>cu,ZodPipe:()=>ss,ZodOptional:()=>rs,ZodObject:()=>Qn,ZodNumberFormat:()=>hi,ZodNumber:()=>Kn,ZodNullable:()=>au,ZodNull:()=>Ul,ZodNonOptional:()=>os,ZodNever:()=>Vl,ZodNanoID:()=>jo,ZodNaN:()=>gu,ZodMap:()=>eu,ZodMAC:()=>Al,ZodLiteral:()=>iu,ZodLazy:()=>yu,ZodKSUID:()=>Bo,ZodJWT:()=>Go,ZodIntersection:()=>Kl,ZodIPv6:()=>Wo,ZodIPv4:()=>Vo,ZodGUID:()=>fn,ZodFunction:()=>ku,ZodFile:()=>nu,ZodExactOptional:()=>ou,ZodEnum:()=>Mi,ZodEmoji:()=>Ro,ZodEmail:()=>Co,ZodE164:()=>Xo,ZodDiscriminatedUnion:()=>ql,ZodDefault:()=>lu,ZodDate:()=>es,ZodCustomStringFormat:()=>Ui,ZodCustom:()=>ir,ZodCodec:()=>as,ZodCatch:()=>mu,ZodCUID2:()=>Uo,ZodCUID:()=>Zo,ZodCIDRv6:()=>Jo,ZodCIDRv4:()=>Ho,ZodBoolean:()=>Xn,ZodBigIntFormat:()=>Yo,ZodBigInt:()=>Gn,ZodBase64URL:()=>Ko,ZodBase64:()=>qo,ZodArray:()=>Hl,ZodAny:()=>Fl});var lv={};wt(lv,{uppercase:()=>So,trim:()=>Do,toUpperCase:()=>Mo,toLowerCase:()=>Eo,startsWith:()=>zo,slugify:()=>No,size:()=>Bn,regex:()=>ko,property:()=>zl,positive:()=>kl,overwrite:()=>It,normalize:()=>To,nonpositive:()=>Sl,nonnegative:()=>Il,negative:()=>wl,multipleOf:()=>Pi,minSize:()=>Rt,minLength:()=>si,mime:()=>Po,maxSize:()=>Zi,maxLength:()=>Vn,lte:()=>et,lt:()=>At,lowercase:()=>wo,length:()=>Wn,includes:()=>Io,gte:()=>Fe,gt:()=>Ct,endsWith:()=>Oo});var Tl={};wt(Tl,{time:()=>dv,duration:()=>fv,datetime:()=>uv,date:()=>cv,ZodISOTime:()=>Ml,ZodISODuration:()=>Nl,ZodISODateTime:()=>Dl,ZodISODate:()=>El});var Dl=_("ZodISODateTime",(e,t)=>{Om.init(e,t),se.init(e,t)});function uv(e){return Up(Dl,e)}var El=_("ZodISODate",(e,t)=>{Pm.init(e,t),se.init(e,t)});function cv(e){return Lp(El,e)}var Ml=_("ZodISOTime",(e,t)=>{Tm.init(e,t),se.init(e,t)});function dv(e){return Fp(Ml,e)}var Nl=_("ZodISODuration",(e,t)=>{Dm.init(e,t),se.init(e,t)});function fv(e){return Bp(Nl,e)}var hv=(e,t)=>{Ma.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:i=>Aa(e,i)},flatten:{value:i=>Na(e,i)},addIssue:{value:i=>{e.issues.push(i),e.message=JSON.stringify(e.issues,Wr,2)}},addIssues:{value:i=>{e.issues.push(...i),e.message=JSON.stringify(e.issues,Wr,2)}},isEmpty:{get(){return e.issues.length===0}}})},BO=_("ZodError",hv),Ge=_("ZodError",hv,{Parent:Error}),mv=An(Ge),pv=Cn(Ge),gv=Rn(Ge),vv=jn(Ge),bv=Ca(Ge),_v=Ra(Ge),yv=ja(Ge),xv=Za(Ge),$v=Ua(Ge),kv=La(Ge),wv=Fa(Ge),Sv=Ba(Ge),L=_("ZodType",(e,t)=>(U.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:dn(e,"input"),output:dn(e,"output")}}),e.toJSONSchema=$g(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...i)=>e.clone(W.mergeDefs(t,{checks:[...t.checks??[],...i.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(i,r)=>ot(e,i,r),e.brand=()=>e,e.register=(i,r)=>(i.add(e,r),e),e.parse=(i,r)=>mv(e,i,r,{callee:e.parse}),e.safeParse=(i,r)=>gv(e,i,r),e.parseAsync=async(i,r)=>pv(e,i,r,{callee:e.parseAsync}),e.safeParseAsync=async(i,r)=>vv(e,i,r),e.spa=e.safeParseAsync,e.encode=(i,r)=>bv(e,i,r),e.decode=(i,r)=>_v(e,i,r),e.encodeAsync=async(i,r)=>yv(e,i,r),e.decodeAsync=async(i,r)=>xv(e,i,r),e.safeEncode=(i,r)=>$v(e,i,r),e.safeDecode=(i,r)=>kv(e,i,r),e.safeEncodeAsync=async(i,r)=>wv(e,i,r),e.safeDecodeAsync=async(i,r)=>Sv(e,i,r),e.refine=(i,r)=>e.check(wu(i,r)),e.superRefine=i=>e.check(Su(i)),e.overwrite=i=>e.check(It(i)),e.optional=()=>hn(e),e.exactOptional=()=>su(e),e.nullable=()=>mn(e),e.nullish=()=>hn(mn(e)),e.nonoptional=i=>fu(e,i),e.array=()=>Yn(e),e.or=i=>ts([e,i]),e.and=i=>Xl(e,i),e.transform=i=>pn(e,ns(i)),e.default=i=>uu(e,i),e.prefault=i=>du(e,i),e.catch=i=>pu(e,i),e.pipe=i=>pn(e,i),e.readonly=()=>bu(e),e.describe=i=>{let r=e.clone();return Qe.add(r,{description:i}),r},Object.defineProperty(e,"description",{get(){var i;return(i=Qe.get(e))==null?void 0:i.description},configurable:!0}),e.meta=(...i)=>{if(i.length===0)return Qe.get(e);let r=e.clone();return Qe.add(r,i[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=i=>i(e),e)),Ao=_("_ZodString",(e,t)=>{Fn.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>kg(e,r,n);let i=e._zod.bag;e.format=i.format??null,e.minLength=i.minimum??null,e.maxLength=i.maximum??null,e.regex=(...r)=>e.check(ko(...r)),e.includes=(...r)=>e.check(Io(...r)),e.startsWith=(...r)=>e.check(zo(...r)),e.endsWith=(...r)=>e.check(Oo(...r)),e.min=(...r)=>e.check(si(...r)),e.max=(...r)=>e.check(Vn(...r)),e.length=(...r)=>e.check(Wn(...r)),e.nonempty=(...r)=>e.check(si(1,...r)),e.lowercase=r=>e.check(wo(r)),e.uppercase=r=>e.check(So(r)),e.trim=()=>e.check(Do()),e.normalize=(...r)=>e.check(To(...r)),e.toLowerCase=()=>e.check(Eo()),e.toUpperCase=()=>e.check(Mo()),e.slugify=()=>e.check(No())}),Jn=_("ZodString",(e,t)=>{Fn.init(e,t),Ao.init(e,t),e.email=i=>e.check(nl(Co,i)),e.url=i=>e.check($o(qn,i)),e.jwt=i=>e.check($l(Go,i)),e.emoji=i=>e.check(ll(Ro,i)),e.guid=i=>e.check(Kr(fn,i)),e.uuid=i=>e.check(rl(ht,i)),e.uuidv4=i=>e.check(ol(ht,i)),e.uuidv6=i=>e.check(sl(ht,i)),e.uuidv7=i=>e.check(al(ht,i)),e.nanoid=i=>e.check(ul(jo,i)),e.guid=i=>e.check(Kr(fn,i)),e.cuid=i=>e.check(cl(Zo,i)),e.cuid2=i=>e.check(dl(Uo,i)),e.ulid=i=>e.check(fl(Lo,i)),e.base64=i=>e.check(_l(qo,i)),e.base64url=i=>e.check(yl(Ko,i)),e.xid=i=>e.check(hl(Fo,i)),e.ksuid=i=>e.check(ml(Bo,i)),e.ipv4=i=>e.check(pl(Vo,i)),e.ipv6=i=>e.check(gl(Wo,i)),e.cidrv4=i=>e.check(vl(Ho,i)),e.cidrv6=i=>e.check(bl(Jo,i)),e.e164=i=>e.check(xl(Xo,i)),e.datetime=i=>e.check(uv(i)),e.date=i=>e.check(cv(i)),e.time=i=>e.check(dv(i)),e.duration=i=>e.check(fv(i))});function Xr(e){return Cp(Jn,e)}var se=_("ZodStringFormat",(e,t)=>{oe.init(e,t),Ao.init(e,t)}),Co=_("ZodEmail",(e,t)=>{_m.init(e,t),se.init(e,t)});function Iv(e){return nl(Co,e)}var fn=_("ZodGUID",(e,t)=>{vm.init(e,t),se.init(e,t)});function zv(e){return Kr(fn,e)}var ht=_("ZodUUID",(e,t)=>{bm.init(e,t),se.init(e,t)});function Ov(e){return rl(ht,e)}function Pv(e){return ol(ht,e)}function Tv(e){return sl(ht,e)}function Dv(e){return al(ht,e)}var qn=_("ZodURL",(e,t)=>{ym.init(e,t),se.init(e,t)});function Ev(e){return $o(qn,e)}function Mv(e){return $o(qn,{protocol:/^https?$/,hostname:fi.domain,...W.normalizeParams(e)})}var Ro=_("ZodEmoji",(e,t)=>{xm.init(e,t),se.init(e,t)});function Nv(e){return ll(Ro,e)}var jo=_("ZodNanoID",(e,t)=>{$m.init(e,t),se.init(e,t)});function Av(e){return ul(jo,e)}var Zo=_("ZodCUID",(e,t)=>{km.init(e,t),se.init(e,t)});function Cv(e){return cl(Zo,e)}var Uo=_("ZodCUID2",(e,t)=>{wm.init(e,t),se.init(e,t)});function Rv(e){return dl(Uo,e)}var Lo=_("ZodULID",(e,t)=>{Sm.init(e,t),se.init(e,t)});function jv(e){return fl(Lo,e)}var Fo=_("ZodXID",(e,t)=>{Im.init(e,t),se.init(e,t)});function Zv(e){return hl(Fo,e)}var Bo=_("ZodKSUID",(e,t)=>{zm.init(e,t),se.init(e,t)});function Uv(e){return ml(Bo,e)}var Vo=_("ZodIPv4",(e,t)=>{Em.init(e,t),se.init(e,t)});function Lv(e){return pl(Vo,e)}var Al=_("ZodMAC",(e,t)=>{Nm.init(e,t),se.init(e,t)});function Fv(e){return jp(Al,e)}var Wo=_("ZodIPv6",(e,t)=>{Mm.init(e,t),se.init(e,t)});function Bv(e){return gl(Wo,e)}var Ho=_("ZodCIDRv4",(e,t)=>{Am.init(e,t),se.init(e,t)});function Vv(e){return vl(Ho,e)}var Jo=_("ZodCIDRv6",(e,t)=>{Cm.init(e,t),se.init(e,t)});function Wv(e){return bl(Jo,e)}var qo=_("ZodBase64",(e,t)=>{Rm.init(e,t),se.init(e,t)});function Hv(e){return _l(qo,e)}var Ko=_("ZodBase64URL",(e,t)=>{Zm.init(e,t),se.init(e,t)});function Jv(e){return yl(Ko,e)}var Xo=_("ZodE164",(e,t)=>{Um.init(e,t),se.init(e,t)});function qv(e){return xl(Xo,e)}var Go=_("ZodJWT",(e,t)=>{Fm.init(e,t),se.init(e,t)});function Kv(e){return $l(Go,e)}var Ui=_("ZodCustomStringFormat",(e,t)=>{Bm.init(e,t),se.init(e,t)});function Xv(e,t,i={}){return Hn(Ui,e,t,i)}function Gv(e){return Hn(Ui,"hostname",fi.hostname,e)}function Yv(e){return Hn(Ui,"hex",fi.hex,e)}function Qv(e,t){let i=(t==null?void 0:t.enc)??"hex",r=`${e}_${i}`,n=fi[r];if(!n)throw Error(`Unrecognized hash format: ${r}`);return Hn(Ui,r,n,t)}var Kn=_("ZodNumber",(e,t)=>{Ka.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wg(e,r,n),e.gt=(r,n)=>e.check(Ct(r,n)),e.gte=(r,n)=>e.check(Fe(r,n)),e.min=(r,n)=>e.check(Fe(r,n)),e.lt=(r,n)=>e.check(At(r,n)),e.lte=(r,n)=>e.check(et(r,n)),e.max=(r,n)=>e.check(et(r,n)),e.int=r=>e.check(Gr(r)),e.safe=r=>e.check(Gr(r)),e.positive=r=>e.check(Ct(0,r)),e.nonnegative=r=>e.check(Fe(0,r)),e.negative=r=>e.check(At(0,r)),e.nonpositive=r=>e.check(et(0,r)),e.multipleOf=(r,n)=>e.check(Pi(r,n)),e.step=(r,n)=>e.check(Pi(r,n)),e.finite=()=>e;let i=e._zod.bag;e.minValue=Math.max(i.minimum??Number.NEGATIVE_INFINITY,i.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(i.maximum??Number.POSITIVE_INFINITY,i.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(i.format??"").includes("int")||Number.isSafeInteger(i.multipleOf??.5),e.isFinite=!0,e.format=i.format??null});function Cl(e){return Vp(Kn,e)}var hi=_("ZodNumberFormat",(e,t)=>{Vm.init(e,t),Kn.init(e,t)});function Gr(e){return Hp(hi,e)}function eb(e){return Jp(hi,e)}function tb(e){return qp(hi,e)}function ib(e){return Kp(hi,e)}function nb(e){return Xp(hi,e)}var Xn=_("ZodBoolean",(e,t)=>{Xa.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Sg(e,i,r)});function Rl(e){return Gp(Xn,e)}var Gn=_("ZodBigInt",(e,t)=>{Ga.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ig(e,r),e.gte=(r,n)=>e.check(Fe(r,n)),e.min=(r,n)=>e.check(Fe(r,n)),e.gt=(r,n)=>e.check(Ct(r,n)),e.gte=(r,n)=>e.check(Fe(r,n)),e.min=(r,n)=>e.check(Fe(r,n)),e.lt=(r,n)=>e.check(At(r,n)),e.lte=(r,n)=>e.check(et(r,n)),e.max=(r,n)=>e.check(et(r,n)),e.positive=r=>e.check(Ct(BigInt(0),r)),e.negative=r=>e.check(At(BigInt(0),r)),e.nonpositive=r=>e.check(et(BigInt(0),r)),e.nonnegative=r=>e.check(Fe(BigInt(0),r)),e.multipleOf=(r,n)=>e.check(Pi(r,n));let i=e._zod.bag;e.minValue=i.minimum??null,e.maxValue=i.maximum??null,e.format=i.format??null});function rb(e){return Qp(Gn,e)}var Yo=_("ZodBigIntFormat",(e,t)=>{Wm.init(e,t),Gn.init(e,t)});function ob(e){return tg(Yo,e)}function sb(e){return ig(Yo,e)}var jl=_("ZodSymbol",(e,t)=>{Hm.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>zg(e,i)});function ab(e){return ng(jl,e)}var Zl=_("ZodUndefined",(e,t)=>{Jm.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Pg(e,i)});function lb(e){return rg(Zl,e)}var Ul=_("ZodNull",(e,t)=>{qm.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Og(e,i,r)});function Ll(e){return og(Ul,e)}var Fl=_("ZodAny",(e,t)=>{Km.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Eg()});function ub(){return sg(Fl)}var Bl=_("ZodUnknown",(e,t)=>{Xm.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Mg()});function ai(){return ag(Bl)}var Vl=_("ZodNever",(e,t)=>{Gm.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Dg(e,i,r)});function Qo(e){return lg(Vl,e)}var Wl=_("ZodVoid",(e,t)=>{Ym.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Tg(e,i)});function cb(e){return ug(Wl,e)}var es=_("ZodDate",(e,t)=>{Qm.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ng(e,r),e.min=(r,n)=>e.check(Fe(r,n)),e.max=(r,n)=>e.check(et(r,n));let i=e._zod.bag;e.minDate=i.minimum?new Date(i.minimum):null,e.maxDate=i.maximum?new Date(i.maximum):null});function db(e){return cg(es,e)}var Hl=_("ZodArray",(e,t)=>{ep.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Hg(e,i,r,n),e.element=t.element,e.min=(i,r)=>e.check(si(i,r)),e.nonempty=i=>e.check(si(1,i)),e.max=(i,r)=>e.check(Vn(i,r)),e.length=(i,r)=>e.check(Wn(i,r)),e.unwrap=()=>e.element});function Yn(e,t){return hg(Hl,e,t)}function fb(e){let t=e._zod.def.shape;return is(Object.keys(t))}var Qn=_("ZodObject",(e,t)=>{rp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Jg(e,i,r,n),W.defineLazy(e,"shape",()=>t.shape),e.keyof=()=>is(Object.keys(e._zod.def.shape)),e.catchall=i=>e.clone({...e._zod.def,catchall:i}),e.passthrough=()=>e.clone({...e._zod.def,catchall:ai()}),e.loose=()=>e.clone({...e._zod.def,catchall:ai()}),e.strict=()=>e.clone({...e._zod.def,catchall:Qo()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=i=>W.extend(e,i),e.safeExtend=i=>W.safeExtend(e,i),e.merge=i=>W.merge(e,i),e.pick=i=>W.pick(e,i),e.omit=i=>W.omit(e,i),e.partial=(...i)=>W.partial(rs,e,i[0]),e.required=(...i)=>W.required(os,e,i[0])});function hb(e,t){let i={type:"object",shape:e??{},...W.normalizeParams(t)};return new Qn(i)}function mb(e,t){return new Qn({type:"object",shape:e,catchall:Qo(),...W.normalizeParams(t)})}function pb(e,t){return new Qn({type:"object",shape:e,catchall:ai(),...W.normalizeParams(t)})}var er=_("ZodUnion",(e,t)=>{xo.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Ol(e,i,r,n),e.options=t.options});function ts(e,t){return new er({type:"union",options:e,...W.normalizeParams(t)})}var Jl=_("ZodXor",(e,t)=>{er.init(e,t),op.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Ol(e,i,r,n),e.options=t.options});function gb(e,t){return new Jl({type:"union",options:e,inclusive:!1,...W.normalizeParams(t)})}var ql=_("ZodDiscriminatedUnion",(e,t)=>{er.init(e,t),sp.init(e,t)});function vb(e,t,i){return new ql({type:"union",options:t,discriminator:e,...W.normalizeParams(i)})}var Kl=_("ZodIntersection",(e,t)=>{ap.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>qg(e,i,r,n)});function Xl(e,t){return new Kl({type:"intersection",left:e,right:t})}var Gl=_("ZodTuple",(e,t)=>{Ya.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Kg(e,i,r,n),e.rest=i=>e.clone({...e._zod.def,rest:i})});function Yl(e,t,i){let r=t instanceof U,n=r?i:t;return new Gl({type:"tuple",items:e,rest:r?t:null,...W.normalizeParams(n)})}var tr=_("ZodRecord",(e,t)=>{lp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Xg(e,i,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function Ql(e,t,i){return new tr({type:"record",keyType:e,valueType:t,...W.normalizeParams(i)})}function bb(e,t,i){let r=ot(e);return r._zod.values=void 0,new tr({type:"record",keyType:r,valueType:t,...W.normalizeParams(i)})}function _b(e,t,i){return new tr({type:"record",keyType:e,valueType:t,mode:"loose",...W.normalizeParams(i)})}var eu=_("ZodMap",(e,t)=>{up.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Vg(e,i),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...i)=>e.check(Rt(...i)),e.nonempty=i=>e.check(Rt(1,i)),e.max=(...i)=>e.check(Zi(...i)),e.size=(...i)=>e.check(Bn(...i))});function yb(e,t,i){return new eu({type:"map",keyType:e,valueType:t,...W.normalizeParams(i)})}var tu=_("ZodSet",(e,t)=>{cp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Wg(e,i),e.min=(...i)=>e.check(Rt(...i)),e.nonempty=i=>e.check(Rt(1,i)),e.max=(...i)=>e.check(Zi(...i)),e.size=(...i)=>e.check(Bn(...i))});function xb(e,t){return new tu({type:"set",valueType:e,...W.normalizeParams(t)})}var Mi=_("ZodEnum",(e,t)=>{dp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ag(e,r,n),e.enum=t.entries,e.options=Object.values(t.entries);let i=new Set(Object.keys(t.entries));e.extract=(r,n)=>{let o={};for(let s of r)if(i.has(s))o[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new Mi({...t,checks:[],...W.normalizeParams(n),entries:o})},e.exclude=(r,n)=>{let o={...t.entries};for(let s of r)if(i.has(s))delete o[s];else throw Error(`Key ${s} not found in enum`);return new Mi({...t,checks:[],...W.normalizeParams(n),entries:o})}});function is(e,t){let i=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Mi({type:"enum",entries:i,...W.normalizeParams(t)})}function $b(e,t){return new Mi({type:"enum",entries:e,...W.normalizeParams(t)})}var iu=_("ZodLiteral",(e,t)=>{fp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Cg(e,i,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function kb(e,t){return new iu({type:"literal",values:Array.isArray(e)?e:[e],...W.normalizeParams(t)})}var nu=_("ZodFile",(e,t)=>{hp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Zg(e,i,r),e.min=(i,r)=>e.check(Rt(i,r)),e.max=(i,r)=>e.check(Zi(i,r)),e.mime=(i,r)=>e.check(Po(Array.isArray(i)?i:[i],r))});function wb(e){return mg(nu,e)}var ru=_("ZodTransform",(e,t)=>{mp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Bg(e,i),e._zod.parse=(i,r)=>{if(r.direction==="backward")throw new vo(e.constructor.name);i.addIssue=o=>{if(typeof o=="string")i.issues.push(W.issue(o,i.value,t));else{let s=o;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=i.value),s.inst??(s.inst=e),i.issues.push(W.issue(s))}};let n=t.transform(i.value,i);return n instanceof Promise?n.then(o=>(i.value=o,i)):(i.value=n,i)}});function ns(e){return new ru({type:"transform",transform:e})}var rs=_("ZodOptional",(e,t)=>{Qa.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Pl(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function hn(e){return new rs({type:"optional",innerType:e})}var ou=_("ZodExactOptional",(e,t)=>{pp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Pl(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function su(e){return new ou({type:"optional",innerType:e})}var au=_("ZodNullable",(e,t)=>{gp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Gg(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function mn(e){return new au({type:"nullable",innerType:e})}function Sb(e){return hn(mn(e))}var lu=_("ZodDefault",(e,t)=>{vp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Qg(e,i,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function uu(e,t){return new lu({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():W.shallowClone(t)}})}var cu=_("ZodPrefault",(e,t)=>{bp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>ev(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function du(e,t){return new cu({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():W.shallowClone(t)}})}var os=_("ZodNonOptional",(e,t)=>{_p.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Yg(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function fu(e,t){return new os({type:"nonoptional",innerType:e,...W.normalizeParams(t)})}var hu=_("ZodSuccess",(e,t)=>{yp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Ug(e,i,r),e.unwrap=()=>e._zod.def.innerType});function Ib(e){return new hu({type:"success",innerType:e})}var mu=_("ZodCatch",(e,t)=>{xp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>tv(e,i,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function pu(e,t){return new mu({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}var gu=_("ZodNaN",(e,t)=>{$p.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Rg(e,i)});function zb(e){return fg(gu,e)}var ss=_("ZodPipe",(e,t)=>{kp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>iv(e,i,r,n),e.in=t.in,e.out=t.out});function pn(e,t){return new ss({type:"pipe",in:e,out:t})}var as=_("ZodCodec",(e,t)=>{ss.init(e,t),el.init(e,t)});function Ob(e,t,i){return new as({type:"pipe",in:e,out:t,transform:i.decode,reverseTransform:i.encode})}var vu=_("ZodReadonly",(e,t)=>{wp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>nv(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function bu(e){return new vu({type:"readonly",innerType:e})}var _u=_("ZodTemplateLiteral",(e,t)=>{Sp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>jg(e,i,r)});function Pb(e,t){return new _u({type:"template_literal",parts:e,...W.normalizeParams(t)})}var yu=_("ZodLazy",(e,t)=>{Op.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>ov(e,i,r,n),e.unwrap=()=>e._zod.def.getter()});function xu(e){return new yu({type:"lazy",getter:e})}var $u=_("ZodPromise",(e,t)=>{zp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>rv(e,i,r,n),e.unwrap=()=>e._zod.def.innerType});function Tb(e){return new $u({type:"promise",innerType:e})}var ku=_("ZodFunction",(e,t)=>{Ip.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Fg(e,i)});function Yr(e){return new ku({type:"function",input:Array.isArray(e==null?void 0:e.input)?Yl(e==null?void 0:e.input):(e==null?void 0:e.input)??Yn(ai()),output:(e==null?void 0:e.output)??ai()})}var ir=_("ZodCustom",(e,t)=>{Pp.init(e,t),L.init(e,t),e._zod.processJSONSchema=(i,r,n)=>Lg(e,i)});function Db(e){let t=new ge({check:"custom"});return t._zod.check=e,t}function Eb(e,t){return pg(ir,e??(()=>!0),t)}function wu(e,t={}){return gg(ir,e,t)}function Su(e){return vg(e)}var Mb=_g,Nb=yg;function Ab(e,t={}){let i=new ir({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...W.normalizeParams(t)});return i._zod.bag.Class=e,i._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:i,path:[...i._zod.def.path??[]]})},i}var Cb=(...e)=>xg({Codec:as,Boolean:Xn,String:Jn},...e);function Rb(e){let t=xu(()=>ts([Xr(e),Cl(),Rl(),Ll(),Yn(t),Ql(Xr(),t)]));return t}function jb(e,t){return pn(ns(e),t)}var VO={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function WO(e){Re({customError:e})}function HO(){return Re().customError}var Ls;Ls||(Ls={});var E={...av,...lv,iso:Tl},JO=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function qO(e,t){let i=e.$schema;return i==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":i==="http://json-schema.org/draft-07/schema#"?"draft-7":i==="http://json-schema.org/draft-04/schema#"?"draft-4":t??"draft-2020-12"}function KO(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let i=e.slice(1).split("/").filter(Boolean);if(i.length===0)return t.rootSchema;let r=t.version==="draft-2020-12"?"$defs":"definitions";if(i[0]===r){let n=i[1];if(!n||!t.defs[n])throw Error(`Reference not found: ${e}`);return t.defs[n]}throw Error(`Reference not found: ${e}`)}function Zb(e,t){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return E.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return E.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let o=KO(n,t),s=Me(o,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return E.null();if(n.length===0)return E.never();if(n.length===1)return E.literal(n[0]);if(n.every(s=>typeof s=="string"))return E.enum(n);let o=n.map(s=>E.literal(s));return o.length<2?o[0]:E.union([o[0],o[1],...o.slice(2)])}if(e.const!==void 0)return E.literal(e.const);let i=e.type;if(Array.isArray(i)){let n=i.map(o=>{let s={...e,type:o};return Zb(s,t)});return n.length===0?E.never():n.length===1?n[0]:E.union(n)}if(!i)return E.any();let r;switch(i){case"string":{let n=E.string();if(e.format){let o=e.format;o==="email"?n=n.check(E.email()):o==="uri"||o==="uri-reference"?n=n.check(E.url()):o==="uuid"||o==="guid"?n=n.check(E.uuid()):o==="date-time"?n=n.check(E.iso.datetime()):o==="date"?n=n.check(E.iso.date()):o==="time"?n=n.check(E.iso.time()):o==="duration"?n=n.check(E.iso.duration()):o==="ipv4"?n=n.check(E.ipv4()):o==="ipv6"?n=n.check(E.ipv6()):o==="mac"?n=n.check(E.mac()):o==="cidr"?n=n.check(E.cidrv4()):o==="cidr-v6"?n=n.check(E.cidrv6()):o==="base64"?n=n.check(E.base64()):o==="base64url"?n=n.check(E.base64url()):o==="e164"?n=n.check(E.e164()):o==="jwt"?n=n.check(E.jwt()):o==="emoji"?n=n.check(E.emoji()):o==="nanoid"?n=n.check(E.nanoid()):o==="cuid"?n=n.check(E.cuid()):o==="cuid2"?n=n.check(E.cuid2()):o==="ulid"?n=n.check(E.ulid()):o==="xid"?n=n.check(E.xid()):o==="ksuid"&&(n=n.check(E.ksuid()))}typeof e.minLength=="number"&&(n=n.min(e.minLength)),typeof e.maxLength=="number"&&(n=n.max(e.maxLength)),e.pattern&&(n=n.regex(new RegExp(e.pattern))),r=n;break}case"number":case"integer":{let n=i==="integer"?E.number().int():E.number();typeof e.minimum=="number"&&(n=n.min(e.minimum)),typeof e.maximum=="number"&&(n=n.max(e.maximum)),typeof e.exclusiveMinimum=="number"?n=n.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(n=n.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?n=n.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(n=n.lt(e.maximum)),typeof e.multipleOf=="number"&&(n=n.multipleOf(e.multipleOf)),r=n;break}case"boolean":{r=E.boolean();break}case"null":{r=E.null();break}case"object":{let n={},o=e.properties||{},s=new Set(e.required||[]);for(let[l,u]of Object.entries(o)){let c=Me(u,t);n[l]=s.has(l)?c:c.optional()}if(e.propertyNames){let l=Me(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties=="object"?Me(e.additionalProperties,t):E.any();if(Object.keys(n).length===0){r=E.record(l,u);break}let c=E.object(n).passthrough(),d=E.looseRecord(l,u);r=E.intersection(c,d);break}if(e.patternProperties){let l=e.patternProperties,u=Object.keys(l),c=[];for(let f of u){let h=Me(l[f],t),m=E.string().regex(new RegExp(f));c.push(E.looseRecord(m,h))}let d=[];if(Object.keys(n).length>0&&d.push(E.object(n).passthrough()),d.push(...c),d.length===0)r=E.object({}).passthrough();else if(d.length===1)r=d[0];else{let f=E.intersection(d[0],d[1]);for(let h=2;h<d.length;h++)f=E.intersection(f,d[h]);r=f}break}let a=E.object(n);e.additionalProperties===!1?r=a.strict():typeof e.additionalProperties=="object"?r=a.catchall(Me(e.additionalProperties,t)):r=a.passthrough();break}case"array":{let{prefixItems:n,items:o}=e;if(n&&Array.isArray(n)){let s=n.map(l=>Me(l,t)),a=o&&typeof o=="object"&&!Array.isArray(o)?Me(o,t):void 0;a?r=E.tuple(s).rest(a):r=E.tuple(s),typeof e.minItems=="number"&&(r=r.check(E.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(E.maxLength(e.maxItems)))}else if(Array.isArray(o)){let s=o.map(l=>Me(l,t)),a=e.additionalItems&&typeof e.additionalItems=="object"?Me(e.additionalItems,t):void 0;a?r=E.tuple(s).rest(a):r=E.tuple(s),typeof e.minItems=="number"&&(r=r.check(E.minLength(e.minItems))),typeof e.maxItems=="number"&&(r=r.check(E.maxLength(e.maxItems)))}else if(o!==void 0){let s=Me(o,t),a=E.array(s);typeof e.minItems=="number"&&(a=a.min(e.minItems)),typeof e.maxItems=="number"&&(a=a.max(e.maxItems)),r=a}else r=E.array(E.any());break}default:throw Error(`Unsupported type: ${i}`)}return e.description&&(r=r.describe(e.description)),e.default!==void 0&&(r=r.default(e.default)),r}function Me(e,t){if(typeof e=="boolean")return e?E.any():E.never();let i=Zb(e,t),r=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map(u=>Me(u,t)),l=E.union(a);i=r?E.intersection(i,l):l}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map(u=>Me(u,t)),l=E.xor(a);i=r?E.intersection(i,l):l}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)i=r?i:E.any();else{let a=r?i:Me(e.allOf[0],t),l=r?0:1;for(let u=l;u<e.allOf.length;u++)a=E.intersection(a,Me(e.allOf[u],t));i=a}e.nullable===!0&&t.version==="openapi-3.0"&&(i=E.nullable(i)),e.readOnly===!0&&(i=E.readonly(i));let n={},o=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of o)a in e&&(n[a]=e[a]);let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)a in e&&(n[a]=e[a]);for(let a of Object.keys(e))JO.has(a)||(n[a]=e[a]);return Object.keys(n).length>0&&t.registry.add(i,n),i}function XO(e,t){if(typeof e=="boolean")return e?E.any():E.never();let i=qO(e,t==null?void 0:t.defaultTarget),r=e.$defs||e.definitions||{},n={version:i,defs:r,refs:new Map,processing:new Set,rootSchema:e,registry:(t==null?void 0:t.registry)??Qe};return Me(e,n)}var Ub={};wt(Ub,{string:()=>GO,number:()=>YO,date:()=>tP,boolean:()=>QO,bigint:()=>eP});function GO(e){return Rp(Jn,e)}function YO(e){return Wp(Kn,e)}function QO(e){return Yp(Xn,e)}function eP(e){return eg(Gn,e)}function tP(e){return dg(es,e)}Re(Tp());var iP=v.union([v.literal("light"),v.literal("dark")]).describe("Color theme preference for the host environment."),Iu=v.union([v.literal("inline"),v.literal("fullscreen"),v.literal("pip")]).describe("Display mode for UI presentation."),nP=v.union([v.literal("--color-background-primary"),v.literal("--color-background-secondary"),v.literal("--color-background-tertiary"),v.literal("--color-background-inverse"),v.literal("--color-background-ghost"),v.literal("--color-background-info"),v.literal("--color-background-danger"),v.literal("--color-background-success"),v.literal("--color-background-warning"),v.literal("--color-background-disabled"),v.literal("--color-text-primary"),v.literal("--color-text-secondary"),v.literal("--color-text-tertiary"),v.literal("--color-text-inverse"),v.literal("--color-text-ghost"),v.literal("--color-text-info"),v.literal("--color-text-danger"),v.literal("--color-text-success"),v.literal("--color-text-warning"),v.literal("--color-text-disabled"),v.literal("--color-text-ghost"),v.literal("--color-border-primary"),v.literal("--color-border-secondary"),v.literal("--color-border-tertiary"),v.literal("--color-border-inverse"),v.literal("--color-border-ghost"),v.literal("--color-border-info"),v.literal("--color-border-danger"),v.literal("--color-border-success"),v.literal("--color-border-warning"),v.literal("--color-border-disabled"),v.literal("--color-ring-primary"),v.literal("--color-ring-secondary"),v.literal("--color-ring-inverse"),v.literal("--color-ring-info"),v.literal("--color-ring-danger"),v.literal("--color-ring-success"),v.literal("--color-ring-warning"),v.literal("--font-sans"),v.literal("--font-mono"),v.literal("--font-weight-normal"),v.literal("--font-weight-medium"),v.literal("--font-weight-semibold"),v.literal("--font-weight-bold"),v.literal("--font-text-xs-size"),v.literal("--font-text-sm-size"),v.literal("--font-text-md-size"),v.literal("--font-text-lg-size"),v.literal("--font-heading-xs-size"),v.literal("--font-heading-sm-size"),v.literal("--font-heading-md-size"),v.literal("--font-heading-lg-size"),v.literal("--font-heading-xl-size"),v.literal("--font-heading-2xl-size"),v.literal("--font-heading-3xl-size"),v.literal("--font-text-xs-line-height"),v.literal("--font-text-sm-line-height"),v.literal("--font-text-md-line-height"),v.literal("--font-text-lg-line-height"),v.literal("--font-heading-xs-line-height"),v.literal("--font-heading-sm-line-height"),v.literal("--font-heading-md-line-height"),v.literal("--font-heading-lg-line-height"),v.literal("--font-heading-xl-line-height"),v.literal("--font-heading-2xl-line-height"),v.literal("--font-heading-3xl-line-height"),v.literal("--border-radius-xs"),v.literal("--border-radius-sm"),v.literal("--border-radius-md"),v.literal("--border-radius-lg"),v.literal("--border-radius-xl"),v.literal("--border-radius-full"),v.literal("--border-width-regular"),v.literal("--shadow-hairline"),v.literal("--shadow-sm"),v.literal("--shadow-md"),v.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),rP=v.record(nP.describe(`Style variables for theming MCP apps.
86
+
87
+ Individual style keys are optional - hosts may provide any subset of these values.
88
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
89
+
90
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
91
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),v.union([v.string(),v.undefined()]).describe(`Style variables for theming MCP apps.
92
+
93
+ Individual style keys are optional - hosts may provide any subset of these values.
94
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
95
+
96
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
97
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps.
98
+
99
+ Individual style keys are optional - hosts may provide any subset of these values.
100
+ Values are strings containing CSS values (colors, sizes, font stacks, etc.).
101
+
102
+ Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
103
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`);v.object({method:v.literal("ui/open-link"),params:v.object({url:v.string().describe("URL to open in the host's browser")})});var oP=v.object({isError:v.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),sP=v.object({isError:v.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough();v.object({method:v.literal("ui/notifications/sandbox-proxy-ready"),params:v.object({})});var zu=v.object({connectDomains:v.array(v.string()).optional().describe("Origins for network requests (fetch/XHR/WebSocket)."),resourceDomains:v.array(v.string()).optional().describe("Origins for static resources (scripts, images, styles, fonts)."),frameDomains:v.array(v.string()).optional().describe("Origins for nested iframes (frame-src directive)."),baseUriDomains:v.array(v.string()).optional().describe("Allowed base URIs for the document (base-uri directive).")}),Ou=v.object({camera:v.object({}).optional().describe("Request camera access (Permission Policy `camera` feature)."),microphone:v.object({}).optional().describe("Request microphone access (Permission Policy `microphone` feature)."),geolocation:v.object({}).optional().describe("Request geolocation access (Permission Policy `geolocation` feature)."),clipboardWrite:v.object({}).optional().describe("Request clipboard write access (Permission Policy `clipboard-write` feature).")});v.object({method:v.literal("ui/notifications/size-changed"),params:v.object({width:v.number().optional().describe("New width in pixels."),height:v.number().optional().describe("New height in pixels.")})});var aP=v.object({method:v.literal("ui/notifications/tool-input"),params:v.object({arguments:v.record(v.string(),v.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),lP=v.object({method:v.literal("ui/notifications/tool-input-partial"),params:v.object({arguments:v.record(v.string(),v.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),uP=v.object({method:v.literal("ui/notifications/tool-cancelled"),params:v.object({reason:v.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),cP=v.object({fonts:v.string().optional()}),dP=v.object({variables:rP.optional().describe("CSS variables for theming the app."),css:cP.optional().describe("CSS blocks that apps can inject.")}),fP=v.object({method:v.literal("ui/resource-teardown"),params:v.object({})});v.record(v.string(),v.unknown());var Dc=v.object({text:v.object({}).optional().describe("Host supports text content blocks."),image:v.object({}).optional().describe("Host supports image content blocks."),audio:v.object({}).optional().describe("Host supports audio content blocks."),resource:v.object({}).optional().describe("Host supports resource content blocks."),resourceLink:v.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:v.object({}).optional().describe("Host supports structured content.")}),hP=v.object({experimental:v.object({}).optional().describe("Experimental features (structure TBD)."),openLinks:v.object({}).optional().describe("Host supports opening external URLs."),serverTools:v.object({listChanged:v.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:v.object({listChanged:v.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:v.object({}).optional().describe("Host accepts log messages."),sandbox:v.object({permissions:Ou.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:zu.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:Dc.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:Dc.optional().describe("Host supports receiving content messages (ui/message) from the Guest UI.")}),mP=v.object({experimental:v.object({}).optional().describe("Experimental features (structure TBD)."),tools:v.object({listChanged:v.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call.")});v.object({method:v.literal("ui/notifications/initialized"),params:v.object({}).optional()});v.object({csp:zu.optional().describe("Content Security Policy configuration."),permissions:Ou.optional().describe("Sandbox permissions requested by the UI."),domain:v.string().optional().describe("Dedicated origin for widget sandbox."),prefersBorder:v.boolean().optional().describe("Visual boundary preference - true if UI prefers a visible border.")});v.object({method:v.literal("ui/request-display-mode"),params:v.object({mode:Iu.describe("The display mode being requested.")})});var pP=v.object({mode:Iu.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),gP=v.union([v.literal("model"),v.literal("app")]).describe("Tool visibility scope - who can access the tool.");v.object({resourceUri:v.string().optional(),visibility:v.array(gP).optional().describe(`Who can access this tool. Default: ["model", "app"]
104
+ - "model": Tool visible to and callable by the agent
105
+ - "app": Tool callable by the app from this server only`)});v.object({method:v.literal("ui/message"),params:v.object({role:v.literal("user").describe('Message role, currently only "user" is supported.'),content:v.array(Mn).describe("Message content blocks (text, image, etc.).")})});v.object({method:v.literal("ui/notifications/sandbox-resource-ready"),params:v.object({html:v.string().describe("HTML content to load into the inner iframe."),sandbox:v.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:zu.optional().describe("CSP configuration from resource metadata."),permissions:Ou.optional().describe("Sandbox permissions from resource metadata.")})});var vP=v.object({method:v.literal("ui/notifications/tool-result"),params:go.describe("Standard MCP tool execution result.")}),Lb=v.object({toolInfo:v.object({id:zn.optional().describe("JSON-RPC id of the tools/call request."),tool:Ta.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:iP.optional().describe("Current color theme preference."),styles:dP.optional().describe("Style configuration for theming the app."),displayMode:Iu.optional().describe("How the UI is currently displayed."),availableDisplayModes:v.array(v.string()).optional().describe("Display modes the host supports."),containerDimensions:v.union([v.object({height:v.number().describe("Fixed container height in pixels.")}),v.object({maxHeight:v.union([v.number(),v.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(v.union([v.object({width:v.number().describe("Fixed container width in pixels.")}),v.object({maxWidth:v.union([v.number(),v.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
106
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:v.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:v.string().optional().describe("User's timezone in IANA format."),userAgent:v.string().optional().describe("Host application identifier."),platform:v.union([v.literal("web"),v.literal("desktop"),v.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:v.object({touch:v.boolean().optional().describe("Whether the device supports touch input."),hover:v.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:v.object({top:v.number().describe("Top safe area inset in pixels."),right:v.number().describe("Right safe area inset in pixels."),bottom:v.number().describe("Bottom safe area inset in pixels."),left:v.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),bP=v.object({method:v.literal("ui/notifications/host-context-changed"),params:Lb.describe("Partial context update containing only changed fields.")});v.object({method:v.literal("ui/update-model-context"),params:v.object({content:v.array(Mn).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:v.record(v.string(),v.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});v.object({method:v.literal("ui/initialize"),params:v.object({appInfo:mo.describe("App identification (name and version)."),appCapabilities:mP.describe("Features and capabilities this app provides."),protocolVersion:v.string().describe("Protocol version this app supports.")})});var _P=v.object({protocolVersion:v.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:mo.describe("Host application identification and version."),hostCapabilities:hP.describe("Features and capabilities provided by the host."),hostContext:Lb.describe("Rich context about the host environment.")}).passthrough();class yP extends xS{constructor(i,r={},n={autoResize:!0}){super(n);O(this,"_appInfo");O(this,"_capabilities");O(this,"options");O(this,"_hostCapabilities");O(this,"_hostInfo");O(this,"_hostContext");O(this,"sendOpenLink",this.openLink);this._appInfo=i,this._capabilities=r,this.options=n,this.setRequestHandler(po,o=>(console.log("Received ping:",o.params),{})),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput(i){this.setNotificationHandler(aP,r=>i(r.params))}set ontoolinputpartial(i){this.setNotificationHandler(lP,r=>i(r.params))}set ontoolresult(i){this.setNotificationHandler(vP,r=>i(r.params))}set ontoolcancelled(i){this.setNotificationHandler(uP,r=>i(r.params))}set onhostcontextchanged(i){this.setNotificationHandler(bP,r=>{this._hostContext={...this._hostContext,...r.params},i(r.params)})}set onteardown(i){this.setRequestHandler(fP,(r,n)=>i(r.params,n))}set oncalltool(i){this.setRequestHandler(Yf,(r,n)=>i(r.params,n))}set onlisttools(i){this.setRequestHandler(Gf,(r,n)=>i(r.params,n))}assertCapabilityForMethod(i){}assertRequestHandlerCapability(i){switch(i){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${i})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${i} registered`)}}assertNotificationCapability(i){}assertTaskCapability(i){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(i){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(i,r){return await this.request({method:"tools/call",params:i},go,r)}sendMessage(i,r){return this.request({method:"ui/message",params:i},sP,r)}sendLog(i){return this.notification({method:"notifications/message",params:i})}updateModelContext(i,r){return this.request({method:"ui/update-model-context",params:i},pa,r)}openLink(i,r){return this.request({method:"ui/open-link",params:i},oP,r)}requestDisplayMode(i,r){return this.request({method:"ui/request-display-mode",params:i},pP,r)}sendSizeChanged(i){return this.notification({method:"ui/notifications/size-changed",params:i})}setupSizeChangedNotifications(){let i=!1,r=0,n=0,o=()=>{i||(i=!0,requestAnimationFrame(()=>{i=!1;let a=document.documentElement,l=a.style.width,u=a.style.height;a.style.width="fit-content",a.style.height="fit-content";let c=a.getBoundingClientRect();a.style.width=l,a.style.height=u;let d=window.innerWidth-a.clientWidth,f=Math.ceil(c.width+d),h=Math.ceil(c.height);(f!==r||h!==n)&&(r=f,n=h,this.sendSizeChanged({width:f,height:h}))}))};o();let s=new ResizeObserver(o);return s.observe(document.documentElement),s.observe(document.body),()=>s.disconnect()}async connect(i=new kS(window.parent,window.parent),r){var n;await super.connect(i);try{let o=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:wS}},_P,r);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:"ui/notifications/initialized"}),(n=this.options)!=null&&n.autoResize&&this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}}/*!
107
+ * @kurkle/color v0.3.4
108
+ * https://github.com/kurkle/color#readme
109
+ * (c) 2024 Jukka Kurkela
110
+ * Released under the MIT License
111
+ */function nr(e){return e+.5|0}const zt=(e,t,i)=>Math.max(Math.min(e,i),t);function Gi(e){return zt(nr(e*2.55),0,255)}function Et(e){return zt(nr(e*255),0,255)}function bt(e){return zt(nr(e/2.55)/100,0,1)}function Ec(e){return zt(nr(e*100),0,100)}const Ye={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},Fs=[..."0123456789ABCDEF"],xP=e=>Fs[e&15],$P=e=>Fs[(e&240)>>4]+Fs[e&15],mr=e=>(e&240)>>4===(e&15),kP=e=>mr(e.r)&&mr(e.g)&&mr(e.b)&&mr(e.a);function wP(e){var t=e.length,i;return e[0]==="#"&&(t===4||t===5?i={r:255&Ye[e[1]]*17,g:255&Ye[e[2]]*17,b:255&Ye[e[3]]*17,a:t===5?Ye[e[4]]*17:255}:(t===7||t===9)&&(i={r:Ye[e[1]]<<4|Ye[e[2]],g:Ye[e[3]]<<4|Ye[e[4]],b:Ye[e[5]]<<4|Ye[e[6]],a:t===9?Ye[e[7]]<<4|Ye[e[8]]:255})),i}const SP=(e,t)=>e<255?t(e):"";function IP(e){var t=kP(e)?xP:$P;return e?"#"+t(e.r)+t(e.g)+t(e.b)+SP(e.a,t):void 0}const zP=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Fb(e,t,i){const r=t*Math.min(i,1-i),n=(o,s=(o+e/30)%12)=>i-r*Math.max(Math.min(s-3,9-s,1),-1);return[n(0),n(8),n(4)]}function OP(e,t,i){const r=(n,o=(n+e/60)%6)=>i-i*t*Math.max(Math.min(o,4-o,1),0);return[r(5),r(3),r(1)]}function PP(e,t,i){const r=Fb(e,1,.5);let n;for(t+i>1&&(n=1/(t+i),t*=n,i*=n),n=0;n<3;n++)r[n]*=1-t-i,r[n]+=t;return r}function TP(e,t,i,r,n){return e===n?(t-i)/r+(t<i?6:0):t===n?(i-e)/r+2:(e-t)/r+4}function Pu(e){const i=e.r/255,r=e.g/255,n=e.b/255,o=Math.max(i,r,n),s=Math.min(i,r,n),a=(o+s)/2;let l,u,c;return o!==s&&(c=o-s,u=a>.5?c/(2-o-s):c/(o+s),l=TP(i,r,n,c,o),l=l*60+.5),[l|0,u||0,a]}function Tu(e,t,i,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,i,r)).map(Et)}function Du(e,t,i){return Tu(Fb,e,t,i)}function DP(e,t,i){return Tu(PP,e,t,i)}function EP(e,t,i){return Tu(OP,e,t,i)}function Bb(e){return(e%360+360)%360}function MP(e){const t=zP.exec(e);let i=255,r;if(!t)return;t[5]!==r&&(i=t[6]?Gi(+t[5]):Et(+t[5]));const n=Bb(+t[2]),o=+t[3]/100,s=+t[4]/100;return t[1]==="hwb"?r=DP(n,o,s):t[1]==="hsv"?r=EP(n,o,s):r=Du(n,o,s),{r:r[0],g:r[1],b:r[2],a:i}}function NP(e,t){var i=Pu(e);i[0]=Bb(i[0]+t),i=Du(i),e.r=i[0],e.g=i[1],e.b=i[2]}function AP(e){if(!e)return;const t=Pu(e),i=t[0],r=Ec(t[1]),n=Ec(t[2]);return e.a<255?`hsla(${i}, ${r}%, ${n}%, ${bt(e.a)})`:`hsl(${i}, ${r}%, ${n}%)`}const Mc={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Nc={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};function CP(){const e={},t=Object.keys(Nc),i=Object.keys(Mc);let r,n,o,s,a;for(r=0;r<t.length;r++){for(s=a=t[r],n=0;n<i.length;n++)o=i[n],a=a.replace(o,Mc[o]);o=parseInt(Nc[s],16),e[a]=[o>>16&255,o>>8&255,o&255]}return e}let pr;function RP(e){pr||(pr=CP(),pr.transparent=[0,0,0,0]);const t=pr[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}const jP=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function ZP(e){const t=jP.exec(e);let i=255,r,n,o;if(t){if(t[7]!==r){const s=+t[7];i=t[8]?Gi(s):zt(s*255,0,255)}return r=+t[1],n=+t[3],o=+t[5],r=255&(t[2]?Gi(r):zt(r,0,255)),n=255&(t[4]?Gi(n):zt(n,0,255)),o=255&(t[6]?Gi(o):zt(o,0,255)),{r,g:n,b:o,a:i}}}function UP(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${bt(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const vs=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055,bi=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function LP(e,t,i){const r=bi(bt(e.r)),n=bi(bt(e.g)),o=bi(bt(e.b));return{r:Et(vs(r+i*(bi(bt(t.r))-r))),g:Et(vs(n+i*(bi(bt(t.g))-n))),b:Et(vs(o+i*(bi(bt(t.b))-o))),a:e.a+i*(t.a-e.a)}}function gr(e,t,i){if(e){let r=Pu(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*i,t===0?360:1)),r=Du(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function Vb(e,t){return e&&Object.assign(t||{},e)}function Ac(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=Et(e[3]))):(t=Vb(e,{r:0,g:0,b:0,a:1}),t.a=Et(t.a)),t}function FP(e){return e.charAt(0)==="r"?ZP(e):MP(e)}class gn{constructor(t){if(t instanceof gn)return t;const i=typeof t;let r;i==="object"?r=Ac(t):i==="string"&&(r=wP(t)||RP(t)||FP(t)),this._rgb=r,this._valid=!!r}get valid(){return this._valid}get rgb(){var t=Vb(this._rgb);return t&&(t.a=bt(t.a)),t}set rgb(t){this._rgb=Ac(t)}rgbString(){return this._valid?UP(this._rgb):void 0}hexString(){return this._valid?IP(this._rgb):void 0}hslString(){return this._valid?AP(this._rgb):void 0}mix(t,i){if(t){const r=this.rgb,n=t.rgb;let o;const s=i===o?.5:i,a=2*s-1,l=r.a-n.a,u=((a*l===-1?a:(a+l)/(1+a*l))+1)/2;o=1-u,r.r=255&u*r.r+o*n.r+.5,r.g=255&u*r.g+o*n.g+.5,r.b=255&u*r.b+o*n.b+.5,r.a=s*r.a+(1-s)*n.a,this.rgb=r}return this}interpolate(t,i){return t&&(this._rgb=LP(this._rgb,t._rgb,i)),this}clone(){return new gn(this.rgb)}alpha(t){return this._rgb.a=Et(t),this}clearer(t){const i=this._rgb;return i.a*=1-t,this}greyscale(){const t=this._rgb,i=nr(t.r*.3+t.g*.59+t.b*.11);return t.r=t.g=t.b=i,this}opaquer(t){const i=this._rgb;return i.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return gr(this._rgb,2,t),this}darken(t){return gr(this._rgb,2,-t),this}saturate(t){return gr(this._rgb,1,t),this}desaturate(t){return gr(this._rgb,1,-t),this}rotate(t){return NP(this._rgb,t),this}}/*!
112
+ * Chart.js v4.5.1
113
+ * https://www.chartjs.org
114
+ * (c) 2025 Chart.js Contributors
115
+ * Released under the MIT License
116
+ */function pt(){}const BP=(()=>{let e=0;return()=>e++})();function H(e){return e==null}function de(e){if(Array.isArray&&Array.isArray(e))return!0;const t=Object.prototype.toString.call(e);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function q(e){return e!==null&&Object.prototype.toString.call(e)==="[object Object]"}function ye(e){return(typeof e=="number"||e instanceof Number)&&isFinite(+e)}function Je(e,t){return ye(e)?e:t}function Z(e,t){return typeof e>"u"?t:e}const VP=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100:+e/t,Wb=(e,t)=>typeof e=="string"&&e.endsWith("%")?parseFloat(e)/100*t:+e;function ae(e,t,i){if(e&&typeof e.call=="function")return e.apply(i,t)}function ee(e,t,i,r){let n,o,s;if(de(e))for(o=e.length,n=0;n<o;n++)t.call(i,e[n],n);else if(q(e))for(s=Object.keys(e),o=s.length,n=0;n<o;n++)t.call(i,e[s[n]],s[n])}function Qr(e,t){let i,r,n,o;if(!e||!t||e.length!==t.length)return!1;for(i=0,r=e.length;i<r;++i)if(n=e[i],o=t[i],n.datasetIndex!==o.datasetIndex||n.index!==o.index)return!1;return!0}function eo(e){if(de(e))return e.map(eo);if(q(e)){const t=Object.create(null),i=Object.keys(e),r=i.length;let n=0;for(;n<r;++n)t[i[n]]=eo(e[i[n]]);return t}return e}function Hb(e){return["__proto__","prototype","constructor"].indexOf(e)===-1}function WP(e,t,i,r){if(!Hb(e))return;const n=t[e],o=i[e];q(n)&&q(o)?vn(n,o,r):t[e]=eo(o)}function vn(e,t,i){const r=de(t)?t:[t],n=r.length;if(!q(e))return e;i=i||{};const o=i.merger||WP;let s;for(let a=0;a<n;++a){if(s=r[a],!q(s))continue;const l=Object.keys(s);for(let u=0,c=l.length;u<c;++u)o(l[u],e,s,i)}return e}function rn(e,t){return vn(e,t,{merger:HP})}function HP(e,t,i){if(!Hb(e))return;const r=t[e],n=i[e];q(r)&&q(n)?rn(r,n):Object.prototype.hasOwnProperty.call(t,e)||(t[e]=eo(n))}const Cc={"":e=>e,x:e=>e.x,y:e=>e.y};function JP(e){const t=e.split("."),i=[];let r="";for(const n of t)r+=n,r.endsWith("\\")?r=r.slice(0,-1)+".":(i.push(r),r="");return i}function qP(e){const t=JP(e);return i=>{for(const r of t){if(r==="")break;i=i&&i[r]}return i}}function jt(e,t){return(Cc[t]||(Cc[t]=qP(t)))(e)}function Eu(e){return e.charAt(0).toUpperCase()+e.slice(1)}const bn=e=>typeof e<"u",Zt=e=>typeof e=="function",Rc=(e,t)=>{if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0};function KP(e){return e.type==="mouseup"||e.type==="click"||e.type==="contextmenu"}const Y=Math.PI,le=2*Y,XP=le+Y,to=Number.POSITIVE_INFINITY,GP=Y/180,ke=Y/2,Jt=Y/4,jc=Y*2/3,Ot=Math.log10,mt=Math.sign;function on(e,t,i){return Math.abs(e-t)<i}function Zc(e){const t=Math.round(e);e=on(e,t,e/1e3)?t:e;const i=Math.pow(10,Math.floor(Ot(e))),r=e/i;return(r<=1?1:r<=2?2:r<=5?5:10)*i}function YP(e){const t=[],i=Math.sqrt(e);let r;for(r=1;r<i;r++)e%r===0&&(t.push(r),t.push(e/r));return i===(i|0)&&t.push(i),t.sort((n,o)=>n-o).pop(),t}function QP(e){return typeof e=="symbol"||typeof e=="object"&&e!==null&&!(Symbol.toPrimitive in e||"toString"in e||"valueOf"in e)}function Ni(e){return!QP(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function e1(e,t){const i=Math.round(e);return i-t<=e&&i+t>=e}function Jb(e,t,i){let r,n,o;for(r=0,n=e.length;r<n;r++)o=e[r][i],isNaN(o)||(t.min=Math.min(t.min,o),t.max=Math.max(t.max,o))}function lt(e){return e*(Y/180)}function Mu(e){return e*(180/Y)}function Uc(e){if(!ye(e))return;let t=1,i=0;for(;Math.round(e*t)/t!==e;)t*=10,i++;return i}function qb(e,t){const i=t.x-e.x,r=t.y-e.y,n=Math.sqrt(i*i+r*r);let o=Math.atan2(r,i);return o<-.5*Y&&(o+=le),{angle:o,distance:n}}function Bs(e,t){return Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2))}function t1(e,t){return(e-t+XP)%le-Y}function Ae(e){return(e%le+le)%le}function _n(e,t,i,r){const n=Ae(e),o=Ae(t),s=Ae(i),a=Ae(o-n),l=Ae(s-n),u=Ae(n-o),c=Ae(n-s);return n===o||n===s||r&&o===s||a>l&&u<c}function Ie(e,t,i){return Math.max(t,Math.min(i,e))}function i1(e){return Ie(e,-32768,32767)}function yt(e,t,i,r=1e-6){return e>=Math.min(t,i)-r&&e<=Math.max(t,i)+r}function Nu(e,t,i){i=i||(s=>e[s]<t);let r=e.length-1,n=0,o;for(;r-n>1;)o=n+r>>1,i(o)?n=o:r=o;return{lo:n,hi:r}}const xt=(e,t,i,r)=>Nu(e,i,r?n=>{const o=e[n][t];return o<i||o===i&&e[n+1][t]===i}:n=>e[n][t]<i),n1=(e,t,i)=>Nu(e,i,r=>e[r][t]>=i);function r1(e,t,i){let r=0,n=e.length;for(;r<n&&e[r]<t;)r++;for(;n>r&&e[n-1]>i;)n--;return r>0||n<e.length?e.slice(r,n):e}const Kb=["push","pop","shift","splice","unshift"];function o1(e,t){if(e._chartjs){e._chartjs.listeners.push(t);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[t]}}),Kb.forEach(i=>{const r="_onData"+Eu(i),n=e[i];Object.defineProperty(e,i,{configurable:!0,enumerable:!1,value(...o){const s=n.apply(this,o);return e._chartjs.listeners.forEach(a=>{typeof a[r]=="function"&&a[r](...o)}),s}})})}function Lc(e,t){const i=e._chartjs;if(!i)return;const r=i.listeners,n=r.indexOf(t);n!==-1&&r.splice(n,1),!(r.length>0)&&(Kb.forEach(o=>{delete e[o]}),delete e._chartjs)}function Xb(e){const t=new Set(e);return t.size===e.length?e:Array.from(t)}const Gb=(function(){return typeof window>"u"?function(e){return e()}:window.requestAnimationFrame})();function Yb(e,t){let i=[],r=!1;return function(...n){i=n,r||(r=!0,Gb.call(window,()=>{r=!1,e.apply(t,i)}))}}function s1(e,t){let i;return function(...r){return t?(clearTimeout(i),i=setTimeout(e,t,r)):e.apply(this,r),t}}const Au=e=>e==="start"?"left":e==="end"?"right":"center",Ne=(e,t,i)=>e==="start"?t:e==="end"?i:(t+i)/2,a1=(e,t,i,r)=>e===(r?"left":"right")?i:e==="center"?(t+i)/2:t;function Qb(e,t,i){const r=t.length;let n=0,o=r;if(e._sorted){const{iScale:s,vScale:a,_parsed:l}=e,u=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,c=s.axis,{min:d,max:f,minDefined:h,maxDefined:m}=s.getUserBounds();if(h){if(n=Math.min(xt(l,c,d).lo,i?r:xt(t,c,s.getPixelForValue(d)).lo),u){const p=l.slice(0,n+1).reverse().findIndex(g=>!H(g[a.axis]));n-=Math.max(0,p)}n=Ie(n,0,r-1)}if(m){let p=Math.max(xt(l,s.axis,f,!0).hi+1,i?0:xt(t,c,s.getPixelForValue(f),!0).hi+1);if(u){const g=l.slice(p-1).findIndex(b=>!H(b[a.axis]));p+=Math.max(0,g)}o=Ie(p,n,r)-n}else o=r-n}return{start:n,count:o}}function e_(e){const{xScale:t,yScale:i,_scaleRanges:r}=e,n={xmin:t.min,xmax:t.max,ymin:i.min,ymax:i.max};if(!r)return e._scaleRanges=n,!0;const o=r.xmin!==t.min||r.xmax!==t.max||r.ymin!==i.min||r.ymax!==i.max;return Object.assign(r,n),o}const vr=e=>e===0||e===1,Fc=(e,t,i)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-t)*le/i)),Bc=(e,t,i)=>Math.pow(2,-10*e)*Math.sin((e-t)*le/i)+1,sn={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*ke)+1,easeOutSine:e=>Math.sin(e*ke),easeInOutSine:e=>-.5*(Math.cos(Y*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>vr(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>vr(e)?e:Fc(e,.075,.3),easeOutElastic:e=>vr(e)?e:Bc(e,.075,.3),easeInOutElastic(e){return vr(e)?e:e<.5?.5*Fc(e*2,.1125,.45):.5+.5*Bc(e*2-1,.1125,.45)},easeInBack(e){return e*e*((1.70158+1)*e-1.70158)},easeOutBack(e){return(e-=1)*e*((1.70158+1)*e+1.70158)+1},easeInOutBack(e){let t=1.70158;return(e/=.5)<1?.5*(e*e*(((t*=1.525)+1)*e-t)):.5*((e-=2)*e*(((t*=1.525)+1)*e+t)+2)},easeInBounce:e=>1-sn.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?sn.easeInBounce(e*2)*.5:sn.easeOutBounce(e*2-1)*.5+.5};function Cu(e){if(e&&typeof e=="object"){const t=e.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Vc(e){return Cu(e)?e:new gn(e)}function bs(e){return Cu(e)?e:new gn(e).saturate(.5).darken(.1).hexString()}const l1=["x","y","borderWidth","radius","tension"],u1=["color","borderColor","backgroundColor"];function c1(e){e.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),e.set("animations",{colors:{type:"color",properties:u1},numbers:{type:"number",properties:l1}}),e.describe("animations",{_fallback:"animation"}),e.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>t|0}}}})}function d1(e){e.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Wc=new Map;function f1(e,t){t=t||{};const i=e+JSON.stringify(t);let r=Wc.get(i);return r||(r=new Intl.NumberFormat(e,t),Wc.set(i,r)),r}function rr(e,t,i){return f1(t,i).format(e)}const t_={values(e){return de(e)?e:""+e},numeric(e,t,i){if(e===0)return"0";const r=this.chart.options.locale;let n,o=e;if(i.length>1){const u=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(u<1e-4||u>1e15)&&(n="scientific"),o=h1(e,i)}const s=Ot(Math.abs(o)),a=isNaN(s)?1:Math.max(Math.min(-1*Math.floor(s),20),0),l={notation:n,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(l,this.options.ticks.format),rr(e,r,l)},logarithmic(e,t,i){if(e===0)return"0";const r=i[t].significand||e/Math.pow(10,Math.floor(Ot(e)));return[1,2,3,5,10,15].includes(r)||t>.8*i.length?t_.numeric.call(this,e,t,i):""}};function h1(e,t){let i=t.length>3?t[2].value-t[1].value:t[1].value-t[0].value;return Math.abs(i)>=1&&e!==Math.floor(e)&&(i=e-Math.floor(e)),i}var ls={formatters:t_};function m1(e){e.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,i)=>i.lineWidth,tickColor:(t,i)=>i.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:ls.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),e.route("scale.ticks","color","","color"),e.route("scale.grid","color","","borderColor"),e.route("scale.border","color","","borderColor"),e.route("scale.title","color","","color"),e.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),e.describe("scales",{_fallback:"scale"}),e.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}const li=Object.create(null),Vs=Object.create(null);function an(e,t){if(!t)return e;const i=t.split(".");for(let r=0,n=i.length;r<n;++r){const o=i[r];e=e[o]||(e[o]=Object.create(null))}return e}function _s(e,t,i){return typeof t=="string"?vn(an(e,t),i):vn(an(e,""),t)}class p1{constructor(t,i){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=r=>r.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(r,n)=>bs(n.backgroundColor),this.hoverBorderColor=(r,n)=>bs(n.borderColor),this.hoverColor=(r,n)=>bs(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(i)}set(t,i){return _s(this,t,i)}get(t){return an(this,t)}describe(t,i){return _s(Vs,t,i)}override(t,i){return _s(li,t,i)}route(t,i,r,n){const o=an(this,t),s=an(this,r),a="_"+i;Object.defineProperties(o,{[a]:{value:o[i],writable:!0},[i]:{enumerable:!0,get(){const l=this[a],u=s[n];return q(l)?Object.assign({},u,l):Z(l,u)},set(l){this[a]=l}}})}apply(t){t.forEach(i=>i(this))}}var fe=new p1({_scriptable:e=>!e.startsWith("on"),_indexable:e=>e!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[c1,d1,m1]);function g1(e){return!e||H(e.size)||H(e.family)?null:(e.style?e.style+" ":"")+(e.weight?e.weight+" ":"")+e.size+"px "+e.family}function io(e,t,i,r,n){let o=t[n];return o||(o=t[n]=e.measureText(n).width,i.push(n)),o>r&&(r=o),r}function v1(e,t,i,r){r=r||{};let n=r.data=r.data||{},o=r.garbageCollect=r.garbageCollect||[];r.font!==t&&(n=r.data={},o=r.garbageCollect=[],r.font=t),e.save(),e.font=t;let s=0;const a=i.length;let l,u,c,d,f;for(l=0;l<a;l++)if(d=i[l],d!=null&&!de(d))s=io(e,n,o,s,d);else if(de(d))for(u=0,c=d.length;u<c;u++)f=d[u],f!=null&&!de(f)&&(s=io(e,n,o,s,f));e.restore();const h=o.length/2;if(h>i.length){for(l=0;l<h;l++)delete n[o[l]];o.splice(0,h)}return s}function qt(e,t,i){const r=e.currentDevicePixelRatio,n=i!==0?Math.max(i/2,.5):0;return Math.round((t-n)*r)/r+n}function Hc(e,t){!t&&!e||(t=t||e.getContext("2d"),t.save(),t.resetTransform(),t.clearRect(0,0,e.width,e.height),t.restore())}function Ws(e,t,i,r){i_(e,t,i,r,null)}function i_(e,t,i,r,n){let o,s,a,l,u,c,d,f;const h=t.pointStyle,m=t.rotation,p=t.radius;let g=(m||0)*GP;if(h&&typeof h=="object"&&(o=h.toString(),o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]")){e.save(),e.translate(i,r),e.rotate(g),e.drawImage(h,-h.width/2,-h.height/2,h.width,h.height),e.restore();return}if(!(isNaN(p)||p<=0)){switch(e.beginPath(),h){default:n?e.ellipse(i,r,n/2,p,0,0,le):e.arc(i,r,p,0,le),e.closePath();break;case"triangle":c=n?n/2:p,e.moveTo(i+Math.sin(g)*c,r-Math.cos(g)*p),g+=jc,e.lineTo(i+Math.sin(g)*c,r-Math.cos(g)*p),g+=jc,e.lineTo(i+Math.sin(g)*c,r-Math.cos(g)*p),e.closePath();break;case"rectRounded":u=p*.516,l=p-u,s=Math.cos(g+Jt)*l,d=Math.cos(g+Jt)*(n?n/2-u:l),a=Math.sin(g+Jt)*l,f=Math.sin(g+Jt)*(n?n/2-u:l),e.arc(i-d,r-a,u,g-Y,g-ke),e.arc(i+f,r-s,u,g-ke,g),e.arc(i+d,r+a,u,g,g+ke),e.arc(i-f,r+s,u,g+ke,g+Y),e.closePath();break;case"rect":if(!m){l=Math.SQRT1_2*p,c=n?n/2:l,e.rect(i-c,r-l,2*c,2*l);break}g+=Jt;case"rectRot":d=Math.cos(g)*(n?n/2:p),s=Math.cos(g)*p,a=Math.sin(g)*p,f=Math.sin(g)*(n?n/2:p),e.moveTo(i-d,r-a),e.lineTo(i+f,r-s),e.lineTo(i+d,r+a),e.lineTo(i-f,r+s),e.closePath();break;case"crossRot":g+=Jt;case"cross":d=Math.cos(g)*(n?n/2:p),s=Math.cos(g)*p,a=Math.sin(g)*p,f=Math.sin(g)*(n?n/2:p),e.moveTo(i-d,r-a),e.lineTo(i+d,r+a),e.moveTo(i+f,r-s),e.lineTo(i-f,r+s);break;case"star":d=Math.cos(g)*(n?n/2:p),s=Math.cos(g)*p,a=Math.sin(g)*p,f=Math.sin(g)*(n?n/2:p),e.moveTo(i-d,r-a),e.lineTo(i+d,r+a),e.moveTo(i+f,r-s),e.lineTo(i-f,r+s),g+=Jt,d=Math.cos(g)*(n?n/2:p),s=Math.cos(g)*p,a=Math.sin(g)*p,f=Math.sin(g)*(n?n/2:p),e.moveTo(i-d,r-a),e.lineTo(i+d,r+a),e.moveTo(i+f,r-s),e.lineTo(i-f,r+s);break;case"line":s=n?n/2:Math.cos(g)*p,a=Math.sin(g)*p,e.moveTo(i-s,r-a),e.lineTo(i+s,r+a);break;case"dash":e.moveTo(i,r),e.lineTo(i+Math.cos(g)*(n?n/2:p),r+Math.sin(g)*p);break;case!1:e.closePath();break}e.fill(),t.borderWidth>0&&e.stroke()}}function $t(e,t,i){return i=i||.5,!t||e&&e.x>t.left-i&&e.x<t.right+i&&e.y>t.top-i&&e.y<t.bottom+i}function us(e,t){e.save(),e.beginPath(),e.rect(t.left,t.top,t.right-t.left,t.bottom-t.top),e.clip()}function cs(e){e.restore()}function b1(e,t,i,r,n){if(!t)return e.lineTo(i.x,i.y);if(n==="middle"){const o=(t.x+i.x)/2;e.lineTo(o,t.y),e.lineTo(o,i.y)}else n==="after"!=!!r?e.lineTo(t.x,i.y):e.lineTo(i.x,t.y);e.lineTo(i.x,i.y)}function _1(e,t,i,r){if(!t)return e.lineTo(i.x,i.y);e.bezierCurveTo(r?t.cp1x:t.cp2x,r?t.cp1y:t.cp2y,r?i.cp2x:i.cp1x,r?i.cp2y:i.cp1y,i.x,i.y)}function y1(e,t){t.translation&&e.translate(t.translation[0],t.translation[1]),H(t.rotation)||e.rotate(t.rotation),t.color&&(e.fillStyle=t.color),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline)}function x1(e,t,i,r,n){if(n.strikethrough||n.underline){const o=e.measureText(r),s=t-o.actualBoundingBoxLeft,a=t+o.actualBoundingBoxRight,l=i-o.actualBoundingBoxAscent,u=i+o.actualBoundingBoxDescent,c=n.strikethrough?(l+u)/2:u;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=n.decorationWidth||2,e.moveTo(s,c),e.lineTo(a,c),e.stroke()}}function $1(e,t){const i=e.fillStyle;e.fillStyle=t.color,e.fillRect(t.left,t.top,t.width,t.height),e.fillStyle=i}function ui(e,t,i,r,n,o={}){const s=de(t)?t:[t],a=o.strokeWidth>0&&o.strokeColor!=="";let l,u;for(e.save(),e.font=n.string,y1(e,o),l=0;l<s.length;++l)u=s[l],o.backdrop&&$1(e,o.backdrop),a&&(o.strokeColor&&(e.strokeStyle=o.strokeColor),H(o.strokeWidth)||(e.lineWidth=o.strokeWidth),e.strokeText(u,i,r,o.maxWidth)),e.fillText(u,i,r,o.maxWidth),x1(e,i,r,u,o),r+=Number(n.lineHeight);e.restore()}function yn(e,t){const{x:i,y:r,w:n,h:o,radius:s}=t;e.arc(i+s.topLeft,r+s.topLeft,s.topLeft,1.5*Y,Y,!0),e.lineTo(i,r+o-s.bottomLeft),e.arc(i+s.bottomLeft,r+o-s.bottomLeft,s.bottomLeft,Y,ke,!0),e.lineTo(i+n-s.bottomRight,r+o),e.arc(i+n-s.bottomRight,r+o-s.bottomRight,s.bottomRight,ke,0,!0),e.lineTo(i+n,r+s.topRight),e.arc(i+n-s.topRight,r+s.topRight,s.topRight,0,-ke,!0),e.lineTo(i+s.topLeft,r)}const k1=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,w1=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function S1(e,t){const i=(""+e).match(k1);if(!i||i[1]==="normal")return t*1.2;switch(e=+i[2],i[3]){case"px":return e;case"%":e/=100;break}return t*e}const I1=e=>+e||0;function Ru(e,t){const i={},r=q(t),n=r?Object.keys(t):t,o=q(e)?r?s=>Z(e[s],e[t[s]]):s=>e[s]:()=>e;for(const s of n)i[s]=I1(o(s));return i}function n_(e){return Ru(e,{top:"y",right:"x",bottom:"y",left:"x"})}function ni(e){return Ru(e,["topLeft","topRight","bottomLeft","bottomRight"])}function je(e){const t=n_(e);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function Se(e,t){e=e||{},t=t||fe.font;let i=Z(e.size,t.size);typeof i=="string"&&(i=parseInt(i,10));let r=Z(e.style,t.style);r&&!(""+r).match(w1)&&(console.warn('Invalid font style specified: "'+r+'"'),r=void 0);const n={family:Z(e.family,t.family),lineHeight:S1(Z(e.lineHeight,t.lineHeight),i),size:i,style:r,weight:Z(e.weight,t.weight),string:""};return n.string=g1(n),n}function Yi(e,t,i,r){let n,o,s;for(n=0,o=e.length;n<o;++n)if(s=e[n],s!==void 0&&s!==void 0)return s}function z1(e,t,i){const{min:r,max:n}=e,o=Wb(t,(n-r)/2),s=(a,l)=>i&&a===0?0:a+l;return{min:s(r,-Math.abs(o)),max:s(n,o)}}function Bt(e,t){return Object.assign(Object.create(e),t)}function ju(e,t=[""],i,r,n=()=>e[0]){const o=i||e;typeof r>"u"&&(r=a_("_fallback",e));const s={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:e,_rootScopes:o,_fallback:r,_getTarget:n,override:a=>ju([a,...e],t,o,r)};return new Proxy(s,{deleteProperty(a,l){return delete a[l],delete a._keys,delete e[0][l],!0},get(a,l){return o_(a,l,()=>A1(l,t,e,a))},getOwnPropertyDescriptor(a,l){return Reflect.getOwnPropertyDescriptor(a._scopes[0],l)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,l){return qc(a).includes(l)},ownKeys(a){return qc(a)},set(a,l,u){const c=a._storage||(a._storage=n());return a[l]=c[l]=u,delete a._keys,!0}})}function Ai(e,t,i,r){const n={_cacheable:!1,_proxy:e,_context:t,_subProxy:i,_stack:new Set,_descriptors:r_(e,r),setContext:o=>Ai(e,o,i,r),override:o=>Ai(e.override(o),t,i,r)};return new Proxy(n,{deleteProperty(o,s){return delete o[s],delete e[s],!0},get(o,s,a){return o_(o,s,()=>P1(o,s,a))},getOwnPropertyDescriptor(o,s){return o._descriptors.allKeys?Reflect.has(e,s)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,s)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(o,s){return Reflect.has(e,s)},ownKeys(){return Reflect.ownKeys(e)},set(o,s,a){return e[s]=a,delete o[s],!0}})}function r_(e,t={scriptable:!0,indexable:!0}){const{_scriptable:i=t.scriptable,_indexable:r=t.indexable,_allKeys:n=t.allKeys}=e;return{allKeys:n,scriptable:i,indexable:r,isScriptable:Zt(i)?i:()=>i,isIndexable:Zt(r)?r:()=>r}}const O1=(e,t)=>e?e+Eu(t):t,Zu=(e,t)=>q(t)&&e!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function o_(e,t,i){if(Object.prototype.hasOwnProperty.call(e,t)||t==="constructor")return e[t];const r=i();return e[t]=r,r}function P1(e,t,i){const{_proxy:r,_context:n,_subProxy:o,_descriptors:s}=e;let a=r[t];return Zt(a)&&s.isScriptable(t)&&(a=T1(t,a,e,i)),de(a)&&a.length&&(a=D1(t,a,e,s.isIndexable)),Zu(t,a)&&(a=Ai(a,n,o&&o[t],s)),a}function T1(e,t,i,r){const{_proxy:n,_context:o,_subProxy:s,_stack:a}=i;if(a.has(e))throw new Error("Recursion detected: "+Array.from(a).join("->")+"->"+e);a.add(e);let l=t(o,s||r);return a.delete(e),Zu(e,l)&&(l=Uu(n._scopes,n,e,l)),l}function D1(e,t,i,r){const{_proxy:n,_context:o,_subProxy:s,_descriptors:a}=i;if(typeof o.index<"u"&&r(e))return t[o.index%t.length];if(q(t[0])){const l=t,u=n._scopes.filter(c=>c!==l);t=[];for(const c of l){const d=Uu(u,n,e,c);t.push(Ai(d,o,s&&s[e],a))}}return t}function s_(e,t,i){return Zt(e)?e(t,i):e}const E1=(e,t)=>e===!0?t:typeof e=="string"?jt(t,e):void 0;function M1(e,t,i,r,n){for(const o of t){const s=E1(i,o);if(s){e.add(s);const a=s_(s._fallback,i,n);if(typeof a<"u"&&a!==i&&a!==r)return a}else if(s===!1&&typeof r<"u"&&i!==r)return null}return!1}function Uu(e,t,i,r){const n=t._rootScopes,o=s_(t._fallback,i,r),s=[...e,...n],a=new Set;a.add(r);let l=Jc(a,s,i,o||i,r);return l===null||typeof o<"u"&&o!==i&&(l=Jc(a,s,o,l,r),l===null)?!1:ju(Array.from(a),[""],n,o,()=>N1(t,i,r))}function Jc(e,t,i,r,n){for(;i;)i=M1(e,t,i,r,n);return i}function N1(e,t,i){const r=e._getTarget();t in r||(r[t]={});const n=r[t];return de(n)&&q(i)?i:n||{}}function A1(e,t,i,r){let n;for(const o of t)if(n=a_(O1(o,e),i),typeof n<"u")return Zu(e,n)?Uu(i,r,e,n):n}function a_(e,t){for(const i of t){if(!i)continue;const r=i[e];if(typeof r<"u")return r}}function qc(e){let t=e._keys;return t||(t=e._keys=C1(e._scopes)),t}function C1(e){const t=new Set;for(const i of e)for(const r of Object.keys(i).filter(n=>!n.startsWith("_")))t.add(r);return Array.from(t)}function l_(e,t,i,r){const{iScale:n}=e,{key:o="r"}=this._parsing,s=new Array(r);let a,l,u,c;for(a=0,l=r;a<l;++a)u=a+i,c=t[u],s[a]={r:n.parse(jt(c,o),u)};return s}const R1=Number.EPSILON||1e-14,Ci=(e,t)=>t<e.length&&!e[t].skip&&e[t],u_=e=>e==="x"?"y":"x";function j1(e,t,i,r){const n=e.skip?t:e,o=t,s=i.skip?t:i,a=Bs(o,n),l=Bs(s,o);let u=a/(a+l),c=l/(a+l);u=isNaN(u)?0:u,c=isNaN(c)?0:c;const d=r*u,f=r*c;return{previous:{x:o.x-d*(s.x-n.x),y:o.y-d*(s.y-n.y)},next:{x:o.x+f*(s.x-n.x),y:o.y+f*(s.y-n.y)}}}function Z1(e,t,i){const r=e.length;let n,o,s,a,l,u=Ci(e,0);for(let c=0;c<r-1;++c)if(l=u,u=Ci(e,c+1),!(!l||!u)){if(on(t[c],0,R1)){i[c]=i[c+1]=0;continue}n=i[c]/t[c],o=i[c+1]/t[c],a=Math.pow(n,2)+Math.pow(o,2),!(a<=9)&&(s=3/Math.sqrt(a),i[c]=n*s*t[c],i[c+1]=o*s*t[c])}}function U1(e,t,i="x"){const r=u_(i),n=e.length;let o,s,a,l=Ci(e,0);for(let u=0;u<n;++u){if(s=a,a=l,l=Ci(e,u+1),!a)continue;const c=a[i],d=a[r];s&&(o=(c-s[i])/3,a[`cp1${i}`]=c-o,a[`cp1${r}`]=d-o*t[u]),l&&(o=(l[i]-c)/3,a[`cp2${i}`]=c+o,a[`cp2${r}`]=d+o*t[u])}}function L1(e,t="x"){const i=u_(t),r=e.length,n=Array(r).fill(0),o=Array(r);let s,a,l,u=Ci(e,0);for(s=0;s<r;++s)if(a=l,l=u,u=Ci(e,s+1),!!l){if(u){const c=u[t]-l[t];n[s]=c!==0?(u[i]-l[i])/c:0}o[s]=a?u?mt(n[s-1])!==mt(n[s])?0:(n[s-1]+n[s])/2:n[s-1]:n[s]}Z1(e,n,o),U1(e,o,t)}function br(e,t,i){return Math.max(Math.min(e,i),t)}function F1(e,t){let i,r,n,o,s,a=$t(e[0],t);for(i=0,r=e.length;i<r;++i)s=o,o=a,a=i<r-1&&$t(e[i+1],t),o&&(n=e[i],s&&(n.cp1x=br(n.cp1x,t.left,t.right),n.cp1y=br(n.cp1y,t.top,t.bottom)),a&&(n.cp2x=br(n.cp2x,t.left,t.right),n.cp2y=br(n.cp2y,t.top,t.bottom)))}function B1(e,t,i,r,n){let o,s,a,l;if(t.spanGaps&&(e=e.filter(u=>!u.skip)),t.cubicInterpolationMode==="monotone")L1(e,n);else{let u=r?e[e.length-1]:e[0];for(o=0,s=e.length;o<s;++o)a=e[o],l=j1(u,a,e[Math.min(o+1,s-(r?0:1))%s],t.tension),a.cp1x=l.previous.x,a.cp1y=l.previous.y,a.cp2x=l.next.x,a.cp2y=l.next.y,u=a}t.capBezierPoints&&F1(e,i)}function Lu(){return typeof window<"u"&&typeof document<"u"}function Fu(e){let t=e.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function no(e,t,i){let r;return typeof e=="string"?(r=parseInt(e,10),e.indexOf("%")!==-1&&(r=r/100*t.parentNode[i])):r=e,r}const ds=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function V1(e,t){return ds(e).getPropertyValue(t)}const W1=["top","right","bottom","left"];function ri(e,t,i){const r={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=W1[n];r[o]=parseFloat(e[t+"-"+o+i])||0}return r.width=r.left+r.right,r.height=r.top+r.bottom,r}const H1=(e,t,i)=>(e>0||t>0)&&(!i||!i.shadowRoot);function J1(e,t){const i=e.touches,r=i&&i.length?i[0]:e,{offsetX:n,offsetY:o}=r;let s=!1,a,l;if(H1(n,o,e.target))a=n,l=o;else{const u=t.getBoundingClientRect();a=r.clientX-u.left,l=r.clientY-u.top,s=!0}return{x:a,y:l,box:s}}function Yt(e,t){if("native"in e)return e;const{canvas:i,currentDevicePixelRatio:r}=t,n=ds(i),o=n.boxSizing==="border-box",s=ri(n,"padding"),a=ri(n,"border","width"),{x:l,y:u,box:c}=J1(e,i),d=s.left+(c&&a.left),f=s.top+(c&&a.top);let{width:h,height:m}=t;return o&&(h-=s.width+a.width,m-=s.height+a.height),{x:Math.round((l-d)/h*i.width/r),y:Math.round((u-f)/m*i.height/r)}}function q1(e,t,i){let r,n;if(t===void 0||i===void 0){const o=e&&Fu(e);if(!o)t=e.clientWidth,i=e.clientHeight;else{const s=o.getBoundingClientRect(),a=ds(o),l=ri(a,"border","width"),u=ri(a,"padding");t=s.width-u.width-l.width,i=s.height-u.height-l.height,r=no(a.maxWidth,o,"clientWidth"),n=no(a.maxHeight,o,"clientHeight")}}return{width:t,height:i,maxWidth:r||to,maxHeight:n||to}}const Pt=e=>Math.round(e*10)/10;function K1(e,t,i,r){const n=ds(e),o=ri(n,"margin"),s=no(n.maxWidth,e,"clientWidth")||to,a=no(n.maxHeight,e,"clientHeight")||to,l=q1(e,t,i);let{width:u,height:c}=l;if(n.boxSizing==="content-box"){const f=ri(n,"border","width"),h=ri(n,"padding");u-=h.width+f.width,c-=h.height+f.height}return u=Math.max(0,u-o.width),c=Math.max(0,r?u/r:c-o.height),u=Pt(Math.min(u,s,l.maxWidth)),c=Pt(Math.min(c,a,l.maxHeight)),u&&!c&&(c=Pt(u/2)),(t!==void 0||i!==void 0)&&r&&l.height&&c>l.height&&(c=l.height,u=Pt(Math.floor(c*r))),{width:u,height:c}}function Kc(e,t,i){const r=t||1,n=Pt(e.height*r),o=Pt(e.width*r);e.height=Pt(e.height),e.width=Pt(e.width);const s=e.canvas;return s.style&&(i||!s.style.height&&!s.style.width)&&(s.style.height=`${e.height}px`,s.style.width=`${e.width}px`),e.currentDevicePixelRatio!==r||s.height!==n||s.width!==o?(e.currentDevicePixelRatio=r,s.height=n,s.width=o,e.ctx.setTransform(r,0,0,r,0,0),!0):!1}const X1=(function(){let e=!1;try{const t={get passive(){return e=!0,!1}};Lu()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return e})();function Xc(e,t){const i=V1(e,t),r=i&&i.match(/^(\d+)(\.\d+)?px$/);return r?+r[1]:void 0}function Qt(e,t,i,r){return{x:e.x+i*(t.x-e.x),y:e.y+i*(t.y-e.y)}}function G1(e,t,i,r){return{x:e.x+i*(t.x-e.x),y:r==="middle"?i<.5?e.y:t.y:r==="after"?i<1?e.y:t.y:i>0?t.y:e.y}}function Y1(e,t,i,r){const n={x:e.cp2x,y:e.cp2y},o={x:t.cp1x,y:t.cp1y},s=Qt(e,n,i),a=Qt(n,o,i),l=Qt(o,t,i),u=Qt(s,a,i),c=Qt(a,l,i);return Qt(u,c,i)}const Q1=function(e,t){return{x(i){return e+e+t-i},setWidth(i){t=i},textAlign(i){return i==="center"?i:i==="right"?"left":"right"},xPlus(i,r){return i-r},leftForLtr(i,r){return i-r}}},eT=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,t){return e+t},leftForLtr(e,t){return e}}};function ki(e,t,i){return e?Q1(t,i):eT()}function c_(e,t){let i,r;(t==="ltr"||t==="rtl")&&(i=e.canvas.style,r=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",t,"important"),e.prevTextDirection=r)}function d_(e,t){t!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty("direction",t[0],t[1]))}function f_(e){return e==="angle"?{between:_n,compare:t1,normalize:Ae}:{between:yt,compare:(t,i)=>t-i,normalize:t=>t}}function Gc({start:e,end:t,count:i,loop:r,style:n}){return{start:e%i,end:t%i,loop:r&&(t-e+1)%i===0,style:n}}function tT(e,t,i){const{property:r,start:n,end:o}=i,{between:s,normalize:a}=f_(r),l=t.length;let{start:u,end:c,loop:d}=e,f,h;if(d){for(u+=l,c+=l,f=0,h=l;f<h&&s(a(t[u%l][r]),n,o);++f)u--,c--;u%=l,c%=l}return c<u&&(c+=l),{start:u,end:c,loop:d,style:e.style}}function h_(e,t,i){if(!i)return[e];const{property:r,start:n,end:o}=i,s=t.length,{compare:a,between:l,normalize:u}=f_(r),{start:c,end:d,loop:f,style:h}=tT(e,t,i),m=[];let p=!1,g=null,b,y,S;const w=()=>l(n,S,b)&&a(n,S)!==0,x=()=>a(o,b)===0||l(o,S,b),I=()=>p||w(),z=()=>!p||x();for(let D=c,N=c;D<=d;++D)y=t[D%s],!y.skip&&(b=u(y[r]),b!==S&&(p=l(b,n,o),g===null&&I()&&(g=a(b,n)===0?D:N),g!==null&&z()&&(m.push(Gc({start:g,end:D,loop:f,count:s,style:h})),g=null),N=D,S=b));return g!==null&&m.push(Gc({start:g,end:d,loop:f,count:s,style:h})),m}function m_(e,t){const i=[],r=e.segments;for(let n=0;n<r.length;n++){const o=h_(r[n],e.points,t);o.length&&i.push(...o)}return i}function iT(e,t,i,r){let n=0,o=t-1;if(i&&!r)for(;n<t&&!e[n].skip;)n++;for(;n<t&&e[n].skip;)n++;for(n%=t,i&&(o+=n);o>n&&e[o%t].skip;)o--;return o%=t,{start:n,end:o}}function nT(e,t,i,r){const n=e.length,o=[];let s=t,a=e[t],l;for(l=t+1;l<=i;++l){const u=e[l%n];u.skip||u.stop?a.skip||(r=!1,o.push({start:t%n,end:(l-1)%n,loop:r}),t=s=u.stop?l:null):(s=l,a.skip&&(t=l)),a=u}return s!==null&&o.push({start:t%n,end:s%n,loop:r}),o}function rT(e,t){const i=e.points,r=e.options.spanGaps,n=i.length;if(!n)return[];const o=!!e._loop,{start:s,end:a}=iT(i,n,o,r);if(r===!0)return Yc(e,[{start:s,end:a,loop:o}],i,t);const l=a<s?a+n:a,u=!!e._fullLoop&&s===0&&a===n-1;return Yc(e,nT(i,s,l,u),i,t)}function Yc(e,t,i,r){return!r||!r.setContext||!i?t:oT(e,t,i,r)}function oT(e,t,i,r){const n=e._chart.getContext(),o=Qc(e.options),{_datasetIndex:s,options:{spanGaps:a}}=e,l=i.length,u=[];let c=o,d=t[0].start,f=d;function h(m,p,g,b){const y=a?-1:1;if(m!==p){for(m+=l;i[m%l].skip;)m-=y;for(;i[p%l].skip;)p+=y;m%l!==p%l&&(u.push({start:m%l,end:p%l,loop:g,style:b}),c=b,d=p%l)}}for(const m of t){d=a?d:m.start;let p=i[d%l],g;for(f=d+1;f<=m.end;f++){const b=i[f%l];g=Qc(r.setContext(Bt(n,{type:"segment",p0:p,p1:b,p0DataIndex:(f-1)%l,p1DataIndex:f%l,datasetIndex:s}))),sT(g,c)&&h(d,f-1,m.loop,c),p=b,c=g}d<f-1&&h(d,f-1,m.loop,c)}return u}function Qc(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function sT(e,t){if(!t)return!1;const i=[],r=function(n,o){return Cu(o)?(i.includes(o)||i.push(o),i.indexOf(o)):o};return JSON.stringify(e,r)!==JSON.stringify(t,r)}function _r(e,t,i){return e.options.clip?e[i]:t[i]}function aT(e,t){const{xScale:i,yScale:r}=e;return i&&r?{left:_r(i,t,"left"),right:_r(i,t,"right"),top:_r(r,t,"top"),bottom:_r(r,t,"bottom")}:t}function p_(e,t){const i=t._clip;if(i.disabled)return!1;const r=aT(t,e.chartArea);return{left:i.left===!1?0:r.left-(i.left===!0?0:i.left),right:i.right===!1?e.width:r.right+(i.right===!0?0:i.right),top:i.top===!1?0:r.top-(i.top===!0?0:i.top),bottom:i.bottom===!1?e.height:r.bottom+(i.bottom===!0?0:i.bottom)}}/*!
117
+ * Chart.js v4.5.1
118
+ * https://www.chartjs.org
119
+ * (c) 2025 Chart.js Contributors
120
+ * Released under the MIT License
121
+ */class lT{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,i,r,n){const o=i.listeners[n],s=i.duration;o.forEach(a=>a({chart:t,initial:i.initial,numSteps:s,currentStep:Math.min(r-i.start,s)}))}_refresh(){this._request||(this._running=!0,this._request=Gb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let i=0;this._charts.forEach((r,n)=>{if(!r.running||!r.items.length)return;const o=r.items;let s=o.length-1,a=!1,l;for(;s>=0;--s)l=o[s],l._active?(l._total>r.duration&&(r.duration=l._total),l.tick(t),a=!0):(o[s]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,r,t,"progress")),o.length||(r.running=!1,this._notify(n,r,t,"complete"),r.initial=!1),i+=o.length}),this._lastDate=t,i===0&&(this._running=!1)}_getAnims(t){const i=this._charts;let r=i.get(t);return r||(r={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},i.set(t,r)),r}listen(t,i,r){this._getAnims(t).listeners[i].push(r)}add(t,i){!i||!i.length||this._getAnims(t).items.push(...i)}has(t){return this._getAnims(t).items.length>0}start(t){const i=this._charts.get(t);i&&(i.running=!0,i.start=Date.now(),i.duration=i.items.reduce((r,n)=>Math.max(r,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const i=this._charts.get(t);return!(!i||!i.running||!i.items.length)}stop(t){const i=this._charts.get(t);if(!i||!i.items.length)return;const r=i.items;let n=r.length-1;for(;n>=0;--n)r[n].cancel();i.items=[],this._notify(t,i,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var gt=new lT;const ed="transparent",uT={boolean(e,t,i){return i>.5?t:e},color(e,t,i){const r=Vc(e||ed),n=r.valid&&Vc(t||ed);return n&&n.valid?n.mix(r,i).hexString():t},number(e,t,i){return e+(t-e)*i}};class cT{constructor(t,i,r,n){const o=i[r];n=Yi([t.to,n,o,t.from]);const s=Yi([t.from,o,n]);this._active=!0,this._fn=t.fn||uT[t.type||typeof s],this._easing=sn[t.easing]||sn.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=i,this._prop=r,this._from=s,this._to=n,this._promises=void 0}active(){return this._active}update(t,i,r){if(this._active){this._notify(!1);const n=this._target[this._prop],o=r-this._start,s=this._duration-o;this._start=r,this._duration=Math.floor(Math.max(s,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Yi([t.to,i,n,t.from]),this._from=Yi([t.from,n,i])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const i=t-this._start,r=this._duration,n=this._prop,o=this._from,s=this._loop,a=this._to;let l;if(this._active=o!==a&&(s||i<r),!this._active){this._target[n]=a,this._notify(!0);return}if(i<0){this._target[n]=o;return}l=i/r%2,l=s&&l>1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((i,r)=>{t.push({res:i,rej:r})})}_notify(t){const i=t?"res":"rej",r=this._promises||[];for(let n=0;n<r.length;n++)r[n][i]()}}class g_{constructor(t,i){this._chart=t,this._properties=new Map,this.configure(i)}configure(t){if(!q(t))return;const i=Object.keys(fe.animation),r=this._properties;Object.getOwnPropertyNames(t).forEach(n=>{const o=t[n];if(!q(o))return;const s={};for(const a of i)s[a]=o[a];(de(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!r.has(a))&&r.set(a,s)})})}_animateOptions(t,i){const r=i.options,n=fT(t,r);if(!n)return[];const o=this._createAnimations(n,r);return r.$shared&&dT(t.options.$animations,r).then(()=>{t.options=r},()=>{}),o}_createAnimations(t,i){const r=this._properties,n=[],o=t.$animations||(t.$animations={}),s=Object.keys(i),a=Date.now();let l;for(l=s.length-1;l>=0;--l){const u=s[l];if(u.charAt(0)==="$")continue;if(u==="options"){n.push(...this._animateOptions(t,i));continue}const c=i[u];let d=o[u];const f=r.get(u);if(d)if(f&&d.active()){d.update(f,c,a);continue}else d.cancel();if(!f||!f.duration){t[u]=c;continue}o[u]=d=new cT(f,t,u,c),n.push(d)}return n}update(t,i){if(this._properties.size===0){Object.assign(t,i);return}const r=this._createAnimations(t,i);if(r.length)return gt.add(this._chart,r),!0}}function dT(e,t){const i=[],r=Object.keys(t);for(let n=0;n<r.length;n++){const o=e[r[n]];o&&o.active()&&i.push(o.wait())}return Promise.all(i)}function fT(e,t){if(!t)return;let i=e.options;if(!i){e.options=t;return}return i.$shared&&(e.options=i=Object.assign({},i,{$shared:!1,$animations:{}})),i}function td(e,t){const i=e&&e.options||{},r=i.reverse,n=i.min===void 0?t:0,o=i.max===void 0?t:0;return{start:r?o:n,end:r?n:o}}function hT(e,t,i){if(i===!1)return!1;const r=td(e,i),n=td(t,i);return{top:n.end,right:r.end,bottom:n.start,left:r.start}}function mT(e){let t,i,r,n;return q(e)?(t=e.top,i=e.right,r=e.bottom,n=e.left):t=i=r=n=e,{top:t,right:i,bottom:r,left:n,disabled:e===!1}}function v_(e,t){const i=[],r=e._getSortedDatasetMetas(t);let n,o;for(n=0,o=r.length;n<o;++n)i.push(r[n].index);return i}function id(e,t,i,r={}){const n=e.keys,o=r.mode==="single";let s,a,l,u;if(t===null)return;let c=!1;for(s=0,a=n.length;s<a;++s){if(l=+n[s],l===i){if(c=!0,r.all)continue;break}u=e.values[l],ye(u)&&(o||t===0||mt(t)===mt(u))&&(t+=u)}return!c&&!r.all?0:t}function pT(e,t){const{iScale:i,vScale:r}=t,n=i.axis==="x"?"x":"y",o=r.axis==="x"?"x":"y",s=Object.keys(e),a=new Array(s.length);let l,u,c;for(l=0,u=s.length;l<u;++l)c=s[l],a[l]={[n]:c,[o]:e[c]};return a}function ys(e,t){const i=e&&e.options.stacked;return i||i===void 0&&t.stack!==void 0}function gT(e,t,i){return`${e.id}.${t.id}.${i.stack||i.type}`}function vT(e){const{min:t,max:i,minDefined:r,maxDefined:n}=e.getUserBounds();return{min:r?t:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}function bT(e,t,i){const r=e[t]||(e[t]={});return r[i]||(r[i]={})}function nd(e,t,i,r){for(const n of t.getMatchingVisibleMetas(r).reverse()){const o=e[n.index];if(i&&o>0||!i&&o<0)return n.index}return null}function rd(e,t){const{chart:i,_cachedMeta:r}=e,n=i._stacks||(i._stacks={}),{iScale:o,vScale:s,index:a}=r,l=o.axis,u=s.axis,c=gT(o,s,r),d=t.length;let f;for(let h=0;h<d;++h){const m=t[h],{[l]:p,[u]:g}=m,b=m._stacks||(m._stacks={});f=b[u]=bT(n,c,p),f[a]=g,f._top=nd(f,s,!0,r.type),f._bottom=nd(f,s,!1,r.type);const y=f._visualValues||(f._visualValues={});y[a]=g}}function xs(e,t){const i=e.scales;return Object.keys(i).filter(r=>i[r].axis===t).shift()}function _T(e,t){return Bt(e,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function yT(e,t,i){return Bt(e,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:i,index:t,mode:"default",type:"data"})}function Vi(e,t){const i=e.controller.index,r=e.vScale&&e.vScale.axis;if(r){t=t||e._parsed;for(const n of t){const o=n._stacks;if(!o||o[r]===void 0||o[r][i]===void 0)return;delete o[r][i],o[r]._visualValues!==void 0&&o[r]._visualValues[i]!==void 0&&delete o[r]._visualValues[i]}}}const $s=e=>e==="reset"||e==="none",od=(e,t)=>t?e:Object.assign({},e),xT=(e,t,i)=>e&&!t.hidden&&t._stacked&&{keys:v_(i,!0),values:null};class ut{constructor(t,i){this.chart=t,this._ctx=t.ctx,this.index=i,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=ys(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Vi(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,i=this._cachedMeta,r=this.getDataset(),n=(d,f,h,m)=>d==="x"?f:d==="r"?m:h,o=i.xAxisID=Z(r.xAxisID,xs(t,"x")),s=i.yAxisID=Z(r.yAxisID,xs(t,"y")),a=i.rAxisID=Z(r.rAxisID,xs(t,"r")),l=i.indexAxis,u=i.iAxisID=n(l,o,s,a),c=i.vAxisID=n(l,s,o,a);i.xScale=this.getScaleForId(o),i.yScale=this.getScaleForId(s),i.rScale=this.getScaleForId(a),i.iScale=this.getScaleForId(u),i.vScale=this.getScaleForId(c)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const i=this._cachedMeta;return t===i.iScale?i.vScale:i.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&Lc(this._data,this),t._stacked&&Vi(t)}_dataCheck(){const t=this.getDataset(),i=t.data||(t.data=[]),r=this._data;if(q(i)){const n=this._cachedMeta;this._data=pT(i,n)}else if(r!==i){if(r){Lc(r,this);const n=this._cachedMeta;Vi(n),n._parsed=[]}i&&Object.isExtensible(i)&&o1(i,this),this._syncList=[],this._data=i}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const i=this._cachedMeta,r=this.getDataset();let n=!1;this._dataCheck();const o=i._stacked;i._stacked=ys(i.vScale,i),i.stack!==r.stack&&(n=!0,Vi(i),i.stack=r.stack),this._resyncElements(t),(n||o!==i._stacked)&&(rd(this,i._parsed),i._stacked=ys(i.vScale,i))}configure(){const t=this.chart.config,i=t.datasetScopeKeys(this._type),r=t.getOptionScopes(this.getDataset(),i,!0);this.options=t.createResolver(r,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,i){const{_cachedMeta:r,_data:n}=this,{iScale:o,_stacked:s}=r,a=o.axis;let l=t===0&&i===n.length?!0:r._sorted,u=t>0&&r._parsed[t-1],c,d,f;if(this._parsing===!1)r._parsed=n,r._sorted=!0,f=n;else{de(n[t])?f=this.parseArrayData(r,n,t,i):q(n[t])?f=this.parseObjectData(r,n,t,i):f=this.parsePrimitiveData(r,n,t,i);const h=()=>d[a]===null||u&&d[a]<u[a];for(c=0;c<i;++c)r._parsed[c+t]=d=f[c],l&&(h()&&(l=!1),u=d);r._sorted=l}s&&rd(this,f)}parsePrimitiveData(t,i,r,n){const{iScale:o,vScale:s}=t,a=o.axis,l=s.axis,u=o.getLabels(),c=o===s,d=new Array(n);let f,h,m;for(f=0,h=n;f<h;++f)m=f+r,d[f]={[a]:c||o.parse(u[m],m),[l]:s.parse(i[m],m)};return d}parseArrayData(t,i,r,n){const{xScale:o,yScale:s}=t,a=new Array(n);let l,u,c,d;for(l=0,u=n;l<u;++l)c=l+r,d=i[c],a[l]={x:o.parse(d[0],c),y:s.parse(d[1],c)};return a}parseObjectData(t,i,r,n){const{xScale:o,yScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=new Array(n);let c,d,f,h;for(c=0,d=n;c<d;++c)f=c+r,h=i[f],u[c]={x:o.parse(jt(h,a),f),y:s.parse(jt(h,l),f)};return u}getParsed(t){return this._cachedMeta._parsed[t]}getDataElement(t){return this._cachedMeta.data[t]}applyStack(t,i,r){const n=this.chart,o=this._cachedMeta,s=i[t.axis],a={keys:v_(n,!0),values:i._stacks[t.axis]._visualValues};return id(a,s,o.index,{mode:r})}updateRangeFromParsed(t,i,r,n){const o=r[i.axis];let s=o===null?NaN:o;const a=n&&r._stacks[i.axis];n&&a&&(n.values=a,s=id(n,o,this._cachedMeta.index)),t.min=Math.min(t.min,s),t.max=Math.max(t.max,s)}getMinMax(t,i){const r=this._cachedMeta,n=r._parsed,o=r._sorted&&t===r.iScale,s=n.length,a=this._getOtherScale(t),l=xT(i,r,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:c,max:d}=vT(a);let f,h;function m(){h=n[f];const p=h[a.axis];return!ye(h[t.axis])||c>p||d<p}for(f=0;f<s&&!(!m()&&(this.updateRangeFromParsed(u,t,h,l),o));++f);if(o){for(f=s-1;f>=0;--f)if(!m()){this.updateRangeFromParsed(u,t,h,l);break}}return u}getAllParsedValues(t){const i=this._cachedMeta._parsed,r=[];let n,o,s;for(n=0,o=i.length;n<o;++n)s=i[n][t.axis],ye(s)&&r.push(s);return r}getMaxOverflow(){return!1}getLabelAndValue(t){const i=this._cachedMeta,r=i.iScale,n=i.vScale,o=this.getParsed(t);return{label:r?""+r.getLabelForValue(o[r.axis]):"",value:n?""+n.getLabelForValue(o[n.axis]):""}}_update(t){const i=this._cachedMeta;this.update(t||"default"),i._clip=mT(Z(this.options.clip,hT(i.xScale,i.yScale,this.getMaxOverflow())))}update(t){}draw(){const t=this._ctx,i=this.chart,r=this._cachedMeta,n=r.data||[],o=i.chartArea,s=[],a=this._drawStart||0,l=this._drawCount||n.length-a,u=this.options.drawActiveElementsOnTop;let c;for(r.dataset&&r.dataset.draw(t,o,a,l),c=a;c<a+l;++c){const d=n[c];d.hidden||(d.active&&u?s.push(d):d.draw(t,o))}for(c=0;c<s.length;++c)s[c].draw(t,o)}getStyle(t,i){const r=i?"active":"default";return t===void 0&&this._cachedMeta.dataset?this.resolveDatasetElementOptions(r):this.resolveDataElementOptions(t||0,r)}getContext(t,i,r){const n=this.getDataset();let o;if(t>=0&&t<this._cachedMeta.data.length){const s=this._cachedMeta.data[t];o=s.$context||(s.$context=yT(this.getContext(),t,s)),o.parsed=this.getParsed(t),o.raw=n.data[t],o.index=o.dataIndex=t}else o=this.$context||(this.$context=_T(this.chart.getContext(),this.index)),o.dataset=n,o.index=o.datasetIndex=this.index;return o.active=!!i,o.mode=r,o}resolveDatasetElementOptions(t){return this._resolveElementOptions(this.datasetElementType.id,t)}resolveDataElementOptions(t,i){return this._resolveElementOptions(this.dataElementType.id,i,t)}_resolveElementOptions(t,i="default",r){const n=i==="active",o=this._cachedDataOpts,s=t+"-"+i,a=o[s],l=this.enableOptionSharing&&bn(r);if(a)return od(a,l);const u=this.chart.config,c=u.datasetElementScopeKeys(this._type,t),d=n?[`${t}Hover`,"hover",t,""]:[t,""],f=u.getOptionScopes(this.getDataset(),c),h=Object.keys(fe.elements[t]),m=()=>this.getContext(r,n,i),p=u.resolveNamedOptions(f,h,m,d);return p.$shared&&(p.$shared=l,o[s]=Object.freeze(od(p,l))),p}_resolveAnimations(t,i,r){const n=this.chart,o=this._cachedDataOpts,s=`animation-${i}`,a=o[s];if(a)return a;let l;if(n.options.animation!==!1){const c=this.chart.config,d=c.datasetAnimationScopeKeys(this._type,i),f=c.getOptionScopes(this.getDataset(),d);l=c.createResolver(f,this.getContext(t,r,i))}const u=new g_(n,l&&l.animations);return l&&l._cacheable&&(o[s]=Object.freeze(u)),u}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,i){return!i||$s(t)||this.chart._animationsDisabled}_getSharedOptions(t,i){const r=this.resolveDataElementOptions(t,i),n=this._sharedOptions,o=this.getSharedOptions(r),s=this.includeOptions(i,o)||o!==n;return this.updateSharedOptions(o,i,r),{sharedOptions:o,includeOptions:s}}updateElement(t,i,r,n){$s(n)?Object.assign(t,r):this._resolveAnimations(i,n).update(t,r)}updateSharedOptions(t,i,r){t&&!$s(i)&&this._resolveAnimations(void 0,i).update(t,r)}_setStyle(t,i,r,n){t.active=n;const o=this.getStyle(i,n);this._resolveAnimations(i,r,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,i,r){this._setStyle(t,r,"active",!1)}setHoverStyle(t,i,r){this._setStyle(t,r,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const i=this._data,r=this._cachedMeta.data;for(const[a,l,u]of this._syncList)this[a](l,u);this._syncList=[];const n=r.length,o=i.length,s=Math.min(o,n);s&&this.parse(0,s),o>n?this._insertElements(n,o-n,t):o<n&&this._removeElements(o,n-o)}_insertElements(t,i,r=!0){const n=this._cachedMeta,o=n.data,s=t+i;let a;const l=u=>{for(u.length+=i,a=u.length-1;a>=s;a--)u[a]=u[a-i]};for(l(o),a=t;a<s;++a)o[a]=new this.dataElementType;this._parsing&&l(n._parsed),this.parse(t,i),r&&this.updateElements(o,t,i,"reset")}updateElements(t,i,r,n){}_removeElements(t,i){const r=this._cachedMeta;if(this._parsing){const n=r._parsed.splice(t,i);r._stacked&&Vi(r,n)}r.data.splice(t,i)}_sync(t){if(this._parsing)this._syncList.push(t);else{const[i,r,n]=t;this[i](r,n)}this.chart._dataChanges.push([this.index,...t])}_onDataPush(){const t=arguments.length;this._sync(["_insertElements",this.getDataset().data.length-t,t])}_onDataPop(){this._sync(["_removeElements",this._cachedMeta.data.length-1,1])}_onDataShift(){this._sync(["_removeElements",0,1])}_onDataSplice(t,i){i&&this._sync(["_removeElements",t,i]);const r=arguments.length-2;r&&this._sync(["_insertElements",t,r])}_onDataUnshift(){this._sync(["_insertElements",0,arguments.length])}}O(ut,"defaults",{}),O(ut,"datasetElementType",null),O(ut,"dataElementType",null);function $T(e,t){if(!e._cache.$bar){const i=e.getMatchingVisibleMetas(t);let r=[];for(let n=0,o=i.length;n<o;n++)r=r.concat(i[n].controller.getAllParsedValues(e));e._cache.$bar=Xb(r.sort((n,o)=>n-o))}return e._cache.$bar}function kT(e){const t=e.iScale,i=$T(t,e.type);let r=t._length,n,o,s,a;const l=()=>{s===32767||s===-32768||(bn(a)&&(r=Math.min(r,Math.abs(s-a)||r)),a=s)};for(n=0,o=i.length;n<o;++n)s=t.getPixelForValue(i[n]),l();for(a=void 0,n=0,o=t.ticks.length;n<o;++n)s=t.getPixelForTick(n),l();return r}function wT(e,t,i,r){const n=i.barThickness;let o,s;return H(n)?(o=t.min*i.categoryPercentage,s=i.barPercentage):(o=n*r,s=1),{chunk:o/r,ratio:s,start:t.pixels[e]-o/2}}function ST(e,t,i,r){const n=t.pixels,o=n[e];let s=e>0?n[e-1]:null,a=e<n.length-1?n[e+1]:null;const l=i.categoryPercentage;s===null&&(s=o-(a===null?t.end-t.start:a-o)),a===null&&(a=o+o-s);const u=o-(o-Math.min(s,a))/2*l;return{chunk:Math.abs(a-s)/2*l/r,ratio:i.barPercentage,start:u}}function IT(e,t,i,r){const n=i.parse(e[0],r),o=i.parse(e[1],r),s=Math.min(n,o),a=Math.max(n,o);let l=s,u=a;Math.abs(s)>Math.abs(a)&&(l=a,u=s),t[i.axis]=u,t._custom={barStart:l,barEnd:u,start:n,end:o,min:s,max:a}}function b_(e,t,i,r){return de(e)?IT(e,t,i,r):t[i.axis]=i.parse(e,r),t}function sd(e,t,i,r){const n=e.iScale,o=e.vScale,s=n.getLabels(),a=n===o,l=[];let u,c,d,f;for(u=i,c=i+r;u<c;++u)f=t[u],d={},d[n.axis]=a||n.parse(s[u],u),l.push(b_(f,d,o,u));return l}function ks(e){return e&&e.barStart!==void 0&&e.barEnd!==void 0}function zT(e,t,i){return e!==0?mt(e):(t.isHorizontal()?1:-1)*(t.min>=i?1:-1)}function OT(e){let t,i,r,n,o;return e.horizontal?(t=e.base>e.x,i="left",r="right"):(t=e.base<e.y,i="bottom",r="top"),t?(n="end",o="start"):(n="start",o="end"),{start:i,end:r,reverse:t,top:n,bottom:o}}function PT(e,t,i,r){let n=t.borderSkipped;const o={};if(!n){e.borderSkipped=o;return}if(n===!0){e.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:s,end:a,reverse:l,top:u,bottom:c}=OT(e);n==="middle"&&i&&(e.enableBorderRadius=!0,(i._top||0)===r?n=u:(i._bottom||0)===r?n=c:(o[ad(c,s,a,l)]=!0,n=u)),o[ad(n,s,a,l)]=!0,e.borderSkipped=o}function ad(e,t,i,r){return r?(e=TT(e,t,i),e=ld(e,i,t)):e=ld(e,t,i),e}function TT(e,t,i){return e===t?i:e===i?t:e}function ld(e,t,i){return e==="start"?t:e==="end"?i:e}function DT(e,{inflateAmount:t},i){e.inflateAmount=t==="auto"?i===1?.33:0:t}class Tr extends ut{parsePrimitiveData(t,i,r,n){return sd(t,i,r,n)}parseArrayData(t,i,r,n){return sd(t,i,r,n)}parseObjectData(t,i,r,n){const{iScale:o,vScale:s}=t,{xAxisKey:a="x",yAxisKey:l="y"}=this._parsing,u=o.axis==="x"?a:l,c=s.axis==="x"?a:l,d=[];let f,h,m,p;for(f=r,h=r+n;f<h;++f)p=i[f],m={},m[o.axis]=o.parse(jt(p,u),f),d.push(b_(jt(p,c),m,s,f));return d}updateRangeFromParsed(t,i,r,n){super.updateRangeFromParsed(t,i,r,n);const o=r._custom;o&&i===this._cachedMeta.vScale&&(t.min=Math.min(t.min,o.min),t.max=Math.max(t.max,o.max))}getMaxOverflow(){return 0}getLabelAndValue(t){const i=this._cachedMeta,{iScale:r,vScale:n}=i,o=this.getParsed(t),s=o._custom,a=ks(s)?"["+s.start+", "+s.end+"]":""+n.getLabelForValue(o[n.axis]);return{label:""+r.getLabelForValue(o[r.axis]),value:a}}initialize(){this.enableOptionSharing=!0,super.initialize();const t=this._cachedMeta;t.stack=this.getDataset().stack}update(t){const i=this._cachedMeta;this.updateElements(i.data,0,i.data.length,t)}updateElements(t,i,r,n){const o=n==="reset",{index:s,_cachedMeta:{vScale:a}}=this,l=a.getBasePixel(),u=a.isHorizontal(),c=this._getRuler(),{sharedOptions:d,includeOptions:f}=this._getSharedOptions(i,n);for(let h=i;h<i+r;h++){const m=this.getParsed(h),p=o||H(m[a.axis])?{base:l,head:l}:this._calculateBarValuePixels(h),g=this._calculateBarIndexPixels(h,c),b=(m._stacks||{})[a.axis],y={horizontal:u,base:p.base,enableBorderRadius:!b||ks(m._custom)||s===b._top||s===b._bottom,x:u?p.head:g.center,y:u?g.center:p.head,height:u?g.size:Math.abs(p.size),width:u?Math.abs(p.size):g.size};f&&(y.options=d||this.resolveDataElementOptions(h,t[h].active?"active":n));const S=y.options||t[h].options;PT(y,S,b,s),DT(y,S,c.ratio),this.updateElement(t[h],h,y,n)}}_getStacks(t,i){const{iScale:r}=this._cachedMeta,n=r.getMatchingVisibleMetas(this._type).filter(c=>c.controller.options.grouped),o=r.options.stacked,s=[],a=this._cachedMeta.controller.getParsed(i),l=a&&a[r.axis],u=c=>{const d=c._parsed.find(h=>h[r.axis]===l),f=d&&d[c.vScale.axis];if(H(f)||isNaN(f))return!0};for(const c of n)if(!(i!==void 0&&u(c))&&((o===!1||s.indexOf(c.stack)===-1||o===void 0&&c.stack===void 0)&&s.push(c.stack),c.index===t))break;return s.length||s.push(void 0),s}_getStackCount(t){return this._getStacks(void 0,t).length}_getAxisCount(){return this._getAxis().length}getFirstScaleIdForIndexAxis(){const t=this.chart.scales,i=this.chart.options.indexAxis;return Object.keys(t).filter(r=>t[r].axis===i).shift()}_getAxis(){const t={},i=this.getFirstScaleIdForIndexAxis();for(const r of this.chart.data.datasets)t[Z(this.chart.options.indexAxis==="x"?r.xAxisID:r.yAxisID,i)]=!0;return Object.keys(t)}_getStackIndex(t,i,r){const n=this._getStacks(t,r),o=i!==void 0?n.indexOf(i):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,i=this._cachedMeta,r=i.iScale,n=[];let o,s;for(o=0,s=i.data.length;o<s;++o)n.push(r.getPixelForValue(this.getParsed(o)[r.axis],o));const a=t.barThickness;return{min:a||kT(i),pixels:n,start:r._startPixel,end:r._endPixel,stackCount:this._getStackCount(),scale:r,grouped:t.grouped,ratio:a?1:t.categoryPercentage*t.barPercentage}}_calculateBarValuePixels(t){const{_cachedMeta:{vScale:i,_stacked:r,index:n},options:{base:o,minBarLength:s}}=this,a=o||0,l=this.getParsed(t),u=l._custom,c=ks(u);let d=l[i.axis],f=0,h=r?this.applyStack(i,l,r):d,m,p;h!==d&&(f=h-d,h=d),c&&(d=u.barStart,h=u.barEnd-u.barStart,d!==0&&mt(d)!==mt(u.barEnd)&&(f=0),f+=d);const g=!H(o)&&!c?o:f;let b=i.getPixelForValue(g);if(this.chart.getDataVisibility(t)?m=i.getPixelForValue(f+h):m=b,p=m-b,Math.abs(p)<s){p=zT(p,i,a)*s,d===a&&(b-=p/2);const y=i.getPixelForDecimal(0),S=i.getPixelForDecimal(1),w=Math.min(y,S),x=Math.max(y,S);b=Math.max(Math.min(b,x),w),m=b+p,r&&!c&&(l._stacks[i.axis]._visualValues[n]=i.getValueForPixel(m)-i.getValueForPixel(b))}if(b===i.getPixelForValue(a)){const y=mt(p)*i.getLineWidthForValue(a)/2;b+=y,p-=y}return{size:p,base:b,head:m,center:m+p/2}}_calculateBarIndexPixels(t,i){const r=i.scale,n=this.options,o=n.skipNull,s=Z(n.maxBarThickness,1/0);let a,l;const u=this._getAxisCount();if(i.grouped){const c=o?this._getStackCount(t):i.stackCount,d=n.barThickness==="flex"?ST(t,i,n,c*u):wT(t,i,n,c*u),f=this.chart.options.indexAxis==="x"?this.getDataset().xAxisID:this.getDataset().yAxisID,h=this._getAxis().indexOf(Z(f,this.getFirstScaleIdForIndexAxis())),m=this._getStackIndex(this.index,this._cachedMeta.stack,o?t:void 0)+h;a=d.start+d.chunk*m+d.chunk/2,l=Math.min(s,d.chunk*d.ratio)}else a=r.getPixelForValue(this.getParsed(t)[r.axis],t),l=Math.min(s,i.min*i.ratio);return{base:a-l/2,head:a+l/2,center:a,size:l}}draw(){const t=this._cachedMeta,i=t.vScale,r=t.data,n=r.length;let o=0;for(;o<n;++o)this.getParsed(o)[i.axis]!==null&&!r[o].hidden&&r[o].draw(this._ctx)}}O(Tr,"id","bar"),O(Tr,"defaults",{datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}}),O(Tr,"overrides",{scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}});class Dr extends ut{initialize(){this.enableOptionSharing=!0,super.initialize()}parsePrimitiveData(t,i,r,n){const o=super.parsePrimitiveData(t,i,r,n);for(let s=0;s<o.length;s++)o[s]._custom=this.resolveDataElementOptions(s+r).radius;return o}parseArrayData(t,i,r,n){const o=super.parseArrayData(t,i,r,n);for(let s=0;s<o.length;s++){const a=i[r+s];o[s]._custom=Z(a[2],this.resolveDataElementOptions(s+r).radius)}return o}parseObjectData(t,i,r,n){const o=super.parseObjectData(t,i,r,n);for(let s=0;s<o.length;s++){const a=i[r+s];o[s]._custom=Z(a&&a.r&&+a.r,this.resolveDataElementOptions(s+r).radius)}return o}getMaxOverflow(){const t=this._cachedMeta.data;let i=0;for(let r=t.length-1;r>=0;--r)i=Math.max(i,t[r].size(this.resolveDataElementOptions(r))/2);return i>0&&i}getLabelAndValue(t){const i=this._cachedMeta,r=this.chart.data.labels||[],{xScale:n,yScale:o}=i,s=this.getParsed(t),a=n.getLabelForValue(s.x),l=o.getLabelForValue(s.y),u=s._custom;return{label:r[t]||"",value:"("+a+", "+l+(u?", "+u:"")+")"}}update(t){const i=this._cachedMeta.data;this.updateElements(i,0,i.length,t)}updateElements(t,i,r,n){const o=n==="reset",{iScale:s,vScale:a}=this._cachedMeta,{sharedOptions:l,includeOptions:u}=this._getSharedOptions(i,n),c=s.axis,d=a.axis;for(let f=i;f<i+r;f++){const h=t[f],m=!o&&this.getParsed(f),p={},g=p[c]=o?s.getPixelForDecimal(.5):s.getPixelForValue(m[c]),b=p[d]=o?a.getBasePixel():a.getPixelForValue(m[d]);p.skip=isNaN(g)||isNaN(b),u&&(p.options=l||this.resolveDataElementOptions(f,h.active?"active":n),o&&(p.options.radius=0)),this.updateElement(h,f,p,n)}}resolveDataElementOptions(t,i){const r=this.getParsed(t);let n=super.resolveDataElementOptions(t,i);n.$shared&&(n=Object.assign({},n,{$shared:!1}));const o=n.radius;return i!=="active"&&(n.radius=0),n.radius+=Z(r&&r._custom,o),n}}O(Dr,"id","bubble"),O(Dr,"defaults",{datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}}),O(Dr,"overrides",{scales:{x:{type:"linear"},y:{type:"linear"}}});function ET(e,t,i){let r=1,n=1,o=0,s=0;if(t<le){const a=e,l=a+t,u=Math.cos(a),c=Math.sin(a),d=Math.cos(l),f=Math.sin(l),h=(S,w,x)=>_n(S,a,l,!0)?1:Math.max(w,w*i,x,x*i),m=(S,w,x)=>_n(S,a,l,!0)?-1:Math.min(w,w*i,x,x*i),p=h(0,u,d),g=h(ke,c,f),b=m(Y,u,d),y=m(Y+ke,c,f);r=(p-b)/2,n=(g-y)/2,o=-(p+b)/2,s=-(g+y)/2}return{ratioX:r,ratioY:n,offsetX:o,offsetY:s}}class ti extends ut{constructor(t,i){super(t,i),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,i){const r=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=r;else{let o=l=>+r[l];if(q(r[t])){const{key:l="value"}=this._parsing;o=u=>+jt(r[u],l)}let s,a;for(s=t,a=t+i;s<a;++s)n._parsed[s]=o(s)}}_getRotation(){return lt(this.options.rotation-90)}_getCircumference(){return lt(this.options.circumference)}_getRotationExtents(){let t=le,i=-le;for(let r=0;r<this.chart.data.datasets.length;++r)if(this.chart.isDatasetVisible(r)&&this.chart.getDatasetMeta(r).type===this._type){const n=this.chart.getDatasetMeta(r).controller,o=n._getRotation(),s=n._getCircumference();t=Math.min(t,o),i=Math.max(i,o+s)}return{rotation:t,circumference:i-t}}update(t){const i=this.chart,{chartArea:r}=i,n=this._cachedMeta,o=n.data,s=this.getMaxBorderWidth()+this.getMaxOffset(o)+this.options.spacing,a=Math.max((Math.min(r.width,r.height)-s)/2,0),l=Math.min(VP(this.options.cutout,a),1),u=this._getRingWeight(this.index),{circumference:c,rotation:d}=this._getRotationExtents(),{ratioX:f,ratioY:h,offsetX:m,offsetY:p}=ET(d,c,l),g=(r.width-s)/f,b=(r.height-s)/h,y=Math.max(Math.min(g,b)/2,0),S=Wb(this.options.radius,y),w=Math.max(S*l,0),x=(S-w)/this._getVisibleDatasetWeightTotal();this.offsetX=m*S,this.offsetY=p*S,n.total=this.calculateTotal(),this.outerRadius=S-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*u,0),this.updateElements(o,0,o.length,t)}_circumference(t,i){const r=this.options,n=this._cachedMeta,o=this._getCircumference();return i&&r.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/le)}updateElements(t,i,r,n){const o=n==="reset",s=this.chart,a=s.chartArea,u=s.options.animation,c=(a.left+a.right)/2,d=(a.top+a.bottom)/2,f=o&&u.animateScale,h=f?0:this.innerRadius,m=f?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(i,n);let b=this._getRotation(),y;for(y=0;y<i;++y)b+=this._circumference(y,o);for(y=i;y<i+r;++y){const S=this._circumference(y,o),w=t[y],x={x:c+this.offsetX,y:d+this.offsetY,startAngle:b,endAngle:b+S,circumference:S,outerRadius:m,innerRadius:h};g&&(x.options=p||this.resolveDataElementOptions(y,w.active?"active":n)),b+=S,this.updateElement(w,y,x,n)}}calculateTotal(){const t=this._cachedMeta,i=t.data;let r=0,n;for(n=0;n<i.length;n++){const o=t._parsed[n];o!==null&&!isNaN(o)&&this.chart.getDataVisibility(n)&&!i[n].hidden&&(r+=Math.abs(o))}return r}calculateCircumference(t){const i=this._cachedMeta.total;return i>0&&!isNaN(t)?le*(Math.abs(t)/i):0}getLabelAndValue(t){const i=this._cachedMeta,r=this.chart,n=r.data.labels||[],o=rr(i._parsed[t],r.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let i=0;const r=this.chart;let n,o,s,a,l;if(!t){for(n=0,o=r.data.datasets.length;n<o;++n)if(r.isDatasetVisible(n)){s=r.getDatasetMeta(n),t=s.data,a=s.controller;break}}if(!t)return 0;for(n=0,o=t.length;n<o;++n)l=a.resolveDataElementOptions(n),l.borderAlign!=="inner"&&(i=Math.max(i,l.borderWidth||0,l.hoverBorderWidth||0));return i}getMaxOffset(t){let i=0;for(let r=0,n=t.length;r<n;++r){const o=this.resolveDataElementOptions(r);i=Math.max(i,o.offset||0,o.hoverOffset||0)}return i}_getRingWeightOffset(t){let i=0;for(let r=0;r<t;++r)this.chart.isDatasetVisible(r)&&(i+=this._getRingWeight(r));return i}_getRingWeight(t){return Math.max(Z(this.chart.data.datasets[t].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}O(ti,"id","doughnut"),O(ti,"defaults",{datasetElementType:!1,dataElementType:"arc",animation:{animateRotate:!0,animateScale:!1},animations:{numbers:{type:"number",properties:["circumference","endAngle","innerRadius","outerRadius","startAngle","x","y","offset","borderWidth","spacing"]}},cutout:"50%",rotation:0,circumference:360,radius:"100%",spacing:0,indexAxis:"r"}),O(ti,"descriptors",{_scriptable:t=>t!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")}),O(ti,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const i=t.data,{labels:{pointStyle:r,textAlign:n,color:o,useBorderRadius:s,borderRadius:a}}=t.legend.options;return i.labels.length&&i.datasets.length?i.labels.map((l,u)=>{const d=t.getDatasetMeta(0).controller.getStyle(u);return{text:l,fillStyle:d.backgroundColor,fontColor:o,hidden:!t.getDataVisibility(u),lineDash:d.borderDash,lineDashOffset:d.borderDashOffset,lineJoin:d.borderJoinStyle,lineWidth:d.borderWidth,strokeStyle:d.borderColor,textAlign:n,pointStyle:r,borderRadius:s&&(a||d.borderRadius),index:u}}):[]}},onClick(t,i,r){r.chart.toggleDataVisibility(i.index),r.chart.update()}}}});class Er extends ut{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(t){const i=this._cachedMeta,{dataset:r,data:n=[],_dataset:o}=i,s=this.chart._animationsDisabled;let{start:a,count:l}=Qb(i,n,s);this._drawStart=a,this._drawCount=l,e_(i)&&(a=0,l=n.length),r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!o._decimated,r.points=n;const u=this.resolveDatasetElementOptions(t);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:u},t),this.updateElements(n,a,l,t)}updateElements(t,i,r,n){const o=n==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,{sharedOptions:c,includeOptions:d}=this._getSharedOptions(i,n),f=s.axis,h=a.axis,{spanGaps:m,segment:p}=this.options,g=Ni(m)?m:Number.POSITIVE_INFINITY,b=this.chart._animationsDisabled||o||n==="none",y=i+r,S=t.length;let w=i>0&&this.getParsed(i-1);for(let x=0;x<S;++x){const I=t[x],z=b?I:{};if(x<i||x>=y){z.skip=!0;continue}const D=this.getParsed(x),N=H(D[h]),F=z[f]=s.getPixelForValue(D[f],x),B=z[h]=o||N?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,D,l):D[h],x);z.skip=isNaN(F)||isNaN(B)||N,z.stop=x>0&&Math.abs(D[f]-w[f])>g,p&&(z.parsed=D,z.raw=u.data[x]),d&&(z.options=c||this.resolveDataElementOptions(x,I.active?"active":n)),b||this.updateElement(I,x,z,n),w=D}}getMaxOverflow(){const t=this._cachedMeta,i=t.dataset,r=i.options&&i.options.borderWidth||0,n=t.data||[];if(!n.length)return r;const o=n[0].size(this.resolveDataElementOptions(0)),s=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(r,o,s)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}O(Er,"id","line"),O(Er,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),O(Er,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});class ln extends ut{constructor(t,i){super(t,i),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const i=this._cachedMeta,r=this.chart,n=r.data.labels||[],o=rr(i._parsed[t].r,r.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,i,r,n){return l_.bind(this)(t,i,r,n)}update(t){const i=this._cachedMeta.data;this._updateRadius(),this.updateElements(i,0,i.length,t)}getMinMax(){const t=this._cachedMeta,i={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((r,n)=>{const o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(o<i.min&&(i.min=o),o>i.max&&(i.max=o))}),i}_updateRadius(){const t=this.chart,i=t.chartArea,r=t.options,n=Math.min(i.right-i.left,i.bottom-i.top),o=Math.max(n/2,0),s=Math.max(r.cutoutPercentage?o/100*r.cutoutPercentage:1,0),a=(o-s)/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,i,r,n){const o=n==="reset",s=this.chart,l=s.options.animation,u=this._cachedMeta.rScale,c=u.xCenter,d=u.yCenter,f=u.getIndexAngle(0)-.5*Y;let h=f,m;const p=360/this.countVisibleElements();for(m=0;m<i;++m)h+=this._computeAngle(m,n,p);for(m=i;m<i+r;m++){const g=t[m];let b=h,y=h+this._computeAngle(m,n,p),S=s.getDataVisibility(m)?u.getDistanceFromCenterForValue(this.getParsed(m).r):0;h=y,o&&(l.animateScale&&(S=0),l.animateRotate&&(b=y=f));const w={x:c,y:d,innerRadius:0,outerRadius:S,startAngle:b,endAngle:y,options:this.resolveDataElementOptions(m,g.active?"active":n)};this.updateElement(g,m,w,n)}}countVisibleElements(){const t=this._cachedMeta;let i=0;return t.data.forEach((r,n)=>{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&i++}),i}_computeAngle(t,i,r){return this.chart.getDataVisibility(t)?lt(this.resolveDataElementOptions(t,i).angle||r):0}}O(ln,"id","polarArea"),O(ln,"defaults",{dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0}),O(ln,"overrides",{aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const i=t.data;if(i.labels.length&&i.datasets.length){const{labels:{pointStyle:r,color:n}}=t.legend.options;return i.labels.map((o,s)=>{const l=t.getDatasetMeta(0).controller.getStyle(s);return{text:o,fillStyle:l.backgroundColor,strokeStyle:l.borderColor,fontColor:n,lineWidth:l.borderWidth,pointStyle:r,hidden:!t.getDataVisibility(s),index:s}})}return[]}},onClick(t,i,r){r.chart.toggleDataVisibility(i.index),r.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}});class Hs extends ti{}O(Hs,"id","pie"),O(Hs,"defaults",{cutout:0,rotation:0,circumference:360,radius:"100%"});class Mr extends ut{getLabelAndValue(t){const i=this._cachedMeta.vScale,r=this.getParsed(t);return{label:i.getLabels()[t],value:""+i.getLabelForValue(r[i.axis])}}parseObjectData(t,i,r,n){return l_.bind(this)(t,i,r,n)}update(t){const i=this._cachedMeta,r=i.dataset,n=i.data||[],o=i.iScale.getLabels();if(r.points=n,t!=="resize"){const s=this.resolveDatasetElementOptions(t);this.options.showLine||(s.borderWidth=0);const a={_loop:!0,_fullLoop:o.length===n.length,options:s};this.updateElement(r,void 0,a,t)}this.updateElements(n,0,n.length,t)}updateElements(t,i,r,n){const o=this._cachedMeta.rScale,s=n==="reset";for(let a=i;a<i+r;a++){const l=t[a],u=this.resolveDataElementOptions(a,l.active?"active":n),c=o.getPointPositionForValue(a,this.getParsed(a).r),d=s?o.xCenter:c.x,f=s?o.yCenter:c.y,h={x:d,y:f,angle:c.angle,skip:isNaN(d)||isNaN(f),options:u};this.updateElement(l,a,h,n)}}}O(Mr,"id","radar"),O(Mr,"defaults",{datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}}),O(Mr,"overrides",{aspectRatio:1,scales:{r:{type:"radialLinear"}}});class Nr extends ut{getLabelAndValue(t){const i=this._cachedMeta,r=this.chart.data.labels||[],{xScale:n,yScale:o}=i,s=this.getParsed(t),a=n.getLabelForValue(s.x),l=o.getLabelForValue(s.y);return{label:r[t]||"",value:"("+a+", "+l+")"}}update(t){const i=this._cachedMeta,{data:r=[]}=i,n=this.chart._animationsDisabled;let{start:o,count:s}=Qb(i,r,n);if(this._drawStart=o,this._drawCount=s,e_(i)&&(o=0,s=r.length),this.options.showLine){this.datasetElementType||this.addElements();const{dataset:a,_dataset:l}=i;a._chart=this.chart,a._datasetIndex=this.index,a._decimated=!!l._decimated,a.points=r;const u=this.resolveDatasetElementOptions(t);u.segment=this.options.segment,this.updateElement(a,void 0,{animated:!n,options:u},t)}else this.datasetElementType&&(delete i.dataset,this.datasetElementType=!1);this.updateElements(r,o,s,t)}addElements(){const{showLine:t}=this.options;!this.datasetElementType&&t&&(this.datasetElementType=this.chart.registry.getElement("line")),super.addElements()}updateElements(t,i,r,n){const o=n==="reset",{iScale:s,vScale:a,_stacked:l,_dataset:u}=this._cachedMeta,c=this.resolveDataElementOptions(i,n),d=this.getSharedOptions(c),f=this.includeOptions(n,d),h=s.axis,m=a.axis,{spanGaps:p,segment:g}=this.options,b=Ni(p)?p:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||o||n==="none";let S=i>0&&this.getParsed(i-1);for(let w=i;w<i+r;++w){const x=t[w],I=this.getParsed(w),z=y?x:{},D=H(I[m]),N=z[h]=s.getPixelForValue(I[h],w),F=z[m]=o||D?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,I,l):I[m],w);z.skip=isNaN(N)||isNaN(F)||D,z.stop=w>0&&Math.abs(I[h]-S[h])>b,g&&(z.parsed=I,z.raw=u.data[w]),f&&(z.options=d||this.resolveDataElementOptions(w,x.active?"active":n)),y||this.updateElement(x,w,z,n),S=I}this.updateSharedOptions(d,n,c)}getMaxOverflow(){const t=this._cachedMeta,i=t.data||[];if(!this.options.showLine){let a=0;for(let l=i.length-1;l>=0;--l)a=Math.max(a,i[l].size(this.resolveDataElementOptions(l))/2);return a>0&&a}const r=t.dataset,n=r.options&&r.options.borderWidth||0;if(!i.length)return n;const o=i[0].size(this.resolveDataElementOptions(0)),s=i[i.length-1].size(this.resolveDataElementOptions(i.length-1));return Math.max(n,o,s)/2}}O(Nr,"id","scatter"),O(Nr,"defaults",{datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1}),O(Nr,"overrides",{interaction:{mode:"point"},scales:{x:{type:"linear"},y:{type:"linear"}}});var MT=Object.freeze({__proto__:null,BarController:Tr,BubbleController:Dr,DoughnutController:ti,LineController:Er,PieController:Hs,PolarAreaController:ln,RadarController:Mr,ScatterController:Nr});function Kt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Bu{constructor(t){O(this,"options");this.options=t||{}}static override(t){Object.assign(Bu.prototype,t)}init(){}formats(){return Kt()}parse(){return Kt()}format(){return Kt()}add(){return Kt()}diff(){return Kt()}startOf(){return Kt()}endOf(){return Kt()}}var NT={_date:Bu};function AT(e,t,i,r){const{controller:n,data:o,_sorted:s}=e,a=n._cachedMeta.iScale,l=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null;if(a&&t===a.axis&&t!=="r"&&s&&o.length){const u=a._reversePixels?n1:xt;if(r){if(n._sharedOptions){const c=o[0],d=typeof c.getRange=="function"&&c.getRange(t);if(d){const f=u(o,t,i-d),h=u(o,t,i+d);return{lo:f.lo,hi:h.hi}}}}else{const c=u(o,t,i);if(l){const{vScale:d}=n._cachedMeta,{_parsed:f}=e,h=f.slice(0,c.lo+1).reverse().findIndex(p=>!H(p[d.axis]));c.lo-=Math.max(0,h);const m=f.slice(c.hi).findIndex(p=>!H(p[d.axis]));c.hi+=Math.max(0,m)}return c}}return{lo:0,hi:o.length-1}}function fs(e,t,i,r,n){const o=e.getSortedVisibleDatasetMetas(),s=i[t];for(let a=0,l=o.length;a<l;++a){const{index:u,data:c}=o[a],{lo:d,hi:f}=AT(o[a],t,s,n);for(let h=d;h<=f;++h){const m=c[h];m.skip||r(m,u,h)}}}function CT(e){const t=e.indexOf("x")!==-1,i=e.indexOf("y")!==-1;return function(r,n){const o=t?Math.abs(r.x-n.x):0,s=i?Math.abs(r.y-n.y):0;return Math.sqrt(Math.pow(o,2)+Math.pow(s,2))}}function ws(e,t,i,r,n){const o=[];return!n&&!e.isPointInArea(t)||fs(e,i,t,function(a,l,u){!n&&!$t(a,e.chartArea,0)||a.inRange(t.x,t.y,r)&&o.push({element:a,datasetIndex:l,index:u})},!0),o}function RT(e,t,i,r){let n=[];function o(s,a,l){const{startAngle:u,endAngle:c}=s.getProps(["startAngle","endAngle"],r),{angle:d}=qb(s,{x:t.x,y:t.y});_n(d,u,c)&&n.push({element:s,datasetIndex:a,index:l})}return fs(e,i,t,o),n}function jT(e,t,i,r,n,o){let s=[];const a=CT(i);let l=Number.POSITIVE_INFINITY;function u(c,d,f){const h=c.inRange(t.x,t.y,n);if(r&&!h)return;const m=c.getCenterPoint(n);if(!(!!o||e.isPointInArea(m))&&!h)return;const g=a(t,m);g<l?(s=[{element:c,datasetIndex:d,index:f}],l=g):g===l&&s.push({element:c,datasetIndex:d,index:f})}return fs(e,i,t,u),s}function Ss(e,t,i,r,n,o){return!o&&!e.isPointInArea(t)?[]:i==="r"&&!r?RT(e,t,i,n):jT(e,t,i,r,n,o)}function ud(e,t,i,r,n){const o=[],s=i==="x"?"inXRange":"inYRange";let a=!1;return fs(e,i,t,(l,u,c)=>{l[s]&&l[s](t[i],n)&&(o.push({element:l,datasetIndex:u,index:c}),a=a||l.inRange(t.x,t.y,n))}),r&&!a?[]:o}var ZT={modes:{index(e,t,i,r){const n=Yt(t,e),o=i.axis||"x",s=i.includeInvisible||!1,a=i.intersect?ws(e,n,o,r,s):Ss(e,n,o,!1,r,s),l=[];return a.length?(e.getSortedVisibleDatasetMetas().forEach(u=>{const c=a[0].index,d=u.data[c];d&&!d.skip&&l.push({element:d,datasetIndex:u.index,index:c})}),l):[]},dataset(e,t,i,r){const n=Yt(t,e),o=i.axis||"xy",s=i.includeInvisible||!1;let a=i.intersect?ws(e,n,o,r,s):Ss(e,n,o,!1,r,s);if(a.length>0){const l=a[0].datasetIndex,u=e.getDatasetMeta(l).data;a=[];for(let c=0;c<u.length;++c)a.push({element:u[c],datasetIndex:l,index:c})}return a},point(e,t,i,r){const n=Yt(t,e),o=i.axis||"xy",s=i.includeInvisible||!1;return ws(e,n,o,r,s)},nearest(e,t,i,r){const n=Yt(t,e),o=i.axis||"xy",s=i.includeInvisible||!1;return Ss(e,n,o,i.intersect,r,s)},x(e,t,i,r){const n=Yt(t,e);return ud(e,n,"x",i.intersect,r)},y(e,t,i,r){const n=Yt(t,e);return ud(e,n,"y",i.intersect,r)}}};const __=["left","top","right","bottom"];function Wi(e,t){return e.filter(i=>i.pos===t)}function cd(e,t){return e.filter(i=>__.indexOf(i.pos)===-1&&i.box.axis===t)}function Hi(e,t){return e.sort((i,r)=>{const n=t?r:i,o=t?i:r;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function UT(e){const t=[];let i,r,n,o,s,a;for(i=0,r=(e||[]).length;i<r;++i)n=e[i],{position:o,options:{stack:s,stackWeight:a=1}}=n,t.push({index:i,box:n,pos:o,horizontal:n.isHorizontal(),weight:n.weight,stack:s&&o+s,stackWeight:a});return t}function LT(e){const t={};for(const i of e){const{stack:r,pos:n,stackWeight:o}=i;if(!r||!__.includes(n))continue;const s=t[r]||(t[r]={count:0,placed:0,weight:0,size:0});s.count++,s.weight+=o}return t}function FT(e,t){const i=LT(e),{vBoxMaxWidth:r,hBoxMaxHeight:n}=t;let o,s,a;for(o=0,s=e.length;o<s;++o){a=e[o];const{fullSize:l}=a.box,u=i[a.stack],c=u&&a.stackWeight/u.weight;a.horizontal?(a.width=c?c*r:l&&t.availableWidth,a.height=n):(a.width=r,a.height=c?c*n:l&&t.availableHeight)}return i}function BT(e){const t=UT(e),i=Hi(t.filter(u=>u.box.fullSize),!0),r=Hi(Wi(t,"left"),!0),n=Hi(Wi(t,"right")),o=Hi(Wi(t,"top"),!0),s=Hi(Wi(t,"bottom")),a=cd(t,"x"),l=cd(t,"y");return{fullSize:i,leftAndTop:r.concat(o),rightAndBottom:n.concat(l).concat(s).concat(a),chartArea:Wi(t,"chartArea"),vertical:r.concat(n).concat(l),horizontal:o.concat(s).concat(a)}}function dd(e,t,i,r){return Math.max(e[i],t[i])+Math.max(e[r],t[r])}function y_(e,t){e.top=Math.max(e.top,t.top),e.left=Math.max(e.left,t.left),e.bottom=Math.max(e.bottom,t.bottom),e.right=Math.max(e.right,t.right)}function VT(e,t,i,r){const{pos:n,box:o}=i,s=e.maxPadding;if(!q(n)){i.size&&(e[n]-=i.size);const d=r[i.stack]||{size:0,count:1};d.size=Math.max(d.size,i.horizontal?o.height:o.width),i.size=d.size/d.count,e[n]+=i.size}o.getPadding&&y_(s,o.getPadding());const a=Math.max(0,t.outerWidth-dd(s,e,"left","right")),l=Math.max(0,t.outerHeight-dd(s,e,"top","bottom")),u=a!==e.w,c=l!==e.h;return e.w=a,e.h=l,i.horizontal?{same:u,other:c}:{same:c,other:u}}function WT(e){const t=e.maxPadding;function i(r){const n=Math.max(t[r]-e[r],0);return e[r]+=n,n}e.y+=i("top"),e.x+=i("left"),i("right"),i("bottom")}function HT(e,t){const i=t.maxPadding;function r(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(s=>{o[s]=Math.max(t[s],i[s])}),o}return r(e?["left","right"]:["top","bottom"])}function Qi(e,t,i,r){const n=[];let o,s,a,l,u,c;for(o=0,s=e.length,u=0;o<s;++o){a=e[o],l=a.box,l.update(a.width||t.w,a.height||t.h,HT(a.horizontal,t));const{same:d,other:f}=VT(t,i,a,r);u|=d&&n.length,c=c||f,l.fullSize||n.push(a)}return u&&Qi(n,t,i,r)||c}function yr(e,t,i,r,n){e.top=i,e.left=t,e.right=t+r,e.bottom=i+n,e.width=r,e.height=n}function fd(e,t,i,r){const n=i.padding;let{x:o,y:s}=t;for(const a of e){const l=a.box,u=r[a.stack]||{placed:0,weight:1},c=a.stackWeight/u.weight||1;if(a.horizontal){const d=t.w*c,f=u.size||l.height;bn(u.start)&&(s=u.start),l.fullSize?yr(l,n.left,s,i.outerWidth-n.right-n.left,f):yr(l,t.left+u.placed,s,d,f),u.start=s,u.placed+=d,s=l.bottom}else{const d=t.h*c,f=u.size||l.width;bn(u.start)&&(o=u.start),l.fullSize?yr(l,o,n.top,f,i.outerHeight-n.bottom-n.top):yr(l,o,t.top+u.placed,f,d),u.start=o,u.placed+=d,o=l.right}}t.x=o,t.y=s}var Ce={addBox(e,t){e.boxes||(e.boxes=[]),t.fullSize=t.fullSize||!1,t.position=t.position||"top",t.weight=t.weight||0,t._layers=t._layers||function(){return[{z:0,draw(i){t.draw(i)}}]},e.boxes.push(t)},removeBox(e,t){const i=e.boxes?e.boxes.indexOf(t):-1;i!==-1&&e.boxes.splice(i,1)},configure(e,t,i){t.fullSize=i.fullSize,t.position=i.position,t.weight=i.weight},update(e,t,i,r){if(!e)return;const n=je(e.options.layout.padding),o=Math.max(t-n.width,0),s=Math.max(i-n.height,0),a=BT(e.boxes),l=a.vertical,u=a.horizontal;ee(e.boxes,p=>{typeof p.beforeLayout=="function"&&p.beforeLayout()});const c=l.reduce((p,g)=>g.box.options&&g.box.options.display===!1?p:p+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:i,padding:n,availableWidth:o,availableHeight:s,vBoxMaxWidth:o/2/c,hBoxMaxHeight:s/2}),f=Object.assign({},n);y_(f,je(r));const h=Object.assign({maxPadding:f,w:o,h:s,x:n.left,y:n.top},n),m=FT(l.concat(u),d);Qi(a.fullSize,h,d,m),Qi(l,h,d,m),Qi(u,h,d,m)&&Qi(l,h,d,m),WT(h),fd(a.leftAndTop,h,d,m),h.x+=h.w,h.y+=h.h,fd(a.rightAndBottom,h,d,m),e.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},ee(a.chartArea,p=>{const g=p.box;Object.assign(g,e.chartArea),g.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class x_{acquireContext(t,i){}releaseContext(t){return!1}addEventListener(t,i,r){}removeEventListener(t,i,r){}getDevicePixelRatio(){return 1}getMaximumSize(t,i,r,n){return i=Math.max(0,i||t.width),r=r||t.height,{width:i,height:Math.max(0,n?Math.floor(i/n):r)}}isAttached(t){return!0}updateConfig(t){}}class JT extends x_{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Ar="$chartjs",qT={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},hd=e=>e===null||e==="";function KT(e,t){const i=e.style,r=e.getAttribute("height"),n=e.getAttribute("width");if(e[Ar]={initial:{height:r,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",hd(n)){const o=Xc(e,"width");o!==void 0&&(e.width=o)}if(hd(r))if(e.style.height==="")e.height=e.width/(t||2);else{const o=Xc(e,"height");o!==void 0&&(e.height=o)}return e}const $_=X1?{passive:!0}:!1;function XT(e,t,i){e&&e.addEventListener(t,i,$_)}function GT(e,t,i){e&&e.canvas&&e.canvas.removeEventListener(t,i,$_)}function YT(e,t){const i=qT[e.type]||e.type,{x:r,y:n}=Yt(e,t);return{type:i,chart:t,native:e,x:r!==void 0?r:null,y:n!==void 0?n:null}}function ro(e,t){for(const i of e)if(i===t||i.contains(t))return!0}function QT(e,t,i){const r=e.canvas,n=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||ro(a.addedNodes,r),s=s&&!ro(a.removedNodes,r);s&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}function eD(e,t,i){const r=e.canvas,n=new MutationObserver(o=>{let s=!1;for(const a of o)s=s||ro(a.removedNodes,r),s=s&&!ro(a.addedNodes,r);s&&i()});return n.observe(document,{childList:!0,subtree:!0}),n}const xn=new Map;let md=0;function k_(){const e=window.devicePixelRatio;e!==md&&(md=e,xn.forEach((t,i)=>{i.currentDevicePixelRatio!==e&&t()}))}function tD(e,t){xn.size||window.addEventListener("resize",k_),xn.set(e,t)}function iD(e){xn.delete(e),xn.size||window.removeEventListener("resize",k_)}function nD(e,t,i){const r=e.canvas,n=r&&Fu(r);if(!n)return;const o=Yb((a,l)=>{const u=n.clientWidth;i(a,l),u<n.clientWidth&&i()},window),s=new ResizeObserver(a=>{const l=a[0],u=l.contentRect.width,c=l.contentRect.height;u===0&&c===0||o(u,c)});return s.observe(n),tD(e,o),s}function Is(e,t,i){i&&i.disconnect(),t==="resize"&&iD(e)}function rD(e,t,i){const r=e.canvas,n=Yb(o=>{e.ctx!==null&&i(YT(o,e))},e);return XT(r,t,n),n}class oD extends x_{acquireContext(t,i){const r=t&&t.getContext&&t.getContext("2d");return r&&r.canvas===t?(KT(t,i),r):null}releaseContext(t){const i=t.canvas;if(!i[Ar])return!1;const r=i[Ar].initial;["height","width"].forEach(o=>{const s=r[o];H(s)?i.removeAttribute(o):i.setAttribute(o,s)});const n=r.style||{};return Object.keys(n).forEach(o=>{i.style[o]=n[o]}),i.width=i.width,delete i[Ar],!0}addEventListener(t,i,r){this.removeEventListener(t,i);const n=t.$proxies||(t.$proxies={}),s={attach:QT,detach:eD,resize:nD}[i]||rD;n[i]=s(t,i,r)}removeEventListener(t,i){const r=t.$proxies||(t.$proxies={}),n=r[i];if(!n)return;({attach:Is,detach:Is,resize:Is}[i]||GT)(t,i,n),r[i]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,i,r,n){return K1(t,i,r,n)}isAttached(t){const i=t&&Fu(t);return!!(i&&i.isConnected)}}function sD(e){return!Lu()||typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas?JT:oD}class ct{constructor(){O(this,"x");O(this,"y");O(this,"active",!1);O(this,"options");O(this,"$animations")}tooltipPosition(t){const{x:i,y:r}=this.getProps(["x","y"],t);return{x:i,y:r}}hasValue(){return Ni(this.x)&&Ni(this.y)}getProps(t,i){const r=this.$animations;if(!i||!r)return this;const n={};return t.forEach(o=>{n[o]=r[o]&&r[o].active()?r[o]._to:this[o]}),n}}O(ct,"defaults",{}),O(ct,"defaultRoutes");function aD(e,t){const i=e.options.ticks,r=lD(e),n=Math.min(i.maxTicksLimit||r,r),o=i.major.enabled?cD(t):[],s=o.length,a=o[0],l=o[s-1],u=[];if(s>n)return dD(t,u,o,s/n),u;const c=uD(o,t,n);if(s>0){let d,f;const h=s>1?Math.round((l-a)/(s-1)):null;for(xr(t,u,c,H(h)?0:a-h,a),d=0,f=s-1;d<f;d++)xr(t,u,c,o[d],o[d+1]);return xr(t,u,c,l,H(h)?t.length:l+h),u}return xr(t,u,c),u}function lD(e){const t=e.options.offset,i=e._tickSize(),r=e._length/i+(t?0:1),n=e._maxLength/i;return Math.floor(Math.min(r,n))}function uD(e,t,i){const r=fD(e),n=t.length/i;if(!r)return Math.max(n,1);const o=YP(r);for(let s=0,a=o.length-1;s<a;s++){const l=o[s];if(l>n)return l}return Math.max(n,1)}function cD(e){const t=[];let i,r;for(i=0,r=e.length;i<r;i++)e[i].major&&t.push(i);return t}function dD(e,t,i,r){let n=0,o=i[0],s;for(r=Math.ceil(r),s=0;s<e.length;s++)s===o&&(t.push(e[s]),n++,o=i[n*r])}function xr(e,t,i,r,n){const o=Z(r,0),s=Math.min(Z(n,e.length),e.length);let a=0,l,u,c;for(i=Math.ceil(i),n&&(l=n-r,i=l/Math.floor(l/i)),c=o;c<0;)a++,c=Math.round(o+a*i);for(u=Math.max(o,0);u<s;u++)u===c&&(t.push(e[u]),a++,c=Math.round(o+a*i))}function fD(e){const t=e.length;let i,r;if(t<2)return!1;for(r=e[0],i=1;i<t;++i)if(e[i]-e[i-1]!==r)return!1;return r}const hD=e=>e==="left"?"right":e==="right"?"left":e,pd=(e,t,i)=>t==="top"||t==="left"?e[t]+i:e[t]-i,gd=(e,t)=>Math.min(t||e,e);function vd(e,t){const i=[],r=e.length/t,n=e.length;let o=0;for(;o<n;o+=r)i.push(e[Math.floor(o)]);return i}function mD(e,t,i){const r=e.ticks.length,n=Math.min(t,r-1),o=e._startPixel,s=e._endPixel,a=1e-6;let l=e.getPixelForTick(n),u;if(!(i&&(r===1?u=Math.max(l-o,s-l):t===0?u=(e.getPixelForTick(1)-l)/2:u=(l-e.getPixelForTick(n-1))/2,l+=n<t?u:-u,l<o-a||l>s+a)))return l}function pD(e,t){ee(e,i=>{const r=i.gc,n=r.length/2;let o;if(n>t){for(o=0;o<n;++o)delete i.data[r[o]];r.splice(0,n)}})}function Ji(e){return e.drawTicks?e.tickLength:0}function bd(e,t){if(!e.display)return 0;const i=Se(e.font,t),r=je(e.padding);return(de(e.text)?e.text.length:1)*i.lineHeight+r.height}function gD(e,t){return Bt(e,{scale:t,type:"scale"})}function vD(e,t,i){return Bt(e,{tick:i,index:t,type:"tick"})}function bD(e,t,i){let r=Au(e);return(i&&t!=="right"||!i&&t==="right")&&(r=hD(r)),r}function _D(e,t,i,r){const{top:n,left:o,bottom:s,right:a,chart:l}=e,{chartArea:u,scales:c}=l;let d=0,f,h,m;const p=s-n,g=a-o;if(e.isHorizontal()){if(h=Ne(r,o,a),q(i)){const b=Object.keys(i)[0],y=i[b];m=c[b].getPixelForValue(y)+p-t}else i==="center"?m=(u.bottom+u.top)/2+p-t:m=pd(e,i,t);f=a-o}else{if(q(i)){const b=Object.keys(i)[0],y=i[b];h=c[b].getPixelForValue(y)-g+t}else i==="center"?h=(u.left+u.right)/2-g+t:h=pd(e,i,t);m=Ne(r,s,n),d=i==="left"?-ke:ke}return{titleX:h,titleY:m,maxWidth:f,rotation:d}}class mi extends ct{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,i){return t}getUserBounds(){let{_userMin:t,_userMax:i,_suggestedMin:r,_suggestedMax:n}=this;return t=Je(t,Number.POSITIVE_INFINITY),i=Je(i,Number.NEGATIVE_INFINITY),r=Je(r,Number.POSITIVE_INFINITY),n=Je(n,Number.NEGATIVE_INFINITY),{min:Je(t,r),max:Je(i,n),minDefined:ye(t),maxDefined:ye(i)}}getMinMax(t){let{min:i,max:r,minDefined:n,maxDefined:o}=this.getUserBounds(),s;if(n&&o)return{min:i,max:r};const a=this.getMatchingVisibleMetas();for(let l=0,u=a.length;l<u;++l)s=a[l].controller.getMinMax(this,t),n||(i=Math.min(i,s.min)),o||(r=Math.max(r,s.max));return i=o&&i>r?r:i,r=n&&i>r?i:r,{min:Je(i,Je(r,i)),max:Je(r,Je(i,r))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){ae(this.options.beforeUpdate,[this])}update(t,i,r){const{beginAtZero:n,grace:o,ticks:s}=this.options,a=s.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=i,this._margins=r=Object.assign({left:0,right:0,top:0,bottom:0},r),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+r.left+r.right:this.height+r.top+r.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=z1(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a<this.ticks.length;this._convertTicksToLabels(l?vd(this.ticks,a):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),s.display&&(s.autoSkip||s.source==="auto")&&(this.ticks=aD(this,this.ticks),this._labelSizes=null,this.afterAutoSkip()),l&&this._convertTicksToLabels(this.ticks),this.beforeFit(),this.fit(),this.afterFit(),this.afterUpdate()}configure(){let t=this.options.reverse,i,r;this.isHorizontal()?(i=this.left,r=this.right):(i=this.top,r=this.bottom,t=!t),this._startPixel=i,this._endPixel=r,this._reversePixels=t,this._length=r-i,this._alignToPixels=this.options.alignToPixels}afterUpdate(){ae(this.options.afterUpdate,[this])}beforeSetDimensions(){ae(this.options.beforeSetDimensions,[this])}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=0,this.right=this.width):(this.height=this.maxHeight,this.top=0,this.bottom=this.height),this.paddingLeft=0,this.paddingTop=0,this.paddingRight=0,this.paddingBottom=0}afterSetDimensions(){ae(this.options.afterSetDimensions,[this])}_callHooks(t){this.chart.notifyPlugins(t,this.getContext()),ae(this.options[t],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){ae(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(t){const i=this.options.ticks;let r,n,o;for(r=0,n=t.length;r<n;r++)o=t[r],o.label=ae(i.callback,[o.value,r,t],this)}afterTickToLabelConversion(){ae(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){ae(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const t=this.options,i=t.ticks,r=gd(this.ticks.length,t.ticks.maxTicksLimit),n=i.minRotation||0,o=i.maxRotation;let s=n,a,l,u;if(!this._isVisible()||!i.display||n>=o||r<=1||!this.isHorizontal()){this.labelRotation=n;return}const c=this._getLabelSizes(),d=c.widest.width,f=c.highest.height,h=Ie(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/r:h/(r-1),d+6>a&&(a=h/(r-(t.offset?.5:1)),l=this.maxHeight-Ji(t.grid)-i.padding-bd(t.title,this.chart.options.font),u=Math.sqrt(d*d+f*f),s=Mu(Math.min(Math.asin(Ie((c.highest.height+6)/a,-1,1)),Math.asin(Ie(l/u,-1,1))-Math.asin(Ie(f/u,-1,1)))),s=Math.max(n,Math.min(o,s))),this.labelRotation=s}afterCalculateLabelRotation(){ae(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){ae(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:i,options:{ticks:r,title:n,grid:o}}=this,s=this._isVisible(),a=this.isHorizontal();if(s){const l=bd(n,i.options.font);if(a?(t.width=this.maxWidth,t.height=Ji(o)+l):(t.height=this.maxHeight,t.width=Ji(o)+l),r.display&&this.ticks.length){const{first:u,last:c,widest:d,highest:f}=this._getLabelSizes(),h=r.padding*2,m=lt(this.labelRotation),p=Math.cos(m),g=Math.sin(m);if(a){const b=r.mirror?0:g*d.width+p*f.height;t.height=Math.min(this.maxHeight,t.height+b+h)}else{const b=r.mirror?0:p*d.width+g*f.height;t.width=Math.min(this.maxWidth,t.width+b+h)}this._calculatePadding(u,c,g,p)}}this._handleMargins(),a?(this.width=this._length=i.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=i.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,i,r,n){const{ticks:{align:o,padding:s},position:a}=this.options,l=this.labelRotation!==0,u=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const c=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let f=0,h=0;l?u?(f=n*t.width,h=r*i.height):(f=r*t.height,h=n*i.width):o==="start"?h=i.width:o==="end"?f=t.width:o!=="inner"&&(f=t.width/2,h=i.width/2),this.paddingLeft=Math.max((f-c+s)*this.width/(this.width-c),0),this.paddingRight=Math.max((h-d+s)*this.width/(this.width-d),0)}else{let c=i.height/2,d=t.height/2;o==="start"?(c=0,d=t.height):o==="end"&&(c=i.height,d=0),this.paddingTop=c+s,this.paddingBottom=d+s}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){ae(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:i}=this.options;return i==="top"||i==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let i,r;for(i=0,r=t.length;i<r;i++)H(t[i].label)&&(t.splice(i,1),r--,i--);this.afterTickToLabelConversion()}_getLabelSizes(){let t=this._labelSizes;if(!t){const i=this.options.ticks.sampleSize;let r=this.ticks;i<r.length&&(r=vd(r,i)),this._labelSizes=t=this._computeLabelSizes(r,r.length,this.options.ticks.maxTicksLimit)}return t}_computeLabelSizes(t,i,r){const{ctx:n,_longestTextCache:o}=this,s=[],a=[],l=Math.floor(i/gd(i,r));let u=0,c=0,d,f,h,m,p,g,b,y,S,w,x;for(d=0;d<i;d+=l){if(m=t[d].label,p=this._resolveTickFontOptions(d),n.font=g=p.string,b=o[g]=o[g]||{data:{},gc:[]},y=p.lineHeight,S=w=0,!H(m)&&!de(m))S=io(n,b.data,b.gc,S,m),w=y;else if(de(m))for(f=0,h=m.length;f<h;++f)x=m[f],!H(x)&&!de(x)&&(S=io(n,b.data,b.gc,S,x),w+=y);s.push(S),a.push(w),u=Math.max(S,u),c=Math.max(w,c)}pD(o,i);const I=s.indexOf(u),z=a.indexOf(c),D=N=>({width:s[N]||0,height:a[N]||0});return{first:D(0),last:D(i-1),widest:D(I),highest:D(z),widths:s,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,i){return NaN}getValueForPixel(t){}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const i=this._startPixel+t*this._length;return i1(this._alignToPixels?qt(this.chart,i,0):i)}getDecimalForPixel(t){const i=(t-this._startPixel)/this._length;return this._reversePixels?1-i:i}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:i}=this;return t<0&&i<0?i:t>0&&i>0?t:0}getContext(t){const i=this.ticks||[];if(t>=0&&t<i.length){const r=i[t];return r.$context||(r.$context=vD(this.getContext(),t,r))}return this.$context||(this.$context=gD(this.chart.getContext(),this))}_tickSize(){const t=this.options.ticks,i=lt(this.labelRotation),r=Math.abs(Math.cos(i)),n=Math.abs(Math.sin(i)),o=this._getLabelSizes(),s=t.autoSkipPadding||0,a=o?o.widest.width+s:0,l=o?o.highest.height+s:0;return this.isHorizontal()?l*r>a*n?a/r:l/n:l*n<a*r?l/r:a/n}_isVisible(){const t=this.options.display;return t!=="auto"?!!t:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(t){const i=this.axis,r=this.chart,n=this.options,{grid:o,position:s,border:a}=n,l=o.offset,u=this.isHorizontal(),d=this.ticks.length+(l?1:0),f=Ji(o),h=[],m=a.setContext(this.getContext()),p=m.display?m.width:0,g=p/2,b=function(ce){return qt(r,ce,p)};let y,S,w,x,I,z,D,N,F,B,K,ze;if(s==="top")y=b(this.bottom),z=this.bottom-f,N=y-g,B=b(t.top)+g,ze=t.bottom;else if(s==="bottom")y=b(this.top),B=t.top,ze=b(t.bottom)-g,z=y+g,N=this.top+f;else if(s==="left")y=b(this.right),I=this.right-f,D=y-g,F=b(t.left)+g,K=t.right;else if(s==="right")y=b(this.left),F=t.left,K=b(t.right)-g,I=y+g,D=this.left+f;else if(i==="x"){if(s==="center")y=b((t.top+t.bottom)/2+.5);else if(q(s)){const ce=Object.keys(s)[0],$e=s[ce];y=b(this.chart.scales[ce].getPixelForValue($e))}B=t.top,ze=t.bottom,z=y+g,N=z+f}else if(i==="y"){if(s==="center")y=b((t.left+t.right)/2);else if(q(s)){const ce=Object.keys(s)[0],$e=s[ce];y=b(this.chart.scales[ce].getPixelForValue($e))}I=y-g,D=I-f,F=t.left,K=t.right}const He=Z(n.ticks.maxTicksLimit,d),te=Math.max(1,Math.ceil(d/He));for(S=0;S<d;S+=te){const ce=this.getContext(S),$e=o.setContext(ce),st=a.setContext(ce),Ee=$e.lineWidth,pi=$e.color,or=st.dash||[],gi=st.dashOffset,Li=$e.tickWidth,Vt=$e.tickColor,Fi=$e.tickBorderDash||[],Wt=$e.tickBorderDashOffset;w=mD(this,S,l),w!==void 0&&(x=qt(r,w,Ee),u?I=D=F=K=x:z=N=B=ze=x,h.push({tx1:I,ty1:z,tx2:D,ty2:N,x1:F,y1:B,x2:K,y2:ze,width:Ee,color:pi,borderDash:or,borderDashOffset:gi,tickWidth:Li,tickColor:Vt,tickBorderDash:Fi,tickBorderDashOffset:Wt}))}return this._ticksLength=d,this._borderValue=y,h}_computeLabelItems(t){const i=this.axis,r=this.options,{position:n,ticks:o}=r,s=this.isHorizontal(),a=this.ticks,{align:l,crossAlign:u,padding:c,mirror:d}=o,f=Ji(r.grid),h=f+c,m=d?-c:h,p=-lt(this.labelRotation),g=[];let b,y,S,w,x,I,z,D,N,F,B,K,ze="middle";if(n==="top")I=this.bottom-m,z=this._getXAxisLabelAlignment();else if(n==="bottom")I=this.top+m,z=this._getXAxisLabelAlignment();else if(n==="left"){const te=this._getYAxisLabelAlignment(f);z=te.textAlign,x=te.x}else if(n==="right"){const te=this._getYAxisLabelAlignment(f);z=te.textAlign,x=te.x}else if(i==="x"){if(n==="center")I=(t.top+t.bottom)/2+h;else if(q(n)){const te=Object.keys(n)[0],ce=n[te];I=this.chart.scales[te].getPixelForValue(ce)+h}z=this._getXAxisLabelAlignment()}else if(i==="y"){if(n==="center")x=(t.left+t.right)/2-h;else if(q(n)){const te=Object.keys(n)[0],ce=n[te];x=this.chart.scales[te].getPixelForValue(ce)}z=this._getYAxisLabelAlignment(f).textAlign}i==="y"&&(l==="start"?ze="top":l==="end"&&(ze="bottom"));const He=this._getLabelSizes();for(b=0,y=a.length;b<y;++b){S=a[b],w=S.label;const te=o.setContext(this.getContext(b));D=this.getPixelForTick(b)+o.labelOffset,N=this._resolveTickFontOptions(b),F=N.lineHeight,B=de(w)?w.length:1;const ce=B/2,$e=te.color,st=te.textStrokeColor,Ee=te.textStrokeWidth;let pi=z;s?(x=D,z==="inner"&&(b===y-1?pi=this.options.reverse?"left":"right":b===0?pi=this.options.reverse?"right":"left":pi="center"),n==="top"?u==="near"||p!==0?K=-B*F+F/2:u==="center"?K=-He.highest.height/2-ce*F+F:K=-He.highest.height+F/2:u==="near"||p!==0?K=F/2:u==="center"?K=He.highest.height/2-ce*F:K=He.highest.height-B*F,d&&(K*=-1),p!==0&&!te.showLabelBackdrop&&(x+=F/2*Math.sin(p))):(I=D,K=(1-B)*F/2);let or;if(te.showLabelBackdrop){const gi=je(te.backdropPadding),Li=He.heights[b],Vt=He.widths[b];let Fi=K-gi.top,Wt=0-gi.left;switch(ze){case"middle":Fi-=Li/2;break;case"bottom":Fi-=Li;break}switch(z){case"center":Wt-=Vt/2;break;case"right":Wt-=Vt;break;case"inner":b===y-1?Wt-=Vt:b>0&&(Wt-=Vt/2);break}or={left:Wt,top:Fi,width:Vt+gi.width,height:Li+gi.height,color:te.backdropColor}}g.push({label:w,font:N,textOffset:K,options:{rotation:p,color:$e,strokeColor:st,strokeWidth:Ee,textAlign:pi,textBaseline:ze,translation:[x,I],backdrop:or}})}return g}_getXAxisLabelAlignment(){const{position:t,ticks:i}=this.options;if(-lt(this.labelRotation))return t==="top"?"left":"right";let n="center";return i.align==="start"?n="left":i.align==="end"?n="right":i.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:i,ticks:{crossAlign:r,mirror:n,padding:o}}=this.options,s=this._getLabelSizes(),a=t+o,l=s.widest.width;let u,c;return i==="left"?n?(c=this.right+o,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c+=l)):(c=this.right-a,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c=this.left)):i==="right"?n?(c=this.left+o,r==="near"?u="right":r==="center"?(u="center",c-=l/2):(u="left",c-=l)):(c=this.left+a,r==="near"?u="left":r==="center"?(u="center",c+=l/2):(u="right",c=this.right)):u="right",{textAlign:u,x:c}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,i=this.options.position;if(i==="left"||i==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(i==="top"||i==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:i},left:r,top:n,width:o,height:s}=this;i&&(t.save(),t.fillStyle=i,t.fillRect(r,n,o,s),t.restore())}getLineWidthForValue(t){const i=this.options.grid;if(!this._isVisible()||!i.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?i.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const i=this.options.grid,r=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,s;const a=(l,u,c)=>{!c.width||!c.color||(r.save(),r.lineWidth=c.width,r.strokeStyle=c.color,r.setLineDash(c.borderDash||[]),r.lineDashOffset=c.borderDashOffset,r.beginPath(),r.moveTo(l.x,l.y),r.lineTo(u.x,u.y),r.stroke(),r.restore())};if(i.display)for(o=0,s=n.length;o<s;++o){const l=n[o];i.drawOnChartArea&&a({x:l.x1,y:l.y1},{x:l.x2,y:l.y2},l),i.drawTicks&&a({x:l.tx1,y:l.ty1},{x:l.tx2,y:l.ty2},{color:l.tickColor,width:l.tickWidth,borderDash:l.tickBorderDash,borderDashOffset:l.tickBorderDashOffset})}}drawBorder(){const{chart:t,ctx:i,options:{border:r,grid:n}}=this,o=r.setContext(this.getContext()),s=r.display?o.width:0;if(!s)return;const a=n.setContext(this.getContext(0)).lineWidth,l=this._borderValue;let u,c,d,f;this.isHorizontal()?(u=qt(t,this.left,s)-s/2,c=qt(t,this.right,a)+a/2,d=f=l):(d=qt(t,this.top,s)-s/2,f=qt(t,this.bottom,a)+a/2,u=c=l),i.save(),i.lineWidth=o.width,i.strokeStyle=o.color,i.beginPath(),i.moveTo(u,d),i.lineTo(c,f),i.stroke(),i.restore()}drawLabels(t){if(!this.options.ticks.display)return;const r=this.ctx,n=this._computeLabelArea();n&&us(r,n);const o=this.getLabelItems(t);for(const s of o){const a=s.options,l=s.font,u=s.label,c=s.textOffset;ui(r,u,0,c,l,a)}n&&cs(r)}drawTitle(){const{ctx:t,options:{position:i,title:r,reverse:n}}=this;if(!r.display)return;const o=Se(r.font),s=je(r.padding),a=r.align;let l=o.lineHeight/2;i==="bottom"||i==="center"||q(i)?(l+=s.bottom,de(r.text)&&(l+=o.lineHeight*(r.text.length-1))):l+=s.top;const{titleX:u,titleY:c,maxWidth:d,rotation:f}=_D(this,l,i,a);ui(t,r.text,0,0,o,{color:r.color,maxWidth:d,rotation:f,textAlign:bD(a,i,n),textBaseline:"middle",translation:[u,c]})}draw(t){this._isVisible()&&(this.drawBackground(),this.drawGrid(t),this.drawBorder(),this.drawTitle(),this.drawLabels(t))}_layers(){const t=this.options,i=t.ticks&&t.ticks.z||0,r=Z(t.grid&&t.grid.z,-1),n=Z(t.border&&t.border.z,0);return!this._isVisible()||this.draw!==mi.prototype.draw?[{z:i,draw:o=>{this.draw(o)}}]:[{z:r,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:i,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const i=this.chart.getSortedVisibleDatasetMetas(),r=this.axis+"AxisID",n=[];let o,s;for(o=0,s=i.length;o<s;++o){const a=i[o];a[r]===this.id&&(!t||a.type===t)&&n.push(a)}return n}_resolveTickFontOptions(t){const i=this.options.ticks.setContext(this.getContext(t));return Se(i.font)}_maxDigits(){const t=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/t}}class $r{constructor(t,i,r){this.type=t,this.scope=i,this.override=r,this.items=Object.create(null)}isForType(t){return Object.prototype.isPrototypeOf.call(this.type.prototype,t.prototype)}register(t){const i=Object.getPrototypeOf(t);let r;$D(i)&&(r=this.register(i));const n=this.items,o=t.id,s=this.scope+"."+o;if(!o)throw new Error("class does not have id: "+t);return o in n||(n[o]=t,yD(t,s,r),this.override&&fe.override(t.id,t.overrides)),s}get(t){return this.items[t]}unregister(t){const i=this.items,r=t.id,n=this.scope;r in i&&delete i[r],n&&r in fe[n]&&(delete fe[n][r],this.override&&delete li[r])}}function yD(e,t,i){const r=vn(Object.create(null),[i?fe.get(i):{},fe.get(t),e.defaults]);fe.set(t,r),e.defaultRoutes&&xD(t,e.defaultRoutes),e.descriptors&&fe.describe(t,e.descriptors)}function xD(e,t){Object.keys(t).forEach(i=>{const r=i.split("."),n=r.pop(),o=[e].concat(r).join("."),s=t[i].split("."),a=s.pop(),l=s.join(".");fe.route(o,n,l,a)})}function $D(e){return"id"in e&&"defaults"in e}class kD{constructor(){this.controllers=new $r(ut,"datasets",!0),this.elements=new $r(ct,"elements"),this.plugins=new $r(Object,"plugins"),this.scales=new $r(mi,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,i,r){[...i].forEach(n=>{const o=r||this._getRegistryForType(n);r||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):ee(n,s=>{const a=r||this._getRegistryForType(s);this._exec(t,a,s)})})}_exec(t,i,r){const n=Eu(t);ae(r["before"+n],[],r),i[t](r),ae(r["after"+n],[],r)}_getRegistryForType(t){for(let i=0;i<this._typedRegistries.length;i++){const r=this._typedRegistries[i];if(r.isForType(t))return r}return this.plugins}_get(t,i,r){const n=i.get(t);if(n===void 0)throw new Error('"'+t+'" is not a registered '+r+".");return n}}var ft=new kD;class wD{constructor(){this._init=void 0}notify(t,i,r,n){if(i==="beforeInit"&&(this._init=this._createDescriptors(t,!0),this._notify(this._init,t,"install")),this._init===void 0)return;const o=n?this._descriptors(t).filter(n):this._descriptors(t),s=this._notify(o,t,i,r);return i==="afterDestroy"&&(this._notify(o,t,"stop"),this._notify(this._init,t,"uninstall"),this._init=void 0),s}_notify(t,i,r,n){n=n||{};for(const o of t){const s=o.plugin,a=s[r],l=[i,n,o.options];if(ae(a,l,s)===!1&&n.cancelable)return!1}return!0}invalidate(){H(this._cache)||(this._oldCache=this._cache,this._cache=void 0)}_descriptors(t){if(this._cache)return this._cache;const i=this._cache=this._createDescriptors(t);return this._notifyStateChanges(t),i}_createDescriptors(t,i){const r=t&&t.config,n=Z(r.options&&r.options.plugins,{}),o=SD(r);return n===!1&&!i?[]:zD(t,o,n,i)}_notifyStateChanges(t){const i=this._oldCache||[],r=this._cache,n=(o,s)=>o.filter(a=>!s.some(l=>a.plugin.id===l.plugin.id));this._notify(n(i,r),t,"stop"),this._notify(n(r,i),t,"start")}}function SD(e){const t={},i=[],r=Object.keys(ft.plugins.items);for(let o=0;o<r.length;o++)i.push(ft.getPlugin(r[o]));const n=e.plugins||[];for(let o=0;o<n.length;o++){const s=n[o];i.indexOf(s)===-1&&(i.push(s),t[s.id]=!0)}return{plugins:i,localIds:t}}function ID(e,t){return!t&&e===!1?null:e===!0?{}:e}function zD(e,{plugins:t,localIds:i},r,n){const o=[],s=e.getContext();for(const a of t){const l=a.id,u=ID(r[l],n);u!==null&&o.push({plugin:a,options:OD(e.config,{plugin:a,local:i[l]},u,s)})}return o}function OD(e,{plugin:t,local:i},r,n){const o=e.pluginScopeKeys(t),s=e.getOptionScopes(r,o);return i&&t.defaults&&s.push(t.defaults),e.createResolver(s,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Js(e,t){const i=fe.datasets[e]||{};return((t.datasets||{})[e]||{}).indexAxis||t.indexAxis||i.indexAxis||"x"}function PD(e,t){let i=e;return e==="_index_"?i=t:e==="_value_"&&(i=t==="x"?"y":"x"),i}function TD(e,t){return e===t?"_index_":"_value_"}function _d(e){if(e==="x"||e==="y"||e==="r")return e}function DD(e){if(e==="top"||e==="bottom")return"x";if(e==="left"||e==="right")return"y"}function qs(e,...t){if(_d(e))return e;for(const i of t){const r=i.axis||DD(i.position)||e.length>1&&_d(e[0].toLowerCase());if(r)return r}throw new Error(`Cannot determine type of '${e}' axis. Please provide 'axis' or 'position' option.`)}function yd(e,t,i){if(i[t+"AxisID"]===e)return{axis:t}}function ED(e,t){if(t.data&&t.data.datasets){const i=t.data.datasets.filter(r=>r.xAxisID===e||r.yAxisID===e);if(i.length)return yd(e,"x",i[0])||yd(e,"y",i[0])}return{}}function MD(e,t){const i=li[e.type]||{scales:{}},r=t.scales||{},n=Js(e.type,t),o=Object.create(null);return Object.keys(r).forEach(s=>{const a=r[s];if(!q(a))return console.error(`Invalid scale configuration for scale: ${s}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${s}`);const l=qs(s,a,ED(s,e),fe.scales[a.type]),u=TD(l,n),c=i.scales||{};o[s]=rn(Object.create(null),[{axis:l},a,c[l],c[u]])}),e.data.datasets.forEach(s=>{const a=s.type||e.type,l=s.indexAxis||Js(a,t),c=(li[a]||{}).scales||{};Object.keys(c).forEach(d=>{const f=PD(d,l),h=s[f+"AxisID"]||f;o[h]=o[h]||Object.create(null),rn(o[h],[{axis:f},r[h],c[d]])})}),Object.keys(o).forEach(s=>{const a=o[s];rn(a,[fe.scales[a.type],fe.scale])}),o}function w_(e){const t=e.options||(e.options={});t.plugins=Z(t.plugins,{}),t.scales=MD(e,t)}function S_(e){return e=e||{},e.datasets=e.datasets||[],e.labels=e.labels||[],e}function ND(e){return e=e||{},e.data=S_(e.data),w_(e),e}const xd=new Map,I_=new Set;function kr(e,t){let i=xd.get(e);return i||(i=t(),xd.set(e,i),I_.add(i)),i}const qi=(e,t,i)=>{const r=jt(t,i);r!==void 0&&e.add(r)};class AD{constructor(t){this._config=ND(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=S_(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),w_(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return kr(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,i){return kr(`${t}.transition.${i}`,()=>[[`datasets.${t}.transitions.${i}`,`transitions.${i}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,i){return kr(`${t}-${i}`,()=>[[`datasets.${t}.elements.${i}`,`datasets.${t}`,`elements.${i}`,""]])}pluginScopeKeys(t){const i=t.id,r=this.type;return kr(`${r}-plugin-${i}`,()=>[[`plugins.${i}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,i){const r=this._scopeCache;let n=r.get(t);return(!n||i)&&(n=new Map,r.set(t,n)),n}getOptionScopes(t,i,r){const{options:n,type:o}=this,s=this._cachedScopes(t,r),a=s.get(i);if(a)return a;const l=new Set;i.forEach(c=>{t&&(l.add(t),c.forEach(d=>qi(l,t,d))),c.forEach(d=>qi(l,n,d)),c.forEach(d=>qi(l,li[o]||{},d)),c.forEach(d=>qi(l,fe,d)),c.forEach(d=>qi(l,Vs,d))});const u=Array.from(l);return u.length===0&&u.push(Object.create(null)),I_.has(i)&&s.set(i,u),u}chartOptionScopes(){const{options:t,type:i}=this;return[t,li[i]||{},fe.datasets[i]||{},{type:i},fe,Vs]}resolveNamedOptions(t,i,r,n=[""]){const o={$shared:!0},{resolver:s,subPrefixes:a}=$d(this._resolverCache,t,n);let l=s;if(RD(s,i)){o.$shared=!1,r=Zt(r)?r():r;const u=this.createResolver(t,r,a);l=Ai(s,r,u)}for(const u of i)o[u]=l[u];return o}createResolver(t,i,r=[""],n){const{resolver:o}=$d(this._resolverCache,t,r);return q(i)?Ai(o,i,void 0,n):o}}function $d(e,t,i){let r=e.get(t);r||(r=new Map,e.set(t,r));const n=i.join();let o=r.get(n);return o||(o={resolver:ju(t,i),subPrefixes:i.filter(a=>!a.toLowerCase().includes("hover"))},r.set(n,o)),o}const CD=e=>q(e)&&Object.getOwnPropertyNames(e).some(t=>Zt(e[t]));function RD(e,t){const{isScriptable:i,isIndexable:r}=r_(e);for(const n of t){const o=i(n),s=r(n),a=(s||o)&&e[n];if(o&&(Zt(a)||CD(a))||s&&de(a))return!0}return!1}var jD="4.5.1";const ZD=["top","bottom","left","right","chartArea"];function kd(e,t){return e==="top"||e==="bottom"||ZD.indexOf(e)===-1&&t==="x"}function wd(e,t){return function(i,r){return i[e]===r[e]?i[t]-r[t]:i[e]-r[e]}}function Sd(e){const t=e.chart,i=t.options.animation;t.notifyPlugins("afterRender"),ae(i&&i.onComplete,[e],t)}function UD(e){const t=e.chart,i=t.options.animation;ae(i&&i.onProgress,[e],t)}function z_(e){return Lu()&&typeof e=="string"?e=document.getElementById(e):e&&e.length&&(e=e[0]),e&&e.canvas&&(e=e.canvas),e}const Cr={},Id=e=>{const t=z_(e);return Object.values(Cr).filter(i=>i.canvas===t).pop()};function LD(e,t,i){const r=Object.keys(e);for(const n of r){const o=+n;if(o>=t){const s=e[n];delete e[n],(i>0||o>t)&&(e[o+i]=s)}}}function FD(e,t,i,r){return!i||e.type==="mouseout"?null:r?t:e}class _t{static register(...t){ft.add(...t),zd()}static unregister(...t){ft.remove(...t),zd()}constructor(t,i){const r=this.config=new AD(i),n=z_(t),o=Id(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const s=r.createResolver(r.chartOptionScopes(),this.getContext());this.platform=new(r.platform||sD(n)),this.platform.updateConfig(r);const a=this.platform.acquireContext(n,s.aspectRatio),l=a&&a.canvas,u=l&&l.height,c=l&&l.width;if(this.id=BP(),this.ctx=a,this.canvas=l,this.width=c,this.height=u,this._options=s,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new wD,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=s1(d=>this.update(d),s.resizeDelay||0),this._dataChanges=[],Cr[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}gt.listen(this,"complete",Sd),gt.listen(this,"progress",UD),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:i},width:r,height:n,_aspectRatio:o}=this;return H(t)?i&&o?o:n?r/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return ft}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Kc(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Hc(this.canvas,this.ctx),this}stop(){return gt.stop(this),this}resize(t,i){gt.running(this)?this._resizeBeforeDraw={width:t,height:i}:this._resize(t,i)}_resize(t,i){const r=this.options,n=this.canvas,o=r.maintainAspectRatio&&this.aspectRatio,s=this.platform.getMaximumSize(n,t,i,o),a=r.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=s.width,this.height=s.height,this._aspectRatio=this.aspectRatio,Kc(this,a,!0)&&(this.notifyPlugins("resize",{size:s}),ae(r.onResize,[this,s],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const i=this.options.scales||{};ee(i,(r,n)=>{r.id=n})}buildOrUpdateScales(){const t=this.options,i=t.scales,r=this.scales,n=Object.keys(r).reduce((s,a)=>(s[a]=!1,s),{});let o=[];i&&(o=o.concat(Object.keys(i).map(s=>{const a=i[s],l=qs(s,a),u=l==="r",c=l==="x";return{options:a,dposition:u?"chartArea":c?"bottom":"left",dtype:u?"radialLinear":c?"category":"linear"}}))),ee(o,s=>{const a=s.options,l=a.id,u=qs(l,a),c=Z(a.type,s.dtype);(a.position===void 0||kd(a.position,u)!==kd(s.dposition))&&(a.position=s.dposition),n[l]=!0;let d=null;if(l in r&&r[l].type===c)d=r[l];else{const f=ft.getScale(c);d=new f({id:l,type:c,ctx:this.ctx,chart:this}),r[d.id]=d}d.init(a,t)}),ee(n,(s,a)=>{s||delete r[a]}),ee(r,s=>{Ce.configure(this,s,s.options),Ce.addBox(this,s)})}_updateMetasets(){const t=this._metasets,i=this.data.datasets.length,r=t.length;if(t.sort((n,o)=>n.index-o.index),r>i){for(let n=i;n<r;++n)this._destroyDatasetMeta(n);t.splice(i,r-i)}this._sortedMetasets=t.slice(0).sort(wd("order","index"))}_removeUnreferencedMetasets(){const{_metasets:t,data:{datasets:i}}=this;t.length>i.length&&delete this._stacks,t.forEach((r,n)=>{i.filter(o=>o===r._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],i=this.data.datasets;let r,n;for(this._removeUnreferencedMetasets(),r=0,n=i.length;r<n;r++){const o=i[r];let s=this.getDatasetMeta(r);const a=o.type||this.config.type;if(s.type&&s.type!==a&&(this._destroyDatasetMeta(r),s=this.getDatasetMeta(r)),s.type=a,s.indexAxis=o.indexAxis||Js(a,this.options),s.order=o.order||0,s.index=r,s.label=""+o.label,s.visible=this.isDatasetVisible(r),s.controller)s.controller.updateIndex(r),s.controller.linkScales();else{const l=ft.getController(a),{datasetElementType:u,dataElementType:c}=fe.datasets[a];Object.assign(l,{dataElementType:ft.getElement(c),datasetElementType:u&&ft.getElement(u)}),s.controller=new l(this,r),t.push(s.controller)}}return this._updateMetasets(),t}_resetElements(){ee(this.data.datasets,(t,i)=>{this.getDatasetMeta(i).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const i=this.config;i.update();const r=this._options=i.createResolver(i.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!r.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let s=0;for(let u=0,c=this.data.datasets.length;u<c;u++){const{controller:d}=this.getDatasetMeta(u),f=!n&&o.indexOf(d)===-1;d.buildOrUpdateElements(f),s=Math.max(+d.getMaxOverflow(),s)}s=this._minPadding=r.layout.autoPadding?s:0,this._updateLayout(s),n||ee(o,u=>{u.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(wd("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){ee(this.scales,t=>{Ce.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,i=new Set(Object.keys(this._listeners)),r=new Set(t.events);(!Rc(i,r)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,i=this._getUniformDataChanges()||[];for(const{method:r,start:n,count:o}of i){const s=r==="_removeElements"?-o:o;LD(t,n,s)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const i=this.data.datasets.length,r=o=>new Set(t.filter(s=>s[0]===o).map((s,a)=>a+","+s.splice(1).join(","))),n=r(0);for(let o=1;o<i;o++)if(!Rc(n,r(o)))return;return Array.from(n).map(o=>o.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ce.update(this,this.width,this.height,t);const i=this.chartArea,r=i.width<=0||i.height<=0;this._layers=[],ee(this.boxes,n=>{r&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let i=0,r=this.data.datasets.length;i<r;++i)this.getDatasetMeta(i).controller.configure();for(let i=0,r=this.data.datasets.length;i<r;++i)this._updateDataset(i,Zt(t)?t({datasetIndex:i}):t);this.notifyPlugins("afterDatasetsUpdate",{mode:t})}}_updateDataset(t,i){const r=this.getDatasetMeta(t),n={meta:r,index:t,mode:i,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",n)!==!1&&(r.controller._update(i),n.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",n))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(gt.has(this)?this.attached&&!gt.running(this)&&gt.start(this):(this.draw(),Sd({chart:this})))}draw(){let t;if(this._resizeBeforeDraw){const{width:r,height:n}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(r,n)}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const i=this._layers;for(t=0;t<i.length&&i[t].z<=0;++t)i[t].draw(this.chartArea);for(this._drawDatasets();t<i.length;++t)i[t].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(t){const i=this._sortedMetasets,r=[];let n,o;for(n=0,o=i.length;n<o;++n){const s=i[n];(!t||s.visible)&&r.push(s)}return r}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const t=this.getSortedVisibleDatasetMetas();for(let i=t.length-1;i>=0;--i)this._drawDataset(t[i]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const i=this.ctx,r={meta:t,index:t.index,cancelable:!0},n=p_(this,t);this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&us(i,n),t.controller.draw(),n&&cs(i),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return $t(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,i,r,n){const o=ZT.modes[i];return typeof o=="function"?o(this,t,r,n):[]}getDatasetMeta(t){const i=this.data.datasets[t],r=this._metasets;let n=r.filter(o=>o&&o._dataset===i).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i&&i.order||0,index:t,_dataset:i,_parsed:[],_sorted:!1},r.push(n)),n}getContext(){return this.$context||(this.$context=Bt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const i=this.data.datasets[t];if(!i)return!1;const r=this.getDatasetMeta(t);return typeof r.hidden=="boolean"?!r.hidden:!i.hidden}setDatasetVisibility(t,i){const r=this.getDatasetMeta(t);r.hidden=!i}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,i,r){const n=r?"show":"hide",o=this.getDatasetMeta(t),s=o.controller._resolveAnimations(void 0,n);bn(i)?(o.data[i].hidden=!r,this.update()):(this.setDatasetVisibility(t,r),s.update(o,{visible:r}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,i){this._updateVisibility(t,i,!1)}show(t,i){this._updateVisibility(t,i,!0)}_destroyDatasetMeta(t){const i=this._metasets[t];i&&i.controller&&i.controller._destroy(),delete this._metasets[t]}_stop(){let t,i;for(this.stop(),gt.remove(this),t=0,i=this.data.datasets.length;t<i;++t)this._destroyDatasetMeta(t)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:t,ctx:i}=this;this._stop(),this.config.clearCache(),t&&(this.unbindEvents(),Hc(t,i),this.platform.releaseContext(i),this.canvas=null,this.ctx=null),delete Cr[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...t){return this.canvas.toDataURL(...t)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const t=this._listeners,i=this.platform,r=(o,s)=>{i.addEventListener(this,o,s),t[o]=s},n=(o,s,a)=>{o.offsetX=s,o.offsetY=a,this._eventHandler(o)};ee(this.options.events,o=>r(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,i=this.platform,r=(l,u)=>{i.addEventListener(this,l,u),t[l]=u},n=(l,u)=>{t[l]&&(i.removeEventListener(this,l,u),delete t[l])},o=(l,u)=>{this.canvas&&this.resize(l,u)};let s;const a=()=>{n("attach",a),this.attached=!0,this.resize(),r("resize",o),r("detach",s)};s=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),r("attach",a)},i.isAttached(this.canvas)?a():s()}unbindEvents(){ee(this._listeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._listeners={},ee(this._responsiveListeners,(t,i)=>{this.platform.removeEventListener(this,i,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,i,r){const n=r?"set":"remove";let o,s,a,l;for(i==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a<l;++a){s=t[a];const u=s&&this.getDatasetMeta(s.datasetIndex).controller;u&&u[n+"HoverStyle"](s.element,s.datasetIndex,s.index)}}getActiveElements(){return this._active||[]}setActiveElements(t){const i=this._active||[],r=t.map(({datasetIndex:o,index:s})=>{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[s],index:s}});!Qr(r,i)&&(this._active=r,this._lastEvent=null,this._updateHoverStyles(r,i))}notifyPlugins(t,i,r){return this._plugins.notify(this,t,i,r)}isPluginEnabled(t){return this._plugins._cache.filter(i=>i.plugin.id===t).length===1}_updateHoverStyles(t,i,r){const n=this.options.hover,o=(l,u)=>l.filter(c=>!u.some(d=>c.datasetIndex===d.datasetIndex&&c.index===d.index)),s=o(i,t),a=r?t:o(t,i);s.length&&this.updateHoverStyle(s,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,i){const r={event:t,replay:i,cancelable:!0,inChartArea:this.isPointInArea(t)},n=s=>(s.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",r,n)===!1)return;const o=this._handleEvent(t,i,r.inChartArea);return r.cancelable=!1,this.notifyPlugins("afterEvent",r,n),(o||r.changed)&&this.render(),this}_handleEvent(t,i,r){const{_active:n=[],options:o}=this,s=i,a=this._getActiveElements(t,n,r,s),l=KP(t),u=FD(t,this._lastEvent,r,l);r&&(this._lastEvent=null,ae(o.onHover,[t,a,this],this),l&&ae(o.onClick,[t,a,this],this));const c=!Qr(a,n);return(c||i)&&(this._active=a,this._updateHoverStyles(a,n,i)),this._lastEvent=u,c}_getActiveElements(t,i,r,n){if(t.type==="mouseout")return[];if(!r)return i;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}O(_t,"defaults",fe),O(_t,"instances",Cr),O(_t,"overrides",li),O(_t,"registry",ft),O(_t,"version",jD),O(_t,"getChart",Id);function zd(){return ee(_t.instances,e=>e._plugins.invalidate())}function BD(e,t,i){const{startAngle:r,x:n,y:o,outerRadius:s,innerRadius:a,options:l}=t,{borderWidth:u,borderJoinStyle:c}=l,d=Math.min(u/s,Ae(r-i));if(e.beginPath(),e.arc(n,o,s-u/2,r+d/2,i-d/2),a>0){const f=Math.min(u/a,Ae(r-i));e.arc(n,o,a+u/2,i-f/2,r+f/2,!0)}else{const f=Math.min(u/2,s*Ae(r-i));if(c==="round")e.arc(n,o,f,i-Y/2,r+Y/2,!0);else if(c==="bevel"){const h=2*f*f,m=-h*Math.cos(i+Y/2)+n,p=-h*Math.sin(i+Y/2)+o,g=h*Math.cos(r+Y/2)+n,b=h*Math.sin(r+Y/2)+o;e.lineTo(m,p),e.lineTo(g,b)}}e.closePath(),e.moveTo(0,0),e.rect(0,0,e.canvas.width,e.canvas.height),e.clip("evenodd")}function VD(e,t,i){const{startAngle:r,pixelMargin:n,x:o,y:s,outerRadius:a,innerRadius:l}=t;let u=n/a;e.beginPath(),e.arc(o,s,a,r-u,i+u),l>n?(u=n/l,e.arc(o,s,l,i+u,r-u,!0)):e.arc(o,s,n,i+ke,r-ke),e.closePath(),e.clip()}function WD(e){return Ru(e,["outerStart","outerEnd","innerStart","innerEnd"])}function HD(e,t,i,r){const n=WD(e.options.borderRadius),o=(i-t)/2,s=Math.min(o,r*t/2),a=l=>{const u=(i-Math.min(o,l))*r/2;return Ie(l,0,Math.min(o,u))};return{outerStart:a(n.outerStart),outerEnd:a(n.outerEnd),innerStart:Ie(n.innerStart,0,s),innerEnd:Ie(n.innerEnd,0,s)}}function _i(e,t,i,r){return{x:i+e*Math.cos(t),y:r+e*Math.sin(t)}}function oo(e,t,i,r,n,o){const{x:s,y:a,startAngle:l,pixelMargin:u,innerRadius:c}=t,d=Math.max(t.outerRadius+r+i-u,0),f=c>0?c+r+i+u:0;let h=0;const m=n-l;if(r){const te=c>0?c-r:0,ce=d>0?d-r:0,$e=(te+ce)/2,st=$e!==0?m*$e/($e+r):m;h=(m-st)/2}const p=Math.max(.001,m*d-i/Y)/d,g=(m-p)/2,b=l+g+h,y=n-g-h,{outerStart:S,outerEnd:w,innerStart:x,innerEnd:I}=HD(t,f,d,y-b),z=d-S,D=d-w,N=b+S/z,F=y-w/D,B=f+x,K=f+I,ze=b+x/B,He=y-I/K;if(e.beginPath(),o){const te=(N+F)/2;if(e.arc(s,a,d,N,te),e.arc(s,a,d,te,F),w>0){const Ee=_i(D,F,s,a);e.arc(Ee.x,Ee.y,w,F,y+ke)}const ce=_i(K,y,s,a);if(e.lineTo(ce.x,ce.y),I>0){const Ee=_i(K,He,s,a);e.arc(Ee.x,Ee.y,I,y+ke,He+Math.PI)}const $e=(y-I/f+(b+x/f))/2;if(e.arc(s,a,f,y-I/f,$e,!0),e.arc(s,a,f,$e,b+x/f,!0),x>0){const Ee=_i(B,ze,s,a);e.arc(Ee.x,Ee.y,x,ze+Math.PI,b-ke)}const st=_i(z,b,s,a);if(e.lineTo(st.x,st.y),S>0){const Ee=_i(z,N,s,a);e.arc(Ee.x,Ee.y,S,b-ke,N)}}else{e.moveTo(s,a);const te=Math.cos(N)*d+s,ce=Math.sin(N)*d+a;e.lineTo(te,ce);const $e=Math.cos(F)*d+s,st=Math.sin(F)*d+a;e.lineTo($e,st)}e.closePath()}function JD(e,t,i,r,n){const{fullCircles:o,startAngle:s,circumference:a}=t;let l=t.endAngle;if(o){oo(e,t,i,r,l,n);for(let u=0;u<o;++u)e.fill();isNaN(a)||(l=s+(a%le||le))}return oo(e,t,i,r,l,n),e.fill(),l}function qD(e,t,i,r,n){const{fullCircles:o,startAngle:s,circumference:a,options:l}=t,{borderWidth:u,borderJoinStyle:c,borderDash:d,borderDashOffset:f,borderRadius:h}=l,m=l.borderAlign==="inner";if(!u)return;e.setLineDash(d||[]),e.lineDashOffset=f,m?(e.lineWidth=u*2,e.lineJoin=c||"round"):(e.lineWidth=u,e.lineJoin=c||"bevel");let p=t.endAngle;if(o){oo(e,t,i,r,p,n);for(let g=0;g<o;++g)e.stroke();isNaN(a)||(p=s+(a%le||le))}m&&VD(e,t,p),l.selfJoin&&p-s>=Y&&h===0&&c!=="miter"&&BD(e,t,p),o||(oo(e,t,i,r,p,n),e.stroke())}class en extends ct{constructor(i){super();O(this,"circumference");O(this,"endAngle");O(this,"fullCircles");O(this,"innerRadius");O(this,"outerRadius");O(this,"pixelMargin");O(this,"startAngle");this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,i&&Object.assign(this,i)}inRange(i,r,n){const o=this.getProps(["x","y"],n),{angle:s,distance:a}=qb(o,{x:i,y:r}),{startAngle:l,endAngle:u,innerRadius:c,outerRadius:d,circumference:f}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],n),h=(this.options.spacing+this.options.borderWidth)/2,m=Z(f,u-l),p=_n(s,l,u)&&l!==u,g=m>=le||p,b=yt(a,c+h,d+h);return g&&b}getCenterPoint(i){const{x:r,y:n,startAngle:o,endAngle:s,innerRadius:a,outerRadius:l}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],i),{offset:u,spacing:c}=this.options,d=(o+s)/2,f=(a+l+c+u)/2;return{x:r+Math.cos(d)*f,y:n+Math.sin(d)*f}}tooltipPosition(i){return this.getCenterPoint(i)}draw(i){const{options:r,circumference:n}=this,o=(r.offset||0)/4,s=(r.spacing||0)/2,a=r.circular;if(this.pixelMargin=r.borderAlign==="inner"?.33:0,this.fullCircles=n>le?Math.floor(n/le):0,n===0||this.innerRadius<0||this.outerRadius<0)return;i.save();const l=(this.startAngle+this.endAngle)/2;i.translate(Math.cos(l)*o,Math.sin(l)*o);const u=1-Math.sin(Math.min(Y,n||0)),c=o*u;i.fillStyle=r.backgroundColor,i.strokeStyle=r.borderColor,JD(i,this,c,s,a),qD(i,this,c,s,a),i.restore()}}O(en,"id","arc"),O(en,"defaults",{borderAlign:"center",borderColor:"#fff",borderDash:[],borderDashOffset:0,borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0,selfJoin:!1}),O(en,"defaultRoutes",{backgroundColor:"backgroundColor"}),O(en,"descriptors",{_scriptable:!0,_indexable:i=>i!=="borderDash"});function O_(e,t,i=t){e.lineCap=Z(i.borderCapStyle,t.borderCapStyle),e.setLineDash(Z(i.borderDash,t.borderDash)),e.lineDashOffset=Z(i.borderDashOffset,t.borderDashOffset),e.lineJoin=Z(i.borderJoinStyle,t.borderJoinStyle),e.lineWidth=Z(i.borderWidth,t.borderWidth),e.strokeStyle=Z(i.borderColor,t.borderColor)}function KD(e,t,i){e.lineTo(i.x,i.y)}function XD(e){return e.stepped?b1:e.tension||e.cubicInterpolationMode==="monotone"?_1:KD}function P_(e,t,i={}){const r=e.length,{start:n=0,end:o=r-1}=i,{start:s,end:a}=t,l=Math.max(n,s),u=Math.min(o,a),c=n<s&&o<s||n>a&&o>a;return{count:r,start:l,loop:t.loop,ilen:u<l&&!c?r+u-l:u-l}}function GD(e,t,i,r){const{points:n,options:o}=t,{count:s,start:a,loop:l,ilen:u}=P_(n,i,r),c=XD(o);let{move:d=!0,reverse:f}=r||{},h,m,p;for(h=0;h<=u;++h)m=n[(a+(f?u-h:h))%s],!m.skip&&(d?(e.moveTo(m.x,m.y),d=!1):c(e,p,m,f,o.stepped),p=m);return l&&(m=n[(a+(f?u:0))%s],c(e,p,m,f,o.stepped)),!!l}function YD(e,t,i,r){const n=t.points,{count:o,start:s,ilen:a}=P_(n,i,r),{move:l=!0,reverse:u}=r||{};let c=0,d=0,f,h,m,p,g,b;const y=w=>(s+(u?a-w:w))%o,S=()=>{p!==g&&(e.lineTo(c,g),e.lineTo(c,p),e.lineTo(c,b))};for(l&&(h=n[y(0)],e.moveTo(h.x,h.y)),f=0;f<=a;++f){if(h=n[y(f)],h.skip)continue;const w=h.x,x=h.y,I=w|0;I===m?(x<p?p=x:x>g&&(g=x),c=(d*c+w)/++d):(S(),e.lineTo(w,x),m=I,d=0,p=g=x),b=x}S()}function Ks(e){const t=e.options,i=t.borderDash&&t.borderDash.length;return!e._decimated&&!e._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!i?YD:GD}function QD(e){return e.stepped?G1:e.tension||e.cubicInterpolationMode==="monotone"?Y1:Qt}function e4(e,t,i,r){let n=t._path;n||(n=t._path=new Path2D,t.path(n,i,r)&&n.closePath()),O_(e,t.options),e.stroke(n)}function t4(e,t,i,r){const{segments:n,options:o}=t,s=Ks(t);for(const a of n)O_(e,o,a.style),e.beginPath(),s(e,t,a,{start:i,end:i+r-1})&&e.closePath(),e.stroke()}const i4=typeof Path2D=="function";function n4(e,t,i,r){i4&&!t.options.segment?e4(e,t,i,r):t4(e,t,i,r)}class Tt extends ct{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,i){const r=this.options;if((r.tension||r.cubicInterpolationMode==="monotone")&&!r.stepped&&!this._pointsUpdated){const n=r.spanGaps?this._loop:this._fullLoop;B1(this._points,r,t,n,i),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=rT(this,this.options.segment))}first(){const t=this.segments,i=this.points;return t.length&&i[t[0].start]}last(){const t=this.segments,i=this.points,r=t.length;return r&&i[t[r-1].end]}interpolate(t,i){const r=this.options,n=t[i],o=this.points,s=m_(this,{property:i,start:n,end:n});if(!s.length)return;const a=[],l=QD(r);let u,c;for(u=0,c=s.length;u<c;++u){const{start:d,end:f}=s[u],h=o[d],m=o[f];if(h===m){a.push(h);continue}const p=Math.abs((n-h[i])/(m[i]-h[i])),g=l(h,m,p,r.stepped);g[i]=t[i],a.push(g)}return a.length===1?a[0]:a}pathSegment(t,i,r){return Ks(this)(t,this,i,r)}path(t,i,r){const n=this.segments,o=Ks(this);let s=this._loop;i=i||0,r=r||this.points.length-i;for(const a of n)s&=o(t,this,a,{start:i,end:i+r-1});return!!s}draw(t,i,r,n){const o=this.options||{};(this.points||[]).length&&o.borderWidth&&(t.save(),n4(t,this,r,n),t.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}O(Tt,"id","line"),O(Tt,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),O(Tt,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),O(Tt,"descriptors",{_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"});function Od(e,t,i,r){const n=e.options,{[i]:o}=e.getProps([i],r);return Math.abs(t-o)<n.radius+n.hitRadius}class Rr extends ct{constructor(i){super();O(this,"parsed");O(this,"skip");O(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,i&&Object.assign(this,i)}inRange(i,r,n){const o=this.options,{x:s,y:a}=this.getProps(["x","y"],n);return Math.pow(i-s,2)+Math.pow(r-a,2)<Math.pow(o.hitRadius+o.radius,2)}inXRange(i,r){return Od(this,i,"x",r)}inYRange(i,r){return Od(this,i,"y",r)}getCenterPoint(i){const{x:r,y:n}=this.getProps(["x","y"],i);return{x:r,y:n}}size(i){i=i||this.options||{};let r=i.radius||0;r=Math.max(r,r&&i.hoverRadius||0);const n=r&&i.borderWidth||0;return(r+n)*2}draw(i,r){const n=this.options;this.skip||n.radius<.1||!$t(this,r,this.size(n)/2)||(i.strokeStyle=n.borderColor,i.lineWidth=n.borderWidth,i.fillStyle=n.backgroundColor,Ws(i,n,this.x,this.y))}getRange(){const i=this.options||{};return i.radius+i.hitRadius}}O(Rr,"id","point"),O(Rr,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),O(Rr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function T_(e,t){const{x:i,y:r,base:n,width:o,height:s}=e.getProps(["x","y","base","width","height"],t);let a,l,u,c,d;return e.horizontal?(d=s/2,a=Math.min(i,n),l=Math.max(i,n),u=r-d,c=r+d):(d=o/2,a=i-d,l=i+d,u=Math.min(r,n),c=Math.max(r,n)),{left:a,top:u,right:l,bottom:c}}function Dt(e,t,i,r){return e?0:Ie(t,i,r)}function r4(e,t,i){const r=e.options.borderWidth,n=e.borderSkipped,o=n_(r);return{t:Dt(n.top,o.top,0,i),r:Dt(n.right,o.right,0,t),b:Dt(n.bottom,o.bottom,0,i),l:Dt(n.left,o.left,0,t)}}function o4(e,t,i){const{enableBorderRadius:r}=e.getProps(["enableBorderRadius"]),n=e.options.borderRadius,o=ni(n),s=Math.min(t,i),a=e.borderSkipped,l=r||q(n);return{topLeft:Dt(!l||a.top||a.left,o.topLeft,0,s),topRight:Dt(!l||a.top||a.right,o.topRight,0,s),bottomLeft:Dt(!l||a.bottom||a.left,o.bottomLeft,0,s),bottomRight:Dt(!l||a.bottom||a.right,o.bottomRight,0,s)}}function s4(e){const t=T_(e),i=t.right-t.left,r=t.bottom-t.top,n=r4(e,i/2,r/2),o=o4(e,i/2,r/2);return{outer:{x:t.left,y:t.top,w:i,h:r,radius:o},inner:{x:t.left+n.l,y:t.top+n.t,w:i-n.l-n.r,h:r-n.t-n.b,radius:{topLeft:Math.max(0,o.topLeft-Math.max(n.t,n.l)),topRight:Math.max(0,o.topRight-Math.max(n.t,n.r)),bottomLeft:Math.max(0,o.bottomLeft-Math.max(n.b,n.l)),bottomRight:Math.max(0,o.bottomRight-Math.max(n.b,n.r))}}}}function zs(e,t,i,r){const n=t===null,o=i===null,a=e&&!(n&&o)&&T_(e,r);return a&&(n||yt(t,a.left,a.right))&&(o||yt(i,a.top,a.bottom))}function a4(e){return e.topLeft||e.topRight||e.bottomLeft||e.bottomRight}function l4(e,t){e.rect(t.x,t.y,t.w,t.h)}function Os(e,t,i={}){const r=e.x!==i.x?-t:0,n=e.y!==i.y?-t:0,o=(e.x+e.w!==i.x+i.w?t:0)-r,s=(e.y+e.h!==i.y+i.h?t:0)-n;return{x:e.x+r,y:e.y+n,w:e.w+o,h:e.h+s,radius:e.radius}}class jr extends ct{constructor(t){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,t&&Object.assign(this,t)}draw(t){const{inflateAmount:i,options:{borderColor:r,backgroundColor:n}}=this,{inner:o,outer:s}=s4(this),a=a4(s.radius)?yn:l4;t.save(),(s.w!==o.w||s.h!==o.h)&&(t.beginPath(),a(t,Os(s,i,o)),t.clip(),a(t,Os(o,-i,s)),t.fillStyle=r,t.fill("evenodd")),t.beginPath(),a(t,Os(o,i)),t.fillStyle=n,t.fill(),t.restore()}inRange(t,i,r){return zs(this,t,i,r)}inXRange(t,i){return zs(this,t,null,i)}inYRange(t,i){return zs(this,null,t,i)}getCenterPoint(t){const{x:i,y:r,base:n,horizontal:o}=this.getProps(["x","y","base","horizontal"],t);return{x:o?(i+n)/2:i,y:o?r:(r+n)/2}}getRange(t){return t==="x"?this.width/2:this.height/2}}O(jr,"id","bar"),O(jr,"defaults",{borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0}),O(jr,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});var u4=Object.freeze({__proto__:null,ArcElement:en,BarElement:jr,LineElement:Tt,PointElement:Rr});const Xs=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],Pd=Xs.map(e=>e.replace("rgb(","rgba(").replace(")",", 0.5)"));function D_(e){return Xs[e%Xs.length]}function E_(e){return Pd[e%Pd.length]}function c4(e,t){return e.borderColor=D_(t),e.backgroundColor=E_(t),++t}function d4(e,t){return e.backgroundColor=e.data.map(()=>D_(t++)),t}function f4(e,t){return e.backgroundColor=e.data.map(()=>E_(t++)),t}function h4(e){let t=0;return(i,r)=>{const n=e.getDatasetMeta(r).controller;n instanceof ti?t=d4(i,t):n instanceof ln?t=f4(i,t):n&&(t=c4(i,t))}}function Td(e){let t;for(t in e)if(e[t].borderColor||e[t].backgroundColor)return!0;return!1}function m4(e){return e&&(e.borderColor||e.backgroundColor)}function p4(){return fe.borderColor!=="rgba(0,0,0,0.1)"||fe.backgroundColor!=="rgba(0,0,0,0.1)"}var g4={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(e,t,i){if(!i.enabled)return;const{data:{datasets:r},options:n}=e.config,{elements:o}=n,s=Td(r)||m4(n)||o&&Td(o)||p4();if(!i.forceOverride&&s)return;const a=h4(e);r.forEach(a)}};function v4(e,t,i,r,n){const o=n.samples||r;if(o>=i)return e.slice(t,t+i);const s=[],a=(i-2)/(o-2);let l=0;const u=t+i-1;let c=t,d,f,h,m,p;for(s[l++]=e[c],d=0;d<o-2;d++){let g=0,b=0,y;const S=Math.floor((d+1)*a)+1+t,w=Math.min(Math.floor((d+2)*a)+1,i)+t,x=w-S;for(y=S;y<w;y++)g+=e[y].x,b+=e[y].y;g/=x,b/=x;const I=Math.floor(d*a)+1+t,z=Math.min(Math.floor((d+1)*a)+1,i)+t,{x:D,y:N}=e[c];for(h=m=-1,y=I;y<z;y++)m=.5*Math.abs((D-g)*(e[y].y-N)-(D-e[y].x)*(b-N)),m>h&&(h=m,f=e[y],p=y);s[l++]=f,c=p}return s[l++]=e[u],s}function b4(e,t,i,r){let n=0,o=0,s,a,l,u,c,d,f,h,m,p;const g=[],b=t+i-1,y=e[t].x,w=e[b].x-y;for(s=t;s<t+i;++s){a=e[s],l=(a.x-y)/w*r,u=a.y;const x=l|0;if(x===c)u<m?(m=u,d=s):u>p&&(p=u,f=s),n=(o*n+a.x)/++o;else{const I=s-1;if(!H(d)&&!H(f)){const z=Math.min(d,f),D=Math.max(d,f);z!==h&&z!==I&&g.push({...e[z],x:n}),D!==h&&D!==I&&g.push({...e[D],x:n})}s>0&&I!==h&&g.push(e[I]),g.push(a),c=x,o=0,m=p=u,d=f=h=s}}return g}function M_(e){if(e._decimated){const t=e._data;delete e._decimated,delete e._data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Dd(e){e.data.datasets.forEach(t=>{M_(t)})}function _4(e,t){const i=t.length;let r=0,n;const{iScale:o}=e,{min:s,max:a,minDefined:l,maxDefined:u}=o.getUserBounds();return l&&(r=Ie(xt(t,o.axis,s).lo,0,i-1)),u?n=Ie(xt(t,o.axis,a).hi+1,r,i)-r:n=i-r,{start:r,count:n}}var y4={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(e,t,i)=>{if(!i.enabled){Dd(e);return}const r=e.width;e.data.datasets.forEach((n,o)=>{const{_data:s,indexAxis:a}=n,l=e.getDatasetMeta(o),u=s||n.data;if(Yi([a,e.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;const c=e.scales[l.xAxisID];if(c.type!=="linear"&&c.type!=="time"||e.options.parsing)return;let{start:d,count:f}=_4(l,u);const h=i.threshold||4*r;if(f<=h){M_(n);return}H(s)&&(n._data=u,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}}));let m;switch(i.algorithm){case"lttb":m=v4(u,d,f,r,i);break;case"min-max":m=b4(u,d,f,r);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}n._decimated=m})},destroy(e){Dd(e)}};function x4(e,t,i){const r=e.segments,n=e.points,o=t.points,s=[];for(const a of r){let{start:l,end:u}=a;u=hs(l,u,n);const c=Gs(i,n[l],n[u],a.loop);if(!t.segments){s.push({source:a,target:c,start:n[l],end:n[u]});continue}const d=m_(t,c);for(const f of d){const h=Gs(i,o[f.start],o[f.end],f.loop),m=h_(a,n,h);for(const p of m)s.push({source:p,target:f,start:{[i]:Ed(c,h,"start",Math.max)},end:{[i]:Ed(c,h,"end",Math.min)}})}}return s}function Gs(e,t,i,r){if(r)return;let n=t[e],o=i[e];return e==="angle"&&(n=Ae(n),o=Ae(o)),{property:e,start:n,end:o}}function $4(e,t){const{x:i=null,y:r=null}=e||{},n=t.points,o=[];return t.segments.forEach(({start:s,end:a})=>{a=hs(s,a,n);const l=n[s],u=n[a];r!==null?(o.push({x:l.x,y:r}),o.push({x:u.x,y:r})):i!==null&&(o.push({x:i,y:l.y}),o.push({x:i,y:u.y}))}),o}function hs(e,t,i){for(;t>e;t--){const r=i[t];if(!isNaN(r.x)&&!isNaN(r.y))break}return t}function Ed(e,t,i,r){return e&&t?r(e[i],t[i]):e?e[i]:t?t[i]:0}function N_(e,t){let i=[],r=!1;return de(e)?(r=!0,i=e):i=$4(e,t),i.length?new Tt({points:i,options:{tension:0},_loop:r,_fullLoop:r}):null}function Md(e){return e&&e.fill!==!1}function k4(e,t,i){let n=e[t].fill;const o=[t];let s;if(!i)return n;for(;n!==!1&&o.indexOf(n)===-1;){if(!ye(n))return n;if(s=e[n],!s)return!1;if(s.visible)return n;o.push(n),n=s.fill}return!1}function w4(e,t,i){const r=O4(e);if(q(r))return isNaN(r.value)?!1:r;let n=parseFloat(r);return ye(n)&&Math.floor(n)===n?S4(r[0],t,n,i):["origin","start","end","stack","shape"].indexOf(r)>=0&&r}function S4(e,t,i,r){return(e==="-"||e==="+")&&(i=t+i),i===t||i<0||i>=r?!1:i}function I4(e,t){let i=null;return e==="start"?i=t.bottom:e==="end"?i=t.top:q(e)?i=t.getPixelForValue(e.value):t.getBasePixel&&(i=t.getBasePixel()),i}function z4(e,t,i){let r;return e==="start"?r=i:e==="end"?r=t.options.reverse?t.min:t.max:q(e)?r=e.value:r=t.getBaseValue(),r}function O4(e){const t=e.options,i=t.fill;let r=Z(i&&i.target,i);return r===void 0&&(r=!!t.backgroundColor),r===!1||r===null?!1:r===!0?"origin":r}function P4(e){const{scale:t,index:i,line:r}=e,n=[],o=r.segments,s=r.points,a=T4(t,i);a.push(N_({x:null,y:t.bottom},r));for(let l=0;l<o.length;l++){const u=o[l];for(let c=u.start;c<=u.end;c++)D4(n,s[c],a)}return new Tt({points:n,options:{}})}function T4(e,t){const i=[],r=e.getMatchingVisibleMetas("line");for(let n=0;n<r.length;n++){const o=r[n];if(o.index===t)break;o.hidden||i.unshift(o.dataset)}return i}function D4(e,t,i){const r=[];for(let n=0;n<i.length;n++){const o=i[n],{first:s,last:a,point:l}=E4(o,t,"x");if(!(!l||s&&a)){if(s)r.unshift(l);else if(e.push(l),!a)break}}e.push(...r)}function E4(e,t,i){const r=e.interpolate(t,i);if(!r)return{};const n=r[i],o=e.segments,s=e.points;let a=!1,l=!1;for(let u=0;u<o.length;u++){const c=o[u],d=s[c.start][i],f=s[c.end][i];if(yt(n,d,f)){a=n===d,l=n===f;break}}return{first:a,last:l,point:r}}class A_{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,i,r){const{x:n,y:o,radius:s}=this;return i=i||{start:0,end:le},t.arc(n,o,s,i.end,i.start,!0),!r.bounds}interpolate(t){const{x:i,y:r,radius:n}=this,o=t.angle;return{x:i+Math.cos(o)*n,y:r+Math.sin(o)*n,angle:o}}}function M4(e){const{chart:t,fill:i,line:r}=e;if(ye(i))return N4(t,i);if(i==="stack")return P4(e);if(i==="shape")return!0;const n=A4(e);return n instanceof A_?n:N_(n,r)}function N4(e,t){const i=e.getDatasetMeta(t);return i&&e.isDatasetVisible(t)?i.dataset:null}function A4(e){return(e.scale||{}).getPointPositionForValue?R4(e):C4(e)}function C4(e){const{scale:t={},fill:i}=e,r=I4(i,t);if(ye(r)){const n=t.isHorizontal();return{x:n?r:null,y:n?null:r}}return null}function R4(e){const{scale:t,fill:i}=e,r=t.options,n=t.getLabels().length,o=r.reverse?t.max:t.min,s=z4(i,t,o),a=[];if(r.grid.circular){const l=t.getPointPositionForValue(0,o);return new A_({x:l.x,y:l.y,radius:t.getDistanceFromCenterForValue(s)})}for(let l=0;l<n;++l)a.push(t.getPointPositionForValue(l,s));return a}function Ps(e,t,i){const r=M4(t),{chart:n,index:o,line:s,scale:a,axis:l}=t,u=s.options,c=u.fill,d=u.backgroundColor,{above:f=d,below:h=d}=c||{},m=n.getDatasetMeta(o),p=p_(n,m);r&&s.points.length&&(us(e,i),j4(e,{line:s,target:r,above:f,below:h,area:i,scale:a,axis:l,clip:p}),cs(e))}function j4(e,t){const{line:i,target:r,above:n,below:o,area:s,scale:a,clip:l}=t,u=i._loop?"angle":t.axis;e.save();let c=o;o!==n&&(u==="x"?(Nd(e,r,s.top),Ts(e,{line:i,target:r,color:n,scale:a,property:u,clip:l}),e.restore(),e.save(),Nd(e,r,s.bottom)):u==="y"&&(Ad(e,r,s.left),Ts(e,{line:i,target:r,color:o,scale:a,property:u,clip:l}),e.restore(),e.save(),Ad(e,r,s.right),c=n)),Ts(e,{line:i,target:r,color:c,scale:a,property:u,clip:l}),e.restore()}function Nd(e,t,i){const{segments:r,points:n}=t;let o=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:u}=a,c=n[l],d=n[hs(l,u,n)];o?(e.moveTo(c.x,c.y),o=!1):(e.lineTo(c.x,i),e.lineTo(c.x,c.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(d.x,i)}e.lineTo(t.first().x,i),e.closePath(),e.clip()}function Ad(e,t,i){const{segments:r,points:n}=t;let o=!0,s=!1;e.beginPath();for(const a of r){const{start:l,end:u}=a,c=n[l],d=n[hs(l,u,n)];o?(e.moveTo(c.x,c.y),o=!1):(e.lineTo(i,c.y),e.lineTo(c.x,c.y)),s=!!t.pathSegment(e,a,{move:s}),s?e.closePath():e.lineTo(i,d.y)}e.lineTo(i,t.first().y),e.closePath(),e.clip()}function Ts(e,t){const{line:i,target:r,property:n,color:o,scale:s,clip:a}=t,l=x4(i,r,n);for(const{source:u,target:c,start:d,end:f}of l){const{style:{backgroundColor:h=o}={}}=u,m=r!==!0;e.save(),e.fillStyle=h,Z4(e,s,a,m&&Gs(n,d,f)),e.beginPath();const p=!!i.pathSegment(e,u);let g;if(m){p?e.closePath():Cd(e,r,f,n);const b=!!r.pathSegment(e,c,{move:p,reverse:!0});g=p&&b,g||Cd(e,r,d,n)}e.closePath(),e.fill(g?"evenodd":"nonzero"),e.restore()}}function Z4(e,t,i,r){const n=t.chart.chartArea,{property:o,start:s,end:a}=r||{};if(o==="x"||o==="y"){let l,u,c,d;o==="x"?(l=s,u=n.top,c=a,d=n.bottom):(l=n.left,u=s,c=n.right,d=a),e.beginPath(),i&&(l=Math.max(l,i.left),c=Math.min(c,i.right),u=Math.max(u,i.top),d=Math.min(d,i.bottom)),e.rect(l,u,c-l,d-u),e.clip()}}function Cd(e,t,i,r){const n=t.interpolate(i,r);n&&e.lineTo(n.x,n.y)}var U4={id:"filler",afterDatasetsUpdate(e,t,i){const r=(e.data.datasets||[]).length,n=[];let o,s,a,l;for(s=0;s<r;++s)o=e.getDatasetMeta(s),a=o.dataset,l=null,a&&a.options&&a instanceof Tt&&(l={visible:e.isDatasetVisible(s),index:s,fill:w4(a,s,r),chart:e,axis:o.controller.options.indexAxis,scale:o.vScale,line:a}),o.$filler=l,n.push(l);for(s=0;s<r;++s)l=n[s],!(!l||l.fill===!1)&&(l.fill=k4(n,s,i.propagate))},beforeDraw(e,t,i){const r=i.drawTime==="beforeDraw",n=e.getSortedVisibleDatasetMetas(),o=e.chartArea;for(let s=n.length-1;s>=0;--s){const a=n[s].$filler;a&&(a.line.updateControlPoints(o,a.axis),r&&a.fill&&Ps(e.ctx,a,o))}},beforeDatasetsDraw(e,t,i){if(i.drawTime!=="beforeDatasetsDraw")return;const r=e.getSortedVisibleDatasetMetas();for(let n=r.length-1;n>=0;--n){const o=r[n].$filler;Md(o)&&Ps(e.ctx,o,e.chartArea)}},beforeDatasetDraw(e,t,i){const r=t.meta.$filler;!Md(r)||i.drawTime!=="beforeDatasetDraw"||Ps(e.ctx,r,e.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Rd=(e,t)=>{let{boxHeight:i=t,boxWidth:r=t}=e;return e.usePointStyle&&(i=Math.min(i,t),r=e.pointStyleWidth||Math.min(r,t)),{boxWidth:r,boxHeight:i,itemHeight:Math.max(t,i)}},L4=(e,t)=>e!==null&&t!==null&&e.datasetIndex===t.datasetIndex&&e.index===t.index;class jd extends ct{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i,r){this.maxWidth=t,this.maxHeight=i,this._margins=r,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let i=ae(t.generateLabels,[this.chart],this)||[];t.filter&&(i=i.filter(r=>t.filter(r,this.chart.data))),t.sort&&(i=i.sort((r,n)=>t.sort(r,n,this.chart.data))),this.options.reverse&&i.reverse(),this.legendItems=i}fit(){const{options:t,ctx:i}=this;if(!t.display){this.width=this.height=0;return}const r=t.labels,n=Se(r.font),o=n.size,s=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=Rd(r,o);let u,c;i.font=n.string,this.isHorizontal()?(u=this.maxWidth,c=this._fitRows(s,o,a,l)+10):(c=this.maxHeight,u=this._fitCols(s,n,a,l)+10),this.width=Math.min(u,t.maxWidth||this.maxWidth),this.height=Math.min(c,t.maxHeight||this.maxHeight)}_fitRows(t,i,r,n){const{ctx:o,maxWidth:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.lineWidths=[0],c=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let f=-1,h=-c;return this.legendItems.forEach((m,p)=>{const g=r+i/2+o.measureText(m.text).width;(p===0||u[u.length-1]+g+2*a>s)&&(d+=c,u[u.length-(p>0?0:1)]=0,h+=c,f++),l[p]={left:0,top:h,row:f,width:g,height:n},u[u.length-1]+=g+a}),d}_fitCols(t,i,r,n){const{ctx:o,maxHeight:s,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],u=this.columnSizes=[],c=s-t;let d=a,f=0,h=0,m=0,p=0;return this.legendItems.forEach((g,b)=>{const{itemWidth:y,itemHeight:S}=F4(r,i,o,g,n);b>0&&h+S+2*a>c&&(d+=f+a,u.push({width:f,height:h}),m+=f+a,p++,f=h=0),l[b]={left:m,top:h,col:p,width:y,height:S},f=Math.max(f,y),h+=S+a}),d+=f,u.push({width:f,height:h}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:i,options:{align:r,labels:{padding:n},rtl:o}}=this,s=ki(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=Ne(r,this.left+n,this.right-this.lineWidths[a]);for(const u of i)a!==u.row&&(a=u.row,l=Ne(r,this.left+n,this.right-this.lineWidths[a])),u.top+=this.top+t+n,u.left=s.leftForLtr(s.x(l),u.width),l+=u.width+n}else{let a=0,l=Ne(r,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const u of i)u.col!==a&&(a=u.col,l=Ne(r,this.top+t+n,this.bottom-this.columnSizes[a].height)),u.top=l,u.left+=this.left+n,u.left=s.leftForLtr(s.x(u.left),u.width),l+=u.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;us(t,this),this._draw(),cs(t)}}_draw(){const{options:t,columnSizes:i,lineWidths:r,ctx:n}=this,{align:o,labels:s}=t,a=fe.color,l=ki(t.rtl,this.left,this.width),u=Se(s.font),{padding:c}=s,d=u.size,f=d/2;let h;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=u.string;const{boxWidth:m,boxHeight:p,itemHeight:g}=Rd(s,d),b=function(I,z,D){if(isNaN(m)||m<=0||isNaN(p)||p<0)return;n.save();const N=Z(D.lineWidth,1);if(n.fillStyle=Z(D.fillStyle,a),n.lineCap=Z(D.lineCap,"butt"),n.lineDashOffset=Z(D.lineDashOffset,0),n.lineJoin=Z(D.lineJoin,"miter"),n.lineWidth=N,n.strokeStyle=Z(D.strokeStyle,a),n.setLineDash(Z(D.lineDash,[])),s.usePointStyle){const F={radius:p*Math.SQRT2/2,pointStyle:D.pointStyle,rotation:D.rotation,borderWidth:N},B=l.xPlus(I,m/2),K=z+f;i_(n,F,B,K,s.pointStyleWidth&&m)}else{const F=z+Math.max((d-p)/2,0),B=l.leftForLtr(I,m),K=ni(D.borderRadius);n.beginPath(),Object.values(K).some(ze=>ze!==0)?yn(n,{x:B,y:F,w:m,h:p,radius:K}):n.rect(B,F,m,p),n.fill(),N!==0&&n.stroke()}n.restore()},y=function(I,z,D){ui(n,D.text,I,z+g/2,u,{strikethrough:D.hidden,textAlign:l.textAlign(D.textAlign)})},S=this.isHorizontal(),w=this._computeTitleHeight();S?h={x:Ne(o,this.left+c,this.right-r[0]),y:this.top+c+w,line:0}:h={x:this.left+c,y:Ne(o,this.top+w+c,this.bottom-i[0].height),line:0},c_(this.ctx,t.textDirection);const x=g+c;this.legendItems.forEach((I,z)=>{n.strokeStyle=I.fontColor,n.fillStyle=I.fontColor;const D=n.measureText(I.text).width,N=l.textAlign(I.textAlign||(I.textAlign=s.textAlign)),F=m+f+D;let B=h.x,K=h.y;l.setWidth(this.width),S?z>0&&B+F+c>this.right&&(K=h.y+=x,h.line++,B=h.x=Ne(o,this.left+c,this.right-r[h.line])):z>0&&K+x>this.bottom&&(B=h.x=B+i[h.line].width+c,h.line++,K=h.y=Ne(o,this.top+w+c,this.bottom-i[h.line].height));const ze=l.x(B);if(b(ze,K,I),B=a1(N,B+m+f,S?B+F:this.right,t.rtl),y(l.x(B),K,I),S)h.x+=F+c;else if(typeof I.text!="string"){const He=u.lineHeight;h.y+=C_(I,He)+c}else h.y+=x}),d_(this.ctx,t.textDirection)}drawTitle(){const t=this.options,i=t.title,r=Se(i.font),n=je(i.padding);if(!i.display)return;const o=ki(t.rtl,this.left,this.width),s=this.ctx,a=i.position,l=r.size/2,u=n.top+l;let c,d=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),c=this.top+u,d=Ne(t.align,d,this.right-f);else{const m=this.columnSizes.reduce((p,g)=>Math.max(p,g.height),0);c=u+Ne(t.align,this.top,this.bottom-m-t.labels.padding-this._computeTitleHeight())}const h=Ne(a,d,d+f);s.textAlign=o.textAlign(Au(a)),s.textBaseline="middle",s.strokeStyle=i.color,s.fillStyle=i.color,s.font=r.string,ui(s,i.text,h,c,r)}_computeTitleHeight(){const t=this.options.title,i=Se(t.font),r=je(t.padding);return t.display?i.lineHeight+r.height:0}_getLegendItemAt(t,i){let r,n,o;if(yt(t,this.left,this.right)&&yt(i,this.top,this.bottom)){for(o=this.legendHitBoxes,r=0;r<o.length;++r)if(n=o[r],yt(t,n.left,n.left+n.width)&&yt(i,n.top,n.top+n.height))return this.legendItems[r]}return null}handleEvent(t){const i=this.options;if(!W4(t.type,i))return;const r=this._getLegendItemAt(t.x,t.y);if(t.type==="mousemove"||t.type==="mouseout"){const n=this._hoveredItem,o=L4(n,r);n&&!o&&ae(i.onLeave,[t,n,this],this),this._hoveredItem=r,r&&!o&&ae(i.onHover,[t,r,this],this)}else r&&ae(i.onClick,[t,r,this],this)}}function F4(e,t,i,r,n){const o=B4(r,e,t,i),s=V4(n,r,t.lineHeight);return{itemWidth:o,itemHeight:s}}function B4(e,t,i,r){let n=e.text;return n&&typeof n!="string"&&(n=n.reduce((o,s)=>o.length>s.length?o:s)),t+i.size/2+r.measureText(n).width}function V4(e,t,i){let r=e;return typeof t.text!="string"&&(r=C_(t,i)),r}function C_(e,t){const i=e.text?e.text.length:0;return t*i}function W4(e,t){return!!((e==="mousemove"||e==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(e==="click"||e==="mouseup"))}var H4={id:"legend",_element:jd,start(e,t,i){const r=e.legend=new jd({ctx:e.ctx,options:i,chart:e});Ce.configure(e,r,i),Ce.addBox(e,r)},stop(e){Ce.removeBox(e,e.legend),delete e.legend},beforeUpdate(e,t,i){const r=e.legend;Ce.configure(e,r,i),r.options=i},afterUpdate(e){const t=e.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(e,t){t.replay||e.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(e,t,i){const r=t.datasetIndex,n=i.chart;n.isDatasetVisible(r)?(n.hide(r),t.hidden=!0):(n.show(r),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:e=>e.chart.options.color,boxWidth:40,padding:10,generateLabels(e){const t=e.data.datasets,{labels:{usePointStyle:i,pointStyle:r,textAlign:n,color:o,useBorderRadius:s,borderRadius:a}}=e.legend.options;return e._getSortedDatasetMetas().map(l=>{const u=l.controller.getStyle(i?0:void 0),c=je(u.borderWidth);return{text:t[l.index].label,fillStyle:u.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:u.borderCapStyle,lineDash:u.borderDash,lineDashOffset:u.borderDashOffset,lineJoin:u.borderJoinStyle,lineWidth:(c.width+c.height)/4,strokeStyle:u.borderColor,pointStyle:r||u.pointStyle,rotation:u.rotation,textAlign:n||u.textAlign,borderRadius:s&&(a||u.borderRadius),datasetIndex:l.index}},this)}},title:{color:e=>e.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:e=>!e.startsWith("on"),labels:{_scriptable:e=>!["generateLabels","filter","sort"].includes(e)}}};class Vu extends ct{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,i){const r=this.options;if(this.left=0,this.top=0,!r.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=i;const n=de(r.text)?r.text.length:1;this._padding=je(r.padding);const o=n*Se(r.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:i,left:r,bottom:n,right:o,options:s}=this,a=s.align;let l=0,u,c,d;return this.isHorizontal()?(c=Ne(a,r,o),d=i+t,u=o-r):(s.position==="left"?(c=r+t,d=Ne(a,n,i),l=Y*-.5):(c=o-t,d=Ne(a,i,n),l=Y*.5),u=n-i),{titleX:c,titleY:d,maxWidth:u,rotation:l}}draw(){const t=this.ctx,i=this.options;if(!i.display)return;const r=Se(i.font),o=r.lineHeight/2+this._padding.top,{titleX:s,titleY:a,maxWidth:l,rotation:u}=this._drawArgs(o);ui(t,i.text,0,0,r,{color:i.color,maxWidth:l,rotation:u,textAlign:Au(i.align),textBaseline:"middle",translation:[s,a]})}}function J4(e,t){const i=new Vu({ctx:e.ctx,options:t,chart:e});Ce.configure(e,i,t),Ce.addBox(e,i),e.titleBlock=i}var q4={id:"title",_element:Vu,start(e,t,i){J4(e,i)},stop(e){const t=e.titleBlock;Ce.removeBox(e,t),delete e.titleBlock},beforeUpdate(e,t,i){const r=e.titleBlock;Ce.configure(e,r,i),r.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const wr=new WeakMap;var K4={id:"subtitle",start(e,t,i){const r=new Vu({ctx:e.ctx,options:i,chart:e});Ce.configure(e,r,i),Ce.addBox(e,r),wr.set(e,r)},stop(e){Ce.removeBox(e,wr.get(e)),wr.delete(e)},beforeUpdate(e,t,i){const r=wr.get(e);Ce.configure(e,r,i),r.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const tn={average(e){if(!e.length)return!1;let t,i,r=new Set,n=0,o=0;for(t=0,i=e.length;t<i;++t){const a=e[t].element;if(a&&a.hasValue()){const l=a.tooltipPosition();r.add(l.x),n+=l.y,++o}}return o===0||r.size===0?!1:{x:[...r].reduce((a,l)=>a+l)/r.size,y:n/o}},nearest(e,t){if(!e.length)return!1;let i=t.x,r=t.y,n=Number.POSITIVE_INFINITY,o,s,a;for(o=0,s=e.length;o<s;++o){const l=e[o].element;if(l&&l.hasValue()){const u=l.getCenterPoint(),c=Bs(t,u);c<n&&(n=c,a=l)}}if(a){const l=a.tooltipPosition();i=l.x,r=l.y}return{x:i,y:r}}};function dt(e,t){return t&&(de(t)?Array.prototype.push.apply(e,t):e.push(t)),e}function vt(e){return(typeof e=="string"||e instanceof String)&&e.indexOf(`
122
+ `)>-1?e.split(`
123
+ `):e}function X4(e,t){const{element:i,datasetIndex:r,index:n}=t,o=e.getDatasetMeta(r).controller,{label:s,value:a}=o.getLabelAndValue(n);return{chart:e,label:s,parsed:o.getParsed(n),raw:e.data.datasets[r].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:r,element:i}}function Zd(e,t){const i=e.chart.ctx,{body:r,footer:n,title:o}=e,{boxWidth:s,boxHeight:a}=t,l=Se(t.bodyFont),u=Se(t.titleFont),c=Se(t.footerFont),d=o.length,f=n.length,h=r.length,m=je(t.padding);let p=m.height,g=0,b=r.reduce((w,x)=>w+x.before.length+x.lines.length+x.after.length,0);if(b+=e.beforeBody.length+e.afterBody.length,d&&(p+=d*u.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),b){const w=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;p+=h*w+(b-h)*l.lineHeight+(b-1)*t.bodySpacing}f&&(p+=t.footerMarginTop+f*c.lineHeight+(f-1)*t.footerSpacing);let y=0;const S=function(w){g=Math.max(g,i.measureText(w).width+y)};return i.save(),i.font=u.string,ee(e.title,S),i.font=l.string,ee(e.beforeBody.concat(e.afterBody),S),y=t.displayColors?s+2+t.boxPadding:0,ee(r,w=>{ee(w.before,S),ee(w.lines,S),ee(w.after,S)}),y=0,i.font=c.string,ee(e.footer,S),i.restore(),g+=m.width,{width:g,height:p}}function G4(e,t){const{y:i,height:r}=t;return i<r/2?"top":i>e.height-r/2?"bottom":"center"}function Y4(e,t,i,r){const{x:n,width:o}=r,s=i.caretSize+i.caretPadding;if(e==="left"&&n+o+s>t.width||e==="right"&&n-o-s<0)return!0}function Q4(e,t,i,r){const{x:n,width:o}=i,{width:s,chartArea:{left:a,right:l}}=e;let u="center";return r==="center"?u=n<=(a+l)/2?"left":"right":n<=o/2?u="left":n>=s-o/2&&(u="right"),Y4(u,e,t,i)&&(u="center"),u}function Ud(e,t,i){const r=i.yAlign||t.yAlign||G4(e,i);return{xAlign:i.xAlign||t.xAlign||Q4(e,t,i,r),yAlign:r}}function eE(e,t){let{x:i,width:r}=e;return t==="right"?i-=r:t==="center"&&(i-=r/2),i}function tE(e,t,i){let{y:r,height:n}=e;return t==="top"?r+=i:t==="bottom"?r-=n+i:r-=n/2,r}function Ld(e,t,i,r){const{caretSize:n,caretPadding:o,cornerRadius:s}=e,{xAlign:a,yAlign:l}=i,u=n+o,{topLeft:c,topRight:d,bottomLeft:f,bottomRight:h}=ni(s);let m=eE(t,a);const p=tE(t,l,u);return l==="center"?a==="left"?m+=u:a==="right"&&(m-=u):a==="left"?m-=Math.max(c,f)+n:a==="right"&&(m+=Math.max(d,h)+n),{x:Ie(m,0,r.width-t.width),y:Ie(p,0,r.height-t.height)}}function Sr(e,t,i){const r=je(i.padding);return t==="center"?e.x+e.width/2:t==="right"?e.x+e.width-r.right:e.x+r.left}function Fd(e){return dt([],vt(e))}function iE(e,t,i){return Bt(e,{tooltip:t,tooltipItems:i,type:"tooltip"})}function Bd(e,t){const i=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return i?e.override(i):e}const R_={beforeTitle:pt,title(e){if(e.length>0){const t=e[0],i=t.chart.data.labels,r=i?i.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(r>0&&t.dataIndex<r)return i[t.dataIndex]}return""},afterTitle:pt,beforeBody:pt,beforeLabel:pt,label(e){if(this&&this.options&&this.options.mode==="dataset")return e.label+": "+e.formattedValue||e.formattedValue;let t=e.dataset.label||"";t&&(t+=": ");const i=e.formattedValue;return H(i)||(t+=i),t},labelColor(e){const i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{borderColor:i.borderColor,backgroundColor:i.backgroundColor,borderWidth:i.borderWidth,borderDash:i.borderDash,borderDashOffset:i.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(e){const i=e.chart.getDatasetMeta(e.datasetIndex).controller.getStyle(e.dataIndex);return{pointStyle:i.pointStyle,rotation:i.rotation}},afterLabel:pt,afterBody:pt,beforeFooter:pt,footer:pt,afterFooter:pt};function Le(e,t,i,r){const n=e[t].call(i,r);return typeof n>"u"?R_[t].call(i,r):n}class Ys extends ct{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const i=this.chart,r=this.options.setContext(this.getContext()),n=r.enabled&&i.options.animation&&r.animations,o=new g_(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=iE(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,i){const{callbacks:r}=i,n=Le(r,"beforeTitle",this,t),o=Le(r,"title",this,t),s=Le(r,"afterTitle",this,t);let a=[];return a=dt(a,vt(n)),a=dt(a,vt(o)),a=dt(a,vt(s)),a}getBeforeBody(t,i){return Fd(Le(i.callbacks,"beforeBody",this,t))}getBody(t,i){const{callbacks:r}=i,n=[];return ee(t,o=>{const s={before:[],lines:[],after:[]},a=Bd(r,o);dt(s.before,vt(Le(a,"beforeLabel",this,o))),dt(s.lines,Le(a,"label",this,o)),dt(s.after,vt(Le(a,"afterLabel",this,o))),n.push(s)}),n}getAfterBody(t,i){return Fd(Le(i.callbacks,"afterBody",this,t))}getFooter(t,i){const{callbacks:r}=i,n=Le(r,"beforeFooter",this,t),o=Le(r,"footer",this,t),s=Le(r,"afterFooter",this,t);let a=[];return a=dt(a,vt(n)),a=dt(a,vt(o)),a=dt(a,vt(s)),a}_createItems(t){const i=this._active,r=this.chart.data,n=[],o=[],s=[];let a=[],l,u;for(l=0,u=i.length;l<u;++l)a.push(X4(this.chart,i[l]));return t.filter&&(a=a.filter((c,d,f)=>t.filter(c,d,f,r))),t.itemSort&&(a=a.sort((c,d)=>t.itemSort(c,d,r))),ee(a,c=>{const d=Bd(t.callbacks,c);n.push(Le(d,"labelColor",this,c)),o.push(Le(d,"labelPointStyle",this,c)),s.push(Le(d,"labelTextColor",this,c))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=s,this.dataPoints=a,a}update(t,i){const r=this.options.setContext(this.getContext()),n=this._active;let o,s=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=tn[r.position].call(this,n,this._eventPosition);s=this._createItems(r),this.title=this.getTitle(s,r),this.beforeBody=this.getBeforeBody(s,r),this.body=this.getBody(s,r),this.afterBody=this.getAfterBody(s,r),this.footer=this.getFooter(s,r);const l=this._size=Zd(this,r),u=Object.assign({},a,l),c=Ud(this.chart,r,u),d=Ld(r,u,c,this.chart);this.xAlign=c.xAlign,this.yAlign=c.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=s,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&r.external&&r.external.call(this,{chart:this.chart,tooltip:this,replay:i})}drawCaret(t,i,r,n){const o=this.getCaretPosition(t,r,n);i.lineTo(o.x1,o.y1),i.lineTo(o.x2,o.y2),i.lineTo(o.x3,o.y3)}getCaretPosition(t,i,r){const{xAlign:n,yAlign:o}=this,{caretSize:s,cornerRadius:a}=r,{topLeft:l,topRight:u,bottomLeft:c,bottomRight:d}=ni(a),{x:f,y:h}=t,{width:m,height:p}=i;let g,b,y,S,w,x;return o==="center"?(w=h+p/2,n==="left"?(g=f,b=g-s,S=w+s,x=w-s):(g=f+m,b=g+s,S=w-s,x=w+s),y=g):(n==="left"?b=f+Math.max(l,c)+s:n==="right"?b=f+m-Math.max(u,d)-s:b=this.caretX,o==="top"?(S=h,w=S-s,g=b-s,y=b+s):(S=h+p,w=S+s,g=b+s,y=b-s),x=S),{x1:g,x2:b,x3:y,y1:S,y2:w,y3:x}}drawTitle(t,i,r){const n=this.title,o=n.length;let s,a,l;if(o){const u=ki(r.rtl,this.x,this.width);for(t.x=Sr(this,r.titleAlign,r),i.textAlign=u.textAlign(r.titleAlign),i.textBaseline="middle",s=Se(r.titleFont),a=r.titleSpacing,i.fillStyle=r.titleColor,i.font=s.string,l=0;l<o;++l)i.fillText(n[l],u.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+a,l+1===o&&(t.y+=r.titleMarginBottom-a)}}_drawColorBox(t,i,r,n,o){const s=this.labelColors[r],a=this.labelPointStyles[r],{boxHeight:l,boxWidth:u}=o,c=Se(o.bodyFont),d=Sr(this,"left",o),f=n.x(d),h=l<c.lineHeight?(c.lineHeight-l)/2:0,m=i.y+h;if(o.usePointStyle){const p={radius:Math.min(u,l)/2,pointStyle:a.pointStyle,rotation:a.rotation,borderWidth:1},g=n.leftForLtr(f,u)+u/2,b=m+l/2;t.strokeStyle=o.multiKeyBackground,t.fillStyle=o.multiKeyBackground,Ws(t,p,g,b),t.strokeStyle=s.borderColor,t.fillStyle=s.backgroundColor,Ws(t,p,g,b)}else{t.lineWidth=q(s.borderWidth)?Math.max(...Object.values(s.borderWidth)):s.borderWidth||1,t.strokeStyle=s.borderColor,t.setLineDash(s.borderDash||[]),t.lineDashOffset=s.borderDashOffset||0;const p=n.leftForLtr(f,u),g=n.leftForLtr(n.xPlus(f,1),u-2),b=ni(s.borderRadius);Object.values(b).some(y=>y!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,yn(t,{x:p,y:m,w:u,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=s.backgroundColor,t.beginPath(),yn(t,{x:g,y:m+1,w:u-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(p,m,u,l),t.strokeRect(p,m,u,l),t.fillStyle=s.backgroundColor,t.fillRect(g,m+1,u-2,l-2))}t.fillStyle=this.labelTextColors[r]}drawBody(t,i,r){const{body:n}=this,{bodySpacing:o,bodyAlign:s,displayColors:a,boxHeight:l,boxWidth:u,boxPadding:c}=r,d=Se(r.bodyFont);let f=d.lineHeight,h=0;const m=ki(r.rtl,this.x,this.width),p=function(D){i.fillText(D,m.x(t.x+h),t.y+f/2),t.y+=f+o},g=m.textAlign(s);let b,y,S,w,x,I,z;for(i.textAlign=s,i.textBaseline="middle",i.font=d.string,t.x=Sr(this,g,r),i.fillStyle=r.bodyColor,ee(this.beforeBody,p),h=a&&g!=="right"?s==="center"?u/2+c:u+2+c:0,w=0,I=n.length;w<I;++w){for(b=n[w],y=this.labelTextColors[w],i.fillStyle=y,ee(b.before,p),S=b.lines,a&&S.length&&(this._drawColorBox(i,t,w,m,r),f=Math.max(d.lineHeight,l)),x=0,z=S.length;x<z;++x)p(S[x]),f=d.lineHeight;ee(b.after,p)}h=0,f=d.lineHeight,ee(this.afterBody,p),t.y-=o}drawFooter(t,i,r){const n=this.footer,o=n.length;let s,a;if(o){const l=ki(r.rtl,this.x,this.width);for(t.x=Sr(this,r.footerAlign,r),t.y+=r.footerMarginTop,i.textAlign=l.textAlign(r.footerAlign),i.textBaseline="middle",s=Se(r.footerFont),i.fillStyle=r.footerColor,i.font=s.string,a=0;a<o;++a)i.fillText(n[a],l.x(t.x),t.y+s.lineHeight/2),t.y+=s.lineHeight+r.footerSpacing}}drawBackground(t,i,r,n){const{xAlign:o,yAlign:s}=this,{x:a,y:l}=t,{width:u,height:c}=r,{topLeft:d,topRight:f,bottomLeft:h,bottomRight:m}=ni(n.cornerRadius);i.fillStyle=n.backgroundColor,i.strokeStyle=n.borderColor,i.lineWidth=n.borderWidth,i.beginPath(),i.moveTo(a+d,l),s==="top"&&this.drawCaret(t,i,r,n),i.lineTo(a+u-f,l),i.quadraticCurveTo(a+u,l,a+u,l+f),s==="center"&&o==="right"&&this.drawCaret(t,i,r,n),i.lineTo(a+u,l+c-m),i.quadraticCurveTo(a+u,l+c,a+u-m,l+c),s==="bottom"&&this.drawCaret(t,i,r,n),i.lineTo(a+h,l+c),i.quadraticCurveTo(a,l+c,a,l+c-h),s==="center"&&o==="left"&&this.drawCaret(t,i,r,n),i.lineTo(a,l+d),i.quadraticCurveTo(a,l,a+d,l),i.closePath(),i.fill(),n.borderWidth>0&&i.stroke()}_updateAnimationTarget(t){const i=this.chart,r=this.$animations,n=r&&r.x,o=r&&r.y;if(n||o){const s=tn[t.position].call(this,this._active,this._eventPosition);if(!s)return;const a=this._size=Zd(this,t),l=Object.assign({},s,this._size),u=Ud(i,t,l),c=Ld(t,l,u,i);(n._to!==c.x||o._to!==c.y)&&(this.xAlign=u.xAlign,this.yAlign=u.yAlign,this.width=a.width,this.height=a.height,this.caretX=s.x,this.caretY=s.y,this._resolveAnimations().update(this,c))}}_willRender(){return!!this.opacity}draw(t){const i=this.options.setContext(this.getContext());let r=this.opacity;if(!r)return;this._updateAnimationTarget(i);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};r=Math.abs(r)<.001?0:r;const s=je(i.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;i.enabled&&a&&(t.save(),t.globalAlpha=r,this.drawBackground(o,t,n,i),c_(t,i.textDirection),o.y+=s.top,this.drawTitle(o,t,i),this.drawBody(o,t,i),this.drawFooter(o,t,i),d_(t,i.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,i){const r=this._active,n=t.map(({datasetIndex:a,index:l})=>{const u=this.chart.getDatasetMeta(a);if(!u)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:u.data[l],index:l}}),o=!Qr(r,n),s=this._positionChanged(n,i);(o||s)&&(this._active=n,this._eventPosition=i,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,i,r=!0){if(i&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],s=this._getActiveElements(t,o,i,r),a=this._positionChanged(s,t),l=i||!Qr(s,o)||a;return l&&(this._active=s,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,i))),l}_getActiveElements(t,i,r,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return i.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const s=this.chart.getElementsAtEventForMode(t,o.mode,o,r);return o.reverse&&s.reverse(),s}_positionChanged(t,i){const{caretX:r,caretY:n,options:o}=this,s=tn[o.position].call(this,t,i);return s!==!1&&(r!==s.x||n!==s.y)}}O(Ys,"positioners",tn);var nE={id:"tooltip",_element:Ys,positioners:tn,afterInit(e,t,i){i&&(e.tooltip=new Ys({chart:e,options:i}))},beforeUpdate(e,t,i){e.tooltip&&e.tooltip.initialize(i)},reset(e,t,i){e.tooltip&&e.tooltip.initialize(i)},afterDraw(e){const t=e.tooltip;if(t&&t._willRender()){const i={tooltip:t};if(e.notifyPlugins("beforeTooltipDraw",{...i,cancelable:!0})===!1)return;t.draw(e.ctx),e.notifyPlugins("afterTooltipDraw",i)}},afterEvent(e,t){if(e.tooltip){const i=t.replay;e.tooltip.handleEvent(t.event,i,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(e,t)=>t.bodyFont.size,boxWidth:(e,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:R_},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:e=>e!=="filter"&&e!=="itemSort"&&e!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},rE=Object.freeze({__proto__:null,Colors:g4,Decimation:y4,Filler:U4,Legend:H4,SubTitle:K4,Title:q4,Tooltip:nE});const oE=(e,t,i,r)=>(typeof t=="string"?(i=e.push(t)-1,r.unshift({index:i,label:t})):isNaN(t)&&(i=null),i);function sE(e,t,i,r){const n=e.indexOf(t);if(n===-1)return oE(e,t,i,r);const o=e.lastIndexOf(t);return n!==o?i:n}const aE=(e,t)=>e===null?null:Ie(Math.round(e),0,t);function Vd(e){const t=this.getLabels();return e>=0&&e<t.length?t[e]:e}class Qs extends mi{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const i=this._addedLabels;if(i.length){const r=this.getLabels();for(const{index:n,label:o}of i)r[n]===o&&r.splice(n,1);this._addedLabels=[]}super.init(t)}parse(t,i){if(H(t))return null;const r=this.getLabels();return i=isFinite(i)&&r[i]===t?i:sE(r,t,Z(i,t),this._addedLabels),aE(i,r.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:i}=this.getUserBounds();let{min:r,max:n}=this.getMinMax(!0);this.options.bounds==="ticks"&&(t||(r=0),i||(n=this.getLabels().length-1)),this.min=r,this.max=n}buildTicks(){const t=this.min,i=this.max,r=this.options.offset,n=[];let o=this.getLabels();o=t===0&&i===o.length-1?o:o.slice(t,i+1),this._valueRange=Math.max(o.length-(r?0:1),1),this._startValue=this.min-(r?.5:0);for(let s=t;s<=i;s++)n.push({value:s});return n}getLabelForValue(t){return Vd.call(this,t)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(t){return typeof t!="number"&&(t=this.parse(t)),t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getPixelForTick(t){const i=this.ticks;return t<0||t>i.length-1?null:this.getPixelForValue(i[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}O(Qs,"id","category"),O(Qs,"defaults",{ticks:{callback:Vd}});function lE(e,t){const i=[],{bounds:n,step:o,min:s,max:a,precision:l,count:u,maxTicks:c,maxDigits:d,includeBounds:f}=e,h=o||1,m=c-1,{min:p,max:g}=t,b=!H(s),y=!H(a),S=!H(u),w=(g-p)/(d+1);let x=Zc((g-p)/m/h)*h,I,z,D,N;if(x<1e-14&&!b&&!y)return[{value:p},{value:g}];N=Math.ceil(g/x)-Math.floor(p/x),N>m&&(x=Zc(N*x/m/h)*h),H(l)||(I=Math.pow(10,l),x=Math.ceil(x*I)/I),n==="ticks"?(z=Math.floor(p/x)*x,D=Math.ceil(g/x)*x):(z=p,D=g),b&&y&&o&&e1((a-s)/o,x/1e3)?(N=Math.round(Math.min((a-s)/x,c)),x=(a-s)/N,z=s,D=a):S?(z=b?s:z,D=y?a:D,N=u-1,x=(D-z)/N):(N=(D-z)/x,on(N,Math.round(N),x/1e3)?N=Math.round(N):N=Math.ceil(N));const F=Math.max(Uc(x),Uc(z));I=Math.pow(10,H(l)?F:l),z=Math.round(z*I)/I,D=Math.round(D*I)/I;let B=0;for(b&&(f&&z!==s?(i.push({value:s}),z<s&&B++,on(Math.round((z+B*x)*I)/I,s,Wd(s,w,e))&&B++):z<s&&B++);B<N;++B){const K=Math.round((z+B*x)*I)/I;if(y&&K>a)break;i.push({value:K})}return y&&f&&D!==a?i.length&&on(i[i.length-1].value,a,Wd(a,w,e))?i[i.length-1].value=a:i.push({value:a}):(!y||D===a)&&i.push({value:D}),i}function Wd(e,t,{horizontal:i,minRotation:r}){const n=lt(r),o=(i?Math.sin(n):Math.cos(n))||.001,s=.75*t*(""+e).length;return Math.min(t/o,s)}class so extends mi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,i){return H(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:i,maxDefined:r}=this.getUserBounds();let{min:n,max:o}=this;const s=l=>n=i?n:l,a=l=>o=r?o:l;if(t){const l=mt(n),u=mt(o);l<0&&u<0?a(0):l>0&&u>0&&s(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||s(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:i,stepSize:r}=t,n;return r?(n=Math.ceil(this.max/r)-Math.floor(this.min/r)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${r} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),i=i||11),i&&(n=Math.min(i,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,i=t.ticks;let r=this.getTickLimit();r=Math.max(2,r);const n={maxTicks:r,bounds:t.bounds,min:t.min,max:t.max,precision:i.precision,step:i.stepSize,count:i.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:i.minRotation||0,includeBounds:i.includeBounds!==!1},o=this._range||this,s=lE(n,o);return t.bounds==="ticks"&&Jb(s,this,"value"),t.reverse?(s.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),s}configure(){const t=this.ticks;let i=this.min,r=this.max;if(super.configure(),this.options.offset&&t.length){const n=(r-i)/Math.max(t.length-1,1)/2;i-=n,r+=n}this._startValue=i,this._endValue=r,this._valueRange=r-i}getLabelForValue(t){return rr(t,this.chart.options.locale,this.options.ticks.format)}}class ea extends so{determineDataLimits(){const{min:t,max:i}=this.getMinMax(!0);this.min=ye(t)?t:0,this.max=ye(i)?i:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),i=t?this.width:this.height,r=lt(this.options.ticks.minRotation),n=(t?Math.sin(r):Math.cos(r))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(i/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}O(ea,"id","linear"),O(ea,"defaults",{ticks:{callback:ls.formatters.numeric}});const $n=e=>Math.floor(Ot(e)),Xt=(e,t)=>Math.pow(10,$n(e)+t);function Hd(e){return e/Math.pow(10,$n(e))===1}function Jd(e,t,i){const r=Math.pow(10,i),n=Math.floor(e/r);return Math.ceil(t/r)-n}function uE(e,t){const i=t-e;let r=$n(i);for(;Jd(e,t,r)>10;)r++;for(;Jd(e,t,r)<10;)r--;return Math.min(r,$n(e))}function cE(e,{min:t,max:i}){t=Je(e.min,t);const r=[],n=$n(t);let o=uE(t,i),s=o<0?Math.pow(10,Math.abs(o)):1;const a=Math.pow(10,o),l=n>o?Math.pow(10,n):0,u=Math.round((t-l)*s)/s,c=Math.floor((t-l)/a/10)*a*10;let d=Math.floor((u-c)/Math.pow(10,o)),f=Je(e.min,Math.round((l+c+d*Math.pow(10,o))*s)/s);for(;f<i;)r.push({value:f,major:Hd(f),significand:d}),d>=10?d=d<15?15:20:d++,d>=20&&(o++,d=2,s=o>=0?1:s),f=Math.round((l+c+d*Math.pow(10,o))*s)/s;const h=Je(e.max,f);return r.push({value:h,major:Hd(h),significand:d}),r}class ta extends mi{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,i){const r=so.prototype.parse.apply(this,[t,i]);if(r===0){this._zero=!0;return}return ye(r)&&r>0?r:null}determineDataLimits(){const{min:t,max:i}=this.getMinMax(!0);this.min=ye(t)?Math.max(0,t):null,this.max=ye(i)?Math.max(0,i):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!ye(this._userMin)&&(this.min=t===Xt(this.min,0)?Xt(this.min,-1):Xt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:i}=this.getUserBounds();let r=this.min,n=this.max;const o=a=>r=t?r:a,s=a=>n=i?n:a;r===n&&(r<=0?(o(1),s(10)):(o(Xt(r,-1)),s(Xt(n,1)))),r<=0&&o(Xt(n,-1)),n<=0&&s(Xt(r,1)),this.min=r,this.max=n}buildTicks(){const t=this.options,i={min:this._userMin,max:this._userMax},r=cE(i,this);return t.bounds==="ticks"&&Jb(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}getLabelForValue(t){return t===void 0?"0":rr(t,this.chart.options.locale,this.options.ticks.format)}configure(){const t=this.min;super.configure(),this._startValue=Ot(t),this._valueRange=Ot(this.max)-Ot(t)}getPixelForValue(t){return(t===void 0||t===0)&&(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Ot(t)-this._startValue)/this._valueRange)}getValueForPixel(t){const i=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+i*this._valueRange)}}O(ta,"id","logarithmic"),O(ta,"defaults",{ticks:{callback:ls.formatters.logarithmic,major:{enabled:!0}}});function ia(e){const t=e.ticks;if(t.display&&e.display){const i=je(t.backdropPadding);return Z(t.font&&t.font.size,fe.font.size)+i.height}return 0}function dE(e,t,i){return i=de(i)?i:[i],{w:v1(e,t.string,i),h:i.length*t.lineHeight}}function qd(e,t,i,r,n){return e===r||e===n?{start:t-i/2,end:t+i/2}:e<r||e>n?{start:t-i,end:t}:{start:t,end:t+i}}function fE(e){const t={l:e.left+e._padding.left,r:e.right-e._padding.right,t:e.top+e._padding.top,b:e.bottom-e._padding.bottom},i=Object.assign({},t),r=[],n=[],o=e._pointLabels.length,s=e.options.pointLabels,a=s.centerPointLabels?Y/o:0;for(let l=0;l<o;l++){const u=s.setContext(e.getPointLabelContext(l));n[l]=u.padding;const c=e.getPointPosition(l,e.drawingArea+n[l],a),d=Se(u.font),f=dE(e.ctx,d,e._pointLabels[l]);r[l]=f;const h=Ae(e.getIndexAngle(l)+a),m=Math.round(Mu(h)),p=qd(m,c.x,f.w,0,180),g=qd(m,c.y,f.h,90,270);hE(i,t,h,p,g)}e.setCenterPoint(t.l-i.l,i.r-t.r,t.t-i.t,i.b-t.b),e._pointLabelItems=gE(e,r,n)}function hE(e,t,i,r,n){const o=Math.abs(Math.sin(i)),s=Math.abs(Math.cos(i));let a=0,l=0;r.start<t.l?(a=(t.l-r.start)/o,e.l=Math.min(e.l,t.l-a)):r.end>t.r&&(a=(r.end-t.r)/o,e.r=Math.max(e.r,t.r+a)),n.start<t.t?(l=(t.t-n.start)/s,e.t=Math.min(e.t,t.t-l)):n.end>t.b&&(l=(n.end-t.b)/s,e.b=Math.max(e.b,t.b+l))}function mE(e,t,i){const r=e.drawingArea,{extra:n,additionalAngle:o,padding:s,size:a}=i,l=e.getPointPosition(t,r+n+s,o),u=Math.round(Mu(Ae(l.angle+ke))),c=_E(l.y,a.h,u),d=vE(u),f=bE(l.x,a.w,d);return{visible:!0,x:l.x,y:c,textAlign:d,left:f,top:c,right:f+a.w,bottom:c+a.h}}function pE(e,t){if(!t)return!0;const{left:i,top:r,right:n,bottom:o}=e;return!($t({x:i,y:r},t)||$t({x:i,y:o},t)||$t({x:n,y:r},t)||$t({x:n,y:o},t))}function gE(e,t,i){const r=[],n=e._pointLabels.length,o=e.options,{centerPointLabels:s,display:a}=o.pointLabels,l={extra:ia(o)/2,additionalAngle:s?Y/n:0};let u;for(let c=0;c<n;c++){l.padding=i[c],l.size=t[c];const d=mE(e,c,l);r.push(d),a==="auto"&&(d.visible=pE(d,u),d.visible&&(u=d))}return r}function vE(e){return e===0||e===180?"center":e<180?"left":"right"}function bE(e,t,i){return i==="right"?e-=t:i==="center"&&(e-=t/2),e}function _E(e,t,i){return i===90||i===270?e-=t/2:(i>270||i<90)&&(e-=t),e}function yE(e,t,i){const{left:r,top:n,right:o,bottom:s}=i,{backdropColor:a}=t;if(!H(a)){const l=ni(t.borderRadius),u=je(t.backdropPadding);e.fillStyle=a;const c=r-u.left,d=n-u.top,f=o-r+u.width,h=s-n+u.height;Object.values(l).some(m=>m!==0)?(e.beginPath(),yn(e,{x:c,y:d,w:f,h,radius:l}),e.fill()):e.fillRect(c,d,f,h)}}function xE(e,t){const{ctx:i,options:{pointLabels:r}}=e;for(let n=t-1;n>=0;n--){const o=e._pointLabelItems[n];if(!o.visible)continue;const s=r.setContext(e.getPointLabelContext(n));yE(i,s,o);const a=Se(s.font),{x:l,y:u,textAlign:c}=o;ui(i,e._pointLabels[n],l,u+a.lineHeight/2,a,{color:s.color,textAlign:c,textBaseline:"middle"})}}function j_(e,t,i,r){const{ctx:n}=e;if(i)n.arc(e.xCenter,e.yCenter,t,0,le);else{let o=e.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let s=1;s<r;s++)o=e.getPointPosition(s,t),n.lineTo(o.x,o.y)}}function $E(e,t,i,r,n){const o=e.ctx,s=t.circular,{color:a,lineWidth:l}=t;!s&&!r||!a||!l||i<0||(o.save(),o.strokeStyle=a,o.lineWidth=l,o.setLineDash(n.dash||[]),o.lineDashOffset=n.dashOffset,o.beginPath(),j_(e,i,s,r),o.closePath(),o.stroke(),o.restore())}function kE(e,t,i){return Bt(e,{label:i,index:t,type:"pointLabel"})}class nn extends so{constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){const t=this._padding=je(ia(this.options)/2),i=this.width=this.maxWidth-t.width,r=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+i/2+t.left),this.yCenter=Math.floor(this.top+r/2+t.top),this.drawingArea=Math.floor(Math.min(i,r)/2)}determineDataLimits(){const{min:t,max:i}=this.getMinMax(!1);this.min=ye(t)&&!isNaN(t)?t:0,this.max=ye(i)&&!isNaN(i)?i:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ia(this.options))}generateTickLabels(t){so.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((i,r)=>{const n=ae(this.options.pointLabels.callback,[i,r],this);return n||n===0?n:""}).filter((i,r)=>this.chart.getDataVisibility(r))}fit(){const t=this.options;t.display&&t.pointLabels.display?fE(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,i,r,n){this.xCenter+=Math.floor((t-i)/2),this.yCenter+=Math.floor((r-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,i,r,n))}getIndexAngle(t){const i=le/(this._pointLabels.length||1),r=this.options.startAngle||0;return Ae(t*i+lt(r))}getDistanceFromCenterForValue(t){if(H(t))return NaN;const i=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*i:(t-this.min)*i}getValueForDistanceFromCenter(t){if(H(t))return NaN;const i=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-i:this.min+i}getPointLabelContext(t){const i=this._pointLabels||[];if(t>=0&&t<i.length){const r=i[t];return kE(this.getContext(),t,r)}}getPointPosition(t,i,r=0){const n=this.getIndexAngle(t)-ke+r;return{x:Math.cos(n)*i+this.xCenter,y:Math.sin(n)*i+this.yCenter,angle:n}}getPointPositionForValue(t,i){return this.getPointPosition(t,this.getDistanceFromCenterForValue(i))}getBasePosition(t){return this.getPointPositionForValue(t||0,this.getBaseValue())}getPointLabelPosition(t){const{left:i,top:r,right:n,bottom:o}=this._pointLabelItems[t];return{left:i,top:r,right:n,bottom:o}}drawBackground(){const{backgroundColor:t,grid:{circular:i}}=this.options;if(t){const r=this.ctx;r.save(),r.beginPath(),j_(this,this.getDistanceFromCenterForValue(this._endValue),i,this._pointLabels.length),r.closePath(),r.fillStyle=t,r.fill(),r.restore()}}drawGrid(){const t=this.ctx,i=this.options,{angleLines:r,grid:n,border:o}=i,s=this._pointLabels.length;let a,l,u;if(i.pointLabels.display&&xE(this,s),n.display&&this.ticks.forEach((c,d)=>{if(d!==0||d===0&&this.min<0){l=this.getDistanceFromCenterForValue(c.value);const f=this.getContext(d),h=n.setContext(f),m=o.setContext(f);$E(this,h,l,s,m)}}),r.display){for(t.save(),a=s-1;a>=0;a--){const c=r.setContext(this.getPointLabelContext(a)),{color:d,lineWidth:f}=c;!f||!d||(t.lineWidth=f,t.strokeStyle=d,t.setLineDash(c.borderDash),t.lineDashOffset=c.borderDashOffset,l=this.getDistanceFromCenterForValue(i.reverse?this.min:this.max),u=this.getPointPosition(a,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(u.x,u.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,i=this.options,r=i.ticks;if(!r.display)return;const n=this.getIndexAngle(0);let o,s;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((a,l)=>{if(l===0&&this.min>=0&&!i.reverse)return;const u=r.setContext(this.getContext(l)),c=Se(u.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),u.showLabelBackdrop){t.font=c.string,s=t.measureText(a.label).width,t.fillStyle=u.backdropColor;const d=je(u.backdropPadding);t.fillRect(-s/2-d.left,-o-c.size/2-d.top,s+d.width,c.size+d.height)}ui(t,a.label,0,-o,c,{color:u.color,strokeColor:u.textStrokeColor,strokeWidth:u.textStrokeWidth})}),t.restore()}drawTitle(){}}O(nn,"id","radialLinear"),O(nn,"defaults",{display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:ls.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(t){return t},padding:5,centerPointLabels:!1}}),O(nn,"defaultRoutes",{"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"}),O(nn,"descriptors",{angleLines:{_fallback:"grid"}});const ms={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Be=Object.keys(ms);function Kd(e,t){return e-t}function Xd(e,t){if(H(t))return null;const i=e._adapter,{parser:r,round:n,isoWeekday:o}=e._parseOpts;let s=t;return typeof r=="function"&&(s=r(s)),ye(s)||(s=typeof r=="string"?i.parse(s,r):i.parse(s)),s===null?null:(n&&(s=n==="week"&&(Ni(o)||o===!0)?i.startOf(s,"isoWeek",o):i.startOf(s,n)),+s)}function Gd(e,t,i,r){const n=Be.length;for(let o=Be.indexOf(e);o<n-1;++o){const s=ms[Be[o]],a=s.steps?s.steps:Number.MAX_SAFE_INTEGER;if(s.common&&Math.ceil((i-t)/(a*s.size))<=r)return Be[o]}return Be[n-1]}function wE(e,t,i,r,n){for(let o=Be.length-1;o>=Be.indexOf(i);o--){const s=Be[o];if(ms[s].common&&e._adapter.diff(n,r,s)>=t-1)return s}return Be[i?Be.indexOf(i):0]}function SE(e){for(let t=Be.indexOf(e)+1,i=Be.length;t<i;++t)if(ms[Be[t]].common)return Be[t]}function Yd(e,t,i){if(!i)e[t]=!0;else if(i.length){const{lo:r,hi:n}=Nu(i,t),o=i[r]>=t?i[r]:i[n];e[o]=!0}}function IE(e,t,i,r){const n=e._adapter,o=+n.startOf(t[0].value,r),s=t[t.length-1].value;let a,l;for(a=o;a<=s;a=+n.add(a,1,r))l=i[a],l>=0&&(t[l].major=!0);return t}function Qd(e,t,i){const r=[],n={},o=t.length;let s,a;for(s=0;s<o;++s)a=t[s],n[a]=s,r.push({value:a,major:!1});return o===0||!i?r:IE(e,r,n,i)}class kn extends mi{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,i={}){const r=t.time||(t.time={}),n=this._adapter=new NT._date(t.adapters.date);n.init(i),rn(r.displayFormats,n.formats()),this._parseOpts={parser:r.parser,round:r.round,isoWeekday:r.isoWeekday},super.init(t),this._normalized=i.normalized}parse(t,i){return t===void 0?null:Xd(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,i=this._adapter,r=t.time.unit||"day";let{min:n,max:o,minDefined:s,maxDefined:a}=this.getUserBounds();function l(u){!s&&!isNaN(u.min)&&(n=Math.min(n,u.min)),!a&&!isNaN(u.max)&&(o=Math.max(o,u.max))}(!s||!a)&&(l(this._getLabelBounds()),(t.bounds!=="ticks"||t.ticks.source!=="labels")&&l(this.getMinMax(!1))),n=ye(n)&&!isNaN(n)?n:+i.startOf(Date.now(),r),o=ye(o)&&!isNaN(o)?o:+i.endOf(Date.now(),r)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){const t=this.getLabelTimestamps();let i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY;return t.length&&(i=t[0],r=t[t.length-1]),{min:i,max:r}}buildTicks(){const t=this.options,i=t.time,r=t.ticks,n=r.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);const o=this.min,s=this.max,a=r1(n,o,s);return this._unit=i.unit||(r.autoSkip?Gd(i.minUnit,this.min,this.max,this._getLabelCapacity(o)):wE(this,a.length,i.minUnit,this.min,this.max)),this._majorUnit=!r.major.enabled||this._unit==="year"?void 0:SE(this._unit),this.initOffsets(n),t.reverse&&a.reverse(),Qd(this,a,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(t=>+t.value))}initOffsets(t=[]){let i=0,r=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?i=1-n:i=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?r=o:r=(o-this.getDecimalForValue(t[t.length-2]))/2);const s=t.length<3?.5:.25;i=Ie(i,0,s),r=Ie(r,0,s),this._offsets={start:i,end:r,factor:1/(i+1+r)}}_generate(){const t=this._adapter,i=this.min,r=this.max,n=this.options,o=n.time,s=o.unit||Gd(o.minUnit,i,r,this._getLabelCapacity(i)),a=Z(n.ticks.stepSize,1),l=s==="week"?o.isoWeekday:!1,u=Ni(l)||l===!0,c={};let d=i,f,h;if(u&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,u?"day":s),t.diff(r,i,s)>1e5*a)throw new Error(i+" and "+r+" are too far apart with stepSize of "+a+" "+s);const m=n.ticks.source==="data"&&this.getDataTimestamps();for(f=d,h=0;f<r;f=+t.add(f,a,s),h++)Yd(c,f,m);return(f===r||n.bounds==="ticks"||h===1)&&Yd(c,f,m),Object.keys(c).sort(Kd).map(p=>+p)}getLabelForValue(t){const i=this._adapter,r=this.options.time;return r.tooltipFormat?i.format(t,r.tooltipFormat):i.format(t,r.displayFormats.datetime)}format(t,i){const n=this.options.time.displayFormats,o=this._unit,s=i||n[o];return this._adapter.format(t,s)}_tickFormatFunction(t,i,r,n){const o=this.options,s=o.ticks.callback;if(s)return ae(s,[t,i,r],this);const a=o.time.displayFormats,l=this._unit,u=this._majorUnit,c=l&&a[l],d=u&&a[u],f=r[i],h=u&&d&&f&&f.major;return this._adapter.format(t,n||(h?d:c))}generateTickLabels(t){let i,r,n;for(i=0,r=t.length;i<r;++i)n=t[i],n.label=this._tickFormatFunction(n.value,i,t)}getDecimalForValue(t){return t===null?NaN:(t-this.min)/(this.max-this.min)}getPixelForValue(t){const i=this._offsets,r=this.getDecimalForValue(t);return this.getPixelForDecimal((i.start+r)*i.factor)}getValueForPixel(t){const i=this._offsets,r=this.getDecimalForPixel(t)/i.factor-i.end;return this.min+r*(this.max-this.min)}_getLabelSize(t){const i=this.options.ticks,r=this.ctx.measureText(t).width,n=lt(this.isHorizontal()?i.maxRotation:i.minRotation),o=Math.cos(n),s=Math.sin(n),a=this._resolveTickFontOptions(0).size;return{w:r*o+a*s,h:r*s+a*o}}_getLabelCapacity(t){const i=this.options.time,r=i.displayFormats,n=r[i.unit]||r.millisecond,o=this._tickFormatFunction(t,0,Qd(this,[t],this._majorUnit),n),s=this._getLabelSize(o),a=Math.floor(this.isHorizontal()?this.width/s.w:this.height/s.h)-1;return a>0?a:1}getDataTimestamps(){let t=this._cache.data||[],i,r;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(i=0,r=n.length;i<r;++i)t=t.concat(n[i].controller.getAllParsedValues(this));return this._cache.data=this.normalize(t)}getLabelTimestamps(){const t=this._cache.labels||[];let i,r;if(t.length)return t;const n=this.getLabels();for(i=0,r=n.length;i<r;++i)t.push(Xd(this,n[i]));return this._cache.labels=this._normalized?t:this.normalize(t)}normalize(t){return Xb(t.sort(Kd))}}O(kn,"id","time"),O(kn,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Ir(e,t,i){let r=0,n=e.length-1,o,s,a,l;i?(t>=e[r].pos&&t<=e[n].pos&&({lo:r,hi:n}=xt(e,"pos",t)),{pos:o,time:a}=e[r],{pos:s,time:l}=e[n]):(t>=e[r].time&&t<=e[n].time&&({lo:r,hi:n}=xt(e,"time",t)),{time:o,pos:a}=e[r],{time:s,pos:l}=e[n]);const u=s-o;return u?a+(l-a)*(t-o)/u:a}class na extends kn{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),i=this._table=this.buildLookupTable(t);this._minPos=Ir(i,this.min),this._tableRange=Ir(i,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:i,max:r}=this,n=[],o=[];let s,a,l,u,c;for(s=0,a=t.length;s<a;++s)u=t[s],u>=i&&u<=r&&n.push(u);if(n.length<2)return[{time:i,pos:0},{time:r,pos:1}];for(s=0,a=n.length;s<a;++s)c=n[s+1],l=n[s-1],u=n[s],Math.round((c+l)/2)!==u&&o.push({time:u,pos:s/(a-1)});return o}_generate(){const t=this.min,i=this.max;let r=super.getDataTimestamps();return(!r.includes(t)||!r.length)&&r.splice(0,0,t),(!r.includes(i)||r.length===1)&&r.push(i),r.sort((n,o)=>n-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const i=this.getDataTimestamps(),r=this.getLabelTimestamps();return i.length&&r.length?t=this.normalize(i.concat(r)):t=i.length?i:r,t=this._cache.all=t,t}getDecimalForValue(t){return(Ir(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const i=this._offsets,r=this.getDecimalForPixel(t)/i.factor-i.end;return Ir(this._table,r*this._tableRange+this._minPos,!0)}}O(na,"id","timeseries"),O(na,"defaults",kn.defaults);var zE=Object.freeze({__proto__:null,CategoryScale:Qs,LinearScale:ea,LogarithmicScale:ta,RadialLinearScale:nn,TimeScale:kn,TimeSeriesScale:na});const OE=[MT,u4,rE,zE];_t.register(...OE);const zr=document.querySelector(".main"),wn=document.getElementById("poll-toggle-btn"),Ds=document.getElementById("status-indicator"),PE=document.getElementById("status-text"),TE=document.getElementById("cpu-chart"),Or=document.getElementById("memory-bar-fill"),DE=document.getElementById("memory-percent"),EE=document.getElementById("memory-detail"),ME=document.getElementById("info-hostname"),NE=document.getElementById("info-platform"),AE=document.getElementById("info-uptime"),CE=30,RE=2e3,Pr=["rgba(59, 130, 246, 0.7)","rgba(16, 185, 129, 0.7)","rgba(245, 158, 11, 0.7)","rgba(239, 68, 68, 0.7)","rgba(139, 92, 246, 0.7)","rgba(236, 72, 153, 0.7)","rgba(20, 184, 166, 0.7)","rgba(249, 115, 22, 0.7)","rgba(34, 197, 94, 0.7)","rgba(168, 85, 247, 0.7)","rgba(251, 146, 60, 0.7)","rgba(74, 222, 128, 0.7)","rgba(96, 165, 250, 0.7)","rgba(248, 113, 113, 0.7)","rgba(167, 139, 250, 0.7)","rgba(244, 114, 182, 0.7)"],J={isPolling:!1,intervalId:null,cpuHistory:[],labels:[],coreCount:0,chart:null,previousCpuSnapshots:null};function Z_(e){const t=window.matchMedia("(prefers-color-scheme: dark)").matches,i=t?"#9ca3af":"#6b7280",r=t?"#374151":"#e5e7eb",n=Array.from({length:e},(o,s)=>({label:`P${s}`,data:[],fill:!0,backgroundColor:Pr[s%Pr.length],borderColor:Pr[s%Pr.length].replace("0.7","1"),borderWidth:1,pointRadius:0,tension:.3}));return new _t(TE,{type:"line",data:{labels:[],datasets:n},options:{responsive:!0,maintainAspectRatio:!1,animation:{duration:300},interaction:{intersect:!1,mode:"index"},plugins:{legend:{display:!0,position:"bottom",labels:{boxWidth:12,padding:8,font:{size:10},color:i}},tooltip:{enabled:!0,callbacks:{label:o=>`${o.dataset.label}: ${o.parsed.y}%`}}},scales:{x:{display:!1},y:{stacked:!0,min:0,max:e*100,ticks:{callback:o=>`${o}%`,color:i,font:{size:10}},grid:{color:r}}}}})}function U_(e,t){if(!J.chart)return;J.chart.data.labels=t;for(let l=0;l<J.coreCount;l++)J.chart.data.datasets[l].data=e.map(u=>u[l]??0);const i=e.map(l=>l.reduce((u,c)=>u+c,0)),r=Math.max(...i,0),n=1.2,o=J.coreCount*15,s=J.coreCount*100,a=Math.min(Math.max(r*n,o),s);J.chart.options.scales.y.max=a,J.chart.update("none")}function jE(e){const t=e.usedPercent;Or.style.width=`${t}%`,Or.classList.remove("warning","danger"),t>=80?Or.classList.add("danger"):t>=60&&Or.classList.add("warning"),DE.textContent=`${t}%`,EE.textContent=`${e.usedFormatted} / ${e.totalFormatted}`}function ZE(e){ME.textContent=e.hostname,NE.textContent=e.platform,AE.textContent=e.uptimeFormatted}function ao(e,t=!1,i=!1){PE.textContent=e,Ds.classList.remove("polling","error"),i?Ds.classList.add("error"):t&&Ds.classList.add("polling")}const Sn=new yP({name:"System Monitor",version:"1.0.0"});function UE(e,t){return!t||t.length!==e.length?e.map(()=>0):e.map((i,r)=>{const n=t[r],o=i.idle-n.idle,s=i.total-n.total;return s===0?0:Math.round((1-o/s)*100)})}async function ef(){try{const t=(await Sn.callServerTool({name:"refresh-stats",arguments:{}})).structuredContent;!J.chart&&t.cpu.count>0&&(J.coreCount=t.cpu.count,J.chart=Z_(J.coreCount));const i=UE(t.cpu.cores,J.previousCpuSnapshots);J.previousCpuSnapshots=t.cpu.cores,J.cpuHistory.push(i),J.labels.push(new Date().toLocaleTimeString()),J.cpuHistory.length>CE&&(J.cpuHistory.shift(),J.labels.shift()),U_(J.cpuHistory,J.labels),jE(t.memory),ZE(t.system);const r=new Date().toLocaleTimeString("en-US",{hour12:!1});ao(r,!0)}catch(e){console.error("Failed to fetch stats:",e),ao("Error",!1,!0)}}function L_(){J.isPolling||(J.isPolling=!0,wn.textContent="Stop",wn.classList.add("active"),ao("Starting...",!0),ef(),J.intervalId=window.setInterval(ef,RE))}function LE(){J.isPolling&&(J.isPolling=!1,J.intervalId&&(clearInterval(J.intervalId),J.intervalId=null),wn.textContent="Start",wn.classList.remove("active"),ao("Stopped"))}function FE(){J.isPolling?LE():L_()}wn.addEventListener("click",FE);window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{J.chart&&(J.chart.destroy(),J.chart=Z_(J.coreCount),U_(J.cpuHistory,J.labels))});Sn.onerror=console.error;function F_(e){e.safeAreaInsets&&(zr.style.paddingTop=`${e.safeAreaInsets.top}px`,zr.style.paddingRight=`${e.safeAreaInsets.right}px`,zr.style.paddingBottom=`${e.safeAreaInsets.bottom}px`,zr.style.paddingLeft=`${e.safeAreaInsets.left}px`)}Sn.onhostcontextchanged=F_;Sn.connect().then(()=>{const e=Sn.getHostContext();e&&F_(e)});setTimeout(L_,500);</script>
124
+ <style rel="stylesheet" crossorigin>*{box-sizing:border-box}html,body{font-family:system-ui,-apple-system,sans-serif;font-size:1rem}code{font-size:1em}:root{--color-bg: #ffffff;--color-text: #1f2937;--color-text-muted: #6b7280;--color-primary: #2563eb;--color-primary-hover: #1d4ed8;--color-success: #10b981;--color-warning: #f59e0b;--color-danger: #ef4444;--color-bar-bg: #e5e7eb;--color-card-bg: #f9fafb;--color-border: #e5e7eb}@media(prefers-color-scheme:dark){:root{--color-bg: #111827;--color-text: #f9fafb;--color-text-muted: #9ca3af;--color-primary: #3b82f6;--color-primary-hover: #60a5fa;--color-success: #34d399;--color-warning: #fbbf24;--color-danger: #f87171;--color-bar-bg: #374151;--color-card-bg: #1f2937;--color-border: #374151}}html,body{margin:0;padding:0;background:var(--color-bg);color:var(--color-text)}.main{width:100%;margin:0 auto;padding:16px;display:flex;flex-direction:column;gap:16px}.header{display:flex;justify-content:space-between;align-items:center;gap:12px}.title{margin:0;font-size:1.25rem;font-weight:600;flex-shrink:0}.header-controls{display:flex;align-items:center;gap:12px;flex-shrink:0}.btn{padding:6px 16px;min-width:60px;font-size:.875rem;font-weight:500;border:none;border-radius:6px;background:var(--color-primary);color:#fff;cursor:pointer;transition:background .15s ease}.btn:hover{background:var(--color-primary-hover)}.btn.active{background:var(--color-danger)}.btn.active:hover{background:#dc2626}.status{display:flex;align-items:center;gap:6px;font-size:.75rem;color:var(--color-text-muted)}.status-text{min-width:8ch;font-family:ui-monospace,monospace;text-align:right}.status-indicator{width:8px;height:8px;border-radius:50%;background:var(--color-text-muted)}.status-indicator.polling{background:var(--color-success);animation:pulse 1.5s infinite}.status-indicator.error{background:var(--color-danger)}@keyframes pulse{0%,to{opacity:1}50%{opacity:.5}}.section-title{margin:0 0 8px;font-size:.75rem;font-weight:600;text-transform:uppercase;letter-spacing:.05em;color:var(--color-text-muted)}.chart-section{background:var(--color-card-bg);border-radius:8px;padding:12px;border:1px solid var(--color-border)}.chart-container{position:relative;height:200px}.memory-section{background:var(--color-card-bg);border-radius:8px;padding:12px;border:1px solid var(--color-border)}.memory-bar-container{display:flex;align-items:center;gap:12px}.memory-bar{flex:1;height:20px;background:var(--color-bar-bg);border-radius:10px;overflow:hidden}.memory-bar-fill{height:100%;width:0%;background:var(--color-success);border-radius:10px;transition:width .3s ease,background .3s ease}.memory-bar-fill.warning{background:var(--color-warning)}.memory-bar-fill.danger{background:var(--color-danger)}.memory-percent{font-size:1.25rem;font-weight:600;min-width:50px;text-align:right}.memory-detail{margin-top:4px;font-size:.875rem;color:var(--color-text-muted)}.info-section{background:var(--color-card-bg);border-radius:8px;padding:12px;border:1px solid var(--color-border)}.info-list{margin:0;display:flex;flex-direction:column;gap:6px}.info-item{display:flex;justify-content:space-between;align-items:center}.info-item dt{font-size:.875rem;color:var(--color-text-muted)}.info-item dd{margin:0;font-size:.875rem;font-weight:500}</style>
125
+ </head>
126
+ <body>
127
+ <main class="main">
128
+ <header class="header">
129
+ <h1 class="title">System Monitor</h1>
130
+ <div class="header-controls">
131
+ <button id="poll-toggle-btn" class="btn">Start</button>
132
+ <span class="status">
133
+ <span id="status-indicator" class="status-indicator"></span>
134
+ <span id="status-text" class="status-text">Ready</span>
135
+ </span>
136
+ </div>
137
+ </header>
138
+
139
+ <section class="chart-section">
140
+ <h2 class="section-title">CPU Usage</h2>
141
+ <div class="chart-container">
142
+ <canvas id="cpu-chart"></canvas>
143
+ </div>
144
+ </section>
145
+
146
+ <section class="memory-section">
147
+ <h2 class="section-title">Memory</h2>
148
+ <div class="memory-bar-container">
149
+ <div class="memory-bar">
150
+ <div id="memory-bar-fill" class="memory-bar-fill"></div>
151
+ </div>
152
+ <span id="memory-percent" class="memory-percent">--%</span>
153
+ </div>
154
+ <div id="memory-detail" class="memory-detail">-- / --</div>
155
+ </section>
156
+
157
+ <section class="info-section">
158
+ <h2 class="section-title">System Info</h2>
159
+ <dl class="info-list">
160
+ <div class="info-item">
161
+ <dt>Hostname</dt>
162
+ <dd id="info-hostname">--</dd>
163
+ </div>
164
+ <div class="info-item">
165
+ <dt>Platform</dt>
166
+ <dd id="info-platform">--</dd>
167
+ </div>
168
+ <div class="info-item">
169
+ <dt>Uptime</dt>
170
+ <dd id="info-uptime">--</dd>
171
+ </div>
172
+ </dl>
173
+ </section>
174
+ </main>
175
+
176
+ </body>
177
+ </html>