@halliday-sdk/payments 2.7.4 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- const e="https://app.halliday.xyz",t="https://v2.prod.halliday.xyz",n=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/;function o(e,t,n){function o(n,o){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:o,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,o);const r=s.prototype,i=Object.keys(r);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=r[t].bind(n))}}const r=n?.Parent??Object;class i extends r{}function s(e){var t;const r=n?.Parent?new i:this;o(r,e),(t=r._zod).deferred??(t.deferred=[]);for(const e of r._zod.deferred)e();return r}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class r extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class i extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const s={};function a(e){return s}function c(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}function d(e,t){return"bigint"==typeof t?t.toString():t}function u(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function l(e){return null==e}function p(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const f=Symbol("evaluating");function m(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==f)return void 0===o&&(o=f,o=n()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function h(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function y(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function g(e){return JSON.stringify(e)}const _="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function v(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const w=u((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function b(e){if(!1===v(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==v(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function E(e){return b(e)?{...e}:Array.isArray(e)?[...e]:e}const z=new Set(["string","number","symbol"]);function k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function O(e,t,n){const o=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(o._zod.parent=e),o}function T(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const A={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 I(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function x(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function S(e){return"string"==typeof e?e:e?.message}function N(e,t,n){const o={...e,path:e.path??[]};if(!e.message){const r=S(e.inst?._zod.def?.error?.(e))??S(t?.error?.(e))??S(n.customError?.(e))??S(n.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function $(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function P(...e){const[t,n,o]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:o}:{...t}}const D=(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,d,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Z=o("$ZodError",D),R=o("$ZodError",D,{Parent:Error});const C=e=>(t,n,o,i)=>{const s=o?Object.assign(o,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new r;if(c.issues.length){const t=new(i?.Err??e)(c.issues.map((e=>N(e,s,a()))));throw _(t,i?.callee),t}return c.value},L=e=>async(t,n,o,r)=>{const i=o?Object.assign(o,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(r?.Err??e)(s.issues.map((e=>N(e,i,a()))));throw _(t,r?.callee),t}return s.value},M=e=>(t,n,o)=>{const i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new r;return s.issues.length?{success:!1,error:new(e??Z)(s.issues.map((e=>N(e,i,a()))))}:{success:!0,data:s.value}},j=M(R),U=e=>async(t,n,o)=>{const r=o?Object.assign(o,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map((e=>N(e,r,a()))))}:{success:!0,data:i.value}},F=U(R),B=e=>(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return C(e)(t,n,r)},V=e=>(t,n,o)=>C(e)(t,n,o),W=e=>async(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return L(e)(t,n,r)},J=e=>async(t,n,o)=>L(e)(t,n,o),G=e=>(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return M(e)(t,n,r)},H=e=>(t,n,o)=>M(e)(t,n,o),Y=e=>async(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return U(e)(t,n,r)},K=e=>async(t,n,o)=>U(e)(t,n,o),q=/^[cC][^\s-]{8,}$/,X=/^[0-9a-z]+$/,Q=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ee=/^[0-9a-vA-V]{20}$/,te=/^[A-Za-z0-9]{27}$/,ne=/^[a-zA-Z0-9_-]{21}$/,oe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,re=/^([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})$/,ie=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)$/,se=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const ae=/^(?:(?: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])$/,ce=/^(([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}|:))$/,de=/^((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])$/,ue=/^(([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])$/,le=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,pe=/^[A-Za-z0-9_-]*$/,fe=/^\+[1-9]\d{6,14}$/,me="(?:(?:\\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])))",he=new RegExp(`^${me}$`);function ye(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const ge=/^-?\d+n?$/,_e=/^-?\d+$/,ve=/^-?\d+(?:\.\d+)?$/,we=/^(?:true|false)$/i,be=/^undefined$/i,Ee=/^[^A-Z]*$/,ze=/^[^a-z]*$/,ke=o("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Oe={number:"number",bigint:"bigint",object:"date"},Te=o("$ZodCheckLessThan",((e,t)=>{ke.init(e,t);const n=Oe[typeof t.value];e._zod.onattach.push((e=>{const n=e._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=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ae=o("$ZodCheckGreaterThan",((e,t)=>{ke.init(e,t);const n=Oe[typeof t.value];e._zod.onattach.push((e=>{const n=e._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=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ie=o("$ZodCheckMultipleOf",((e,t)=>{ke.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,o=t.toString();let r=(o.split(".")[1]||"").length;if(0===r&&/\d?e-\d?/.test(o)){const e=o.match(/\d?e-(\d?)/);e?.[1]&&(r=Number.parseInt(e[1]))}const i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),xe=o("$ZodCheckNumberFormat",((e,t)=>{ke.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),o=n?"int":"number",[r,i]=A[t.format];e._zod.onattach.push((e=>{const o=e._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i,n&&(o.pattern=_e)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}))}a<r&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}})),Se=o("$ZodCheckMaxLength",((e,t)=>{var n;ke.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!l(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const r=$(o);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}})),Ne=o("$ZodCheckMinLength",((e,t)=>{var n;ke.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!l(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const r=$(o);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}})),$e=o("$ZodCheckLengthEquals",((e,t)=>{var n;ke.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!l(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const o=n.value,r=o.length;if(r===t.length)return;const i=$(o),s=r>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Pe=o("$ZodCheckStringFormat",((e,t)=>{var n,o;ke.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.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})}):(o=e._zod).check??(o.check=()=>{})})),De=o("$ZodCheckRegex",((e,t)=>{Pe.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),Ze=o("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=Ee),Pe.init(e,t)})),Re=o("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ze),Pe.init(e,t)})),Ce=o("$ZodCheckIncludes",((e,t)=>{ke.init(e,t);const n=k(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(o)})),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})}})),Le=o("$ZodCheckStartsWith",((e,t)=>{ke.init(e,t);const n=new RegExp(`^${k(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),Me=o("$ZodCheckEndsWith",((e,t)=>{ke.init(e,t);const n=new RegExp(`.*${k(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),je=o("$ZodCheckOverwrite",((e,t)=>{ke.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Ue{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),o=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of o)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Fe={major:4,minor:3,patch:6},Be=o("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fe;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const t of o)for(const n of t._zod.onattach)n(e);if(0===o.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let o,i=I(e);for(const s of t){if(s._zod.def.when){if(!s._zod.def.when(e))continue}else if(i)continue;const t=e.issues.length,a=s._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new r;if(o||a instanceof Promise)o=(o??Promise.resolve()).then((async()=>{await a;e.issues.length!==t&&(i||(i=I(e,t)))}));else{if(e.issues.length===t)continue;i||(i=I(e,t))}}return o?o.then((()=>e)):e},n=(n,i,s)=>{if(I(n))return n.aborted=!0,n;const a=t(i,o,s);if(a instanceof Promise){if(!1===s.async)throw new r;return a.then((t=>e._zod.parse(t,s)))}return e._zod.parse(a,s)};e._zod.run=(i,s)=>{if(s.skipChecks)return e._zod.parse(i,s);if("backward"===s.direction){const t=e._zod.parse({value:i.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,i,s))):n(t,i,s)}const a=e._zod.parse(i,s);if(a instanceof Promise){if(!1===s.async)throw new r;return a.then((e=>t(e,o,s)))}return t(a,o,s)}}m(e,"~standard",(()=>({validate:t=>{try{const n=j(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return F(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1})))})),Ve=o("$ZodString",((e,t)=>{var n;Be.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),We=o("$ZodStringFormat",((e,t)=>{Pe.init(e,t),Ve.init(e,t)})),Je=o("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=re),We.init(e,t)})),Ge=o("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ie(e))}else t.pattern??(t.pattern=ie());We.init(e,t)})),He=o("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=se),We.init(e,t)})),Ye=o("$ZodURL",((e,t)=>{We.init(e,t),e._zod.check=n=>{try{const o=n.value.trim(),r=new URL(o);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=r.href:n.value=o)}catch(o){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),Ke=o("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),We.init(e,t)})),qe=o("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=ne),We.init(e,t)})),Xe=o("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=q),We.init(e,t)})),Qe=o("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=X),We.init(e,t)})),et=o("$ZodULID",((e,t)=>{t.pattern??(t.pattern=Q),We.init(e,t)})),tt=o("$ZodXID",((e,t)=>{t.pattern??(t.pattern=ee),We.init(e,t)})),nt=o("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=te),We.init(e,t)})),ot=o("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ye({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${n.join("|")})`;return new RegExp(`^${me}T(?:${o})$`)}(t)),We.init(e,t)})),rt=o("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=he),We.init(e,t)})),it=o("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ye(t)}$`)),We.init(e,t)})),st=o("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=oe),We.init(e,t)})),at=o("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=ae),We.init(e,t),e._zod.bag.format="ipv4"})),ct=o("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=ce),We.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),dt=o("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=de),We.init(e,t)})),ut=o("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=ue),We.init(e,t),e._zod.check=n=>{const o=n.value.split("/");try{if(2!==o.length)throw new Error;const[e,t]=o;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function lt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const pt=o("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=le),We.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{lt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}));const ft=o("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=pe),We.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!pe.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return lt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),mt=o("$ZodE164",((e,t)=>{t.pattern??(t.pattern=fe),We.init(e,t)}));const ht=o("$ZodJWT",((e,t)=>{We.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[o]=n;if(!o)return!1;const r=JSON.parse(atob(o));return!("typ"in r&&"JWT"!==r?.typ||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),yt=o("$ZodNumber",((e,t)=>{Be.init(e,t),e._zod.pattern=e._zod.bag.pattern??ve,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const r=n.value;if("number"==typeof r&&!Number.isNaN(r)&&Number.isFinite(r))return n;const i="number"==typeof r?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}})),gt=o("$ZodNumberFormat",((e,t)=>{xe.init(e,t),yt.init(e,t)})),_t=o("$ZodBoolean",((e,t)=>{Be.init(e,t),e._zod.pattern=we,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const r=n.value;return"boolean"==typeof r||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}})),vt=o("$ZodBigInt",((e,t)=>{Be.init(e,t),e._zod.pattern=ge,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}})),wt=o("$ZodUndefined",((e,t)=>{Be.init(e,t),e._zod.pattern=be,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const o=t.value;return void 0===o||t.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),t}})),bt=o("$ZodAny",((e,t)=>{Be.init(e,t),e._zod.parse=e=>e})),Et=o("$ZodUnknown",((e,t)=>{Be.init(e,t),e._zod.parse=e=>e})),zt=o("$ZodNever",((e,t)=>{Be.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}));function kt(e,t,n){e.issues.length&&t.issues.push(...x(n,e.issues)),t.value[n]=e.value}const Ot=o("$ZodArray",((e,t)=>{Be.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);const i=[];for(let e=0;e<r.length;e++){const s=r[e],a=t.element._zod.run({value:s,issues:[]},o);a instanceof Promise?i.push(a.then((t=>kt(t,n,e)))):kt(a,n,e)}return i.length?Promise.all(i).then((()=>n)):n}}));function Tt(e,t,n,o,r){if(e.issues.length){if(r&&!(n in o))return;t.issues.push(...x(n,e.issues))}void 0===e.value?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function At(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(o=e.shape,Object.keys(o).filter((e=>"optional"===o[e]._zod.optin&&"optional"===o[e]._zod.optout)));var o;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function It(e,t,n,o,r,i){const s=[],a=r.keySet,c=r.catchall._zod,d=c.def.type,u="optional"===c.optout;for(const r in t){if(a.has(r))continue;if("never"===d){s.push(r);continue}const i=c.run({value:t[r],issues:[]},o);i instanceof Promise?e.push(i.then((e=>Tt(e,n,r,t,u)))):Tt(i,n,r,t,u)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then((()=>n)):n}const xt=o("$ZodObject",((e,t)=>{Be.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const o=u((()=>At(t)));m(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const o=e[t]._zod;if(o.values){n[t]??(n[t]=new Set);for(const e of o.values)n[t].add(e)}}return n}));const r=v,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=o.value);const a=t.value;if(!r(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],d=s.shape;for(const e of s.keys){const o=d[e],r="optional"===o._zod.optout,i=o._zod.run({value:a[e],issues:[]},n);i instanceof Promise?c.push(i.then((n=>Tt(n,t,e,a,r)))):Tt(i,t,e,a,r)}return i?It(c,a,t,n,o.value,e):c.length?Promise.all(c).then((()=>t)):t}})),St=o("$ZodObjectJIT",((e,t)=>{xt.init(e,t);const n=e._zod.parse,o=u((()=>At(t)));let r;const i=v,a=!s.jitless,c=a&&w.value,d=t.catchall;let l;e._zod.parse=(s,u)=>{l??(l=o.value);const p=s.value;return i(p)?a&&c&&!1===u?.async&&!0!==u.jitless?(r||(r=(e=>{const t=new Ue(["shape","payload","ctx"]),n=o.value,r=e=>{const t=g(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let s=0;for(const e of n.keys)i[e]="key_"+s++;t.write("const newResult = {};");for(const o of n.keys){const n=i[o],s=g(o),a=e[o],c="optional"===a?._zod?.optout;t.write(`const ${n} = ${r(o)};`),c?t.write(`\n if (${n}.issues.length) {\n if (${s} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${n}.value;\n }\n \n `):t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),s=r(s,u),d?It([],p,s,u,l,e):s):n(s,u):(s.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),s)}}));function Nt(e,t,n,o){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const r=e.filter((e=>!I(e)));return 1===r.length?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>N(e,o,a())))))}),t)}const $t=o("$ZodUnion",((e,t)=>{Be.init(e,t),m(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),m(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),m(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),m(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>p(e.source))).join("|")})$`)}}));const n=1===t.options.length,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>Nt(t,r,e,i))):Nt(a,r,e,i)}})),Pt=o("$ZodDiscriminatedUnion",((e,t)=>{t.inclusive=!1,$t.init(e,t);const n=e._zod.parse;m(e._zod,"propValues",(()=>{const e={};for(const n of t.options){const o=n._zod.propValues;if(!o||0===Object.keys(o).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(o)){e[t]||(e[t]=new Set);for(const o of n)e[t].add(o)}}return e}));const o=u((()=>{const e=t.options,n=new Map;for(const o of e){const e=o._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,o)}}return n}));e._zod.parse=(r,i)=>{const s=r.value;if(!v(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;const a=o.value.get(s?.[t.discriminator]);return a?a._zod.run(r,i):t.unionFallback?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),r)}})),Dt=o("$ZodIntersection",((e,t)=>{Be.init(e,t),e._zod.parse=(e,n)=>{const o=e.value,r=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return r instanceof Promise||i instanceof Promise?Promise.all([r,i]).then((([t,n])=>Rt(e,t,n))):Rt(e,r,i)}}));function Zt(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(b(e)&&b(t)){const n=Object.keys(t),o=Object.keys(e).filter((e=>-1!==n.indexOf(e))),r={...e,...t};for(const n of o){const o=Zt(e[n],t[n]);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};r[n]=o.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;o<e.length;o++){const r=Zt(e[o],t[o]);if(!r.valid)return{valid:!1,mergeErrorPath:[o,...r.mergeErrorPath]};n.push(r.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Rt(e,t,n){const o=new Map;let r;for(const n of t.issues)if("unrecognized_keys"===n.code){r??(r=n);for(const e of n.keys)o.has(e)||o.set(e,{}),o.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)o.has(e)||o.set(e,{}),o.get(e).r=!0;else e.issues.push(t);const i=[...o].filter((([,e])=>e.l&&e.r)).map((([e])=>e));if(i.length&&r&&e.issues.push({...r,keys:i}),I(e))return e;const s=Zt(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Ct=o("$ZodRecord",((e,t)=>{Be.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!b(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const e of s)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){a.add("number"==typeof e?e.toString():e);const s=t.valueType._zod.run({value:r[e],issues:[]},o);s instanceof Promise?i.push(s.then((t=>{t.issues.length&&n.issues.push(...x(e,t.issues)),n.value[e]=t.value}))):(s.issues.length&&n.issues.push(...x(e,s.issues)),n.value[e]=s.value)}let c;for(const e in r)a.has(e)||(c=c??[],c.push(e));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:c})}else{n.value={};for(const s of Reflect.ownKeys(r)){if("__proto__"===s)continue;let c=t.keyType._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof s&&ve.test(s)&&c.issues.length){const e=t.keyType._zod.run({value:Number(s),issues:[]},o);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(c=e)}if(c.issues.length){"loose"===t.mode?n.value[s]=r[s]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map((e=>N(e,o,a()))),input:s,path:[s],inst:e});continue}const d=t.valueType._zod.run({value:r[s],issues:[]},o);d instanceof Promise?i.push(d.then((e=>{e.issues.length&&n.issues.push(...x(s,e.issues)),n.value[c.value]=e.value}))):(d.issues.length&&n.issues.push(...x(s,d.issues)),n.value[c.value]=d.value)}}return i.length?Promise.all(i).then((()=>n)):n}})),Lt=o("$ZodEnum",((e,t)=>{Be.init(e,t);const n=c(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter((e=>z.has(typeof e))).map((e=>"string"==typeof e?k(e):e.toString())).join("|")})$`),e._zod.parse=(t,r)=>{const i=t.value;return o.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}})),Mt=o("$ZodLiteral",((e,t)=>{if(Be.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map((e=>"string"==typeof e?k(e):e?k(e.toString()):String(e))).join("|")})$`),e._zod.parse=(o,r)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}})),jt=o("$ZodTransform",((e,t)=>{Be.init(e,t),e._zod.parse=(n,o)=>{if("backward"===o.direction)throw new i(e.constructor.name);const s=t.transform(n.value,n);if(o.async){return(s instanceof Promise?s:Promise.resolve(s)).then((e=>(n.value=e,n)))}if(s instanceof Promise)throw new r;return n.value=s,n}}));function Ut(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Ft=o("$ZodOptional",((e,t)=>{Be.init(e,t),e._zod.optin="optional",e._zod.optout="optional",m(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),m(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${p(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then((t=>Ut(t,e.value))):Ut(o,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),Bt=o("$ZodExactOptional",((e,t)=>{Ft.init(e,t),m(e._zod,"values",(()=>t.innerType._zod.values)),m(e._zod,"pattern",(()=>t.innerType._zod.pattern)),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)})),Vt=o("$ZodNullable",((e,t)=>{Be.init(e,t),m(e._zod,"optin",(()=>t.innerType._zod.optin)),m(e._zod,"optout",(()=>t.innerType._zod.optout)),m(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${p(e.source)}|null)$`):void 0})),m(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),Wt=o("$ZodDefault",((e,t)=>{Be.init(e,t),e._zod.optin="optional",m(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then((e=>Jt(e,t))):Jt(o,t)}}));function Jt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Gt=o("$ZodPrefault",((e,t)=>{Be.init(e,t),e._zod.optin="optional",m(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),Ht=o("$ZodNonOptional",((e,t)=>{Be.init(e,t),m(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,o)=>{const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then((t=>Yt(t,e))):Yt(r,e)}}));function Yt(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Kt=o("$ZodCatch",((e,t)=>{Be.init(e,t),m(e._zod,"optin",(()=>t.innerType._zod.optin)),m(e._zod,"optout",(()=>t.innerType._zod.optout)),m(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then((o=>(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map((e=>N(e,n,a())))},input:e.value}),e.issues=[]),e))):(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map((e=>N(e,n,a())))},input:e.value}),e.issues=[]),e)}})),qt=o("$ZodPipe",((e,t)=>{Be.init(e,t),m(e._zod,"values",(()=>t.in._zod.values)),m(e._zod,"optin",(()=>t.in._zod.optin)),m(e._zod,"optout",(()=>t.out._zod.optout)),m(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const o=t.out._zod.run(e,n);return o instanceof Promise?o.then((e=>Xt(e,t.in,n))):Xt(o,t.in,n)}const o=t.in._zod.run(e,n);return o instanceof Promise?o.then((e=>Xt(e,t.out,n))):Xt(o,t.out,n)}}));function Xt(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Qt=o("$ZodReadonly",((e,t)=>{Be.init(e,t),m(e._zod,"propValues",(()=>t.innerType._zod.propValues)),m(e._zod,"values",(()=>t.innerType._zod.values)),m(e._zod,"optin",(()=>t.innerType?._zod?.optin)),m(e._zod,"optout",(()=>t.innerType?._zod?.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then(en):en(o)}}));function en(e){return e.value=Object.freeze(e.value),e}const tn=o("$ZodCustom",((e,t)=>{ke.init(e,t),Be.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then((t=>nn(t,n,o,e)));nn(r,n,o,e)}}));function nn(e,t,n,o){if(!e){const e={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(e.params=o._zod.def.params),t.issues.push(P(e))}}var on;class rn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(on=globalThis).__zod_globalRegistry??(on.__zod_globalRegistry=new rn);const sn=globalThis.__zod_globalRegistry;function an(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...T(t)})}function cn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...T(t)})}function dn(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(t)})}function un(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(t)})}function ln(e,t){return new Te({check:"less_than",...T(t),value:e,inclusive:!1})}function pn(e,t){return new Te({check:"less_than",...T(t),value:e,inclusive:!0})}function fn(e,t){return new Ae({check:"greater_than",...T(t),value:e,inclusive:!1})}function mn(e,t){return new Ae({check:"greater_than",...T(t),value:e,inclusive:!0})}function hn(e,t){return new Ie({check:"multiple_of",...T(t),value:e})}function yn(e,t){return new Se({check:"max_length",...T(t),maximum:e})}function gn(e,t){return new Ne({check:"min_length",...T(t),minimum:e})}function _n(e,t){return new $e({check:"length_equals",...T(t),length:e})}function vn(e){return new je({check:"overwrite",tx:e})}function wn(e){const t=function(e,t){const n=new ke({check:"custom",...T(t)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(P(e,n.value,t._zod.def));else{const o=e;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(P(o))}},e(n.value,n))));return t}function bn(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??sn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function En(e,t,n={path:[],schemaPath:[]}){var o;const r=e._zod.def,i=t.seen.get(e);if(i){i.count++;return n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema}const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const o={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,o);else{const n=s.schema,i=t.processors[r.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);i(e,t,n,o)}const i=e._zod.parent;i&&(s.ref||(s.ref=i),En(i,t,o),t.seen.get(i).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(s.schema,c),"input"===t.io&&On(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault;return t.seen.get(e).schema}function zn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=o.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(n,t[0])}}const r=t=>{if(t[1].schema.$ref)return;const o=t[1],{ref:r,defId:i}=(t=>{const o="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,r=e.external.uri??(e=>e);if(n)return{ref:r(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${r("__shared")}#/${o}/${i}`}}if(t[1]===n)return{ref:"#"};const r=`#/${o}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:r+i}})(t);o.def={...o.schema},i&&(o.defId=i);const s=o.schema;for(const e in s)delete s[e];s.$ref=r};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const o=n[1];if(t===n[0]){r(n);continue}if(e.external){const o=e.external.registry.get(n[0])?.id;if(t!==n[0]&&o){r(n);continue}}const i=e.metadataRegistry.get(n[0])?.id;i?r(n):(o.cycle||o.count>1&&"ref"===e.reused)&&r(n)}}function kn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=t=>{const n=e.seen.get(t);if(null===n.ref)return;const r=n.def??n.schema,i={...r},s=n.ref;if(n.ref=null,s){o(s);const n=e.seen.get(s),a=n.schema;!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(r,a):(r.allOf=r.allOf??[],r.allOf.push(a)),Object.assign(r,i);if(t._zod.parent===s)for(const e in r)"$ref"!==e&&"allOf"!==e&&(e in i||delete r[e]);if(a.$ref&&n.def)for(const e in r)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(r[e])===JSON.stringify(n.def[e])&&delete r[e]}const a=t._zod.parent;if(a&&a!==s){o(a);const t=e.seen.get(a);if(t?.schema.$ref&&(r.$ref=t.schema.$ref,t.def))for(const e in r)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(r[e])===JSON.stringify(t.def[e])&&delete r[e]}e.override({zodSchema:t,jsonSchema:r,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())o(t[0]);const r={};if("draft-2020-12"===e.target?r.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?r.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(n)}Object.assign(r,n.def??n.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?r.$defs=i:r.definitions=i);try{const n=JSON.parse(JSON.stringify(r));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Tn(t,"input",e.processors),output:Tn(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function On(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const o=e._zod.def;if("transform"===o.type)return!0;if("array"===o.type)return On(o.element,n);if("set"===o.type)return On(o.valueType,n);if("lazy"===o.type)return On(o.getter(),n);if("promise"===o.type||"optional"===o.type||"nonoptional"===o.type||"nullable"===o.type||"readonly"===o.type||"default"===o.type||"prefault"===o.type)return On(o.innerType,n);if("intersection"===o.type)return On(o.left,n)||On(o.right,n);if("record"===o.type||"map"===o.type)return On(o.keyType,n)||On(o.valueType,n);if("pipe"===o.type)return On(o.in,n)||On(o.out,n);if("object"===o.type){for(const e in o.shape)if(On(o.shape[e],n))return!0;return!1}if("union"===o.type){for(const e of o.options)if(On(e,n))return!0;return!1}if("tuple"===o.type){for(const e of o.items)if(On(e,n))return!0;return!(!o.rest||!On(o.rest,n))}return!1}const Tn=(e,t,n={})=>o=>{const{libraryOptions:r,target:i}=o??{},s=bn({...r??{},target:i,io:t,processors:n});return En(e,s),zn(s,e),kn(s,e)},An={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},In=(e,t,n,o)=>{const r=e._zod.def;En(r.innerType,t,o);t.seen.get(e).ref=r.innerType},xn=o("ZodISODateTime",((e,t)=>{ot.init(e,t),no.init(e,t)}));function Sn(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(t)})}(xn,e)}const Nn=o("ZodISODate",((e,t)=>{rt.init(e,t),no.init(e,t)}));function $n(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}(Nn,e)}const Pn=o("ZodISOTime",((e,t)=>{it.init(e,t),no.init(e,t)}));function Dn(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}(Pn,e)}const Zn=o("ZodISODuration",((e,t)=>{st.init(e,t),no.init(e,t)}));function Rn(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}(Zn,e)}const Cn=(e,t)=>{Z.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},o=e=>{for(const r of e.issues)if("invalid_union"===r.code&&r.errors.length)r.errors.map((e=>o({issues:e})));else if("invalid_key"===r.code)o({issues:r.issues});else if("invalid_element"===r.code)o({issues:r.issues});else if(0===r.path.length)n._errors.push(t(r));else{let e=n,o=0;for(;o<r.path.length;){const n=r.path[o];o===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],o++}}};return o(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},o=[];for(const r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,d,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,d,2)}},isEmpty:{get:()=>0===e.issues.length}})},Ln=o("ZodError",Cn),Mn=o("ZodError",Cn,{Parent:Error}),jn=C(Mn),Un=L(Mn),Fn=M(Mn),Bn=U(Mn),Vn=B(Mn),Wn=V(Mn),Jn=W(Mn),Gn=J(Mn),Hn=G(Mn),Yn=H(Mn),Kn=Y(Mn),qn=K(Mn),Xn=o("ZodType",((e,t)=>(Be.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Tn(e,"input"),output:Tn(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const o=bn({...n,processors:t});return En(e,o),zn(o,e),kn(o,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(y(t,{checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>O(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>jn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Fn(e,t,n),e.parseAsync=async(t,n)=>Un(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Bn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Vn(e,t,n),e.decode=(t,n)=>Wn(e,t,n),e.encodeAsync=async(t,n)=>Jn(e,t,n),e.decodeAsync=async(t,n)=>Gn(e,t,n),e.safeEncode=(t,n)=>Hn(e,t,n),e.safeDecode=(t,n)=>Yn(e,t,n),e.safeEncodeAsync=async(t,n)=>Kn(e,t,n),e.safeDecodeAsync=async(t,n)=>qn(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...T(n)})}(mr,e,t)}(t,n)),e.superRefine=t=>e.check(wn(t)),e.overwrite=t=>e.check(vn(t)),e.optional=()=>or(e),e.exactOptional=()=>new rr({type:"optional",innerType:e}),e.nullable=()=>sr(e),e.nullish=()=>or(sr(e)),e.nonoptional=t=>function(e,t){return new dr({type:"nonoptional",innerType:e,...T(t)})}(e,t),e.array=()=>jo(e),e.or=t=>Vo([e,t]),e.and=t=>new Go({type:"intersection",left:e,right:t}),e.transform=t=>pr(e,tr(t)),e.default=t=>{return n=t,new ar({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():E(n)}});var n},e.prefault=t=>{return n=t,new cr({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():E(n)}});var n},e.catch=t=>{return new ur({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>pr(e,t),e.readonly=()=>new fr({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return sn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>sn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return sn.get(e);const n=e.clone();return sn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e))),Qn=o("_ZodString",((e,t)=>{Ve.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n)=>{const o=n;o.type="string";const{minimum:r,maximum:i,format:s,patterns:a,contentEncoding:c}=e._zod.bag;if("number"==typeof r&&(o.minLength=r),"number"==typeof i&&(o.maxLength=i),s&&(o.format=An[s]??s,""===o.format&&delete o.format,"time"===s&&delete o.format),c&&(o.contentEncoding=c),a&&a.size>0){const e=[...a];1===e.length?o.pattern=e[0].source:e.length>1&&(o.allOf=[...e.map((e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source})))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new De({check:"string_format",format:"regex",...T(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ce({check:"string_format",format:"includes",...T(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Le({check:"string_format",format:"starts_with",...T(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Me({check:"string_format",format:"ends_with",...T(t),suffix:e})}(...t)),e.min=(...t)=>e.check(gn(...t)),e.max=(...t)=>e.check(yn(...t)),e.length=(...t)=>e.check(_n(...t)),e.nonempty=(...t)=>e.check(gn(1,...t)),e.lowercase=t=>e.check(function(e){return new Ze({check:"string_format",format:"lowercase",...T(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Re({check:"string_format",format:"uppercase",...T(e)})}(t)),e.trim=()=>e.check(vn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return vn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(vn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(vn((e=>e.toUpperCase()))),e.slugify=()=>e.check(vn((e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))))})),eo=o("ZodString",((e,t)=>{Ve.init(e,t),Qn.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...T(t)})}(oo,t)),e.url=t=>e.check(cn(so,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...T(t)})}(zo,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...T(t)})}(co,t)),e.guid=t=>e.check(an(ro,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...T(t)})}(io,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(t)})}(io,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(t)})}(io,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(t)})}(io,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(t)})}(uo,t)),e.guid=t=>e.check(an(ro,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...T(t)})}(lo,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(t)})}(po,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...T(t)})}(fo,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...T(t)})}(wo,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...T(t)})}(bo,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...T(t)})}(mo,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(t)})}(ho,t)),e.ipv4=t=>e.check(dn(yo,t)),e.ipv6=t=>e.check(un(go,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(t)})}(_o,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(t)})}(vo,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...T(t)})}(Eo,t)),e.datetime=t=>e.check(Sn(t)),e.date=t=>e.check($n(t)),e.time=t=>e.check(Dn(t)),e.duration=t=>e.check(Rn(t))}));function to(e){return function(e,t){return new e({type:"string",...T(t)})}(eo,e)}const no=o("ZodStringFormat",((e,t)=>{We.init(e,t),Qn.init(e,t)})),oo=o("ZodEmail",((e,t)=>{He.init(e,t),no.init(e,t)})),ro=o("ZodGUID",((e,t)=>{Je.init(e,t),no.init(e,t)})),io=o("ZodUUID",((e,t)=>{Ge.init(e,t),no.init(e,t)})),so=o("ZodURL",((e,t)=>{Ye.init(e,t),no.init(e,t)}));function ao(e){return cn(so,e)}const co=o("ZodEmoji",((e,t)=>{Ke.init(e,t),no.init(e,t)})),uo=o("ZodNanoID",((e,t)=>{qe.init(e,t),no.init(e,t)})),lo=o("ZodCUID",((e,t)=>{Xe.init(e,t),no.init(e,t)})),po=o("ZodCUID2",((e,t)=>{Qe.init(e,t),no.init(e,t)})),fo=o("ZodULID",((e,t)=>{et.init(e,t),no.init(e,t)})),mo=o("ZodXID",((e,t)=>{tt.init(e,t),no.init(e,t)})),ho=o("ZodKSUID",((e,t)=>{nt.init(e,t),no.init(e,t)})),yo=o("ZodIPv4",((e,t)=>{at.init(e,t),no.init(e,t)}));const go=o("ZodIPv6",((e,t)=>{ct.init(e,t),no.init(e,t)}));const _o=o("ZodCIDRv4",((e,t)=>{dt.init(e,t),no.init(e,t)})),vo=o("ZodCIDRv6",((e,t)=>{ut.init(e,t),no.init(e,t)})),wo=o("ZodBase64",((e,t)=>{pt.init(e,t),no.init(e,t)})),bo=o("ZodBase64URL",((e,t)=>{ft.init(e,t),no.init(e,t)})),Eo=o("ZodE164",((e,t)=>{mt.init(e,t),no.init(e,t)})),zo=o("ZodJWT",((e,t)=>{ht.init(e,t),no.init(e,t)})),ko=o("ZodNumber",((e,t)=>{yt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n)=>{const o=n,{minimum:r,maximum:i,format:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:d}=e._zod.bag;"string"==typeof s&&s.includes("int")?o.type="integer":o.type="number","number"==typeof d&&("draft-04"===t.target||"openapi-3.0"===t.target?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d),"number"==typeof r&&(o.minimum=r,"number"==typeof d&&"draft-04"!==t.target&&(d>=r?delete o.minimum:delete o.exclusiveMinimum)),"number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),"number"==typeof i&&(o.maximum=i,"number"==typeof c&&"draft-04"!==t.target&&(c<=i?delete o.maximum:delete o.exclusiveMaximum)),"number"==typeof a&&(o.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(fn(t,n)),e.gte=(t,n)=>e.check(mn(t,n)),e.min=(t,n)=>e.check(mn(t,n)),e.lt=(t,n)=>e.check(ln(t,n)),e.lte=(t,n)=>e.check(pn(t,n)),e.max=(t,n)=>e.check(pn(t,n)),e.int=t=>e.check(Ao(t)),e.safe=t=>e.check(Ao(t)),e.positive=t=>e.check(fn(0,t)),e.nonnegative=t=>e.check(mn(0,t)),e.negative=t=>e.check(ln(0,t)),e.nonpositive=t=>e.check(pn(0,t)),e.multipleOf=(t,n)=>e.check(hn(t,n)),e.step=(t,n)=>e.check(hn(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Oo(e){return function(e,t){return new e({type:"number",checks:[],...T(t)})}(ko,e)}const To=o("ZodNumberFormat",((e,t)=>{gt.init(e,t),ko.init(e,t)}));function Ao(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...T(t)})}(To,e)}const Io=o("ZodBoolean",((e,t)=>{_t.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)}));function xo(e){return function(e,t){return new e({type:"boolean",...T(t)})}(Io,e)}const So=o("ZodBigInt",((e,t)=>{vt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema")})(0,e),e.gte=(t,n)=>e.check(mn(t,n)),e.min=(t,n)=>e.check(mn(t,n)),e.gt=(t,n)=>e.check(fn(t,n)),e.gte=(t,n)=>e.check(mn(t,n)),e.min=(t,n)=>e.check(mn(t,n)),e.lt=(t,n)=>e.check(ln(t,n)),e.lte=(t,n)=>e.check(pn(t,n)),e.max=(t,n)=>e.check(pn(t,n)),e.positive=t=>e.check(fn(BigInt(0),t)),e.negative=t=>e.check(ln(BigInt(0),t)),e.nonpositive=t=>e.check(pn(BigInt(0),t)),e.nonnegative=t=>e.check(mn(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(hn(t,n));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}));function No(e){return function(e,t){return new e({type:"bigint",...T(t)})}(So,e)}const $o=o("ZodUndefined",((e,t)=>{wt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema")})(0,e)}));const Po=o("ZodAny",((e,t)=>{bt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}));function Do(){return new Po({type:"any"})}const Zo=o("ZodUnknown",((e,t)=>{Et.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}));function Ro(){return new Zo({type:"unknown"})}const Co=o("ZodNever",((e,t)=>{zt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)}));function Lo(e){return function(e,t){return new e({type:"never",...T(t)})}(Co,e)}const Mo=o("ZodArray",((e,t)=>{Ot.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(r.minItems=s),"number"==typeof a&&(r.maxItems=a),r.type="array",r.items=En(i.element,t,{...o,path:[...o.path,"items"]})})(e,t,n,o),e.element=t.element,e.min=(t,n)=>e.check(gn(t,n)),e.nonempty=t=>e.check(gn(1,t)),e.max=(t,n)=>e.check(yn(t,n)),e.length=(t,n)=>e.check(_n(t,n)),e.unwrap=()=>e.element}));function jo(e,t){return function(e,t,n){return new e({type:"array",element:t,...T(n)})}(Mo,e,t)}const Uo=o("ZodObject",((e,t)=>{St.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=n,i=e._zod.def;r.type="object",r.properties={};const s=i.shape;for(const e in s)r.properties[e]=En(s[e],t,{...o,path:[...o.path,"properties",e]});const a=new Set(Object.keys(s)),c=new Set([...a].filter((e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout})));c.size>0&&(r.required=Array.from(c)),"never"===i.catchall?._zod.def.type?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=En(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,n,o),m(e,"shape",(()=>t.shape)),e.keyof=()=>qo(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ro()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ro()}),e.strict=()=>e.clone({...e._zod.def,catchall:Lo()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!b(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=y(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return h(this,"shape",n),n}});return O(e,o)}(e,t),e.safeExtend=t=>function(e,t){if(!b(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=y(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return h(this,"shape",n),n}});return O(e,n)}(e,t),e.merge=t=>function(e,t){const n=y(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return h(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return O(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return O(e,y(e._zod.def,{get shape(){const e={};for(const o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(e[o]=n.shape[o])}return h(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=y(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete o[e]}return h(this,"shape",o),o},checks:[]});return O(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=y(t._zod.def,{get shape(){const o=t._zod.def.shape,r={...o};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=e?new e({type:"optional",innerType:o[t]}):o[t])}else for(const t in o)r[t]=e?new e({type:"optional",innerType:o[t]}):o[t];return h(this,"shape",r),r},checks:[]});return O(t,r)}(nr,e,t[0]),e.required=(...t)=>function(e,t,n){const o=y(t._zod.def,{get shape(){const o=t._zod.def.shape,r={...o};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=new e({type:"nonoptional",innerType:o[t]}))}else for(const t in o)r[t]=new e({type:"nonoptional",innerType:o[t]});return h(this,"shape",r),r}});return O(t,o)}(dr,e,t[0])}));function Fo(e,t){const n={type:"object",shape:e??{},...T(t)};return new Uo(n)}const Bo=o("ZodUnion",((e,t)=>{$t.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def,i=!1===r.inclusive,s=r.options.map(((e,n)=>En(e,t,{...o,path:[...o.path,i?"oneOf":"anyOf",n]})));i?n.oneOf=s:n.anyOf=s})(e,t,n,o),e.options=t.options}));function Vo(e,t){return new Bo({type:"union",options:e,...T(t)})}const Wo=o("ZodDiscriminatedUnion",((e,t)=>{Bo.init(e,t),Pt.init(e,t)}));function Jo(e,t,n){return new Wo({type:"union",options:t,discriminator:e,...T(n)})}const Go=o("ZodIntersection",((e,t)=>{Dt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def,i=En(r.left,t,{...o,path:[...o.path,"allOf",0]}),s=En(r.right,t,{...o,path:[...o.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=c})(e,t,n,o)}));const Ho=o("ZodRecord",((e,t)=>{Ct.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=n,i=e._zod.def;r.type="object";const s=i.keyType,a=s._zod.bag,c=a?.patterns;if("loose"===i.mode&&c&&c.size>0){const e=En(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});r.patternProperties={};for(const t of c)r.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(r.propertyNames=En(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),r.additionalProperties=En(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});const d=s._zod.values;if(d){const e=[...d].filter((e=>"string"==typeof e||"number"==typeof e));e.length>0&&(r.required=e)}})(e,t,n,o),e.keyType=t.keyType,e.valueType=t.valueType}));function Yo(e,t,n){return new Ho({type:"record",keyType:e,valueType:t,...T(n)})}const Ko=o("ZodEnum",((e,t)=>{Lt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n)=>{const o=c(e._zod.def.entries);o.every((e=>"number"==typeof e))&&(n.type="number"),o.every((e=>"string"==typeof e))&&(n.type="string"),n.enum=o})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,o)=>{const r={};for(const o of e){if(!n.has(o))throw new Error(`Key ${o} not found in enum`);r[o]=t.entries[o]}return new Ko({...t,checks:[],...T(o),entries:r})},e.exclude=(e,o)=>{const r={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete r[t]}return new Ko({...t,checks:[],...T(o),entries:r})}}));function qo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Ko({type:"enum",entries:n,...T(t)})}const Xo=o("ZodLiteral",((e,t)=>{Mt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n)=>{const o=e._zod.def,r=[];for(const e of o.values)if(void 0===e){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");r.push(Number(e))}else r.push(e);if(0===r.length);else if(1===r.length){const e=r[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else r.every((e=>"number"==typeof e))&&(n.type="number"),r.every((e=>"string"==typeof e))&&(n.type="string"),r.every((e=>"boolean"==typeof e))&&(n.type="boolean"),r.every((e=>null===e))&&(n.type="null"),n.enum=r})(e,t,n),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 Qo(e,t){return new Xo({type:"literal",values:Array.isArray(e)?e:[e],...T(t)})}const er=o("ZodTransform",((e,t)=>{jt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,o)=>{if("backward"===o.direction)throw new i(e.constructor.name);n.addIssue=o=>{if("string"==typeof o)n.issues.push(P(o,n.value,t));else{const t=o;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(P(t))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then((e=>(n.value=e,n))):(n.value=r,n)}}));function tr(e){return new er({type:"transform",transform:e})}const nr=o("ZodOptional",((e,t)=>{Ft.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>In(e,t,0,o),e.unwrap=()=>e._zod.def.innerType}));function or(e){return new nr({type:"optional",innerType:e})}const rr=o("ZodExactOptional",((e,t)=>{Bt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>In(e,t,0,o),e.unwrap=()=>e._zod.def.innerType}));const ir=o("ZodNullable",((e,t)=>{Vt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def,i=En(r.innerType,t,o),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,o),e.unwrap=()=>e._zod.def.innerType}));function sr(e){return new ir({type:"nullable",innerType:e})}const ar=o("ZodDefault",((e,t)=>{Wt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def;En(r.innerType,t,o),t.seen.get(e).ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))})(e,t,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}));const cr=o("ZodPrefault",((e,t)=>{Gt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def;En(r.innerType,t,o),t.seen.get(e).ref=r.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))})(e,t,n,o),e.unwrap=()=>e._zod.def.innerType}));const dr=o("ZodNonOptional",((e,t)=>{Ht.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def;En(r.innerType,t,o),t.seen.get(e).ref=r.innerType})(e,t,0,o),e.unwrap=()=>e._zod.def.innerType}));const ur=o("ZodCatch",((e,t)=>{Kt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def;let i;En(r.innerType,t,o),t.seen.get(e).ref=r.innerType;try{i=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}));const lr=o("ZodPipe",((e,t)=>{qt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def,i="input"===t.io?"transform"===r.in._zod.def.type?r.out:r.in:r.out;En(i,t,o),t.seen.get(e).ref=i})(e,t,0,o),e.in=t.in,e.out=t.out}));function pr(e,t){return new lr({type:"pipe",in:e,out:t})}const fr=o("ZodReadonly",((e,t)=>{Qt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def;En(r.innerType,t,o),t.seen.get(e).ref=r.innerType,n.readOnly=!0})(e,t,n,o),e.unwrap=()=>e._zod.def.innerType}));const mr=o("ZodCustom",((e,t)=>{tn.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)}));const hr=to().regex(/^0x[a-fA-F0-9]*$/,{message:"Must be a hex string beginning with 0x"}).transform((e=>e)),yr=to().regex(/^0x[a-fA-F0-9]{40}$/,{message:"Must be a 40-character hex string beginning with 0x"}).transform((e=>e.toLowerCase())),gr=to(),_r=to();Fo({EVM:yr,SOL:gr}).keyof();const vr=to().regex(/^(\d+|\d*\.\d+)$/);No().min(0n),No().min(0n);const wr=to().refine((e=>/^[a-zA-Z_]{3,}$/.test(e)),{message:"Invalid fiat"}),br=Fo({issuer:to(),name:to(),alias:to().optional(),symbol:to(),decimals:Oo()}),Er=to(),zr=to().regex(/^[a-zA-Z]\w{1,7}$/,{message:"Must be a short alpha-numeric symbol"}),kr=Oo().min(0).max(18),Or=to().url(),Tr=to(),Ar=Fo({chain:to(),address:hr}),Ir=Fo({chain:Qo("solana"),address:gr}),xr=Fo({chain:to(),address:to()}),Sr=Vo([Ar,Ir,xr]),Nr=to().refine((e=>{const[t,n]=e.split(":");return Sr.safeParse({chain:t,address:n}).success}),{message:"Invalid token"}),$r=Fo({name:Er,symbol:zr,decimals:kr,alias:zr.optional(),image_url:Or.optional(),coingecko_id:Tr.optional(),wrapper:zr.optional(),is_native:xo().optional()}),Pr=Vo([Ar.extend($r.shape),Ir.extend($r.shape),xr.extend($r.shape)]),Dr=Vo([Nr,wr]);Vo([Pr,br]),Jo("type",[Fo({type:Qo("chain"),chain:to()}),Fo({type:Qo("issuer"),issuer:to()})]);const Zr=to().transform((e=>e.toLowerCase()));var Rr,Cr;Rr=e=>"string"==typeof e?e.toUpperCase():e,Cr=qo(["ONRAMP","OFFRAMP"]),pr(tr(Rr),Cr),Fo({to:yr,from:yr.optional(),nonce:Oo().optional(),gasLimit:No().optional(),gasPrice:No().optional(),maxPriorityFeePerGas:No().optional(),maxFeePerGas:No().optional(),data:to().optional(),value:No().optional(),chainId:Oo()}),Fo({transactionHash:to().optional(),blockHash:to().optional(),blockNumber:Oo().optional(),from:yr.optional(),to:yr.optional(),rawReceipt:Do()});const Lr=Fo({chain_id:No(),network:to(),address_family:function(e,t){return new e({type:"undefined",...T(t)})}($o,Mr),explorer:ao().optional(),image:ao().optional(),is_testnet:xo()});var Mr;Jo("address_family",[Lr.extend({address_family:Qo("EVM"),native_currency:Fo({name:to(),symbol:to(),decimals:Oo()}),rpc:to().optional()}),Lr.extend({address_family:Qo("SOL")}),Lr]);const jr=qo(["CREDIT_CARD","DEBIT_CARD","ACH","FIAT_BALANCE","TOKEN_BALANCE","APPLE_PAY","PAYPAL","VENMO","REVOLUT","GOOGLE_PAY","SEPA","FASTER_PAYMENTS","PIX","UPI","WIRE"]),Ur=()=>{if("undefined"==typeof navigator)return!1;const e=navigator;let t=!1;e.userAgentData&&"boolean"==typeof e.userAgentData.mobile&&(t=e.userAgentData.mobile);const n=navigator.userAgent||navigator.vendor||window.opera||"";return t||/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile|tablet/i.test(n)},Fr=to().refine((e=>n.test(e)),{message:"Invalid payment ID"}),Br=qo(["BETA_EDGES","ORG_BETA_EDGES","ORG_EDGES"]),Vr=Fo({onramps:jo(Zr).optional(),offramps:jo(Zr).optional(),sandbox:xo().optional().default(!1),features:jo(Br).optional()}),Wr=Vr.extend({inputs:jo(Dr).optional(),outputs:jo(Dr)});Vo([Wr,Vr.extend({inputs:jo(Dr),outputs:jo(Dr).optional()})]);const Jr=Fo({asset:Dr,amount:vr}),Gr=Fo({token:Nr,amount:vr}),Hr=to(),Yr=Vo([function(e){return dn(yo,e)}(),function(e){return un(go,e)}()]),Kr=Fo({price_currency:wr,onramps:jo(Zr).optional(),onramp_methods:jo(jr).optional(),customer_ip_address:to().optional(),customer_id:to().optional(),label:to().optional(),parent_payment_id:Fr.optional(),features:jo(Br).optional(),rev_share_name:to().optional(),allow_unsafe_transfer_out:xo().optional(),show_all_issues:xo().optional(),allow_exceed_max_input_limit:xo().optional(),allow_unsafe_slippage:xo().optional()}),qr=Fo({"#":to()}),Xr=Fo({type:Qo("CallImmediateAction"),target:to(),value:qr,calldata:to()}),Qr=Fo({actions:jo(Xr),user_estimated_gas:qr}),ei=Jo("kind",[Fo({kind:Qo("FIXED_INPUT"),fixed_input_amount:Jr,output_asset:Dr,custom_actions:Qr.optional(),dest_address:to().optional()})]),ti=Kr.extend({request:ei}),ni=qo(["USER","DEST","HALLIDAY","SPW","REV_SHARE","BRIDGE"]),oi=Fo({asset:Dr,property:qo(["APPROVAL","BALANCE"])}),ri=Fo({account:ni,resource:oi}),ii=Vo([Qo("COMPLETE"),Qo("UNREACHABLE"),Qo("FAILED")]),si=Vo([ii,Qo("PENDING")]),ai=qo(["PENDING","COMPLETE","FAILED","EXPIRED","WITHDRAWN","TAINTED"]),ci=Fo({consume:jo(ri),produce:jo(ri)}),di=ri.extend({amount:vr}),ui=ci.extend({consume:jo(di),produce:jo(di)}),li=Yo(Dr,to()),pi=Jo("kind",[Fo({kind:Vo([Qo("amount"),Qo("amount-downstream")]),given:to(),limits:Fo({min:to().optional(),max:to().optional()}),source:to(),message:to()}),Fo({kind:Qo("geolocation"),message:to()}),Fo({kind:Qo("provider"),message:to()}),Fo({kind:Qo("other"),message:to()}),Fo({kind:Qo("unknown"),message:to()})]),fi=Fo({service_ids:jo(to()),latency_seconds:Oo(),issues:jo(pi).optional()}),mi=Fo({type:Vo([Qo("USER_FUND"),Qo("ONCHAIN_STEP"),Qo("ONRAMP")]),net_effect:ui,pieces_info:jo(Fo({type:Vo([Qo("onramp"),Qo("poll"),Qo("bridge"),Qo("rev_share"),Qo("transfer_out"),Qo("convert")])})),step_index:Oo().optional()}),hi=Fo({payment_id:to(),output_amount:Fo({asset:Dr,amount:to()}),onramp:Zr.optional(),onramp_method:jr.optional(),fees:Fo({total_fees:to(),conversion_fees:to(),network_fees:to(),business_fees:to(),currency_symbol:wr}),route:jo(mi)}),yi=mi.extend({status:si,transaction_hash:to().optional()}),gi=hi.omit({payment_id:!0}).partial({output_amount:!0,onramp:!0,onramp_method:!0,fees:!0}).extend({route:jo(yi)});Fo({quote_request:ti,quotes:jo(hi),current_prices:li,price_currency:wr,state_token:to(),quoted_at:to(),accept_by:to(),failures:jo(fi)}),Fo({payment_id:Fr,state_token:to(),owner_chain:to().optional(),owner_address:_r,destination_address:_r,client_redirect_url:to().optional(),allow_unsafe_owner:xo().optional()});const _i=Fo({deposit_token:Nr,deposit_chain:to(),deposit_amount:vr,deposit_address:_r}),vi=Fo({type:qo(["ONRAMP","TRANSFER_IN"]),payment_id:Fr,funding_page_url:ao(),deposit_info:jo(_i)}),wi=Fo({payment_id:Fr,org_id:to(),status:ai,funded:xo(),created_at:to(),updated_at:to(),initiate_fund_by:to(),completed_at:to().optional(),quote_request:ti,quoted:hi.omit({payment_id:!0}),fulfilled:gi,current_prices:li,price_currency:wr,customer_id:to().optional(),label:to().optional(),processing_addresses:jo(Fo({address:_r,chain:to()})),owner_chain:to(),owner_address:_r,destination_address:_r,next_instruction:vi.optional(),parent_payment_id:Fr.optional()});Fo({payment_id:Fr,redirect_url:to(),referrer_domain:to().optional()}),Fo({funding_page_onramp_url:to(),client_redirect_url:to().optional(),client_secret:to().optional()}),Fo({id_query:to().optional(),pagination_key:to().optional(),dest_address:_r.optional(),owner_address:_r.optional(),limit:Oo().int().positive().optional(),category:qo(["ALL","NEW_OR_FUNDED"]).optional(),label:to().optional()}),Fo({payment_statuses:jo(wi),next_pagination_key:to().nullable()}),Fo({payment_id:Fr.optional(),custom_queries:jo(Fo({address:_r,token:Vo([Nr,Sr])})).optional()}).refine((e=>!(!e.payment_id&&!e.custom_queries?.length)),{message:"payment_id or custom_queries is required"}),Fo({balance_results:jo(Fo({address:_r,token:Nr,value:Jo("kind",[Fo({kind:Qo("amount"),amount:vr}),Fo({kind:Qo("error")})])}))}),Fo({fiat:wr,tokens:jo(Nr)});const bi=to(),Ei=Fo({payment_id:Fr,token_amounts:jo(Gr),recipient_address:_r});Fo({payment_id:Fr,withdraw_authorization:bi}),Ei.extend({owner_signature:Hr}),Fo({payment_id:Fr,transaction_hash:to()});const zi=qo(["EMBED","POPUP","MODAL"]),ki=qo(["DEFAULT","ALL_UPPERCASE"]),Oi=qo(["AUTO","MEDIUM"]),Ti=qo(["ATTACHED","BUTTON"]),Ai=qo(["SQUARE","DEFAULT"]),Ii=to().refine((e=>/^(#[0-9A-Fa-f]{3,8}|rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\)|rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3}(\s*,\s*(0(\.\d+)?|1(\.0+)?))\))$/.test(e)),{message:"Invalid CSS color value"}),xi=Fo({src:ao(),alt:to(),width:Oo().positive(),height:Oo().positive()}),Si=Fo({primaryColor:Ii.optional(),backgroundColor:Ii.optional(),borderColor:Ii.optional(),textColor:Ii.optional(),textSecondaryColor:Ii.optional(),accentColor:Ii.optional(),componentShadow:to().optional(),borderStyle:Ai.optional(),textMode:ki.optional(),paymentCategoryGrouping:Ti.optional(),fontWeight:Oi.optional(),logo:xi.optional()}),Ni=Do(),$i=jo(qo(["wallet","open-wallet","exchange","open-exchange","cash","open-cash","deposit"])),Pi=qo(["haffer","wudoo-mono"]),Di=to().optional(),Zi=Fo({address:_r,signMessage:Do().refine((e=>"function"==typeof e)).optional(),sendTransaction:Do().refine((e=>"function"==typeof e)).optional(),signTypedData:Do().refine((e=>"function"==typeof e)).optional()}),Ri=Fo({redirectUrl:ao(),ctaText:to(),secondaryRedirectUrl:ao().optional(),secondaryCtaText:to().optional()}).refine((e=>!(e.secondaryRedirectUrl&&!e.secondaryCtaText||!e.secondaryRedirectUrl&&e.secondaryCtaText)),{message:"secondaryCtaText and secondaryRedirectUrl must be provided together."}),Ci=Fo({apiKey:to().nonempty(),destinationAddress:_r.optional(),widgetVersion:qo(["1","2"]).optional(),...Wr.shape,customStyles:Si.optional(),targetElementId:to().optional(),windowType:zi.optional(),redirects:Ri.optional(),statusCallback:Do().refine((e=>"function"==typeof e)).optional(),owner:Zi.optional(),funder:Zi.optional(),features:jo(Br).optional(),paymentCategoryOrder:$i.optional(),fontName:Pi.optional(),headerTitle:Di.optional(),showSkeleton:xo().optional(),skeletonBackgroundColor:to().optional()}),Li=Ci.refine((e=>!("EMBED"===e.windowType&&!e.targetElementId)),{message:"targetElementId is required when windowType is EMBED"}),Mi=Ci.omit({owner:!0,funder:!0,statusCallback:!0}),ji=to().regex(/^(https:\/\/(?:[\w-]+\.)*halliday\.xyz(?:\/.*)?|http:\/\/localhost(?::\d+)?(?:\/.*)?|https:\/\/localhost(?::\d+)?(?:\/.*)?)$/,"Invalid API baseUrl"),Ui=Yo(to(),xo()),Fi=Fo({dangerouslyOverrideHallidayDomainName:ao().optional(),dangerouslyOverrideApiBaseUrl:ji.optional(),dangerouslyOverrideIPAddress:Yr.optional(),dangerouslyOverrideFeatureFlags:Ui.optional()}),Bi=qo(["FULL","MODAL","OVERLAY","EMBED"]),Vi=Fo({appMode:Bi.optional(),apiBaseUrl:ji.optional(),hasOwner:xo(),hasTxHandler:xo(),hostOrigin:ao().nullable(),ipAddress:Yr.optional(),featureFlags:Ui.optional()}),Wi=Fo({...Mi.shape,...Vi.shape,ownerAddress:_r.optional(),funderAddress:_r.optional()});var Ji;!function(e){e.ACTION_TRANSACTION="ACTION_TRANSACTION",e.EVENT_ORDER_STATUS="EVENT_ORDER_STATUS",e.EVENT_WINDOW_CLOSE="EVENT_WINDOW_CLOSE",e.ACTION_SIGN_MESSAGE="ACTION_SIGN_MESSAGE",e.ACTION_PROVIDER_WIDGET="ACTION_PROVIDER_WIDGET",e.ACTION_SIGN_TYPED_DATA="ACTION_SIGN_TYPED_DATA",e.EVENT_RESIZE="EVENT_RESIZE"}(Ji||(Ji={}));const Gi=Fo({apiKey:to().nonempty(),sandbox:xo().optional(),onReady:Do().refine((e=>"function"==typeof e||void 0===e)).optional(),onError:Do().refine((e=>"function"==typeof e||void 0===e)).optional()}),Hi=e=>{if(e)return e.includes("deposit")?e:["deposit",...e]},Yi=()=>{const e=document.getElementById("halliday-payments-skeleton");e&&(e.style.opacity="0",setTimeout((()=>e.remove()),300))},Ki=e=>{const t=Wi.parse(e);return btoa(JSON.stringify(t))},qi=e=>Wi.parse(JSON.parse(atob(e))),Xi=t=>{const{windowOrigin:n=e,...o}=t,r=Ki(o),i=o.widgetVersion;if(i)try{return`${n}/v${parseInt(i)}/payments/quote?data=${r}`}catch(e){console.error("Error parsing widget version",e)}return`${n}/payments/quote?data=${r}`},Qi=e=>{const t=window.innerWidth/2-240,{windowType:n="POPUP",targetElementId:o,windowOrigin:r}=e,i=Xi(e);let s;if("EMBED"===n){const e=document.getElementById(o);if(!e)throw new Error(`Element with id ${o} not found`);let t=document.getElementById("halliday-payments-embed");if((t?t.src:null)===i)t.style.display="block";else{let n=document.getElementById("halliday-payments-wrapper");n||(e.innerHTML="",e.style&&(e.style.position="relative"),n=document.createElement("div"),n.id="halliday-payments-wrapper",n.style.cssText="\n position: relative;\n width: 480px;\n max-width: 100%;\n display: block;\n ",e.appendChild(n)),t=document.createElement("iframe"),t.id="halliday-payments-embed",t.src=i,t.style.cssText="\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: none;\n display: block;\n ",t.setAttribute("scrolling","no"),n.appendChild(t)}s=t.contentWindow;const n=e=>{const{type:t,payload:o}=e.data||{},i=e.source===s,a=e.origin===r;if(i&&(a||t===Ji.EVENT_RESIZE))if(t===Ji.EVENT_WINDOW_CLOSE){window.removeEventListener("message",n);const e=document.getElementById("halliday-payments-embed");e&&(e.style.display="none")}else if(t===Ji.EVENT_RESIZE){const e=document.getElementById("halliday-payments-skeleton"),t=document.getElementById("halliday-payments-wrapper");void 0!==o?.height&&(e&&(e.style.height=o.height+"px"),t&&(t.style.minHeight=o.height+"px"))}else"WIDGET_READY"!==t&&"HALLIDAY_READY"!==t||Yi()};window.addEventListener("message",n)}else if("MODAL"===n){let e=document.getElementById("halliday-payments-modal");(e?e.src:null)===i?e.style.display="block":(e&&e.remove(),e=document.createElement("iframe"),e.id="halliday-payments-modal",e.src=i,e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100dvw",e.style.height="100dvh",e.style.border="none",e.style.zIndex="1000",e.setAttribute("scrolling","no"),document.body.appendChild(e));const t=e=>{if(e.origin!==r||e.source!==s)return;const{type:n}=e.data||{};if(n===Ji.EVENT_WINDOW_CLOSE){window.removeEventListener("message",t);const e=document.getElementById("halliday-payments-modal");e&&(e.style.display="none")}};window.addEventListener("message",t),s=e.contentWindow}else s=window.open(i,"Halliday Payments",`popup left=${t} top=70 width=480 height=638`);return s},es=e=>{const t=window.innerWidth/2-240;return window.open(e,"Provider Widget",`popup left=${t} top=70 width=480 height=638`)},ts=async({apiKey:e,baseURL:t,workflowId:n})=>{let o;for(let r=1;r<=3;r++)try{const o=await fetch(`${t}/quotes/status?workflow_id=${n}`,{headers:{Authorization:`Bearer ${e}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.json()}catch(e){if(o=e instanceof Error?e:new Error(String(e)),3===r)throw o;const t=1e3*Math.pow(2,r);await new Promise((e=>setTimeout(e,t)))}throw o},ns=async({apiKey:e,baseURL:t,window:n,workflowId:o})=>{for(;!n.closed;){let n;try{n=await ts({apiKey:e,baseURL:t,workflowId:o})}catch(e){console.error("Error fetching payment status",e);break}const r=n.fulfilled.route.find((e=>"ONRAMP"===e.type)),i=r?.status;if("COMPLETE"===i)break;await new Promise((e=>setTimeout(e,5e3)))}},os=e=>{e instanceof Ln?e.issues.forEach((e=>{console.error("Validation Error",{path:e.path.join("."),message:e.message})})):console.error("openHallidayPayments Error",{error:e})},rs="halliday-payments-preload";let is={isPreloaded:!1,isLoading:!1,iframe:null,error:null,startTime:null,readyTime:null},ss=null,as=null,cs=null,ds=null,us=null,ls=null,ps=null,fs=null,ms=0;const hs=()=>is.isPreloaded&&!is.error,ys=async(t,...n)=>{if(is.isPreloaded)return void console.warn("[HallidayPayments] Already initialized");const o=++ms;if(is.isLoading&&ps){const e=new Error("Initialization superseded by a newer call");fs?.(e)}const r=n[999]||n[0]||{};let i,s;try{i=Gi.parse(t)}catch(e){throw os(e),e}try{s=Fi.parse(r)}catch(e){throw os(e),e}ss=i,ds=s,as=i.onReady||null,cs=i.onError||null;const a=(s.dangerouslyOverrideHallidayDomainName||e).replace(/\/$/,"");is={...is,isLoading:!0,startTime:Date.now(),error:null};const c=new Promise(((e,t)=>{let n=!0,r=null;const c=e=>{n&&(n=!1,r&&(clearTimeout(r),r=null),p(),is.iframe&&is.iframe.remove(),is={...is,isLoading:!1,error:null,iframe:null},d(),t(e||new Error("Initialization cancelled")))},d=()=>{ps=null,fs===c&&(fs=null)};r=setTimeout((()=>{if(!n||o!==ms)return;const e=new Error("Widget load timeout exceeded");is={...is,isLoading:!1,error:e},p(),cs?.(e),d(),t(e)}),3e4),!n&&r&&(clearTimeout(r),r=null);const u=t=>{if(!n||o!==ms)return;if(t.origin!==a)return;if(t.source!==is.iframe?.contentWindow)return;const{type:i}=t.data||{};"WIDGET_READY"!==i&&"HALLIDAY_READY"!==i||(r&&(clearTimeout(r),r=null),p(),is={...is,isPreloaded:!0,isLoading:!1,readyTime:Date.now()},as?.(),d(),e())},l=e=>{if(!n||o!==ms)return;if(e.origin!==a)return;if(e.source!==is.iframe?.contentWindow)return;const{type:t,payload:r}=e.data||{};t===Ji.EVENT_RESIZE&&r&&is.iframe&&(void 0!==r.width&&(is.iframe.style.width=r.width+"px"),void 0!==r.height&&(is.iframe.style.height=r.height+"px"))},p=()=>{window.removeEventListener("message",u),window.removeEventListener("message",l),us===l&&(us=null)};window.addEventListener("message",u),window.addEventListener("message",l),us=l;const f=document.getElementById(rs);f&&f.remove();const m=document.createElement("iframe");m.id=rs;let h="MODAL";try{h=Ur()?"OVERLAY":"MODAL"}catch{}const y=Xi({apiKey:i.apiKey,sandbox:i.sandbox||!1,widgetVersion:"2",outputs:[],hasOwner:!1,hasTxHandler:!1,hostOrigin:"undefined"!=typeof window?window.origin:null,windowOrigin:a,appMode:h,apiBaseUrl:s.dangerouslyOverrideApiBaseUrl,ipAddress:s.dangerouslyOverrideIPAddress,featureFlags:s.dangerouslyOverrideFeatureFlags});m.src=y,m.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100dvw;\n height: 100dvh;\n border: none;\n z-index: -1;\n visibility: hidden;\n pointer-events: none;\n opacity: 0;\n ",m.setAttribute("aria-hidden","true"),m.setAttribute("tabindex","-1"),m.onload=()=>{n&&o===ms&&setTimeout((()=>{n&&o===ms&&is.isLoading&&!is.isPreloaded&&(r&&(clearTimeout(r),r=null),p(),is={...is,isPreloaded:!0,isLoading:!1,readyTime:Date.now()},as?.(),d(),e())}),3e3)},m.onerror=()=>{if(!n||o!==ms)return;r&&(clearTimeout(r),r=null),p();const e=new Error("Failed to load widget");is={...is,isLoading:!1,error:e},cs?.(e),d(),t(e)},document.body.appendChild(m),is.iframe=m,fs=c}));return ps=c,c},gs=()=>{const e=is.iframe;e&&(e.style.visibility="hidden",e.style.opacity="0",e.style.pointerEvents="none",e.style.zIndex="-1",e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1"))},_s=()=>{us&&(window.removeEventListener("message",us),us=null);const e=is.iframe;e&&e._embedCleanup&&e._embedCleanup();const t=document.getElementById(rs);t&&t.remove();const n=document.getElementById("halliday-payments-placeholder");n&&n.remove();const o=document.getElementById("halliday-payments-modal");o&&o.remove();const r=document.getElementById("halliday-payments-skeleton");r&&r.remove(),is={isPreloaded:!1,isLoading:!1,iframe:null,error:null,startTime:null,readyTime:null},ss=null,ds=null,as=null,cs=null,ls=null,ps=null,fs=null},vs=e=>{const{windowOrigin:t,widgetWindow:n,providerWindowRef:o,cleanMessageHandlers:r,hasOwner:i,hasTxHandler:s,signMessage:a,signTypedData:c,sendTransaction:d,statusCallback:u,apiKey:l,apiBaseUrl:p}=e,f=[];return f.push((e=>{if(e.origin!==t||e.source!==n)return;const{type:o}=e.data||{};o===Ji.EVENT_WINDOW_CLOSE&&r()})),i&&f.push((async e=>{if(e.origin!==t||e.source!==n)return;const{type:o,payload:r}=e.data||{};if(o===Ji.ACTION_SIGN_MESSAGE){const{messageId:e,message:i,ownerAddress:s}=r;try{const r="function"==typeof a?await a({message:i,ownerAddress:s}):(()=>{throw new Error("No signMessage function provided")})();n.postMessage({type:o,payload:{messageId:e,signature:r}},t)}catch(r){n.postMessage({type:o,payload:{messageId:e,error:r instanceof Error?r.message:r}},t)}}else if(o===Ji.ACTION_SIGN_TYPED_DATA){const{messageId:e,typedData:i,ownerAddress:s}=r;try{const r="function"==typeof c?await c({typedData:i,ownerAddress:s}):(()=>{throw new Error("No signTypedData function provided")})();n.postMessage({type:o,payload:{messageId:e,signature:r}},t)}catch(r){n.postMessage({type:o,payload:{messageId:e,error:r instanceof Error?r.message:r}},t)}}})),s&&f.push((async e=>{if(e.origin!==t||e.source!==n)return;const{type:o,payload:r}=e.data||{};if(o===Ji.ACTION_TRANSACTION){const{messageId:e,chainConfig:i,transaction:s}=r;try{const r="function"==typeof d?await d(s,i):(()=>{throw new Error("No sendTransaction function provided")})();n.postMessage({type:o,payload:{messageId:e,txReceipt:r}},t)}catch(r){n.postMessage({type:o,payload:{messageId:e,error:r instanceof Error?r.message:r}},t)}}})),u&&f.push((e=>{if(e.origin!==t||e.source!==n)return;const{type:o,payload:r}=e.data||{};o===Ji.EVENT_ORDER_STATUS&&u({type:o,payload:r})})),f.push((async e=>{if(e.origin!==t||e.source!==n)return;const{type:r,payload:i}=e.data||{};if(r===Ji.ACTION_PROVIDER_WIDGET){const{url:e,redirectUrl:t,providerWidgetMode:r,workflowId:s}=i||{};if(!(e&&t&&r&&s))return;let a=null;"REDIRECT"===r?(n.location=e,a=n):"POPUP"===r&&(o.current=es(e),a=o.current),a&&(await ns({apiKey:l,baseURL:p,workflowId:s,window:a}),a.closed||("REDIRECT"===r?n.location=t:"POPUP"===r&&(o.current?.close(),o.current=null)))}})),f},ws=(()=>{let n=null,o=null;const r={get current(){return o},set current(e){o=e}};let i=[];const s=()=>{i.forEach((e=>{window.removeEventListener("message",e)})),i=[]},a=e=>{e.forEach((e=>{window.addEventListener("message",e)})),i=e},c=async(i,...d)=>{const u=d[999]||d[0]||{},l=async()=>{let r,c;try{r=Li.parse(i)}catch(e){throw os(e),e}try{c=Fi.parse(u)}catch(e){throw os(e),e}const{dangerouslyOverrideHallidayDomainName:d,dangerouslyOverrideApiBaseUrl:l,dangerouslyOverrideIPAddress:p,dangerouslyOverrideFeatureFlags:f}=c,{owner:m,statusCallback:h,funder:y,windowType:g}=r,_=(d||e).replace(/\/$/,""),v=m?.signMessage,w=m?.signTypedData,b=y?.sendTransaction||m?.sendTransaction,E=m?.address,z=y?.address,k=_r.safeParse(E).success&&"function"==typeof w,O=_r.safeParse(z).success&&"function"==typeof b;let T=null,A="FULL";try{T=window.origin,"MODAL"===g?A=Ur()?"OVERLAY":"MODAL":"EMBED"===g&&(A="EMBED")}catch(e){}s();const I=[e=>{if(e.origin!==_||e.source!==n)return;const{type:t}=e.data||{};t===Ji.EVENT_WINDOW_CLOSE&&s()}];if(k){const e=async e=>{if(e.origin!==_||e.source!==n)return;const{type:t,payload:o}=e.data||{};if(t===Ji.ACTION_SIGN_MESSAGE){const{messageId:e,message:r,ownerAddress:i}=o;try{let o;if("function"!=typeof v)throw new Error("No signMessage function provided");o=await v({message:r,ownerAddress:i}),n?.postMessage({type:t,payload:{messageId:e,signature:o}},_)}catch(o){console.error("Error signing message",o),n?.postMessage({type:t,payload:{messageId:e,error:o instanceof Error?o.message:o}},_)}}else if(t===Ji.ACTION_SIGN_TYPED_DATA){const{messageId:e,typedData:r,ownerAddress:i}=o;try{let o;if("function"!=typeof w)throw new Error("No signTypedData function provided");o=await w({typedData:r,ownerAddress:i}),n?.postMessage({type:t,payload:{messageId:e,signature:o}},_)}catch(o){console.error("Error signing typed data",o),n?.postMessage({type:t,payload:{messageId:e,error:o instanceof Error?o.message:o}},_)}}};I.push(e)}if(O){const e=async e=>{if(e.origin!==_||e.source!==n)return;const{type:t,payload:o}=e.data||{};if(t===Ji.ACTION_TRANSACTION){const{messageId:e,chainConfig:r,transaction:i}=o;try{let o;if("function"!=typeof b)throw new Error("No sendTransaction function provided");o=await b(i,r),n?.postMessage({type:t,payload:{messageId:e,txReceipt:o}},_)}catch(o){console.error("Error handling transaction",o),n?.postMessage({type:t,payload:{messageId:e,error:o instanceof Error?o.message:o}},_)}}};I.push(e)}if(h){const e=e=>{if(e.origin!==_||e.source!==n)return;const{type:t,payload:o}=e.data||{};t===Ji.EVENT_ORDER_STATUS&&h({type:t,payload:o})};I.push(e)}I.push((async e=>{if(e.origin!==_||e.source!==n)return;const{type:i,payload:s}=e.data||{};if(i===Ji.ACTION_PROVIDER_WIDGET&&n){const{url:e,redirectUrl:i,providerWidgetMode:a,workflowId:c}=s||{};if(!(e&&i&&a&&c))throw new Error("Invalid provider widget payload");let d=null;if("REDIRECT"===a)n.location=e,d=n;else{if("POPUP"!==a)throw new Error("Invalid provider widget mode");o=es(e),d=o}if(await ns({apiKey:r.apiKey,baseURL:l||t,workflowId:c,window:d}),d?.closed)return;"REDIRECT"===a?n.location=i:"POPUP"===a&&(o?.close(),o=null)}}));const x={...r,sandbox:r.sandbox||!1,hasOwner:k,hasTxHandler:O,windowOrigin:_,apiBaseUrl:l,hostOrigin:T,ownerAddress:E,funderAddress:z,ipAddress:p,featureFlags:f,appMode:A,fontName:r.fontName,paymentCategoryOrder:Hi(r.paymentCategoryOrder),headerTitle:r.headerTitle};n=Qi(x),a(I)},p=i.windowType,f=i.targetElementId,m=i.showSkeleton??!0,h=i.skeletonBackgroundColor??i.customStyles?.backgroundColor;if("EMBED"===p&&f&&m){const e=document.getElementById(f);e&&(hs()||((e,t)=>{const n=document.getElementById("halliday-payments-skeleton");n&&n.remove(),e.style&&(e.style.position="relative");let o=document.getElementById("halliday-payments-wrapper");o||(o=document.createElement("div"),o.id="halliday-payments-wrapper",o.style.cssText="\n position: relative;\n width: 480px;\n max-width: 100%;\n display: block;\n ",e.appendChild(o));const r=t||"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",i=document.createElement("div");if(i.id="halliday-payments-skeleton",i.style.cssText=`\n width: 100%;\n height: 400px;\n background: ${r};\n background-size: 200% 100%;\n animation: halliday-skeleton-pulse 1.5s ease-in-out infinite;\n border-radius: 12px;\n position: relative;\n z-index: 1;\n transition: opacity 0.3s ease-out;\n `,!document.getElementById("halliday-skeleton-styles")&&document.head)try{const e=document.createElement("style");e.id="halliday-skeleton-styles",e.textContent="\n @keyframes halliday-skeleton-pulse {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n ",document.head.appendChild(e)}catch{}o.appendChild(i)})(e,h))}if(hs()){const o=ss,c=ds,d=(c?.dangerouslyOverrideHallidayDomainName||e).replace(/\/$/,""),{owner:l,funder:p,statusCallback:f}=i,m=l?.signMessage,h=l?.signTypedData,y=p?.sendTransaction||l?.sendTransaction,g=l?.address,_=p?.address,v=_r.safeParse(g).success&&"function"==typeof h,w=_r.safeParse(_).success&&"function"==typeof y,b=i.windowType||"MODAL",E=i.targetElementId;let z=null,k="FULL";try{z=window.origin,"MODAL"===b?k=Ur()?"OVERLAY":"MODAL":"EMBED"===b&&(k="EMBED")}catch{}const O={apiKey:i.apiKey||o?.apiKey||"",sandbox:i.sandbox??o?.sandbox??!1,widgetVersion:i.widgetVersion,destinationAddress:i.destinationAddress,outputs:i.outputs??[],inputs:i.inputs,customStyles:i.customStyles,redirects:i.redirects,features:i.features,paymentCategoryOrder:Hi(i.paymentCategoryOrder),fontName:i.fontName,headerTitle:i.headerTitle,windowType:b,targetElementId:E,hasOwner:v,hasTxHandler:w,ownerAddress:g,funderAddress:_,hostOrigin:z,appMode:k,windowOrigin:d,apiBaseUrl:u?.dangerouslyOverrideApiBaseUrl??c?.dangerouslyOverrideApiBaseUrl,ipAddress:u?.dangerouslyOverrideIPAddress??c?.dangerouslyOverrideIPAddress,featureFlags:u?.dangerouslyOverrideFeatureFlags??c?.dangerouslyOverrideFeatureFlags};if(n=(t=>{const n=is.iframe;if(!n||!is.isPreloaded||!ss)return null;const o=(ds?.dangerouslyOverrideHallidayDomainName||e).replace(/\/$/,""),r=t?.windowType||"MODAL",i=t?.targetElementId;if("POPUP"===r)return null;let s="MODAL";try{"MODAL"===r?s=Ur()?"OVERLAY":"MODAL":"EMBED"===r&&(s="EMBED")}catch{}if(t){const{windowType:e,...r}=t;n.contentWindow?.postMessage({type:"HALLIDAY_UPDATE_PARAMS",payload:{...r,appMode:s}},o)}if("EMBED"===r){if(!i)return console.error("[HallidayPayments] EMBED mode requires targetElementId in openHallidayPayments"),null;const e=document.getElementById(i);if(!e)return console.error(`[HallidayPayments] Target element '${i}' not found`),null;let t=document.getElementById("halliday-payments-wrapper")||document.getElementById("halliday-payments-placeholder");t||(t=document.createElement("div"),t.id="halliday-payments-placeholder",t.style.cssText=`\n width: 480px;\n max-width: 100%;\n height: ${ls||400}px;\n `,e.appendChild(t));const r=()=>{const e=t.getBoundingClientRect();n.style.position="fixed",n.style.top=e.top+"px",n.style.left=e.left+"px",n.style.width=e.width+"px",n.style.height=e.height+"px",n.style.border="none",n.style.zIndex="1"};t.offsetHeight,requestAnimationFrame((()=>{requestAnimationFrame((()=>{r(),n.style.visibility="visible",n.style.opacity="1",n.style.pointerEvents="auto"}))}));const s=new ResizeObserver((()=>{r()}));s.observe(t);const a=()=>r();window.addEventListener("scroll",a,!0);const c=()=>r();window.addEventListener("resize",c),n._embedCleanup=()=>{s.disconnect(),window.removeEventListener("scroll",a,!0),window.removeEventListener("resize",c),t?.remove()};const d=e=>{if(e.origin!==o)return;if(e.source!==n.contentWindow)return;const{type:i,payload:s}=e.data||{};i===Ji.EVENT_RESIZE&&s&&void 0!==s.height&&t&&(ls=s.height,t.style.height=s.height+"px",r())};if(window.addEventListener("message",d),n.removeAttribute("aria-hidden"),n.removeAttribute("tabindex"),is.isPreloaded)Yi();else{const e=t=>{if(t.origin!==o)return;if(t.source!==n.contentWindow)return;const{type:r}=t.data||{};"WIDGET_READY"!==r&&"HALLIDAY_READY"!==r||(window.removeEventListener("message",e),Yi())};window.addEventListener("message",e)}}else n.id="halliday-payments-modal",n.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100dvw;\n height: 100dvh;\n border: none;\n z-index: 10000;\n ",n.removeAttribute("aria-hidden"),n.removeAttribute("tabindex"),n.setAttribute("scrolling","no"),n.parentElement!==document.body&&document.body.appendChild(n);setTimeout((()=>{n.contentWindow?.postMessage({type:"HALLIDAY_SHOW"},o)}),10);const a=e=>{if(e.origin!==o)return;if(e.source!==n.contentWindow)return;const{type:t}=e.data||{};t===Ji.EVENT_WINDOW_CLOSE&&(window.removeEventListener("message",a),gs())};return window.addEventListener("message",a),n.contentWindow})(O),n){s();const e=vs({windowOrigin:d,widgetWindow:n,providerWindowRef:r,cleanMessageHandlers:s,hasOwner:v,hasTxHandler:w,signMessage:m,signTypedData:h,sendTransaction:y,statusCallback:f,apiKey:o?.apiKey||i.apiKey,apiBaseUrl:c?.dangerouslyOverrideApiBaseUrl||t});return void a(e)}if("POPUP"===b&&(n=Qi({...O,windowOrigin:d}),n)){s();const e=vs({windowOrigin:d,widgetWindow:n,providerWindowRef:r,cleanMessageHandlers:s,hasOwner:v,hasTxHandler:w,signMessage:m,signTypedData:h,sendTransaction:y,statusCallback:f,apiKey:o?.apiKey||i.apiKey,apiBaseUrl:c?.dangerouslyOverrideApiBaseUrl||t});return void a(e)}}return null===ss||hs()?l():new Promise((e=>{const t=Date.now(),n=()=>{hs()?c(i,...d).then(e):Date.now()-t>=3e4?l().then(e):setTimeout(n,100)};n()}))};return{openWidget:c}})();async function bs(e,...t){try{return ws.openWidget(e,...t)}catch(e){throw os(e),e}}export{Bi as AppMode,Ai as BorderStyle,Si as CustomStyles,Pi as FontName,Di as HeaderTitle,Gi as InitConfig,Ji as MessageType,Ni as OrderStatus,$i as PaymentCategoryOrder,Wi as PaymentsWidgetQueryParams,Li as PaymentsWidgetSDKParams,qi as deserializeQueryParams,_s as destroyClient,Xi as getPaymentsWidgetUrl,ys as initializeClient,bs as openHallidayPayments,Ki as serializeQueryParams};
1
+ const e="https://app.halliday.xyz",t="https://v2.prod.halliday.xyz",n=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/;function o(e,t,n){function o(n,o){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:o,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,o);const r=s.prototype,i=Object.keys(r);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=r[t].bind(n))}}const r=n?.Parent??Object;class i extends r{}function s(e){var t;const r=n?.Parent?new i:this;o(r,e),(t=r._zod).deferred??(t.deferred=[]);for(const e of r._zod.deferred)e();return r}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!(n?.Parent&&t instanceof n.Parent)||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}class r extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class i extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}const s={};function a(e){return s}function c(e){const t=Object.values(e).filter((e=>"number"==typeof e));return Object.entries(e).filter((([e,n])=>-1===t.indexOf(+e))).map((([e,t])=>t))}function d(e,t){return"bigint"==typeof t?t.toString():t}function u(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function l(e){return null==e}function p(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const f=Symbol("evaluating");function m(e,t,n){let o;Object.defineProperty(e,t,{get(){if(o!==f)return void 0===o&&(o=f,o=n()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function h(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function y(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function g(e){return JSON.stringify(e)}const _="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function v(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const w=u((()=>{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}}));function b(e){if(!1===v(e))return!1;const t=e.constructor;if(void 0===t)return!0;if("function"!=typeof t)return!0;const n=t.prototype;return!1!==v(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function E(e){return b(e)?{...e}:Array.isArray(e)?[...e]:e}const z=new Set(["string","number","symbol"]);function k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function O(e,t,n){const o=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(o._zod.parent=e),o}function T(e){const t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(void 0!==t?.message){if(void 0!==t?.error)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,"string"==typeof t.error?{...t,error:()=>t.error}:t}const A={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 I(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!0!==e.issues[n]?.continue)return!0;return!1}function x(e,t){return t.map((t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t}))}function S(e){return"string"==typeof e?e:e?.message}function N(e,t,n){const o={...e,path:e.path??[]};if(!e.message){const r=S(e.inst?._zod.def?.error?.(e))??S(t?.error?.(e))??S(n.customError?.(e))??S(n.localeError?.(e))??"Invalid input";o.message=r}return delete o.inst,delete o.continue,t?.reportInput||delete o.input,o}function $(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function P(...e){const[t,n,o]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:o}:{...t}}const D=(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,d,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Z=o("$ZodError",D),R=o("$ZodError",D,{Parent:Error});const C=e=>(t,n,o,i)=>{const s=o?Object.assign(o,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new r;if(c.issues.length){const t=new(i?.Err??e)(c.issues.map((e=>N(e,s,a()))));throw _(t,i?.callee),t}return c.value},L=e=>async(t,n,o,r)=>{const i=o?Object.assign(o,{async:!0}):{async:!0};let s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(r?.Err??e)(s.issues.map((e=>N(e,i,a()))));throw _(t,r?.callee),t}return s.value},M=e=>(t,n,o)=>{const i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new r;return s.issues.length?{success:!1,error:new(e??Z)(s.issues.map((e=>N(e,i,a()))))}:{success:!0,data:s.value}},j=M(R),U=e=>async(t,n,o)=>{const r=o?Object.assign(o,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map((e=>N(e,r,a()))))}:{success:!0,data:i.value}},F=U(R),B=e=>(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return C(e)(t,n,r)},V=e=>(t,n,o)=>C(e)(t,n,o),W=e=>async(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return L(e)(t,n,r)},J=e=>async(t,n,o)=>L(e)(t,n,o),G=e=>(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return M(e)(t,n,r)},H=e=>(t,n,o)=>M(e)(t,n,o),Y=e=>async(t,n,o)=>{const r=o?Object.assign(o,{direction:"backward"}):{direction:"backward"};return U(e)(t,n,r)},K=e=>async(t,n,o)=>U(e)(t,n,o),q=/^[cC][^\s-]{8,}$/,X=/^[0-9a-z]+$/,Q=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,ee=/^[0-9a-vA-V]{20}$/,te=/^[A-Za-z0-9]{27}$/,ne=/^[a-zA-Z0-9_-]{21}$/,oe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,re=/^([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})$/,ie=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)$/,se=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const ae=/^(?:(?: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])$/,ce=/^(([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}|:))$/,de=/^((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])$/,ue=/^(([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])$/,le=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,pe=/^[A-Za-z0-9_-]*$/,fe=/^\+[1-9]\d{6,14}$/,me="(?:(?:\\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])))",he=new RegExp(`^${me}$`);function ye(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}const ge=/^-?\d+n?$/,_e=/^-?\d+$/,ve=/^-?\d+(?:\.\d+)?$/,we=/^(?:true|false)$/i,be=/^undefined$/i,Ee=/^[^A-Z]*$/,ze=/^[^a-z]*$/,ke=o("$ZodCheck",((e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])})),Oe={number:"number",bigint:"bigint",object:"date"},Te=o("$ZodCheckLessThan",((e,t)=>{ke.init(e,t);const n=Oe[typeof t.value];e._zod.onattach.push((e=>{const n=e._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=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ae=o("$ZodCheckGreaterThan",((e,t)=>{ke.init(e,t);const n=Oe[typeof t.value];e._zod.onattach.push((e=>{const n=e._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=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}})),Ie=o("$ZodCheckMultipleOf",((e,t)=>{ke.init(e,t),e._zod.onattach.push((e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)})),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof n.value?n.value%t.value===BigInt(0):0===function(e,t){const n=(e.toString().split(".")[1]||"").length,o=t.toString();let r=(o.split(".")[1]||"").length;if(0===r&&/\d?e-\d?/.test(o)){const e=o.match(/\d?e-(\d?)/);e?.[1]&&(r=Number.parseInt(e[1]))}const i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(".",""))%Number.parseInt(t.toFixed(i).replace(".",""))/10**i}(n.value,t.value))||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}})),xe=o("$ZodCheckNumberFormat",((e,t)=>{ke.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),o=n?"int":"number",[r,i]=A[t.format];e._zod.onattach.push((e=>{const o=e._zod.bag;o.format=t.format,o.minimum=r,o.maximum=i,n&&(o.pattern=_e)})),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});if(!Number.isSafeInteger(a))return void(a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}))}a<r&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),a>i&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}})),Se=o("$ZodCheckMaxLength",((e,t)=>{var n;ke.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!l(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(e._zod.bag.maximum=t.maximum)})),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const r=$(o);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}})),Ne=o("$ZodCheckMinLength",((e,t)=>{var n;ke.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!l(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(e._zod.bag.minimum=t.minimum)})),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const r=$(o);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}})),$e=o("$ZodCheckLengthEquals",((e,t)=>{var n;ke.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!l(t)&&void 0!==t.length}),e._zod.onattach.push((e=>{const n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length})),e._zod.check=n=>{const o=n.value,r=o.length;if(r===t.length)return;const i=$(o),s=r>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}})),Pe=o("$ZodCheckStringFormat",((e,t)=>{var n,o;ke.init(e,t),e._zod.onattach.push((e=>{const n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??(n.patterns=new Set),n.patterns.add(t.pattern))})),t.pattern?(n=e._zod).check??(n.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})}):(o=e._zod).check??(o.check=()=>{})})),De=o("$ZodCheckRegex",((e,t)=>{Pe.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,t.pattern.test(n.value)||n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}})),Ze=o("$ZodCheckLowerCase",((e,t)=>{t.pattern??(t.pattern=Ee),Pe.init(e,t)})),Re=o("$ZodCheckUpperCase",((e,t)=>{t.pattern??(t.pattern=ze),Pe.init(e,t)})),Ce=o("$ZodCheckIncludes",((e,t)=>{ke.init(e,t);const n=k(t.includes),o=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=o,e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(o)})),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})}})),Le=o("$ZodCheckStartsWith",((e,t)=>{ke.init(e,t);const n=new RegExp(`^${k(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}})),Me=o("$ZodCheckEndsWith",((e,t)=>{ke.init(e,t);const n=new RegExp(`.*${k(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)})),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}})),je=o("$ZodCheckOverwrite",((e,t)=>{ke.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}));class Ue{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e)return e(this,{execution:"sync"}),void e(this,{execution:"async"});const t=e.split("\n").filter((e=>e)),n=Math.min(...t.map((e=>e.length-e.trimStart().length))),o=t.map((e=>e.slice(n))).map((e=>" ".repeat(2*this.indent)+e));for(const e of o)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map((e=>` ${e}`))].join("\n"))}}const Fe={major:4,minor:3,patch:6},Be=o("$ZodType",((e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Fe;const o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(const t of o)for(const n of t._zod.onattach)n(e);if(0===o.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push((()=>{e._zod.run=e._zod.parse}));else{const t=(e,t,n)=>{let o,i=I(e);for(const s of t){if(s._zod.def.when){if(!s._zod.def.when(e))continue}else if(i)continue;const t=e.issues.length,a=s._zod.check(e);if(a instanceof Promise&&!1===n?.async)throw new r;if(o||a instanceof Promise)o=(o??Promise.resolve()).then((async()=>{await a;e.issues.length!==t&&(i||(i=I(e,t)))}));else{if(e.issues.length===t)continue;i||(i=I(e,t))}}return o?o.then((()=>e)):e},n=(n,i,s)=>{if(I(n))return n.aborted=!0,n;const a=t(i,o,s);if(a instanceof Promise){if(!1===s.async)throw new r;return a.then((t=>e._zod.parse(t,s)))}return e._zod.parse(a,s)};e._zod.run=(i,s)=>{if(s.skipChecks)return e._zod.parse(i,s);if("backward"===s.direction){const t=e._zod.parse({value:i.value,issues:[]},{...s,skipChecks:!0});return t instanceof Promise?t.then((e=>n(e,i,s))):n(t,i,s)}const a=e._zod.parse(i,s);if(a instanceof Promise){if(!1===s.async)throw new r;return a.then((e=>t(e,o,s)))}return t(a,o,s)}}m(e,"~standard",(()=>({validate:t=>{try{const n=j(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return F(e,t).then((e=>e.success?{value:e.data}:{issues:e.error?.issues}))}},vendor:"zod",version:1})))})),Ve=o("$ZodString",((e,t)=>{var n;Be.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??(n=e._zod.bag,new RegExp(`^${n?`[\\s\\S]{${n?.minimum??0},${n?.maximum??""}}`:"[\\s\\S]*"}$`)),e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=String(n.value)}catch(o){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}})),We=o("$ZodStringFormat",((e,t)=>{Pe.init(e,t),Ve.init(e,t)})),Je=o("$ZodGUID",((e,t)=>{t.pattern??(t.pattern=re),We.init(e,t)})),Ge=o("$ZodUUID",((e,t)=>{if(t.version){const e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=ie(e))}else t.pattern??(t.pattern=ie());We.init(e,t)})),He=o("$ZodEmail",((e,t)=>{t.pattern??(t.pattern=se),We.init(e,t)})),Ye=o("$ZodURL",((e,t)=>{We.init(e,t),e._zod.check=n=>{try{const o=n.value.trim(),r=new URL(o);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(":")?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),void(t.normalize?n.value=r.href:n.value=o)}catch(o){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}})),Ke=o("$ZodEmoji",((e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),We.init(e,t)})),qe=o("$ZodNanoID",((e,t)=>{t.pattern??(t.pattern=ne),We.init(e,t)})),Xe=o("$ZodCUID",((e,t)=>{t.pattern??(t.pattern=q),We.init(e,t)})),Qe=o("$ZodCUID2",((e,t)=>{t.pattern??(t.pattern=X),We.init(e,t)})),et=o("$ZodULID",((e,t)=>{t.pattern??(t.pattern=Q),We.init(e,t)})),tt=o("$ZodXID",((e,t)=>{t.pattern??(t.pattern=ee),We.init(e,t)})),nt=o("$ZodKSUID",((e,t)=>{t.pattern??(t.pattern=te),We.init(e,t)})),ot=o("$ZodISODateTime",((e,t)=>{t.pattern??(t.pattern=function(e){const t=ye({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const o=`${t}(?:${n.join("|")})`;return new RegExp(`^${me}T(?:${o})$`)}(t)),We.init(e,t)})),rt=o("$ZodISODate",((e,t)=>{t.pattern??(t.pattern=he),We.init(e,t)})),it=o("$ZodISOTime",((e,t)=>{t.pattern??(t.pattern=new RegExp(`^${ye(t)}$`)),We.init(e,t)})),st=o("$ZodISODuration",((e,t)=>{t.pattern??(t.pattern=oe),We.init(e,t)})),at=o("$ZodIPv4",((e,t)=>{t.pattern??(t.pattern=ae),We.init(e,t),e._zod.bag.format="ipv4"})),ct=o("$ZodIPv6",((e,t)=>{t.pattern??(t.pattern=ce),We.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}})),dt=o("$ZodCIDRv4",((e,t)=>{t.pattern??(t.pattern=de),We.init(e,t)})),ut=o("$ZodCIDRv6",((e,t)=>{t.pattern??(t.pattern=ue),We.init(e,t),e._zod.check=n=>{const o=n.value.split("/");try{if(2!==o.length)throw new Error;const[e,t]=o;if(!t)throw new Error;const n=Number(t);if(`${n}`!==t)throw new Error;if(n<0||n>128)throw new Error;new URL(`http://[${e}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}}));function lt(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const pt=o("$ZodBase64",((e,t)=>{t.pattern??(t.pattern=le),We.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{lt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}}));const ft=o("$ZodBase64URL",((e,t)=>{t.pattern??(t.pattern=pe),We.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!pe.test(e))return!1;const t=e.replace(/[-_]/g,(e=>"-"===e?"+":"/"));return lt(t.padEnd(4*Math.ceil(t.length/4),"="))})(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}})),mt=o("$ZodE164",((e,t)=>{t.pattern??(t.pattern=fe),We.init(e,t)}));const ht=o("$ZodJWT",((e,t)=>{We.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[o]=n;if(!o)return!1;const r=JSON.parse(atob(o));return!("typ"in r&&"JWT"!==r?.typ||!r.alg||t&&(!("alg"in r)||r.alg!==t))}catch{return!1}})(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}})),yt=o("$ZodNumber",((e,t)=>{Be.init(e,t),e._zod.pattern=e._zod.bag.pattern??ve,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const r=n.value;if("number"==typeof r&&!Number.isNaN(r)&&Number.isFinite(r))return n;const i="number"==typeof r?Number.isNaN(r)?"NaN":Number.isFinite(r)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:r,inst:e,...i?{received:i}:{}}),n}})),gt=o("$ZodNumberFormat",((e,t)=>{xe.init(e,t),yt.init(e,t)})),_t=o("$ZodBoolean",((e,t)=>{Be.init(e,t),e._zod.pattern=we,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const r=n.value;return"boolean"==typeof r||n.issues.push({expected:"boolean",code:"invalid_type",input:r,inst:e}),n}})),vt=o("$ZodBigInt",((e,t)=>{Be.init(e,t),e._zod.pattern=ge,e._zod.parse=(n,o)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch(e){}return"bigint"==typeof n.value||n.issues.push({expected:"bigint",code:"invalid_type",input:n.value,inst:e}),n}})),wt=o("$ZodUndefined",((e,t)=>{Be.init(e,t),e._zod.pattern=be,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,n)=>{const o=t.value;return void 0===o||t.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:e}),t}})),bt=o("$ZodAny",((e,t)=>{Be.init(e,t),e._zod.parse=e=>e})),Et=o("$ZodUnknown",((e,t)=>{Be.init(e,t),e._zod.parse=e=>e})),zt=o("$ZodNever",((e,t)=>{Be.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}));function kt(e,t,n){e.issues.length&&t.issues.push(...x(n,e.issues)),t.value[n]=e.value}const Ot=o("$ZodArray",((e,t)=>{Be.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!Array.isArray(r))return n.issues.push({expected:"array",code:"invalid_type",input:r,inst:e}),n;n.value=Array(r.length);const i=[];for(let e=0;e<r.length;e++){const s=r[e],a=t.element._zod.run({value:s,issues:[]},o);a instanceof Promise?i.push(a.then((t=>kt(t,n,e)))):kt(a,n,e)}return i.length?Promise.all(i).then((()=>n)):n}}));function Tt(e,t,n,o,r){if(e.issues.length){if(r&&!(n in o))return;t.issues.push(...x(n,e.issues))}void 0===e.value?n in o&&(t.value[n]=void 0):t.value[n]=e.value}function At(e){const t=Object.keys(e.shape);for(const n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);const n=(o=e.shape,Object.keys(o).filter((e=>"optional"===o[e]._zod.optin&&"optional"===o[e]._zod.optout)));var o;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function It(e,t,n,o,r,i){const s=[],a=r.keySet,c=r.catchall._zod,d=c.def.type,u="optional"===c.optout;for(const r in t){if(a.has(r))continue;if("never"===d){s.push(r);continue}const i=c.run({value:t[r],issues:[]},o);i instanceof Promise?e.push(i.then((e=>Tt(e,n,r,t,u)))):Tt(i,n,r,t,u)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then((()=>n)):n}const xt=o("$ZodObject",((e,t)=>{Be.init(e,t);const n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){const e=t.shape;Object.defineProperty(t,"shape",{get:()=>{const n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}const o=u((()=>At(t)));m(e._zod,"propValues",(()=>{const e=t.shape,n={};for(const t in e){const o=e[t]._zod;if(o.values){n[t]??(n[t]=new Set);for(const e of o.values)n[t].add(e)}}return n}));const r=v,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=o.value);const a=t.value;if(!r(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const c=[],d=s.shape;for(const e of s.keys){const o=d[e],r="optional"===o._zod.optout,i=o._zod.run({value:a[e],issues:[]},n);i instanceof Promise?c.push(i.then((n=>Tt(n,t,e,a,r)))):Tt(i,t,e,a,r)}return i?It(c,a,t,n,o.value,e):c.length?Promise.all(c).then((()=>t)):t}})),St=o("$ZodObjectJIT",((e,t)=>{xt.init(e,t);const n=e._zod.parse,o=u((()=>At(t)));let r;const i=v,a=!s.jitless,c=a&&w.value,d=t.catchall;let l;e._zod.parse=(s,u)=>{l??(l=o.value);const p=s.value;return i(p)?a&&c&&!1===u?.async&&!0!==u.jitless?(r||(r=(e=>{const t=new Ue(["shape","payload","ctx"]),n=o.value,r=e=>{const t=g(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const i=Object.create(null);let s=0;for(const e of n.keys)i[e]="key_"+s++;t.write("const newResult = {};");for(const o of n.keys){const n=i[o],s=g(o),a=e[o],c="optional"===a?._zod?.optout;t.write(`const ${n} = ${r(o)};`),c?t.write(`\n if (${n}.issues.length) {\n if (${s} in input) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n }\n \n if (${n}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${n}.value;\n }\n \n `):t.write(`\n if (${n}.issues.length) {\n payload.issues = payload.issues.concat(${n}.issues.map(iss => ({\n ...iss,\n path: iss.path ? [${s}, ...iss.path] : [${s}]\n })));\n }\n \n if (${n}.value === undefined) {\n if (${s} in input) {\n newResult[${s}] = undefined;\n }\n } else {\n newResult[${s}] = ${n}.value;\n }\n \n `)}t.write("payload.value = newResult;"),t.write("return payload;");const a=t.compile();return(t,n)=>a(e,t,n)})(t.shape)),s=r(s,u),d?It([],p,s,u,l,e):s):n(s,u):(s.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),s)}}));function Nt(e,t,n,o){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const r=e.filter((e=>!I(e)));return 1===r.length?(t.value=r[0].value,r[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map((e=>e.issues.map((e=>N(e,o,a())))))}),t)}const $t=o("$ZodUnion",((e,t)=>{Be.init(e,t),m(e._zod,"optin",(()=>t.options.some((e=>"optional"===e._zod.optin))?"optional":void 0)),m(e._zod,"optout",(()=>t.options.some((e=>"optional"===e._zod.optout))?"optional":void 0)),m(e._zod,"values",(()=>{if(t.options.every((e=>e._zod.values)))return new Set(t.options.flatMap((e=>Array.from(e._zod.values))))})),m(e._zod,"pattern",(()=>{if(t.options.every((e=>e._zod.pattern))){const e=t.options.map((e=>e._zod.pattern));return new RegExp(`^(${e.map((e=>p(e.source))).join("|")})$`)}}));const n=1===t.options.length,o=t.options[0]._zod.run;e._zod.parse=(r,i)=>{if(n)return o(r,i);let s=!1;const a=[];for(const e of t.options){const t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then((t=>Nt(t,r,e,i))):Nt(a,r,e,i)}})),Pt=o("$ZodDiscriminatedUnion",((e,t)=>{t.inclusive=!1,$t.init(e,t);const n=e._zod.parse;m(e._zod,"propValues",(()=>{const e={};for(const n of t.options){const o=n._zod.propValues;if(!o||0===Object.keys(o).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(o)){e[t]||(e[t]=new Set);for(const o of n)e[t].add(o)}}return e}));const o=u((()=>{const e=t.options,n=new Map;for(const o of e){const e=o._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,o)}}return n}));e._zod.parse=(r,i)=>{const s=r.value;if(!v(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;const a=o.value.get(s?.[t.discriminator]);return a?a._zod.run(r,i):t.unionFallback?n(r,i):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),r)}})),Dt=o("$ZodIntersection",((e,t)=>{Be.init(e,t),e._zod.parse=(e,n)=>{const o=e.value,r=t.left._zod.run({value:o,issues:[]},n),i=t.right._zod.run({value:o,issues:[]},n);return r instanceof Promise||i instanceof Promise?Promise.all([r,i]).then((([t,n])=>Rt(e,t,n))):Rt(e,r,i)}}));function Zt(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(b(e)&&b(t)){const n=Object.keys(t),o=Object.keys(e).filter((e=>-1!==n.indexOf(e))),r={...e,...t};for(const n of o){const o=Zt(e[n],t[n]);if(!o.valid)return{valid:!1,mergeErrorPath:[n,...o.mergeErrorPath]};r[n]=o.data}return{valid:!0,data:r}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let o=0;o<e.length;o++){const r=Zt(e[o],t[o]);if(!r.valid)return{valid:!1,mergeErrorPath:[o,...r.mergeErrorPath]};n.push(r.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Rt(e,t,n){const o=new Map;let r;for(const n of t.issues)if("unrecognized_keys"===n.code){r??(r=n);for(const e of n.keys)o.has(e)||o.set(e,{}),o.get(e).l=!0}else e.issues.push(n);for(const t of n.issues)if("unrecognized_keys"===t.code)for(const e of t.keys)o.has(e)||o.set(e,{}),o.get(e).r=!0;else e.issues.push(t);const i=[...o].filter((([,e])=>e.l&&e.r)).map((([e])=>e));if(i.length&&r&&e.issues.push({...r,keys:i}),I(e))return e;const s=Zt(t.value,n.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Ct=o("$ZodRecord",((e,t)=>{Be.init(e,t),e._zod.parse=(n,o)=>{const r=n.value;if(!b(r))return n.issues.push({expected:"record",code:"invalid_type",input:r,inst:e}),n;const i=[],s=t.keyType._zod.values;if(s){n.value={};const a=new Set;for(const e of s)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){a.add("number"==typeof e?e.toString():e);const s=t.valueType._zod.run({value:r[e],issues:[]},o);s instanceof Promise?i.push(s.then((t=>{t.issues.length&&n.issues.push(...x(e,t.issues)),n.value[e]=t.value}))):(s.issues.length&&n.issues.push(...x(e,s.issues)),n.value[e]=s.value)}let c;for(const e in r)a.has(e)||(c=c??[],c.push(e));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:r,inst:e,keys:c})}else{n.value={};for(const s of Reflect.ownKeys(r)){if("__proto__"===s)continue;let c=t.keyType._zod.run({value:s,issues:[]},o);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if("string"==typeof s&&ve.test(s)&&c.issues.length){const e=t.keyType._zod.run({value:Number(s),issues:[]},o);if(e instanceof Promise)throw new Error("Async schemas not supported in object keys currently");0===e.issues.length&&(c=e)}if(c.issues.length){"loose"===t.mode?n.value[s]=r[s]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map((e=>N(e,o,a()))),input:s,path:[s],inst:e});continue}const d=t.valueType._zod.run({value:r[s],issues:[]},o);d instanceof Promise?i.push(d.then((e=>{e.issues.length&&n.issues.push(...x(s,e.issues)),n.value[c.value]=e.value}))):(d.issues.length&&n.issues.push(...x(s,d.issues)),n.value[c.value]=d.value)}}return i.length?Promise.all(i).then((()=>n)):n}})),Lt=o("$ZodEnum",((e,t)=>{Be.init(e,t);const n=c(t.entries),o=new Set(n);e._zod.values=o,e._zod.pattern=new RegExp(`^(${n.filter((e=>z.has(typeof e))).map((e=>"string"==typeof e?k(e):e.toString())).join("|")})$`),e._zod.parse=(t,r)=>{const i=t.value;return o.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}})),Mt=o("$ZodLiteral",((e,t)=>{if(Be.init(e,t),0===t.values.length)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map((e=>"string"==typeof e?k(e):e?k(e.toString()):String(e))).join("|")})$`),e._zod.parse=(o,r)=>{const i=o.value;return n.has(i)||o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}})),jt=o("$ZodTransform",((e,t)=>{Be.init(e,t),e._zod.parse=(n,o)=>{if("backward"===o.direction)throw new i(e.constructor.name);const s=t.transform(n.value,n);if(o.async){return(s instanceof Promise?s:Promise.resolve(s)).then((e=>(n.value=e,n)))}if(s instanceof Promise)throw new r;return n.value=s,n}}));function Ut(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}const Ft=o("$ZodOptional",((e,t)=>{Be.init(e,t),e._zod.optin="optional",e._zod.optout="optional",m(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0)),m(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${p(e.source)})?$`):void 0})),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then((t=>Ut(t,e.value))):Ut(o,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,n)}})),Bt=o("$ZodExactOptional",((e,t)=>{Ft.init(e,t),m(e._zod,"values",(()=>t.innerType._zod.values)),m(e._zod,"pattern",(()=>t.innerType._zod.pattern)),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)})),Vt=o("$ZodNullable",((e,t)=>{Be.init(e,t),m(e._zod,"optin",(()=>t.innerType._zod.optin)),m(e._zod,"optout",(()=>t.innerType._zod.optout)),m(e._zod,"pattern",(()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${p(e.source)}|null)$`):void 0})),m(e._zod,"values",(()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0)),e._zod.parse=(e,n)=>null===e.value?e:t.innerType._zod.run(e,n)})),Wt=o("$ZodDefault",((e,t)=>{Be.init(e,t),e._zod.optin="optional",m(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);if(void 0===e.value)return e.value=t.defaultValue,e;const o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then((e=>Jt(e,t))):Jt(o,t)}}));function Jt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Gt=o("$ZodPrefault",((e,t)=>{Be.init(e,t),e._zod.optin="optional",m(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>("backward"===n.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))})),Ht=o("$ZodNonOptional",((e,t)=>{Be.init(e,t),m(e._zod,"values",(()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter((e=>void 0!==e))):void 0})),e._zod.parse=(n,o)=>{const r=t.innerType._zod.run(n,o);return r instanceof Promise?r.then((t=>Yt(t,e))):Yt(r,e)}}));function Yt(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Kt=o("$ZodCatch",((e,t)=>{Be.init(e,t),m(e._zod,"optin",(()=>t.innerType._zod.optin)),m(e._zod,"optout",(()=>t.innerType._zod.optout)),m(e._zod,"values",(()=>t.innerType._zod.values)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then((o=>(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map((e=>N(e,n,a())))},input:e.value}),e.issues=[]),e))):(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map((e=>N(e,n,a())))},input:e.value}),e.issues=[]),e)}})),qt=o("$ZodPipe",((e,t)=>{Be.init(e,t),m(e._zod,"values",(()=>t.in._zod.values)),m(e._zod,"optin",(()=>t.in._zod.optin)),m(e._zod,"optout",(()=>t.out._zod.optout)),m(e._zod,"propValues",(()=>t.in._zod.propValues)),e._zod.parse=(e,n)=>{if("backward"===n.direction){const o=t.out._zod.run(e,n);return o instanceof Promise?o.then((e=>Xt(e,t.in,n))):Xt(o,t.in,n)}const o=t.in._zod.run(e,n);return o instanceof Promise?o.then((e=>Xt(e,t.out,n))):Xt(o,t.out,n)}}));function Xt(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const Qt=o("$ZodReadonly",((e,t)=>{Be.init(e,t),m(e._zod,"propValues",(()=>t.innerType._zod.propValues)),m(e._zod,"values",(()=>t.innerType._zod.values)),m(e._zod,"optin",(()=>t.innerType?._zod?.optin)),m(e._zod,"optout",(()=>t.innerType?._zod?.optout)),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then(en):en(o)}}));function en(e){return e.value=Object.freeze(e.value),e}const tn=o("$ZodCustom",((e,t)=>{ke.init(e,t),Be.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const o=n.value,r=t.fn(o);if(r instanceof Promise)return r.then((t=>nn(t,n,o,e)));nn(r,n,o,e)}}));function nn(e,t,n,o){if(!e){const e={code:"custom",input:n,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(e.params=o._zod.def.params),t.issues.push(P(e))}}var on;class rn{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){const n=t[0];return this._map.set(e,n),n&&"object"==typeof n&&"id"in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){const t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){const t=e._zod.parent;if(t){const n={...this.get(t)??{}};delete n.id;const o={...n,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(on=globalThis).__zod_globalRegistry??(on.__zod_globalRegistry=new rn);const sn=globalThis.__zod_globalRegistry;function an(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...T(t)})}function cn(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...T(t)})}function dn(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...T(t)})}function un(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...T(t)})}function ln(e,t){return new Te({check:"less_than",...T(t),value:e,inclusive:!1})}function pn(e,t){return new Te({check:"less_than",...T(t),value:e,inclusive:!0})}function fn(e,t){return new Ae({check:"greater_than",...T(t),value:e,inclusive:!1})}function mn(e,t){return new Ae({check:"greater_than",...T(t),value:e,inclusive:!0})}function hn(e,t){return new Ie({check:"multiple_of",...T(t),value:e})}function yn(e,t){return new Se({check:"max_length",...T(t),maximum:e})}function gn(e,t){return new Ne({check:"min_length",...T(t),minimum:e})}function _n(e,t){return new $e({check:"length_equals",...T(t),length:e})}function vn(e){return new je({check:"overwrite",tx:e})}function wn(e){const t=function(e,t){const n=new ke({check:"custom",...T(t)});return n._zod.check=e,n}((n=>(n.addIssue=e=>{if("string"==typeof e)n.issues.push(P(e,n.value,t._zod.def));else{const o=e;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(P(o))}},e(n.value,n))));return t}function bn(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??sn,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function En(e,t,n={path:[],schemaPath:[]}){var o;const r=e._zod.def,i=t.seen.get(e);if(i){i.count++;return n.schemaPath.includes(e)&&(i.cycle=n.path),i.schema}const s={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,s);const a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{const o={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,o);else{const n=s.schema,i=t.processors[r.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);i(e,t,n,o)}const i=e._zod.parent;i&&(s.ref||(s.ref=i),En(i,t,o),t.seen.get(i).isParent=!0)}const c=t.metadataRegistry.get(e);c&&Object.assign(s.schema,c),"input"===t.io&&On(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&s.schema._prefault&&((o=s.schema).default??(o.default=s.schema._prefault)),delete s.schema._prefault;return t.seen.get(e).schema}function zn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=o.get(n);if(e&&e!==t[0])throw new Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(n,t[0])}}const r=t=>{if(t[1].schema.$ref)return;const o=t[1],{ref:r,defId:i}=(t=>{const o="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,r=e.external.uri??(e=>e);if(n)return{ref:r(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${r("__shared")}#/${o}/${i}`}}if(t[1]===n)return{ref:"#"};const r=`#/${o}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:r+i}})(t);o.def={...o.schema},i&&(o.defId=i);const s=o.schema;for(const e in s)delete s[e];s.$ref=r};if("throw"===e.cycles)for(const t of e.seen.entries()){const e=t[1];if(e.cycle)throw new Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>\n\nSet the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const n of e.seen.entries()){const o=n[1];if(t===n[0]){r(n);continue}if(e.external){const o=e.external.registry.get(n[0])?.id;if(t!==n[0]&&o){r(n);continue}}const i=e.metadataRegistry.get(n[0])?.id;i?r(n):(o.cycle||o.count>1&&"ref"===e.reused)&&r(n)}}function kn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const o=t=>{const n=e.seen.get(t);if(null===n.ref)return;const r=n.def??n.schema,i={...r},s=n.ref;if(n.ref=null,s){o(s);const n=e.seen.get(s),a=n.schema;!a.$ref||"draft-07"!==e.target&&"draft-04"!==e.target&&"openapi-3.0"!==e.target?Object.assign(r,a):(r.allOf=r.allOf??[],r.allOf.push(a)),Object.assign(r,i);if(t._zod.parent===s)for(const e in r)"$ref"!==e&&"allOf"!==e&&(e in i||delete r[e]);if(a.$ref&&n.def)for(const e in r)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(r[e])===JSON.stringify(n.def[e])&&delete r[e]}const a=t._zod.parent;if(a&&a!==s){o(a);const t=e.seen.get(a);if(t?.schema.$ref&&(r.$ref=t.schema.$ref,t.def))for(const e in r)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(r[e])===JSON.stringify(t.def[e])&&delete r[e]}e.override({zodSchema:t,jsonSchema:r,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())o(t[0]);const r={};if("draft-2020-12"===e.target?r.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?r.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?r.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const n=e.external.registry.get(t)?.id;if(!n)throw new Error("Schema is missing an `id` property");r.$id=e.external.uri(n)}Object.assign(r,n.def??n.schema);const i=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(i[e.defId]=e.def)}e.external||Object.keys(i).length>0&&("draft-2020-12"===e.target?r.$defs=i:r.definitions=i);try{const n=JSON.parse(JSON.stringify(r));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Tn(t,"input",e.processors),output:Tn(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function On(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const o=e._zod.def;if("transform"===o.type)return!0;if("array"===o.type)return On(o.element,n);if("set"===o.type)return On(o.valueType,n);if("lazy"===o.type)return On(o.getter(),n);if("promise"===o.type||"optional"===o.type||"nonoptional"===o.type||"nullable"===o.type||"readonly"===o.type||"default"===o.type||"prefault"===o.type)return On(o.innerType,n);if("intersection"===o.type)return On(o.left,n)||On(o.right,n);if("record"===o.type||"map"===o.type)return On(o.keyType,n)||On(o.valueType,n);if("pipe"===o.type)return On(o.in,n)||On(o.out,n);if("object"===o.type){for(const e in o.shape)if(On(o.shape[e],n))return!0;return!1}if("union"===o.type){for(const e of o.options)if(On(e,n))return!0;return!1}if("tuple"===o.type){for(const e of o.items)if(On(e,n))return!0;return!(!o.rest||!On(o.rest,n))}return!1}const Tn=(e,t,n={})=>o=>{const{libraryOptions:r,target:i}=o??{},s=bn({...r??{},target:i,io:t,processors:n});return En(e,s),zn(s,e),kn(s,e)},An={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},In=(e,t,n,o)=>{const r=e._zod.def;En(r.innerType,t,o);t.seen.get(e).ref=r.innerType},xn=o("ZodISODateTime",((e,t)=>{ot.init(e,t),no.init(e,t)}));function Sn(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...T(t)})}(xn,e)}const Nn=o("ZodISODate",((e,t)=>{rt.init(e,t),no.init(e,t)}));function $n(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...T(t)})}(Nn,e)}const Pn=o("ZodISOTime",((e,t)=>{it.init(e,t),no.init(e,t)}));function Dn(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...T(t)})}(Pn,e)}const Zn=o("ZodISODuration",((e,t)=>{st.init(e,t),no.init(e,t)}));function Rn(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...T(t)})}(Zn,e)}const Cn=(e,t)=>{Z.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},o=e=>{for(const r of e.issues)if("invalid_union"===r.code&&r.errors.length)r.errors.map((e=>o({issues:e})));else if("invalid_key"===r.code)o({issues:r.issues});else if("invalid_element"===r.code)o({issues:r.issues});else if(0===r.path.length)n._errors.push(t(r));else{let e=n,o=0;for(;o<r.path.length;){const n=r.path[o];o===r.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(r))):e[n]=e[n]||{_errors:[]},e=e[n],o++}}};return o(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},o=[];for(const r of e.issues)r.path.length>0?(n[r.path[0]]=n[r.path[0]]||[],n[r.path[0]].push(t(r))):o.push(t(r));return{formErrors:o,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,d,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,d,2)}},isEmpty:{get:()=>0===e.issues.length}})},Ln=o("ZodError",Cn),Mn=o("ZodError",Cn,{Parent:Error}),jn=C(Mn),Un=L(Mn),Fn=M(Mn),Bn=U(Mn),Vn=B(Mn),Wn=V(Mn),Jn=W(Mn),Gn=J(Mn),Hn=G(Mn),Yn=H(Mn),Kn=Y(Mn),qn=K(Mn),Xn=o("ZodType",((e,t)=>(Be.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Tn(e,"input"),output:Tn(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const o=bn({...n,processors:t});return En(e,o),zn(o,e),kn(o,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(y(t,{checks:[...t.checks??[],...n.map((e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e))]}),{parent:!0}),e.with=e.check,e.clone=(t,n)=>O(e,t,n),e.brand=()=>e,e.register=(t,n)=>(t.add(e,n),e),e.parse=(t,n)=>jn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Fn(e,t,n),e.parseAsync=async(t,n)=>Un(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Bn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Vn(e,t,n),e.decode=(t,n)=>Wn(e,t,n),e.encodeAsync=async(t,n)=>Jn(e,t,n),e.decodeAsync=async(t,n)=>Gn(e,t,n),e.safeEncode=(t,n)=>Hn(e,t,n),e.safeDecode=(t,n)=>Yn(e,t,n),e.safeEncodeAsync=async(t,n)=>Kn(e,t,n),e.safeDecodeAsync=async(t,n)=>qn(e,t,n),e.refine=(t,n)=>e.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...T(n)})}(mr,e,t)}(t,n)),e.superRefine=t=>e.check(wn(t)),e.overwrite=t=>e.check(vn(t)),e.optional=()=>or(e),e.exactOptional=()=>new rr({type:"optional",innerType:e}),e.nullable=()=>sr(e),e.nullish=()=>or(sr(e)),e.nonoptional=t=>function(e,t){return new dr({type:"nonoptional",innerType:e,...T(t)})}(e,t),e.array=()=>jo(e),e.or=t=>Vo([e,t]),e.and=t=>new Go({type:"intersection",left:e,right:t}),e.transform=t=>pr(e,tr(t)),e.default=t=>{return n=t,new ar({type:"default",innerType:e,get defaultValue(){return"function"==typeof n?n():E(n)}});var n},e.prefault=t=>{return n=t,new cr({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof n?n():E(n)}});var n},e.catch=t=>{return new ur({type:"catch",innerType:e,catchValue:"function"==typeof(n=t)?n:()=>n});var n},e.pipe=t=>pr(e,t),e.readonly=()=>new fr({type:"readonly",innerType:e}),e.describe=t=>{const n=e.clone();return sn.add(n,{description:t}),n},Object.defineProperty(e,"description",{get:()=>sn.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return sn.get(e);const n=e.clone();return sn.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e))),Qn=o("_ZodString",((e,t)=>{Ve.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n)=>{const o=n;o.type="string";const{minimum:r,maximum:i,format:s,patterns:a,contentEncoding:c}=e._zod.bag;if("number"==typeof r&&(o.minLength=r),"number"==typeof i&&(o.maxLength=i),s&&(o.format=An[s]??s,""===o.format&&delete o.format,"time"===s&&delete o.format),c&&(o.contentEncoding=c),a&&a.size>0){const e=[...a];1===e.length?o.pattern=e[0].source:e.length>1&&(o.allOf=[...e.map((e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source})))])}})(e,t,n);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(function(e,t){return new De({check:"string_format",format:"regex",...T(t),pattern:e})}(...t)),e.includes=(...t)=>e.check(function(e,t){return new Ce({check:"string_format",format:"includes",...T(t),includes:e})}(...t)),e.startsWith=(...t)=>e.check(function(e,t){return new Le({check:"string_format",format:"starts_with",...T(t),prefix:e})}(...t)),e.endsWith=(...t)=>e.check(function(e,t){return new Me({check:"string_format",format:"ends_with",...T(t),suffix:e})}(...t)),e.min=(...t)=>e.check(gn(...t)),e.max=(...t)=>e.check(yn(...t)),e.length=(...t)=>e.check(_n(...t)),e.nonempty=(...t)=>e.check(gn(1,...t)),e.lowercase=t=>e.check(function(e){return new Ze({check:"string_format",format:"lowercase",...T(e)})}(t)),e.uppercase=t=>e.check(function(e){return new Re({check:"string_format",format:"uppercase",...T(e)})}(t)),e.trim=()=>e.check(vn((e=>e.trim()))),e.normalize=(...t)=>e.check(function(e){return vn((t=>t.normalize(e)))}(...t)),e.toLowerCase=()=>e.check(vn((e=>e.toLowerCase()))),e.toUpperCase=()=>e.check(vn((e=>e.toUpperCase()))),e.slugify=()=>e.check(vn((e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e))))})),eo=o("ZodString",((e,t)=>{Ve.init(e,t),Qn.init(e,t),e.email=t=>e.check(function(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...T(t)})}(oo,t)),e.url=t=>e.check(cn(so,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...T(t)})}(zo,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...T(t)})}(co,t)),e.guid=t=>e.check(an(ro,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...T(t)})}(io,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...T(t)})}(io,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...T(t)})}(io,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...T(t)})}(io,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...T(t)})}(uo,t)),e.guid=t=>e.check(an(ro,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...T(t)})}(lo,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...T(t)})}(po,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...T(t)})}(fo,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...T(t)})}(wo,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...T(t)})}(bo,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...T(t)})}(mo,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...T(t)})}(ho,t)),e.ipv4=t=>e.check(dn(yo,t)),e.ipv6=t=>e.check(un(go,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...T(t)})}(_o,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...T(t)})}(vo,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...T(t)})}(Eo,t)),e.datetime=t=>e.check(Sn(t)),e.date=t=>e.check($n(t)),e.time=t=>e.check(Dn(t)),e.duration=t=>e.check(Rn(t))}));function to(e){return function(e,t){return new e({type:"string",...T(t)})}(eo,e)}const no=o("ZodStringFormat",((e,t)=>{We.init(e,t),Qn.init(e,t)})),oo=o("ZodEmail",((e,t)=>{He.init(e,t),no.init(e,t)})),ro=o("ZodGUID",((e,t)=>{Je.init(e,t),no.init(e,t)})),io=o("ZodUUID",((e,t)=>{Ge.init(e,t),no.init(e,t)})),so=o("ZodURL",((e,t)=>{Ye.init(e,t),no.init(e,t)}));function ao(e){return cn(so,e)}const co=o("ZodEmoji",((e,t)=>{Ke.init(e,t),no.init(e,t)})),uo=o("ZodNanoID",((e,t)=>{qe.init(e,t),no.init(e,t)})),lo=o("ZodCUID",((e,t)=>{Xe.init(e,t),no.init(e,t)})),po=o("ZodCUID2",((e,t)=>{Qe.init(e,t),no.init(e,t)})),fo=o("ZodULID",((e,t)=>{et.init(e,t),no.init(e,t)})),mo=o("ZodXID",((e,t)=>{tt.init(e,t),no.init(e,t)})),ho=o("ZodKSUID",((e,t)=>{nt.init(e,t),no.init(e,t)})),yo=o("ZodIPv4",((e,t)=>{at.init(e,t),no.init(e,t)}));const go=o("ZodIPv6",((e,t)=>{ct.init(e,t),no.init(e,t)}));const _o=o("ZodCIDRv4",((e,t)=>{dt.init(e,t),no.init(e,t)})),vo=o("ZodCIDRv6",((e,t)=>{ut.init(e,t),no.init(e,t)})),wo=o("ZodBase64",((e,t)=>{pt.init(e,t),no.init(e,t)})),bo=o("ZodBase64URL",((e,t)=>{ft.init(e,t),no.init(e,t)})),Eo=o("ZodE164",((e,t)=>{mt.init(e,t),no.init(e,t)})),zo=o("ZodJWT",((e,t)=>{ht.init(e,t),no.init(e,t)})),ko=o("ZodNumber",((e,t)=>{yt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n)=>{const o=n,{minimum:r,maximum:i,format:s,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:d}=e._zod.bag;"string"==typeof s&&s.includes("int")?o.type="integer":o.type="number","number"==typeof d&&("draft-04"===t.target||"openapi-3.0"===t.target?(o.minimum=d,o.exclusiveMinimum=!0):o.exclusiveMinimum=d),"number"==typeof r&&(o.minimum=r,"number"==typeof d&&"draft-04"!==t.target&&(d>=r?delete o.minimum:delete o.exclusiveMinimum)),"number"==typeof c&&("draft-04"===t.target||"openapi-3.0"===t.target?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),"number"==typeof i&&(o.maximum=i,"number"==typeof c&&"draft-04"!==t.target&&(c<=i?delete o.maximum:delete o.exclusiveMaximum)),"number"==typeof a&&(o.multipleOf=a)})(e,t,n),e.gt=(t,n)=>e.check(fn(t,n)),e.gte=(t,n)=>e.check(mn(t,n)),e.min=(t,n)=>e.check(mn(t,n)),e.lt=(t,n)=>e.check(ln(t,n)),e.lte=(t,n)=>e.check(pn(t,n)),e.max=(t,n)=>e.check(pn(t,n)),e.int=t=>e.check(Ao(t)),e.safe=t=>e.check(Ao(t)),e.positive=t=>e.check(fn(0,t)),e.nonnegative=t=>e.check(mn(0,t)),e.negative=t=>e.check(ln(0,t)),e.nonpositive=t=>e.check(pn(0,t)),e.multipleOf=(t,n)=>e.check(hn(t,n)),e.step=(t,n)=>e.check(hn(t,n)),e.finite=()=>e;const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null}));function Oo(e){return function(e,t){return new e({type:"number",checks:[],...T(t)})}(ko,e)}const To=o("ZodNumberFormat",((e,t)=>{gt.init(e,t),ko.init(e,t)}));function Ao(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...T(t)})}(To,e)}const Io=o("ZodBoolean",((e,t)=>{_t.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)}));function xo(e){return function(e,t){return new e({type:"boolean",...T(t)})}(Io,e)}const So=o("ZodBigInt",((e,t)=>{vt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("BigInt cannot be represented in JSON Schema")})(0,e),e.gte=(t,n)=>e.check(mn(t,n)),e.min=(t,n)=>e.check(mn(t,n)),e.gt=(t,n)=>e.check(fn(t,n)),e.gte=(t,n)=>e.check(mn(t,n)),e.min=(t,n)=>e.check(mn(t,n)),e.lt=(t,n)=>e.check(ln(t,n)),e.lte=(t,n)=>e.check(pn(t,n)),e.max=(t,n)=>e.check(pn(t,n)),e.positive=t=>e.check(fn(BigInt(0),t)),e.negative=t=>e.check(ln(BigInt(0),t)),e.nonpositive=t=>e.check(pn(BigInt(0),t)),e.nonnegative=t=>e.check(mn(BigInt(0),t)),e.multipleOf=(t,n)=>e.check(hn(t,n));const n=e._zod.bag;e.minValue=n.minimum??null,e.maxValue=n.maximum??null,e.format=n.format??null}));function No(e){return function(e,t){return new e({type:"bigint",...T(t)})}(So,e)}const $o=o("ZodUndefined",((e,t)=>{wt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Undefined cannot be represented in JSON Schema")})(0,e)}));const Po=o("ZodAny",((e,t)=>{bt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}));function Do(){return new Po({type:"any"})}const Zo=o("ZodUnknown",((e,t)=>{Et.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}}));function Ro(){return new Zo({type:"unknown"})}const Co=o("ZodNever",((e,t)=>{zt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)}));function Lo(e){return function(e,t){return new e({type:"never",...T(t)})}(Co,e)}const Mo=o("ZodArray",((e,t)=>{Ot.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(r.minItems=s),"number"==typeof a&&(r.maxItems=a),r.type="array",r.items=En(i.element,t,{...o,path:[...o.path,"items"]})})(e,t,n,o),e.element=t.element,e.min=(t,n)=>e.check(gn(t,n)),e.nonempty=t=>e.check(gn(1,t)),e.max=(t,n)=>e.check(yn(t,n)),e.length=(t,n)=>e.check(_n(t,n)),e.unwrap=()=>e.element}));function jo(e,t){return function(e,t,n){return new e({type:"array",element:t,...T(n)})}(Mo,e,t)}const Uo=o("ZodObject",((e,t)=>{St.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=n,i=e._zod.def;r.type="object",r.properties={};const s=i.shape;for(const e in s)r.properties[e]=En(s[e],t,{...o,path:[...o.path,"properties",e]});const a=new Set(Object.keys(s)),c=new Set([...a].filter((e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout})));c.size>0&&(r.required=Array.from(c)),"never"===i.catchall?._zod.def.type?r.additionalProperties=!1:i.catchall?i.catchall&&(r.additionalProperties=En(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,n,o),m(e,"shape",(()=>t.shape)),e.keyof=()=>qo(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Ro()}),e.loose=()=>e.clone({...e._zod.def,catchall:Ro()}),e.strict=()=>e.clone({...e._zod.def,catchall:Lo()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>function(e,t){if(!b(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const n=e._zod.def.shape;for(const e in t)if(void 0!==Object.getOwnPropertyDescriptor(n,e))throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=y(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return h(this,"shape",n),n}});return O(e,o)}(e,t),e.safeExtend=t=>function(e,t){if(!b(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=y(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return h(this,"shape",n),n}});return O(e,n)}(e,t),e.merge=t=>function(e,t){const n=y(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return h(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return O(e,n)}(e,t),e.pick=t=>function(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return O(e,y(e._zod.def,{get shape(){const e={};for(const o in t){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(e[o]=n.shape[o])}return h(this,"shape",e),e},checks:[]}))}(e,t),e.omit=t=>function(e,t){const n=e._zod.def,o=n.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=y(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete o[e]}return h(this,"shape",o),o},checks:[]});return O(e,r)}(e,t),e.partial=(...t)=>function(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=y(t._zod.def,{get shape(){const o=t._zod.def.shape,r={...o};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=e?new e({type:"optional",innerType:o[t]}):o[t])}else for(const t in o)r[t]=e?new e({type:"optional",innerType:o[t]}):o[t];return h(this,"shape",r),r},checks:[]});return O(t,r)}(nr,e,t[0]),e.required=(...t)=>function(e,t,n){const o=y(t._zod.def,{get shape(){const o=t._zod.def.shape,r={...o};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=new e({type:"nonoptional",innerType:o[t]}))}else for(const t in o)r[t]=new e({type:"nonoptional",innerType:o[t]});return h(this,"shape",r),r}});return O(t,o)}(dr,e,t[0])}));function Fo(e,t){const n={type:"object",shape:e??{},...T(t)};return new Uo(n)}const Bo=o("ZodUnion",((e,t)=>{$t.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def,i=!1===r.inclusive,s=r.options.map(((e,n)=>En(e,t,{...o,path:[...o.path,i?"oneOf":"anyOf",n]})));i?n.oneOf=s:n.anyOf=s})(e,t,n,o),e.options=t.options}));function Vo(e,t){return new Bo({type:"union",options:e,...T(t)})}const Wo=o("ZodDiscriminatedUnion",((e,t)=>{Bo.init(e,t),Pt.init(e,t)}));function Jo(e,t,n){return new Wo({type:"union",options:t,discriminator:e,...T(n)})}const Go=o("ZodIntersection",((e,t)=>{Dt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def,i=En(r.left,t,{...o,path:[...o.path,"allOf",0]}),s=En(r.right,t,{...o,path:[...o.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=c})(e,t,n,o)}));const Ho=o("ZodRecord",((e,t)=>{Ct.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=n,i=e._zod.def;r.type="object";const s=i.keyType,a=s._zod.bag,c=a?.patterns;if("loose"===i.mode&&c&&c.size>0){const e=En(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});r.patternProperties={};for(const t of c)r.patternProperties[t.source]=e}else"draft-07"!==t.target&&"draft-2020-12"!==t.target||(r.propertyNames=En(i.keyType,t,{...o,path:[...o.path,"propertyNames"]})),r.additionalProperties=En(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]});const d=s._zod.values;if(d){const e=[...d].filter((e=>"string"==typeof e||"number"==typeof e));e.length>0&&(r.required=e)}})(e,t,n,o),e.keyType=t.keyType,e.valueType=t.valueType}));function Yo(e,t,n){return new Ho({type:"record",keyType:e,valueType:t,...T(n)})}const Ko=o("ZodEnum",((e,t)=>{Lt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n)=>{const o=c(e._zod.def.entries);o.every((e=>"number"==typeof e))&&(n.type="number"),o.every((e=>"string"==typeof e))&&(n.type="string"),n.enum=o})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,o)=>{const r={};for(const o of e){if(!n.has(o))throw new Error(`Key ${o} not found in enum`);r[o]=t.entries[o]}return new Ko({...t,checks:[],...T(o),entries:r})},e.exclude=(e,o)=>{const r={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete r[t]}return new Ko({...t,checks:[],...T(o),entries:r})}}));function qo(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map((e=>[e,e]))):e;return new Ko({type:"enum",entries:n,...T(t)})}const Xo=o("ZodLiteral",((e,t)=>{Mt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n)=>{const o=e._zod.def,r=[];for(const e of o.values)if(void 0===e){if("throw"===t.unrepresentable)throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw new Error("BigInt literals cannot be represented in JSON Schema");r.push(Number(e))}else r.push(e);if(0===r.length);else if(1===r.length){const e=r[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else r.every((e=>"number"==typeof e))&&(n.type="number"),r.every((e=>"string"==typeof e))&&(n.type="string"),r.every((e=>"boolean"==typeof e))&&(n.type="boolean"),r.every((e=>null===e))&&(n.type="null"),n.enum=r})(e,t,n),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 Qo(e,t){return new Xo({type:"literal",values:Array.isArray(e)?e:[e],...T(t)})}const er=o("ZodTransform",((e,t)=>{jt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Transforms cannot be represented in JSON Schema")})(0,e),e._zod.parse=(n,o)=>{if("backward"===o.direction)throw new i(e.constructor.name);n.addIssue=o=>{if("string"==typeof o)n.issues.push(P(o,n.value,t));else{const t=o;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(P(t))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then((e=>(n.value=e,n))):(n.value=r,n)}}));function tr(e){return new er({type:"transform",transform:e})}const nr=o("ZodOptional",((e,t)=>{Ft.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>In(e,t,0,o),e.unwrap=()=>e._zod.def.innerType}));function or(e){return new nr({type:"optional",innerType:e})}const rr=o("ZodExactOptional",((e,t)=>{Bt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>In(e,t,0,o),e.unwrap=()=>e._zod.def.innerType}));const ir=o("ZodNullable",((e,t)=>{Vt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def,i=En(r.innerType,t,o),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,o),e.unwrap=()=>e._zod.def.innerType}));function sr(e){return new ir({type:"nullable",innerType:e})}const ar=o("ZodDefault",((e,t)=>{Wt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def;En(r.innerType,t,o),t.seen.get(e).ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))})(e,t,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap}));const cr=o("ZodPrefault",((e,t)=>{Gt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def;En(r.innerType,t,o),t.seen.get(e).ref=r.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))})(e,t,n,o),e.unwrap=()=>e._zod.def.innerType}));const dr=o("ZodNonOptional",((e,t)=>{Ht.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def;En(r.innerType,t,o),t.seen.get(e).ref=r.innerType})(e,t,0,o),e.unwrap=()=>e._zod.def.innerType}));const ur=o("ZodCatch",((e,t)=>{Kt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def;let i;En(r.innerType,t,o),t.seen.get(e).ref=r.innerType;try{i=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap}));const lr=o("ZodPipe",((e,t)=>{qt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def,i="input"===t.io?"transform"===r.in._zod.def.type?r.out:r.in:r.out;En(i,t,o),t.seen.get(e).ref=i})(e,t,0,o),e.in=t.in,e.out=t.out}));function pr(e,t){return new lr({type:"pipe",in:e,out:t})}const fr=o("ZodReadonly",((e,t)=>{Qt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,o)=>((e,t,n,o)=>{const r=e._zod.def;En(r.innerType,t,o),t.seen.get(e).ref=r.innerType,n.readOnly=!0})(e,t,n,o),e.unwrap=()=>e._zod.def.innerType}));const mr=o("ZodCustom",((e,t)=>{tn.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t)=>{if("throw"===t.unrepresentable)throw new Error("Custom types cannot be represented in JSON Schema")})(0,e)}));const hr=to().regex(/^0x[a-fA-F0-9]*$/,{message:"Must be a hex string beginning with 0x"}).transform((e=>e)),yr=to().regex(/^0x[a-fA-F0-9]{40}$/,{message:"Must be a 40-character hex string beginning with 0x"}).transform((e=>e.toLowerCase())),gr=to(),_r=to();Fo({EVM:yr,SOL:gr}).keyof();const vr=to().regex(/^(\d+|\d*\.\d+)$/);No().min(0n),No().min(0n);const wr=to().refine((e=>/^[a-zA-Z_]{3,}$/.test(e)),{message:"Invalid fiat"}),br=Fo({issuer:to(),name:to(),alias:to().optional(),symbol:to(),decimals:Oo()}),Er=to(),zr=to().regex(/^[a-zA-Z]\w{1,7}$/,{message:"Must be a short alpha-numeric symbol"}),kr=Oo().min(0).max(18),Or=to().url(),Tr=to(),Ar=Fo({chain:to(),address:hr}),Ir=Fo({chain:Qo("solana"),address:gr}),xr=Fo({chain:to(),address:to()}),Sr=Vo([Ar,Ir,xr]),Nr=to().refine((e=>{const[t,n]=e.split(":");return Sr.safeParse({chain:t,address:n}).success}),{message:"Invalid token"}),$r=Fo({name:Er,symbol:zr,decimals:kr,alias:zr.optional(),image_url:Or.optional(),coingecko_id:Tr.optional(),wrapper:zr.optional(),is_native:xo().optional()}),Pr=Vo([Ar.extend($r.shape),Ir.extend($r.shape),xr.extend($r.shape)]),Dr=Vo([Nr,wr]);Vo([Pr,br]),Jo("type",[Fo({type:Qo("chain"),chain:to()}),Fo({type:Qo("issuer"),issuer:to()})]);const Zr=to().transform((e=>e.toLowerCase()));var Rr,Cr;Rr=e=>"string"==typeof e?e.toUpperCase():e,Cr=qo(["ONRAMP","OFFRAMP"]),pr(tr(Rr),Cr),Fo({to:yr,from:yr.optional(),nonce:Oo().optional(),gasLimit:No().optional(),gasPrice:No().optional(),maxPriorityFeePerGas:No().optional(),maxFeePerGas:No().optional(),data:to().optional(),value:No().optional(),chainId:Oo()}),Fo({transactionHash:to().optional(),blockHash:to().optional(),blockNumber:Oo().optional(),from:yr.optional(),to:yr.optional(),rawReceipt:Do()});const Lr=Fo({chain_id:No(),network:to(),address_family:function(e,t){return new e({type:"undefined",...T(t)})}($o,Mr),explorer:ao().optional(),image:ao().optional(),is_testnet:xo()});var Mr;Jo("address_family",[Lr.extend({address_family:Qo("EVM"),native_currency:Fo({name:to(),symbol:to(),decimals:Oo()}),rpc:to().optional()}),Lr.extend({address_family:Qo("SOL")}),Lr]);const jr=qo(["CREDIT_CARD","DEBIT_CARD","ACH","FIAT_BALANCE","TOKEN_BALANCE","APPLE_PAY","PAYPAL","VENMO","REVOLUT","GOOGLE_PAY","SEPA","FASTER_PAYMENTS","PIX","UPI","WIRE"]),Ur=()=>{if("undefined"==typeof navigator)return!1;const e=navigator;let t=!1;e.userAgentData&&"boolean"==typeof e.userAgentData.mobile&&(t=e.userAgentData.mobile);const n=navigator.userAgent||navigator.vendor||window.opera||"";return t||/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile|tablet/i.test(n)},Fr=to().refine((e=>n.test(e)),{message:"Invalid payment ID"}),Br=qo(["BETA_EDGES","ORG_BETA_EDGES","ORG_EDGES"]),Vr=Fo({onramps:jo(Zr).optional(),offramps:jo(Zr).optional(),sandbox:xo().optional().default(!1),features:jo(Br).optional()}),Wr=Vr.extend({inputs:jo(Dr).optional(),outputs:jo(Dr)});Vo([Wr,Vr.extend({inputs:jo(Dr),outputs:jo(Dr).optional()})]);const Jr=Fo({asset:Dr,amount:vr}),Gr=Fo({token:Nr,amount:vr}),Hr=to(),Yr=Vo([function(e){return dn(yo,e)}(),function(e){return un(go,e)}()]),Kr=Fo({price_currency:wr,onramps:jo(Zr).optional(),onramp_methods:jo(jr).optional(),customer_ip_address:to().optional(),customer_id:to().optional(),label:to().optional(),parent_payment_id:Fr.optional(),features:jo(Br).optional(),rev_share_name:to().optional(),allow_unsafe_transfer_out:xo().optional(),show_all_issues:xo().optional(),allow_exceed_max_input_limit:xo().optional(),allow_unsafe_slippage:xo().optional()}),qr=Fo({"#":to()}),Xr=Fo({type:Qo("CallImmediateAction"),target:to(),value:qr,calldata:to()}),Qr=Fo({actions:jo(Xr),user_estimated_gas:qr}),ei=Jo("kind",[Fo({kind:Qo("FIXED_INPUT"),fixed_input_amount:Jr,output_asset:Dr,custom_actions:Qr.optional(),dest_address:to().optional()})]),ti=Kr.extend({request:ei}),ni=qo(["USER","DEST","HALLIDAY","SPW","REV_SHARE","BRIDGE"]),oi=Fo({asset:Dr,property:qo(["APPROVAL","BALANCE"])}),ri=Fo({account:ni,resource:oi}),ii=Vo([Qo("COMPLETE"),Qo("UNREACHABLE"),Qo("FAILED")]),si=Vo([ii,Qo("PENDING")]),ai=qo(["PENDING","COMPLETE","FAILED","EXPIRED","WITHDRAWN","TAINTED"]),ci=Fo({consume:jo(ri),produce:jo(ri)}),di=ri.extend({amount:vr}),ui=ci.extend({consume:jo(di),produce:jo(di)}),li=Yo(Dr,to()),pi=Jo("kind",[Fo({kind:Vo([Qo("amount"),Qo("amount-downstream")]),given:to(),limits:Fo({min:to().optional(),max:to().optional()}),source:to(),message:to()}),Fo({kind:Qo("geolocation"),message:to()}),Fo({kind:Qo("provider"),message:to()}),Fo({kind:Qo("other"),message:to()}),Fo({kind:Qo("unknown"),message:to()})]),fi=Fo({service_ids:jo(to()),latency_seconds:Oo(),issues:jo(pi).optional()}),mi=Fo({type:Vo([Qo("USER_FUND"),Qo("ONCHAIN_STEP"),Qo("ONRAMP")]),net_effect:ui,pieces_info:jo(Fo({type:Vo([Qo("onramp"),Qo("poll"),Qo("bridge"),Qo("rev_share"),Qo("transfer_out"),Qo("convert")])})),step_index:Oo().optional()}),hi=Fo({payment_id:to(),output_amount:Fo({asset:Dr,amount:to()}),onramp:Zr.optional(),onramp_method:jr.optional(),fees:Fo({total_fees:to(),conversion_fees:to(),network_fees:to(),business_fees:to(),currency_symbol:wr}),route:jo(mi)}),yi=mi.extend({status:si,transaction_hash:to().optional()}),gi=hi.omit({payment_id:!0}).partial({output_amount:!0,onramp:!0,onramp_method:!0,fees:!0}).extend({route:jo(yi)});Fo({quote_request:ti,quotes:jo(hi),current_prices:li,price_currency:wr,state_token:to(),quoted_at:to(),accept_by:to(),failures:jo(fi)}),Fo({payment_id:Fr,state_token:to(),owner_chain:to().optional(),owner_address:_r,destination_address:_r,client_redirect_url:to().optional(),allow_unsafe_owner:xo().optional()});const _i=Fo({deposit_token:Nr,deposit_chain:to(),deposit_amount:vr,deposit_address:_r}),vi=Fo({type:qo(["ONRAMP","TRANSFER_IN"]),payment_id:Fr,funding_page_url:ao(),deposit_info:jo(_i)}),wi=Fo({payment_id:Fr,org_id:to(),status:ai,funded:xo(),created_at:to(),updated_at:to(),initiate_fund_by:to(),completed_at:to().optional(),quote_request:ti,quoted:hi.omit({payment_id:!0}),fulfilled:gi,current_prices:li,price_currency:wr,customer_id:to().optional(),label:to().optional(),processing_addresses:jo(Fo({address:_r,chain:to()})),owner_chain:to(),owner_address:_r,destination_address:_r,next_instruction:vi.optional(),parent_payment_id:Fr.optional(),client_redirect_url:to().nullable()});Fo({payment_id:Fr,redirect_url:to(),referrer_domain:to().optional()}),Fo({funding_page_onramp_url:to(),client_redirect_url:to().optional(),client_secret:to().optional()}),Fo({id_query:to().optional(),pagination_key:to().optional(),dest_address:_r.optional(),owner_address:_r.optional(),limit:Oo().int().positive().optional(),category:qo(["ALL","NEW_OR_FUNDED"]).optional(),label:to().optional()}),Fo({payment_statuses:jo(wi),next_pagination_key:to().nullable()}),Fo({payment_id:Fr.optional(),custom_queries:jo(Fo({address:_r,token:Vo([Nr,Sr])})).optional()}).refine((e=>!(!e.payment_id&&!e.custom_queries?.length)),{message:"payment_id or custom_queries is required"}),Fo({balance_results:jo(Fo({address:_r,token:Nr,value:Jo("kind",[Fo({kind:Qo("amount"),amount:vr}),Fo({kind:Qo("error")})])}))}),Fo({fiat:wr,tokens:jo(Nr)});const bi=to(),Ei=Fo({payment_id:Fr,token_amounts:jo(Gr),recipient_address:_r});Fo({payment_id:Fr,withdraw_authorization:bi}),Ei.extend({owner_signature:Hr}),Fo({payment_id:Fr,transaction_hash:to()});const zi=qo(["EMBED","POPUP","MODAL"]),ki=qo(["DEFAULT","ALL_UPPERCASE"]),Oi=qo(["AUTO","MEDIUM"]),Ti=qo(["ATTACHED","BUTTON"]),Ai=qo(["SQUARE","DEFAULT"]),Ii=qo(["BLUR","OFF"]),xi=to().refine((e=>/^(#[0-9A-Fa-f]{3,8}|rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\)|rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3}(\s*,\s*(0(\.\d+)?|1(\.0+)?))\))$/.test(e)),{message:"Invalid CSS color value"}),Si=to().refine((e=>/^\d*\.?\d+px$/.test(e)),{message:"Invalid CSS font size value. Expected a number followed by px (e.g. '16px')."}),Ni=to().refine((e=>/^\d*\.?\d+(px|rem)$/.test(e)),{message:"Invalid CSS border radius value. Expected a number followed by px or rem (e.g. '8px', '0.5rem')."}),$i=Fo({src:ao(),alt:to(),width:Oo().positive(),height:Oo().positive()}),Pi=Fo({primaryColor:xi.optional(),backgroundColor:xi.optional(),borderColor:xi.optional(),textColor:xi.optional(),textSecondaryColor:xi.optional(),accentColor:xi.optional(),componentShadow:to().optional(),borderStyle:Ai.optional(),textMode:ki.optional(),paymentCategoryGrouping:Ti.optional(),fontWeight:Oi.optional(),baseFontSize:Si.optional(),baseBorderRadius:Ni.optional(),backgroundStyle:Ii.optional(),logo:$i.optional()}),Di=Do(),Zi=jo(qo(["wallet","open-wallet","exchange","open-exchange","cash","open-cash","deposit"])),Ri=qo(["haffer","wudoo-mono","inter"]),Ci=to().optional(),Li=Fo({address:_r,signMessage:Do().refine((e=>"function"==typeof e)).optional(),sendTransaction:Do().refine((e=>"function"==typeof e)).optional(),signTypedData:Do().refine((e=>"function"==typeof e)).optional()}),Mi=Fo({redirectUrl:ao(),ctaText:to(),secondaryRedirectUrl:ao().optional(),secondaryCtaText:to().optional()}).refine((e=>!(e.secondaryRedirectUrl&&!e.secondaryCtaText||!e.secondaryRedirectUrl&&e.secondaryCtaText)),{message:"secondaryCtaText and secondaryRedirectUrl must be provided together."}),ji=Fo({apiKey:to().nonempty(),destinationAddress:_r.optional(),widgetVersion:qo(["1","2"]).optional(),...Wr.shape,customStyles:Pi.optional(),targetElementId:to().optional(),windowType:zi.optional(),redirects:Mi.optional(),statusCallback:Do().refine((e=>"function"==typeof e)).optional(),owner:Li.optional(),funder:Li.optional(),features:jo(Br).optional(),paymentCategoryOrder:Zi.optional(),fontName:Ri.optional(),headerTitle:Ci.optional(),onramps:jo(to()).optional(),showSkeleton:xo().optional(),skeletonBackgroundColor:to().optional()}),Ui=ji.refine((e=>!("EMBED"===e.windowType&&!e.targetElementId)),{message:"targetElementId is required when windowType is EMBED"}),Fi=ji.omit({owner:!0,funder:!0,statusCallback:!0}),Bi=to().regex(/^(https:\/\/(?:[\w-]+\.)*halliday\.xyz(?:\/.*)?|http:\/\/localhost(?::\d+)?(?:\/.*)?|https:\/\/localhost(?::\d+)?(?:\/.*)?)$/,"Invalid API baseUrl"),Vi=Yo(to(),xo()),Wi=Fo({dangerouslyOverrideHallidayDomainName:ao().optional(),dangerouslyOverrideApiBaseUrl:Bi.optional(),dangerouslyOverrideIPAddress:Yr.optional(),dangerouslyOverrideFeatureFlags:Vi.optional()}),Ji=qo(["FULL","MODAL","OVERLAY","EMBED"]),Gi=Fo({appMode:Ji.optional(),apiBaseUrl:Bi.optional(),hasOwner:xo(),hasTxHandler:xo(),hostOrigin:ao().nullable(),ipAddress:Yr.optional(),featureFlags:Vi.optional()}),Hi=Fo({...Fi.shape,...Gi.shape,ownerAddress:_r.optional(),funderAddress:_r.optional()});var Yi;!function(e){e.ACTION_TRANSACTION="ACTION_TRANSACTION",e.EVENT_ORDER_STATUS="EVENT_ORDER_STATUS",e.EVENT_WINDOW_CLOSE="EVENT_WINDOW_CLOSE",e.ACTION_SIGN_MESSAGE="ACTION_SIGN_MESSAGE",e.ACTION_PROVIDER_WIDGET="ACTION_PROVIDER_WIDGET",e.ACTION_SIGN_TYPED_DATA="ACTION_SIGN_TYPED_DATA",e.EVENT_RESIZE="EVENT_RESIZE"}(Yi||(Yi={}));const Ki=Fo({apiKey:to().nonempty(),sandbox:xo().optional(),onReady:Do().refine((e=>"function"==typeof e||void 0===e)).optional(),onError:Do().refine((e=>"function"==typeof e||void 0===e)).optional()}),qi=e=>{if(e)return e.includes("deposit")?e:["deposit",...e]},Xi=()=>{const e=document.getElementById("halliday-payments-skeleton");e&&(e.style.opacity="0",setTimeout((()=>e.remove()),300))},Qi=e=>{const t=Hi.parse(e);return btoa(JSON.stringify(t))},es=e=>Hi.parse(JSON.parse(atob(e))),ts=t=>{const{windowOrigin:n=e,...o}=t,r=Qi(o),i=o.widgetVersion;if(i)try{return`${n}/v${parseInt(i)}/payments/quote?data=${r}`}catch(e){console.error("Error parsing widget version",e)}return`${n}/payments/quote?data=${r}`},ns=e=>{const t=window.innerWidth/2-240,{windowType:n="POPUP",targetElementId:o,windowOrigin:r}=e,i=ts(e);let s;if("EMBED"===n){const e=document.getElementById(o);if(!e)throw new Error(`Element with id ${o} not found`);let t=document.getElementById("halliday-payments-embed");if((t?t.src:null)===i)t.style.display="block";else{let n=document.getElementById("halliday-payments-wrapper");n||(e.innerHTML="",e.style&&(e.style.position="relative"),n=document.createElement("div"),n.id="halliday-payments-wrapper",n.style.cssText="\n position: relative;\n width: 480px;\n max-width: 100%;\n display: block;\n ",e.appendChild(n)),t=document.createElement("iframe"),t.id="halliday-payments-embed",t.src=i,t.style.cssText="\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: none;\n display: block;\n ",t.setAttribute("scrolling","no"),n.appendChild(t)}s=t.contentWindow;const n=e=>{const{type:t,payload:o}=e.data||{},i=e.source===s,a=e.origin===r;if(i&&(a||t===Yi.EVENT_RESIZE))if(t===Yi.EVENT_WINDOW_CLOSE){window.removeEventListener("message",n);const e=document.getElementById("halliday-payments-embed");e&&(e.style.display="none")}else if(t===Yi.EVENT_RESIZE){const e=document.getElementById("halliday-payments-skeleton"),t=document.getElementById("halliday-payments-wrapper");void 0!==o?.height&&(e&&(e.style.height=o.height+"px"),t&&(t.style.minHeight=o.height+"px"))}else"WIDGET_READY"!==t&&"HALLIDAY_READY"!==t||Xi()};window.addEventListener("message",n)}else if("MODAL"===n){let e=document.getElementById("halliday-payments-modal");(e?e.src:null)===i?e.style.display="block":(e&&e.remove(),e=document.createElement("iframe"),e.id="halliday-payments-modal",e.src=i,e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100dvw",e.style.height="100dvh",e.style.border="none",e.style.zIndex="1000",e.setAttribute("scrolling","no"),document.body.appendChild(e));const t=e=>{if(e.origin!==r||e.source!==s)return;const{type:n}=e.data||{};if(n===Yi.EVENT_WINDOW_CLOSE){window.removeEventListener("message",t);const e=document.getElementById("halliday-payments-modal");e&&(e.style.display="none")}};window.addEventListener("message",t),s=e.contentWindow}else s=window.open(i,"Halliday Payments",`popup left=${t} top=70 width=480 height=638`);return s},os=e=>{const t=window.innerWidth/2-240;return window.open(e,"Provider Widget",`popup left=${t} top=70 width=480 height=638`)},rs=async({apiKey:e,baseURL:t,workflowId:n})=>{let o;for(let r=1;r<=3;r++)try{const o=await fetch(`${t}/quotes/status?workflow_id=${n}`,{headers:{Authorization:`Bearer ${e}`}});if(!o.ok)throw new Error(`HTTP error! status: ${o.status}`);return await o.json()}catch(e){if(o=e instanceof Error?e:new Error(String(e)),3===r)throw o;const t=1e3*Math.pow(2,r);await new Promise((e=>setTimeout(e,t)))}throw o},is=async({apiKey:e,baseURL:t,window:n,workflowId:o})=>{for(;!n.closed;){let n;try{n=await rs({apiKey:e,baseURL:t,workflowId:o})}catch(e){console.error("Error fetching payment status",e);break}const r=n.fulfilled.route.find((e=>"ONRAMP"===e.type)),i=r?.status;if("COMPLETE"===i)break;await new Promise((e=>setTimeout(e,5e3)))}},ss=e=>{e instanceof Ln?e.issues.forEach((e=>{console.error("Validation Error",{path:e.path.join("."),message:e.message})})):console.error("openHallidayPayments Error",{error:e})},as="halliday-payments-preload";let cs={isPreloaded:!1,isLoading:!1,iframe:null,error:null,startTime:null,readyTime:null},ds=null,us=null,ls=null,ps=null,fs=null,ms=null,hs=null,ys=null,gs=0;const _s=()=>cs.isPreloaded&&!cs.error,vs=async(t,...n)=>{if(cs.isPreloaded)return void console.warn("[HallidayPayments] Already initialized");const o=++gs;if(cs.isLoading&&hs){const e=new Error("Initialization superseded by a newer call");ys?.(e)}const r=n[999]||n[0]||{};let i,s;try{i=Ki.parse(t)}catch(e){throw ss(e),e}try{s=Wi.parse(r)}catch(e){throw ss(e),e}ds=i,ps=s,us=i.onReady||null,ls=i.onError||null;const a=(s.dangerouslyOverrideHallidayDomainName||e).replace(/\/$/,"");cs={...cs,isLoading:!0,startTime:Date.now(),error:null};const c=new Promise(((e,t)=>{let n=!0,r=null;const c=e=>{n&&(n=!1,r&&(clearTimeout(r),r=null),p(),cs.iframe&&cs.iframe.remove(),cs={...cs,isLoading:!1,error:null,iframe:null},d(),t(e||new Error("Initialization cancelled")))},d=()=>{hs=null,ys===c&&(ys=null)};r=setTimeout((()=>{if(!n||o!==gs)return;const e=new Error("Widget load timeout exceeded");cs={...cs,isLoading:!1,error:e},p(),ls?.(e),d(),t(e)}),3e4),!n&&r&&(clearTimeout(r),r=null);const u=t=>{if(!n||o!==gs)return;if(t.origin!==a)return;if(t.source!==cs.iframe?.contentWindow)return;const{type:i}=t.data||{};"WIDGET_READY"!==i&&"HALLIDAY_READY"!==i||(r&&(clearTimeout(r),r=null),p(),cs={...cs,isPreloaded:!0,isLoading:!1,readyTime:Date.now()},us?.(),d(),e())},l=e=>{if(!n||o!==gs)return;if(e.origin!==a)return;if(e.source!==cs.iframe?.contentWindow)return;const{type:t,payload:r}=e.data||{};t===Yi.EVENT_RESIZE&&r&&cs.iframe&&(void 0!==r.width&&(cs.iframe.style.width=r.width+"px"),void 0!==r.height&&(cs.iframe.style.height=r.height+"px"))},p=()=>{window.removeEventListener("message",u),window.removeEventListener("message",l),fs===l&&(fs=null)};window.addEventListener("message",u),window.addEventListener("message",l),fs=l;const f=document.getElementById(as);f&&f.remove();const m=document.createElement("iframe");m.id=as;let h="MODAL";try{h=Ur()?"OVERLAY":"MODAL"}catch{}const y=ts({apiKey:i.apiKey,sandbox:i.sandbox||!1,widgetVersion:"2",outputs:[],hasOwner:!1,hasTxHandler:!1,hostOrigin:"undefined"!=typeof window?window.origin:null,windowOrigin:a,appMode:h,apiBaseUrl:s.dangerouslyOverrideApiBaseUrl,ipAddress:s.dangerouslyOverrideIPAddress,featureFlags:s.dangerouslyOverrideFeatureFlags});m.src=y,m.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100dvw;\n height: 100dvh;\n border: none;\n z-index: -1;\n visibility: hidden;\n pointer-events: none;\n opacity: 0;\n ",m.setAttribute("aria-hidden","true"),m.setAttribute("tabindex","-1"),m.onload=()=>{n&&o===gs&&setTimeout((()=>{n&&o===gs&&cs.isLoading&&!cs.isPreloaded&&(r&&(clearTimeout(r),r=null),p(),cs={...cs,isPreloaded:!0,isLoading:!1,readyTime:Date.now()},us?.(),d(),e())}),3e3)},m.onerror=()=>{if(!n||o!==gs)return;r&&(clearTimeout(r),r=null),p();const e=new Error("Failed to load widget");cs={...cs,isLoading:!1,error:e},ls?.(e),d(),t(e)},document.body.appendChild(m),cs.iframe=m,ys=c}));return hs=c,c},ws=()=>{const e=cs.iframe;e&&(e.style.visibility="hidden",e.style.opacity="0",e.style.pointerEvents="none",e.style.zIndex="-1",e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1"))},bs=()=>{fs&&(window.removeEventListener("message",fs),fs=null);const e=cs.iframe;e&&e._embedCleanup&&e._embedCleanup();const t=document.getElementById(as);t&&t.remove();const n=document.getElementById("halliday-payments-placeholder");n&&n.remove();const o=document.getElementById("halliday-payments-modal");o&&o.remove();const r=document.getElementById("halliday-payments-skeleton");r&&r.remove(),cs={isPreloaded:!1,isLoading:!1,iframe:null,error:null,startTime:null,readyTime:null},ds=null,ps=null,us=null,ls=null,ms=null,hs=null,ys=null},Es=e=>{const{windowOrigin:t,widgetWindow:n,providerWindowRef:o,cleanMessageHandlers:r,hasOwner:i,hasTxHandler:s,signMessage:a,signTypedData:c,sendTransaction:d,statusCallback:u,apiKey:l,apiBaseUrl:p}=e,f=[];return f.push((e=>{if(e.origin!==t||e.source!==n)return;const{type:o}=e.data||{};o===Yi.EVENT_WINDOW_CLOSE&&r()})),i&&f.push((async e=>{if(e.origin!==t||e.source!==n)return;const{type:o,payload:r}=e.data||{};if(o===Yi.ACTION_SIGN_MESSAGE){const{messageId:e,message:i,ownerAddress:s}=r;try{const r="function"==typeof a?await a({message:i,...void 0!==s&&{ownerAddress:s}}):(()=>{throw new Error("No signMessage function provided")})();n.postMessage({type:o,payload:{messageId:e,signature:r}},t)}catch(r){n.postMessage({type:o,payload:{messageId:e,error:r instanceof Error?r.message:r}},t)}}else if(o===Yi.ACTION_SIGN_TYPED_DATA){const{messageId:e,typedData:i,ownerAddress:s}=r;try{const r="function"==typeof c?await c({typedData:i,...void 0!==s&&{ownerAddress:s}}):(()=>{throw new Error("No signTypedData function provided")})();n.postMessage({type:o,payload:{messageId:e,signature:r}},t)}catch(r){n.postMessage({type:o,payload:{messageId:e,error:r instanceof Error?r.message:r}},t)}}})),s&&f.push((async e=>{if(e.origin!==t||e.source!==n)return;const{type:o,payload:r}=e.data||{};if(o===Yi.ACTION_TRANSACTION){const{messageId:e,chainConfig:i,transaction:s}=r;try{const r="function"==typeof d?await d(s,i):(()=>{throw new Error("No sendTransaction function provided")})();n.postMessage({type:o,payload:{messageId:e,txReceipt:r}},t)}catch(r){n.postMessage({type:o,payload:{messageId:e,error:r instanceof Error?r.message:r}},t)}}})),u&&f.push((e=>{if(e.origin!==t||e.source!==n)return;const{type:o,payload:r}=e.data||{};o===Yi.EVENT_ORDER_STATUS&&u({type:o,payload:r})})),f.push((async e=>{if(e.origin!==t||e.source!==n)return;const{type:r,payload:i}=e.data||{};if(r===Yi.ACTION_PROVIDER_WIDGET){const{url:e,redirectUrl:t,providerWidgetMode:r,workflowId:s}=i||{};if(!(e&&t&&r&&s))return;let a=null;"REDIRECT"===r?(n.location=e,a=n):"POPUP"===r&&(o.current=os(e),a=o.current),a&&(await is({apiKey:l,baseURL:p,workflowId:s,window:a}),a.closed||("REDIRECT"===r?n.location=t:"POPUP"===r&&(o.current?.close(),o.current=null)))}})),f},zs=(()=>{let n=null,o=null;const r={get current(){return o},set current(e){o=e}};let i=[];const s=()=>{i.forEach((e=>{window.removeEventListener("message",e)})),i=[]},a=e=>{e.forEach((e=>{window.addEventListener("message",e)})),i=e},c=async(i,...d)=>{const u=d[999]||d[0]||{},l=async()=>{let r,c;try{r=Ui.parse(i)}catch(e){throw ss(e),e}try{c=Wi.parse(u)}catch(e){throw ss(e),e}const{dangerouslyOverrideHallidayDomainName:d,dangerouslyOverrideApiBaseUrl:l,dangerouslyOverrideIPAddress:p,dangerouslyOverrideFeatureFlags:f}=c,{owner:m,statusCallback:h,funder:y,windowType:g}=r,_=(d||e).replace(/\/$/,""),v=m?.signMessage,w=m?.signTypedData,b=y?.sendTransaction||m?.sendTransaction,E=m?.address,z=y?.address,k=_r.safeParse(E).success&&"function"==typeof w,O=_r.safeParse(z).success&&"function"==typeof b;let T=null,A="FULL";try{T=window.origin,"MODAL"===g?A=Ur()?"OVERLAY":"MODAL":"EMBED"===g&&(A="EMBED")}catch(e){}s();const I=[e=>{if(e.origin!==_||e.source!==n)return;const{type:t}=e.data||{};t===Yi.EVENT_WINDOW_CLOSE&&s()}];if(k){const e=async e=>{if(e.origin!==_||e.source!==n)return;const{type:t,payload:o}=e.data||{};if(t===Yi.ACTION_SIGN_MESSAGE){const{messageId:e,message:r,ownerAddress:i}=o;try{let o;if("function"!=typeof v)throw new Error("No signMessage function provided");o=await v({message:r,...void 0!==i&&{ownerAddress:i}}),n?.postMessage({type:t,payload:{messageId:e,signature:o}},_)}catch(o){console.error("Error signing message",o),n?.postMessage({type:t,payload:{messageId:e,error:o instanceof Error?o.message:o}},_)}}else if(t===Yi.ACTION_SIGN_TYPED_DATA){const{messageId:e,typedData:r,ownerAddress:i}=o;try{let o;if("function"!=typeof w)throw new Error("No signTypedData function provided");o=await w({typedData:r,...void 0!==i&&{ownerAddress:i}}),n?.postMessage({type:t,payload:{messageId:e,signature:o}},_)}catch(o){console.error("Error signing typed data",o),n?.postMessage({type:t,payload:{messageId:e,error:o instanceof Error?o.message:o}},_)}}};I.push(e)}if(O){const e=async e=>{if(e.origin!==_||e.source!==n)return;const{type:t,payload:o}=e.data||{};if(t===Yi.ACTION_TRANSACTION){const{messageId:e,chainConfig:r,transaction:i}=o;try{let o;if("function"!=typeof b)throw new Error("No sendTransaction function provided");o=await b(i,r),n?.postMessage({type:t,payload:{messageId:e,txReceipt:o}},_)}catch(o){console.error("Error handling transaction",o),n?.postMessage({type:t,payload:{messageId:e,error:o instanceof Error?o.message:o}},_)}}};I.push(e)}if(h){const e=e=>{if(e.origin!==_||e.source!==n)return;const{type:t,payload:o}=e.data||{};t===Yi.EVENT_ORDER_STATUS&&h({type:t,payload:o})};I.push(e)}I.push((async e=>{if(e.origin!==_||e.source!==n)return;const{type:i,payload:s}=e.data||{};if(i===Yi.ACTION_PROVIDER_WIDGET&&n){const{url:e,redirectUrl:i,providerWidgetMode:a,workflowId:c}=s||{};if(!(e&&i&&a&&c))throw new Error("Invalid provider widget payload");let d=null;if("REDIRECT"===a)n.location=e,d=n;else{if("POPUP"!==a)throw new Error("Invalid provider widget mode");o=os(e),d=o}if(await is({apiKey:r.apiKey,baseURL:l||t,workflowId:c,window:d}),d?.closed)return;"REDIRECT"===a?n.location=i:"POPUP"===a&&(o?.close(),o=null)}}));const x={...r,sandbox:r.sandbox||!1,hasOwner:k,hasTxHandler:O,windowOrigin:_,apiBaseUrl:l,hostOrigin:T,ownerAddress:E,funderAddress:z,ipAddress:p,featureFlags:f,appMode:A,fontName:r.fontName,paymentCategoryOrder:qi(r.paymentCategoryOrder),headerTitle:r.headerTitle,onramps:r.onramps};n=ns(x),a(I)},p=i.windowType,f=i.targetElementId,m=i.showSkeleton??!0,h=i.skeletonBackgroundColor??i.customStyles?.backgroundColor;if("EMBED"===p&&f&&m){const e=document.getElementById(f);e&&(_s()||((e,t)=>{const n=document.getElementById("halliday-payments-skeleton");n&&n.remove(),e.style&&(e.style.position="relative");let o=document.getElementById("halliday-payments-wrapper");o||(o=document.createElement("div"),o.id="halliday-payments-wrapper",o.style.cssText="\n position: relative;\n width: 480px;\n max-width: 100%;\n display: block;\n ",e.appendChild(o));const r=t||"linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%)",i=document.createElement("div");if(i.id="halliday-payments-skeleton",i.style.cssText=`\n width: 100%;\n height: 400px;\n background: ${r};\n background-size: 200% 100%;\n animation: halliday-skeleton-pulse 1.5s ease-in-out infinite;\n border-radius: 12px;\n position: relative;\n z-index: 1;\n transition: opacity 0.3s ease-out;\n `,!document.getElementById("halliday-skeleton-styles")&&document.head)try{const e=document.createElement("style");e.id="halliday-skeleton-styles",e.textContent="\n @keyframes halliday-skeleton-pulse {\n 0% { background-position: 200% 0; }\n 100% { background-position: -200% 0; }\n }\n ",document.head.appendChild(e)}catch{}o.appendChild(i)})(e,h))}if(_s()){const o=ds,c=ps,d=(c?.dangerouslyOverrideHallidayDomainName||e).replace(/\/$/,""),{owner:l,funder:p,statusCallback:f}=i,m=l?.signMessage,h=l?.signTypedData,y=p?.sendTransaction||l?.sendTransaction,g=l?.address,_=p?.address,v=_r.safeParse(g).success&&"function"==typeof h,w=_r.safeParse(_).success&&"function"==typeof y,b=i.windowType||"MODAL",E=i.targetElementId;let z=null,k="FULL";try{z=window.origin,"MODAL"===b?k=Ur()?"OVERLAY":"MODAL":"EMBED"===b&&(k="EMBED")}catch{}const O={apiKey:i.apiKey||o?.apiKey||"",sandbox:i.sandbox??o?.sandbox??!1,widgetVersion:i.widgetVersion,destinationAddress:i.destinationAddress,onramps:i.onramps,outputs:i.outputs??[],inputs:i.inputs,customStyles:i.customStyles,redirects:i.redirects,features:i.features,paymentCategoryOrder:qi(i.paymentCategoryOrder),fontName:i.fontName,headerTitle:i.headerTitle,windowType:b,targetElementId:E,hasOwner:v,hasTxHandler:w,ownerAddress:g,funderAddress:_,hostOrigin:z,appMode:k,windowOrigin:d,apiBaseUrl:u?.dangerouslyOverrideApiBaseUrl??c?.dangerouslyOverrideApiBaseUrl,ipAddress:u?.dangerouslyOverrideIPAddress??c?.dangerouslyOverrideIPAddress,featureFlags:u?.dangerouslyOverrideFeatureFlags??c?.dangerouslyOverrideFeatureFlags};if(n=(t=>{const n=cs.iframe;if(!n||!cs.isPreloaded||!ds)return null;const o=(ps?.dangerouslyOverrideHallidayDomainName||e).replace(/\/$/,""),r=t?.windowType||"MODAL",i=t?.targetElementId;if("POPUP"===r)return null;let s="MODAL";try{"MODAL"===r?s=Ur()?"OVERLAY":"MODAL":"EMBED"===r&&(s="EMBED")}catch{}if(t){const{windowType:e,...r}=t;n.contentWindow?.postMessage({type:"HALLIDAY_UPDATE_PARAMS",payload:{...r,appMode:s}},o)}if("EMBED"===r){if(!i)return console.error("[HallidayPayments] EMBED mode requires targetElementId in openHallidayPayments"),null;const e=document.getElementById(i);if(!e)return console.error(`[HallidayPayments] Target element '${i}' not found`),null;let t=document.getElementById("halliday-payments-wrapper")||document.getElementById("halliday-payments-placeholder");t||(t=document.createElement("div"),t.id="halliday-payments-placeholder",t.style.cssText=`\n width: 480px;\n max-width: 100%;\n height: ${ms||400}px;\n `,e.appendChild(t));const r=()=>{const e=t.getBoundingClientRect();n.style.position="fixed",n.style.top=e.top+"px",n.style.left=e.left+"px",n.style.width=e.width+"px",n.style.height=e.height+"px",n.style.border="none",n.style.zIndex="1"};t.offsetHeight,requestAnimationFrame((()=>{requestAnimationFrame((()=>{r(),n.style.visibility="visible",n.style.opacity="1",n.style.pointerEvents="auto"}))}));const s=new ResizeObserver((()=>{r()}));s.observe(t);const a=()=>r();window.addEventListener("scroll",a,!0);const c=()=>r();window.addEventListener("resize",c),n._embedCleanup=()=>{s.disconnect(),window.removeEventListener("scroll",a,!0),window.removeEventListener("resize",c),t?.remove()};const d=e=>{if(e.origin!==o)return;if(e.source!==n.contentWindow)return;const{type:i,payload:s}=e.data||{};i===Yi.EVENT_RESIZE&&s&&void 0!==s.height&&t&&(ms=s.height,t.style.height=s.height+"px",r())};if(window.addEventListener("message",d),n.removeAttribute("aria-hidden"),n.removeAttribute("tabindex"),cs.isPreloaded)Xi();else{const e=t=>{if(t.origin!==o)return;if(t.source!==n.contentWindow)return;const{type:r}=t.data||{};"WIDGET_READY"!==r&&"HALLIDAY_READY"!==r||(window.removeEventListener("message",e),Xi())};window.addEventListener("message",e)}}else n.id="halliday-payments-modal",n.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100dvw;\n height: 100dvh;\n border: none;\n z-index: 10000;\n ",n.removeAttribute("aria-hidden"),n.removeAttribute("tabindex"),n.setAttribute("scrolling","no"),n.parentElement!==document.body&&document.body.appendChild(n);setTimeout((()=>{n.contentWindow?.postMessage({type:"HALLIDAY_SHOW"},o)}),10);const a=e=>{if(e.origin!==o)return;if(e.source!==n.contentWindow)return;const{type:t}=e.data||{};t===Yi.EVENT_WINDOW_CLOSE&&(window.removeEventListener("message",a),ws())};return window.addEventListener("message",a),n.contentWindow})(O),n){s();const e=Es({windowOrigin:d,widgetWindow:n,providerWindowRef:r,cleanMessageHandlers:s,hasOwner:v,hasTxHandler:w,...void 0!==m&&{signMessage:m},...void 0!==h&&{signTypedData:h},...void 0!==y&&{sendTransaction:y},...void 0!==f&&{statusCallback:f},apiKey:o?.apiKey||i.apiKey,apiBaseUrl:c?.dangerouslyOverrideApiBaseUrl||t});return void a(e)}if("POPUP"===b&&(n=ns({...O,windowOrigin:d}),n)){s();const e=Es({windowOrigin:d,widgetWindow:n,providerWindowRef:r,cleanMessageHandlers:s,hasOwner:v,hasTxHandler:w,...void 0!==m&&{signMessage:m},...void 0!==h&&{signTypedData:h},...void 0!==y&&{sendTransaction:y},...void 0!==f&&{statusCallback:f},apiKey:o?.apiKey||i.apiKey,apiBaseUrl:c?.dangerouslyOverrideApiBaseUrl||t});return void a(e)}}return null===ds||_s()?l():new Promise((e=>{const t=Date.now(),n=()=>{_s()?c(i,...d).then(e):Date.now()-t>=3e4?l().then(e):setTimeout(n,100)};n()}))};return{openWidget:c}})();async function ks(e,...t){try{return zs.openWidget(e,...t)}catch(e){throw ss(e),e}}export{Ji as AppMode,Ii as BackgroundStyle,Ai as BorderStyle,Si as CssFontSize,Pi as CustomStyles,Ri as FontName,Ci as HeaderTitle,Ki as InitConfig,Yi as MessageType,Di as OrderStatus,Zi as PaymentCategoryOrder,Hi as PaymentsWidgetQueryParams,Ui as PaymentsWidgetSDKParams,es as deserializeQueryParams,bs as destroyClient,ts as getPaymentsWidgetUrl,vs as initializeClient,ks as openHallidayPayments,Qi as serializeQueryParams};
2
2
  //# sourceMappingURL=index.esm.min.js.map