@guardian/support-dotcom-components 10.1.0 → 11.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/shared/types/abTests/epic.d.ts +0 -5
- package/dist/shared/types/abTests/epic.d.ts.map +1 -1
- package/dist/shared/types/props/banner.d.ts +0 -2
- package/dist/shared/types/props/banner.d.ts.map +1 -1
- package/dist/shared/types/props/epic.d.ts +0 -10
- package/dist/shared/types/props/epic.d.ts.map +1 -1
- package/dist/shared/types/props/header.d.ts +0 -2
- package/dist/shared/types/props/header.d.ts.map +1 -1
- package/dist/shared/types/targeting/epic.d.ts +0 -3
- package/dist/shared/types/targeting/epic.d.ts.map +1 -1
- package/dist/shared/types/targeting/header.d.ts +0 -1
- package/dist/shared/types/targeting/header.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e="gu.history.weeklyArticleCount",t="gu.history.articleCountsThisWeek",n=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},i=t=>t.get(e)??void 0,r=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),o=(e,t={})=>(e.forEach(e=>{r.has(e)&&(t[e]=(t[e]??0)+1)}),t),s=(i,r,s)=>{const a=((e,i)=>{const r=n(new Date),o=e.get(t);if(o?.week===r){const n=o.articles[i]||0;return e.set(t,{week:r,articles:{...o.articles,[i]:n+1}}),n>0}return e.set(t,{week:r,articles:{[i]:1}}),!1})(i,r);if(!a){const t=n(new Date),r=i.get(e)??[],a=r.length>0?r[0]:null;if(a?.week&&a.week===t)a.count+=1,a.tags=o(s,a.tags),i.set(e,r);else{r.unshift({week:t,count:1,tags:o(s,{})});const n=t-365,a=r.filter(e=>e.week>=n);i.set(e,a)}}};var a;function u(e,t,n){function i(n,i){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:i,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,i);const r=s.prototype,o=Object.keys(r);for(let e=0;e<o.length;e++){const t=o[e];t in n||(n[t]=r[t].bind(n))}}const r=n?.Parent??Object;class o extends r{}function s(e){var t;const r=n?.Parent?new o:this;i(r,e),(t=r._zod).deferred??(t.deferred=[]);for(const e of r._zod.deferred)e();return r}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),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 c extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class l extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(a=globalThis).__zod_globalConfig??(a.__zod_globalConfig={});const d=globalThis.__zod_globalConfig;function p(e){return e&&Object.assign(d,e),d}function f(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 h(e,t){return"bigint"==typeof t?t.toString():t}function m(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function g(e){return null==e}function y(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const v=Symbol("evaluating");function _(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==v)return void 0===i&&(i=v,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function b(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function w(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function z(e){return JSON.stringify(e)}const S="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function k(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const C=m(()=>{if(d.jitless)return!1;if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function T(e){if(!1===k(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!==k(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function N(e){return T(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const I=new Set(["string","number","symbol"]);function $(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function O(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 P(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 Z(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!1===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 M(e){return"string"==typeof e?e:e?.message}function R(e,t,n){const i=e.message?e.message:M(e.inst?._zod.def?.error?.(e))??M(t?.error?.(e))??M(n.customError?.(e))??M(n.localeError?.(e))??"Invalid input",{inst:r,continue:o,input:s,...a}=e;return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=s),a}function U(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function D(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const G=(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,h,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},L=u("$ZodError",G),F=u("$ZodError",G,{Parent:Error});const j=e=>(t,n,i,r)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new c;if(s.issues.length){const t=new(r?.Err??e)(s.issues.map(e=>R(e,o,p())));throw S(t,r?.callee),t}return s.value},B=e=>async(t,n,i,r)=>{const o=i?{...i,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(r?.Err??e)(s.issues.map(e=>R(e,o,p())));throw S(t,r?.callee),t}return s.value},J=e=>(t,n,i)=>{const r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new c;return o.issues.length?{success:!1,error:new(e??L)(o.issues.map(e=>R(e,r,p())))}:{success:!0,data:o.value}},V=J(F),K=e=>async(t,n,i)=>{const r=i?{...i,async:!0}:{async:!0};let o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>R(e,r,p())))}:{success:!0,data:o.value}},W=K(F),Y=e=>(t,n,i)=>{const r=i?{...i,direction:"backward"}:{direction:"backward"};return j(e)(t,n,r)},H=e=>(t,n,i)=>j(e)(t,n,i),Q=e=>async(t,n,i)=>{const r=i?{...i,direction:"backward"}:{direction:"backward"};return B(e)(t,n,r)},X=e=>async(t,n,i)=>B(e)(t,n,i),q=e=>(t,n,i)=>{const r=i?{...i,direction:"backward"}:{direction:"backward"};return J(e)(t,n,r)},ee=e=>(t,n,i)=>J(e)(t,n,i),te=e=>async(t,n,i)=>{const r=i?{...i,direction:"backward"}:{direction:"backward"};return K(e)(t,n,r)},ne=e=>async(t,n,i)=>K(e)(t,n,i),ie=/^[cC][0-9a-z]{6,}$/,re=/^[0-9a-z]+$/,oe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,se=/^[0-9a-vA-V]{20}$/,ae=/^[A-Za-z0-9]{27}$/,ue=/^[a-zA-Z0-9_-]{21}$/,ce=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,le=/^([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})$/,de=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)$/,pe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const fe=/^(?:(?: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])$/,he=/^(([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}|:))$/,me=/^((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])$/,ge=/^(([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])$/,ye=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ve=/^[A-Za-z0-9_-]*$/,_e=/^https?$/,be=/^\+[1-9]\d{6,14}$/,we="(?:(?:\\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])))",ze=new RegExp(`^${we}$`);function Se(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 ke=/^-?\d+$/,Ce=/^-?\d+(?:\.\d+)?$/,Te=/^(?:true|false)$/i,Ne=/^[^A-Z]*$/,Ie=/^[^a-z]*$/,$e=u("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ee={number:"number",bigint:"bigint",object:"date"},Oe=u("$ZodCheckLessThan",(e,t)=>{$e.init(e,t);const n=Ee[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ae=u("$ZodCheckGreaterThan",(e,t)=>{$e.init(e,t);const n=Ee[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pe=u("$ZodCheckMultipleOf",(e,t)=>{$e.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/t,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-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})}}),Ze=u("$ZodCheckNumberFormat",(e,t)=>{$e.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[r,o]=A[t.format];e._zod.onattach.push(e=>{const i=e._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o,n&&(i.pattern=ke)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,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:i,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:i,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>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),xe=u("$ZodCheckMaxLength",(e,t)=>{var n;$e.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!g(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 i=n.value;if(i.length<=t.maximum)return;const r=U(i);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Me=u("$ZodCheckMinLength",(e,t)=>{var n;$e.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!g(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 i=n.value;if(i.length>=t.minimum)return;const r=U(i);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Re=u("$ZodCheckLengthEquals",(e,t)=>{var n;$e.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!g(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 i=n.value,r=i.length;if(r===t.length)return;const o=U(i),s=r>t.length;n.issues.push({origin:o,...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})}}),Ue=u("$ZodCheckStringFormat",(e,t)=>{var n,i;$e.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})}):(i=e._zod).check??(i.check=()=>{})}),De=u("$ZodCheckRegex",(e,t)=>{Ue.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})}}),Ge=u("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ne),Ue.init(e,t)}),Le=u("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ie),Ue.init(e,t)}),Fe=u("$ZodCheckIncludes",(e,t)=>{$e.init(e,t);const n=$(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)}),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})}}),je=u("$ZodCheckStartsWith",(e,t)=>{$e.init(e,t);const n=new RegExp(`^${$(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})}}),Be=u("$ZodCheckEndsWith",(e,t)=>{$e.init(e,t);const n=new RegExp(`.*${$(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=u("$ZodCheckOverwrite",(e,t)=>{$e.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Ve{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)),i=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Ke={major:4,minor:4,patch:3},We=u("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ke;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let i,r=P(e);for(const o of t){if(o._zod.def.when){if(Z(e))continue;if(!o._zod.def.when(e))continue}else if(r)continue;const t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new c;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(r||(r=P(e,t)))});else{if(e.issues.length===t)continue;r||(r=P(e,t))}}return i?i.then(()=>e):e},n=(n,r,o)=>{if(P(n))return n.aborted=!0,n;const s=t(r,i,o);if(s instanceof Promise){if(!1===o.async)throw new c;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(r,o)=>{if(o.skipChecks)return e._zod.parse(r,o);if("backward"===o.direction){const t=e._zod.parse({value:r.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,o)):n(t,r,o)}const s=e._zod.parse(r,o);if(s instanceof Promise){if(!1===o.async)throw new c;return s.then(e=>t(e,i,o))}return t(s,i,o)}}_(e,"~standard",()=>({validate:t=>{try{const n=V(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return W(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Ye=u("$ZodString",(e,t)=>{var n;We.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,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),He=u("$ZodStringFormat",(e,t)=>{Ue.init(e,t),Ye.init(e,t)}),Qe=u("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=le),He.init(e,t)}),Xe=u("$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=de(e))}else t.pattern??(t.pattern=de());He.init(e,t)}),qe=u("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=pe),He.init(e,t)}),et=u("$ZodURL",(e,t)=>{He.init(e,t),e._zod.check=n=>{try{const i=n.value.trim();if(!t.normalize&&t.protocol?.source===_e.source&&!/^https?:\/\//i.test(i))return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});const r=new URL(i);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=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),tt=u("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),He.init(e,t)}),nt=u("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ue),He.init(e,t)}),it=u("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ie),He.init(e,t)}),rt=u("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=re),He.init(e,t)}),ot=u("$ZodULID",(e,t)=>{t.pattern??(t.pattern=oe),He.init(e,t)}),st=u("$ZodXID",(e,t)=>{t.pattern??(t.pattern=se),He.init(e,t)}),at=u("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ae),He.init(e,t)}),ut=u("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Se({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${we}T(?:${i})$`)}(t)),He.init(e,t)}),ct=u("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ze),He.init(e,t)}),lt=u("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Se(t)}$`)),He.init(e,t)}),dt=u("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ce),He.init(e,t)}),pt=u("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fe),He.init(e,t),e._zod.bag.format="ipv4"}),ft=u("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=he),He.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})}}}),ht=u("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=me),He.init(e,t)}),mt=u("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ge),He.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(2!==i.length)throw new Error;const[e,t]=i;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 gt(e){if(""===e)return!0;if(/\s/.test(e))return!1;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const yt=u("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ye),He.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{gt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const vt=u("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ve),He.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!ve.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return gt(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})}}),_t=u("$ZodE164",(e,t)=>{t.pattern??(t.pattern=be),He.init(e,t)});const bt=u("$ZodJWT",(e,t)=>{He.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const r=JSON.parse(atob(i));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})}}),wt=u("$ZodNumber",(e,t)=>{We.init(e,t),e._zod.pattern=e._zod.bag.pattern??Ce,e._zod.parse=(n,i)=>{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 o="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,...o?{received:o}:{}}),n}}),zt=u("$ZodNumberFormat",(e,t)=>{Ze.init(e,t),wt.init(e,t)}),St=u("$ZodBoolean",(e,t)=>{We.init(e,t),e._zod.pattern=Te,e._zod.parse=(n,i)=>{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}}),kt=u("$ZodAny",(e,t)=>{We.init(e,t),e._zod.parse=e=>e}),Ct=u("$ZodUnknown",(e,t)=>{We.init(e,t),e._zod.parse=e=>e}),Tt=u("$ZodNever",(e,t)=>{We.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Nt(e,t,n){e.issues.length&&t.issues.push(...x(n,e.issues)),t.value[n]=e.value}const It=u("$ZodArray",(e,t)=>{We.init(e,t),e._zod.parse=(n,i)=>{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 o=[];for(let e=0;e<r.length;e++){const s=r[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(t=>Nt(t,n,e))):Nt(a,n,e)}return o.length?Promise.all(o).then(()=>n):n}});function $t(e,t,n,i,r,o){const s=n in i;if(e.issues.length){if(r&&o&&!s)return;t.issues.push(...x(n,e.issues))}s||r?void 0===e.value?s&&(t.value[n]=void 0):t.value[n]=e.value:e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]})}function Et(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=(i=e.shape,Object.keys(i).filter(e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ot(e,t,n,i,r,o){const s=[],a=r.keySet,u=r.catchall._zod,c=u.def.type,l="optional"===u.optin,d="optional"===u.optout;for(const r in t){if("__proto__"===r)continue;if(a.has(r))continue;if("never"===c){s.push(r);continue}const o=u.run({value:t[r],issues:[]},i);o instanceof Promise?e.push(o.then(e=>$t(e,n,r,t,l,d))):$t(o,n,r,t,l,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const At=u("$ZodObject",(e,t)=>{We.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 i=m(()=>Et(t));_(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n});const r=k,o=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=i.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 u=[],c=s.shape;for(const e of s.keys){const i=c[e],r="optional"===i._zod.optin,o="optional"===i._zod.optout,s=i._zod.run({value:a[e],issues:[]},n);s instanceof Promise?u.push(s.then(n=>$t(n,t,e,a,r,o))):$t(s,t,e,a,r,o)}return o?Ot(u,a,t,n,i.value,e):u.length?Promise.all(u).then(()=>t):t}}),Pt=u("$ZodObjectJIT",(e,t)=>{At.init(e,t);const n=e._zod.parse,i=m(()=>Et(t));let r;const o=k,s=!d.jitless,a=s&&C.value,u=t.catchall;let c;e._zod.parse=(l,d)=>{c??(c=i.value);const p=l.value;return o(p)?s&&a&&!1===d?.async&&!0!==d.jitless?(r||(r=(e=>{const t=new Ve(["shape","payload","ctx"]),n=i.value,r=e=>{const t=z(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const o=Object.create(null);let s=0;for(const e of n.keys)o[e]="key_"+s++;t.write("const newResult = {};");for(const i of n.keys){const n=o[i],s=z(i),a=e[i],u="optional"===a?._zod?.optin,c="optional"===a?._zod?.optout;t.write(`const ${n} = ${r(i)};`),u&&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 `):u?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(`\n const ${n}_present = ${s} in input;\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 if (!${n}_present && !${n}.issues.length) {\n payload.issues.push({\n code: "invalid_type",\n expected: "nonoptional",\n input: undefined,\n path: [${s}]\n });\n }\n\n if (${n}_present) {\n if (${n}.value === undefined) {\n newResult[${s}] = undefined;\n } else {\n newResult[${s}] = ${n}.value;\n }\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)),l=r(l,d),u?Ot([],p,l,d,c,e):l):n(l,d):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)}});function Zt(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const r=e.filter(e=>!P(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=>R(e,i,p())))}),t)}const xt=u("$ZodUnion",(e,t)=>{We.init(e,t),_(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),_(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),_(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),_(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=>y(e.source)).join("|")})$`)}});const n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:i.value,issues:[]},r);if(t instanceof Promise)s.push(t),o=!0;else{if(0===t.issues.length)return t;s.push(t)}}return o?Promise.all(s).then(t=>Zt(t,i,e,r)):Zt(s,i,e,r)}}),Mt=u("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xt.init(e,t);const n=e._zod.parse;_(e._zod,"propValues",()=>{const e={};for(const n of t.options){const i=n._zod.propValues;if(!i||0===Object.keys(i).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(i)){e[t]||(e[t]=new Set);for(const i of n)e[t].add(i)}}return e});const i=m(()=>{const e=t.options,n=new Map;for(const i of e){const e=i._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,i)}}return n});e._zod.parse=(r,o)=>{const s=r.value;if(!k(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;const a=i.value.get(s?.[t.discriminator]);return a?a._zod.run(r,o):t.unionFallback||"backward"===o.direction?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()),input:s,path:[t.discriminator],inst:e}),r)}}),Rt=u("$ZodIntersection",(e,t)=>{We.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,r=t.left._zod.run({value:i,issues:[]},n),o=t.right._zod.run({value:i,issues:[]},n);return r instanceof Promise||o instanceof Promise?Promise.all([r,o]).then(([t,n])=>Dt(e,t,n)):Dt(e,r,o)}});function Ut(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(T(e)&&T(t)){const n=Object.keys(t),i=Object.keys(e).filter(e=>-1!==n.indexOf(e)),r={...e,...t};for(const n of i){const i=Ut(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r[n]=i.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 i=0;i<e.length;i++){const r=Ut(e[i],t[i]);if(!r.valid)return{valid:!1,mergeErrorPath:[i,...r.mergeErrorPath]};n.push(r.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Dt(e,t,n){const i=new Map;let r;for(const n of t.issues)if("unrecognized_keys"===n.code){r??(r=n);for(const e of n.keys)i.has(e)||i.set(e,{}),i.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)i.has(e)||i.set(e,{}),i.get(e).r=!0;else e.issues.push(t);const o=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&r&&e.issues.push({...r,keys:o}),P(e))return e;const s=Ut(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 Gt=u("$ZodEnum",(e,t)=>{We.init(e,t);const n=f(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(e=>I.has(typeof e)).map(e=>"string"==typeof e?$(e):e.toString()).join("|")})$`),e._zod.parse=(t,r)=>{const o=t.value;return i.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),Lt=u("$ZodLiteral",(e,t)=>{if(We.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?$(e):e?$(e.toString()):String(e)).join("|")})$`),e._zod.parse=(i,r)=>{const o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),Ft=u("$ZodTransform",(e,t)=>{We.init(e,t),e._zod.optin="optional",e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new l(e.constructor.name);const r=t.transform(n.value,n);if(i.async){return(r instanceof Promise?r:Promise.resolve(r)).then(e=>(n.value=e,n.fallback=!0,n))}if(r instanceof Promise)throw new c;return n.value=r,n.fallback=!0,n}});function jt(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Bt=u("$ZodOptional",(e,t)=>{We.init(e,t),e._zod.optin="optional",e._zod.optout="optional",_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${y(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=e.value,r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>jt(e,i)):jt(r,i)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Jt=u("$ZodExactOptional",(e,t)=>{Bt.init(e,t),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Vt=u("$ZodNullable",(e,t)=>{We.init(e,t),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${y(e.source)}|null)$`):void 0}),_(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)}),Kt=u("$ZodDefault",(e,t)=>{We.init(e,t),e._zod.optin="optional",_(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 i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Wt(e,t)):Wt(i,t)}});function Wt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Yt=u("$ZodPrefault",(e,t)=>{We.init(e,t),e._zod.optin="optional",_(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=u("$ZodNonOptional",(e,t)=>{We.init(e,t),_(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,i)=>{const r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(t=>Qt(t,e)):Qt(r,e)}});function Qt(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 Xt=u("$ZodCatch",(e,t)=>{We.init(e,t),e._zod.optin="optional",_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(e=>R(e,n,p()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(e=>R(e,n,p()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),qt=u("$ZodPipe",(e,t)=>{We.init(e,t),_(e._zod,"values",()=>t.in._zod.values),_(e._zod,"optin",()=>t.in._zod.optin),_(e._zod,"optout",()=>t.out._zod.optout),_(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then(e=>en(e,t.in,n)):en(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then(e=>en(e,t.out,n)):en(i,t.out,n)}});function en(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const tn=u("$ZodReadonly",(e,t)=>{We.init(e,t),_(e._zod,"propValues",()=>t.innerType._zod.propValues),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"optin",()=>t.innerType?._zod?.optin),_(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(nn):nn(i)}});function nn(e){return e.value=Object.freeze(e.value),e}const rn=u("$ZodCustom",(e,t)=>{$e.init(e,t),We.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,r=t.fn(i);if(r instanceof Promise)return r.then(t=>on(t,n,i,e));on(r,n,i,e)}});function on(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(D(e))}}var sn;class an{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 i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(sn=globalThis).__zod_globalRegistry??(sn.__zod_globalRegistry=new an);const un=globalThis.__zod_globalRegistry;function cn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...O(t)})}function ln(e,t){return new Oe({check:"less_than",...O(t),value:e,inclusive:!1})}function dn(e,t){return new Oe({check:"less_than",...O(t),value:e,inclusive:!0})}function pn(e,t){return new Ae({check:"greater_than",...O(t),value:e,inclusive:!1})}function fn(e,t){return new Ae({check:"greater_than",...O(t),value:e,inclusive:!0})}function hn(e,t){return new Pe({check:"multiple_of",...O(t),value:e})}function mn(e,t){return new xe({check:"max_length",...O(t),maximum:e})}function gn(e,t){return new Me({check:"min_length",...O(t),minimum:e})}function yn(e,t){return new Re({check:"length_equals",...O(t),length:e})}function vn(e){return new Je({check:"overwrite",tx:e})}function _n(e,t){const n=function(e,t){const n=new $e({check:"custom",...O(t)});return n._zod.check=e,n}(t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(D(e,t.value,n._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),t.issues.push(D(i))}},e(t.value,t)),t);return n}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??un,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 wn(e,t,n={path:[],schemaPath:[]}){var i;const r=e._zod.def,o=t.seen.get(e);if(o){o.count++;return n.schemaPath.includes(e)&&(o.cycle=n.path),o.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 i={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,i);else{const n=s.schema,o=t.processors[r.type];if(!o)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);o(e,t,n,i)}const o=e._zod.parent;o&&(s.ref||(s.ref=o),wn(o,t,i),t.seen.get(o).isParent=!0)}const u=t.metadataRegistry.get(e);u&&Object.assign(s.schema,u),"input"===t.io&&kn(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&"_prefault"in s.schema&&((i=s.schema).default??(i.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 i=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=i.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.`);i.set(n,t[0])}}const r=t=>{if(t[1].schema.$ref)return;const i=t[1],{ref:r,defId:o}=(t=>{const i="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 o=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=o,{defId:o,ref:`${r("__shared")}#/${i}/${o}`}}if(t[1]===n)return{ref:"#"};const r=`#/${i}/`,o=t[1].schema.id??"__schema"+e.counter++;return{defId:o,ref:r+o}})(t);i.def={...i.schema},o&&(i.defId=o);const s=i.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 i=n[1];if(t===n[0]){r(n);continue}if(e.external){const i=e.external.registry.get(n[0])?.id;if(t!==n[0]&&i){r(n);continue}}const o=e.metadataRegistry.get(n[0])?.id;o?r(n):(i.cycle||i.count>1&&"ref"===e.reused)&&r(n)}}function Sn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=t=>{const n=e.seen.get(t);if(null===n.ref)return;const r=n.def??n.schema,o={...r},s=n.ref;if(n.ref=null,s){i(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,o);if(t._zod.parent===s)for(const e in r)"$ref"!==e&&"allOf"!==e&&(e in o||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){i(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())i(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 o=e.metadataRegistry.get(t)?.id;void 0!==o&&r.id===o&&delete r.id;const s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?r.$defs=s:r.definitions=s);try{const n=JSON.parse(JSON.stringify(r));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Cn(t,"input",e.processors),output:Cn(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function kn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return kn(i.element,n);if("set"===i.type)return kn(i.valueType,n);if("lazy"===i.type)return kn(i.getter(),n);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type)return kn(i.innerType,n);if("intersection"===i.type)return kn(i.left,n)||kn(i.right,n);if("record"===i.type||"map"===i.type)return kn(i.keyType,n)||kn(i.valueType,n);if("pipe"===i.type)return!!e._zod.traits.has("$ZodCodec")||(kn(i.in,n)||kn(i.out,n));if("object"===i.type){for(const e in i.shape)if(kn(i.shape[e],n))return!0;return!1}if("union"===i.type){for(const e of i.options)if(kn(e,n))return!0;return!1}if("tuple"===i.type){for(const e of i.items)if(kn(e,n))return!0;return!(!i.rest||!kn(i.rest,n))}return!1}const Cn=(e,t,n={})=>i=>{const{libraryOptions:r,target:o}=i??{},s=bn({...r??{},target:o,io:t,processors:n});return wn(e,s),zn(s,e),Sn(s,e)},Tn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Nn=(e,t,n,i)=>{const r=e._zod.def;wn(r.innerType,t,i);t.seen.get(e).ref=r.innerType},In=u("ZodISODateTime",(e,t)=>{ut.init(e,t),ni.init(e,t)});function $n(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...O(t)})}(In,e)}const En=u("ZodISODate",(e,t)=>{ct.init(e,t),ni.init(e,t)});function On(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...O(t)})}(En,e)}const An=u("ZodISOTime",(e,t)=>{lt.init(e,t),ni.init(e,t)});function Pn(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...O(t)})}(An,e)}const Zn=u("ZodISODuration",(e,t)=>{dt.init(e,t),ni.init(e,t)});function xn(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...O(t)})}(Zn,e)}const Mn=(e,t)=>{L.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},i=(e,r=[])=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>i({issues:e},[...r,...o.path]));else if("invalid_key"===o.code)i({issues:o.issues},[...r,...o.path]);else if("invalid_element"===o.code)i({issues:o.issues},[...r,...o.path]);else{const e=[...r,...o.path];if(0===e.length)n._errors.push(t(o));else{let i=n,r=0;for(;r<e.length;){const n=e[r];r===e.length-1?(i[n]=i[n]||{_errors:[]},i[n]._errors.push(t(o))):i[n]=i[n]||{_errors:[]},i=i[n],r++}}}};return i(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},i=[];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))):i.push(t(r));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,h,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,h,2)}},isEmpty:{get:()=>0===e.issues.length}})},Rn=u("ZodError",Mn,{Parent:Error}),Un=j(Rn),Dn=B(Rn),Gn=J(Rn),Ln=K(Rn),Fn=Y(Rn),jn=H(Rn),Bn=Q(Rn),Jn=X(Rn),Vn=q(Rn),Kn=ee(Rn),Wn=te(Rn),Yn=ne(Rn),Hn=new WeakMap;function Qn(e,t,n){const i=Object.getPrototypeOf(e);let r=Hn.get(i);if(r||(r=new Set,Hn.set(i,r)),!r.has(t)){r.add(t);for(const e in n){const t=n[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,get(){const n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const Xn=u("ZodType",(e,t)=>(We.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Cn(e,"input"),output:Cn(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const i=bn({...n,processors:t});return wn(e,i),zn(i,e),Sn(i,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Un(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Gn(e,t,n),e.parseAsync=async(t,n)=>Dn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ln(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Fn(e,t,n),e.decode=(t,n)=>jn(e,t,n),e.encodeAsync=async(t,n)=>Bn(e,t,n),e.decodeAsync=async(t,n)=>Jn(e,t,n),e.safeEncode=(t,n)=>Vn(e,t,n),e.safeDecode=(t,n)=>Kn(e,t,n),e.safeEncodeAsync=async(t,n)=>Wn(e,t,n),e.safeDecodeAsync=async(t,n)=>Yn(e,t,n),Qn(e,"ZodType",{check(...e){const t=this.def;return this.clone(w(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return E(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...O(n)})}(ar,e,t)}(e,t))},superRefine(e,t){return this.check(function(e,t){return _n(e,t)}(e,t))},overwrite(e){return this.check(vn(e))},optional(){return Hi(this)},exactOptional(){return new Qi({type:"optional",innerType:this})},nullable(){return qi(this)},nullish(){return Hi(qi(this))},nonoptional(e){return function(e,t){return new nr({type:"nonoptional",innerType:e,...O(t)})}(this,e)},array(){return xi(this)},or(e){return Di([this,e])},and(e){return ji(this,e)},transform(e){return or(this,new Wi({type:"transform",transform:e}))},default(e){return t=e,new er({type:"default",innerType:this,get defaultValue(){return"function"==typeof t?t():N(t)}});var t},prefault(e){return t=e,new tr({type:"prefault",innerType:this,get defaultValue(){return"function"==typeof t?t():N(t)}});var t},catch(e){return new ir({type:"catch",innerType:this,catchValue:"function"==typeof(t=e)?t:()=>t});var t},pipe(e){return or(this,e)},readonly(){return new sr({type:"readonly",innerType:this})},describe(e){const t=this.clone();return un.add(t,{description:e}),t},meta(...e){if(0===e.length)return un.get(this);const t=this.clone();return un.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>un.get(e)?.description,configurable:!0}),e)),qn=u("_ZodString",(e,t)=>{Ye.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n)=>{const i=n;i.type="string";const{minimum:r,maximum:o,format:s,patterns:a,contentEncoding:u}=e._zod.bag;if("number"==typeof r&&(i.minLength=r),"number"==typeof o&&(i.maxLength=o),s&&(i.format=Tn[s]??s,""===i.format&&delete i.format,"time"===s&&delete i.format),u&&(i.contentEncoding=u),a&&a.size>0){const e=[...a];1===e.length?i.pattern=e[0].source:e.length>1&&(i.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,Qn(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new De({check:"string_format",format:"regex",...O(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new Fe({check:"string_format",format:"includes",...O(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new je({check:"string_format",format:"starts_with",...O(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new Be({check:"string_format",format:"ends_with",...O(t),suffix:e})}(...e))},min(...e){return this.check(gn(...e))},max(...e){return this.check(mn(...e))},length(...e){return this.check(yn(...e))},nonempty(...e){return this.check(gn(1,...e))},lowercase(e){return this.check(function(e){return new Ge({check:"string_format",format:"lowercase",...O(e)})}(e))},uppercase(e){return this.check(function(e){return new Le({check:"string_format",format:"uppercase",...O(e)})}(e))},trim(){return this.check(vn(e=>e.trim()))},normalize(...e){return this.check(function(e){return vn(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(vn(e=>e.toLowerCase()))},toUpperCase(){return this.check(vn(e=>e.toUpperCase()))},slugify(){return this.check(vn(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}})}),ei=u("ZodString",(e,t)=>{Ye.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,...O(t)})}(ii,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...O(t)})}(si,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...O(t)})}(wi,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...O(t)})}(ai,t)),e.guid=t=>e.check(cn(ri,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...O(t)})}(oi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...O(t)})}(oi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...O(t)})}(oi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...O(t)})}(oi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...O(t)})}(ui,t)),e.guid=t=>e.check(cn(ri,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...O(t)})}(ci,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...O(t)})}(li,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...O(t)})}(di,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...O(t)})}(vi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...O(t)})}(_i,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...O(t)})}(pi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...O(t)})}(fi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...O(t)})}(hi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...O(t)})}(mi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...O(t)})}(gi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...O(t)})}(yi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...O(t)})}(bi,t)),e.datetime=t=>e.check($n(t)),e.date=t=>e.check(On(t)),e.time=t=>e.check(Pn(t)),e.duration=t=>e.check(xn(t))});function ti(e){return function(e,t){return new e({type:"string",...O(t)})}(ei,e)}const ni=u("ZodStringFormat",(e,t)=>{He.init(e,t),qn.init(e,t)}),ii=u("ZodEmail",(e,t)=>{qe.init(e,t),ni.init(e,t)}),ri=u("ZodGUID",(e,t)=>{Qe.init(e,t),ni.init(e,t)}),oi=u("ZodUUID",(e,t)=>{Xe.init(e,t),ni.init(e,t)}),si=u("ZodURL",(e,t)=>{et.init(e,t),ni.init(e,t)}),ai=u("ZodEmoji",(e,t)=>{tt.init(e,t),ni.init(e,t)}),ui=u("ZodNanoID",(e,t)=>{nt.init(e,t),ni.init(e,t)}),ci=u("ZodCUID",(e,t)=>{it.init(e,t),ni.init(e,t)}),li=u("ZodCUID2",(e,t)=>{rt.init(e,t),ni.init(e,t)}),di=u("ZodULID",(e,t)=>{ot.init(e,t),ni.init(e,t)}),pi=u("ZodXID",(e,t)=>{st.init(e,t),ni.init(e,t)}),fi=u("ZodKSUID",(e,t)=>{at.init(e,t),ni.init(e,t)}),hi=u("ZodIPv4",(e,t)=>{pt.init(e,t),ni.init(e,t)}),mi=u("ZodIPv6",(e,t)=>{ft.init(e,t),ni.init(e,t)}),gi=u("ZodCIDRv4",(e,t)=>{ht.init(e,t),ni.init(e,t)}),yi=u("ZodCIDRv6",(e,t)=>{mt.init(e,t),ni.init(e,t)}),vi=u("ZodBase64",(e,t)=>{yt.init(e,t),ni.init(e,t)}),_i=u("ZodBase64URL",(e,t)=>{vt.init(e,t),ni.init(e,t)}),bi=u("ZodE164",(e,t)=>{_t.init(e,t),ni.init(e,t)}),wi=u("ZodJWT",(e,t)=>{bt.init(e,t),ni.init(e,t)}),zi=u("ZodNumber",(e,t)=>{wt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n)=>{const i=n,{minimum:r,maximum:o,format:s,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;"string"==typeof s&&s.includes("int")?i.type="integer":i.type="number";const l="number"==typeof c&&c>=(r??Number.NEGATIVE_INFINITY),d="number"==typeof u&&u<=(o??Number.POSITIVE_INFINITY),p="draft-04"===t.target||"openapi-3.0"===t.target;l?p?(i.minimum=c,i.exclusiveMinimum=!0):i.exclusiveMinimum=c:"number"==typeof r&&(i.minimum=r),d?p?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:"number"==typeof o&&(i.maximum=o),"number"==typeof a&&(i.multipleOf=a)})(e,t,n),Qn(e,"ZodNumber",{gt(e,t){return this.check(pn(e,t))},gte(e,t){return this.check(fn(e,t))},min(e,t){return this.check(fn(e,t))},lt(e,t){return this.check(ln(e,t))},lte(e,t){return this.check(dn(e,t))},max(e,t){return this.check(dn(e,t))},int(e){return this.check(Ci(e))},safe(e){return this.check(Ci(e))},positive(e){return this.check(pn(0,e))},nonnegative(e){return this.check(fn(0,e))},negative(e){return this.check(ln(0,e))},nonpositive(e){return this.check(dn(0,e))},multipleOf(e,t){return this.check(hn(e,t))},step(e,t){return this.check(hn(e,t))},finite(){return this}});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 Si(e){return function(e,t){return new e({type:"number",checks:[],...O(t)})}(zi,e)}const ki=u("ZodNumberFormat",(e,t)=>{zt.init(e,t),zi.init(e,t)});function Ci(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...O(t)})}(ki,e)}const Ti=u("ZodBoolean",(e,t)=>{St.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function Ni(e){return function(e,t){return new e({type:"boolean",...O(t)})}(Ti,e)}const Ii=u("ZodAny",(e,t)=>{kt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function $i(){return new Ii({type:"any"})}const Ei=u("ZodUnknown",(e,t)=>{Ct.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Oi(){return new Ei({type:"unknown"})}const Ai=u("ZodNever",(e,t)=>{Tt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function Pi(e){return function(e,t){return new e({type:"never",...O(t)})}(Ai,e)}const Zi=u("ZodArray",(e,t)=>{It.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=n,o=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=wn(o.element,t,{...i,path:[...i.path,"items"]})})(e,t,n,i),e.element=t.element,Qn(e,"ZodArray",{min(e,t){return this.check(gn(e,t))},nonempty(e){return this.check(gn(1,e))},max(e,t){return this.check(mn(e,t))},length(e,t){return this.check(yn(e,t))},unwrap(){return this.element}})});function xi(e,t){return function(e,t,n){return new e({type:"array",element:t,...O(n)})}(Zi,e,t)}const Mi=u("ZodObject",(e,t)=>{Pt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=n,o=e._zod.def;r.type="object",r.properties={};const s=o.shape;for(const e in s)r.properties[e]=wn(s[e],t,{...i,path:[...i.path,"properties",e]});const a=new Set(Object.keys(s)),u=new Set([...a].filter(e=>{const n=o.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));u.size>0&&(r.required=Array.from(u)),"never"===o.catchall?._zod.def.type?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=wn(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,n,i),_(e,"shape",()=>t.shape),Qn(e,"ZodObject",{keyof(){return Ji(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Oi()})},loose(){return this.clone({...this._zod.def,catchall:Oi()})},strict(){return this.clone({...this._zod.def,catchall:Pi()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!T(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 i=w(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return b(this,"shape",n),n}});return E(e,i)}(this,e)},safeExtend(e){return function(e,t){if(!T(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=w(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return b(this,"shape",n),n}});return E(e,n)}(this,e)},merge(e){return function(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=w(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return b(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return E(e,n)}(this,e)},pick(e){return function(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return E(e,w(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return b(this,"shape",e),e},checks:[]}))}(this,e)},omit(e){return function(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=w(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return b(this,"shape",i),i},checks:[]});return E(e,r)}(this,e)},partial(...e){return function(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=w(t._zod.def,{get shape(){const i=t._zod.def.shape,r={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)r[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return b(this,"shape",r),r},checks:[]});return E(t,r)}(Yi,this,e[0])},required(...e){return function(e,t,n){const i=w(t._zod.def,{get shape(){const i=t._zod.def.shape,r={...i};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:i[t]}))}else for(const t in i)r[t]=new e({type:"nonoptional",innerType:i[t]});return b(this,"shape",r),r}});return E(t,i)}(nr,this,e[0])}})});function Ri(e,t){const n={type:"object",shape:e??{},...O(t)};return new Mi(n)}const Ui=u("ZodUnion",(e,t)=>{xt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def,o=!1===r.inclusive,s=r.options.map((e,n)=>wn(e,t,{...i,path:[...i.path,o?"oneOf":"anyOf",n]}));o?n.oneOf=s:n.anyOf=s})(e,t,n,i),e.options=t.options});function Di(e,t){return new Ui({type:"union",options:e,...O(t)})}const Gi=u("ZodDiscriminatedUnion",(e,t)=>{Ui.init(e,t),Mt.init(e,t)});function Li(e,t,n){return new Gi({type:"union",options:t,discriminator:e,...O(n)})}const Fi=u("ZodIntersection",(e,t)=>{Rt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def,o=wn(r.left,t,{...i,path:[...i.path,"allOf",0]}),s=wn(r.right,t,{...i,path:[...i.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,u=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=u})(e,t,n,i)});function ji(e,t){return new Fi({type:"intersection",left:e,right:t})}const Bi=u("ZodEnum",(e,t)=>{Gt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n)=>{const i=f(e._zod.def.entries);i.every(e=>"number"==typeof e)&&(n.type="number"),i.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=i})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const r={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);r[i]=t.entries[i]}return new Bi({...t,checks:[],...O(i),entries:r})},e.exclude=(e,i)=>{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 Bi({...t,checks:[],...O(i),entries:r})}});function Ji(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Bi({type:"enum",entries:n,...O(t)})}const Vi=u("ZodLiteral",(e,t)=>{Lt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n)=>{const i=e._zod.def,r=[];for(const e of i.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 Ki(e,t){return new Vi({type:"literal",values:Array.isArray(e)?e:[e],...O(t)})}const Wi=u("ZodTransform",(e,t)=>{Ft.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,i)=>{if("backward"===i.direction)throw new l(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(D(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(D(t))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});const Yi=u("ZodOptional",(e,t)=>{Bt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>Nn(e,t,0,i),e.unwrap=()=>e._zod.def.innerType});function Hi(e){return new Yi({type:"optional",innerType:e})}const Qi=u("ZodExactOptional",(e,t)=>{Jt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>Nn(e,t,0,i),e.unwrap=()=>e._zod.def.innerType});const Xi=u("ZodNullable",(e,t)=>{Vt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def,o=wn(r.innerType,t,i),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]})(e,t,n,i),e.unwrap=()=>e._zod.def.innerType});function qi(e){return new Xi({type:"nullable",innerType:e})}const er=u("ZodDefault",(e,t)=>{Kt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def;wn(r.innerType,t,i),t.seen.get(e).ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))})(e,t,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const tr=u("ZodPrefault",(e,t)=>{Yt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def;wn(r.innerType,t,i),t.seen.get(e).ref=r.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))})(e,t,n,i),e.unwrap=()=>e._zod.def.innerType});const nr=u("ZodNonOptional",(e,t)=>{Ht.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def;wn(r.innerType,t,i),t.seen.get(e).ref=r.innerType})(e,t,0,i),e.unwrap=()=>e._zod.def.innerType});const ir=u("ZodCatch",(e,t)=>{Xt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def;let o;wn(r.innerType,t,i),t.seen.get(e).ref=r.innerType;try{o=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o})(e,t,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const rr=u("ZodPipe",(e,t)=>{qt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s="input"===t.io?o?r.out:r.in:r.out;wn(s,t,i),t.seen.get(e).ref=s})(e,t,0,i),e.in=t.in,e.out=t.out});function or(e,t){return new rr({type:"pipe",in:e,out:t})}const sr=u("ZodReadonly",(e,t)=>{tn.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def;wn(r.innerType,t,i),t.seen.get(e).ref=r.innerType,n.readOnly=!0})(e,t,n,i),e.unwrap=()=>e._zod.def.innerType});const ar=u("ZodCustom",(e,t)=>{rn.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 ur=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],cr=Ji(ur),lr=Ri({targetedCountryGroups:xi(cr),targetedCountryCodes:xi(ti()).optional()}).optional(),dr={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},pr={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},fr={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},hr={GBP:"£",USD:"$",AUD:"$",EUR:"€",NZD:"NZ$",CAD:"CA$"},mr=e=>Object.keys(dr).find(t=>dr[t].countries.includes(e??""))??"International",gr=(e,t=[],n=[])=>0===t.length&&0===n.length||!!e&&(!!t.includes(mr(e.toUpperCase()))||n.includes(e.toUpperCase())),yr=e=>{if(e){const t=mr(e);return fr[t]}return"£"},vr=e=>{if(e)return pr[e]},_r=e=>e.includes("subscribe/weekly/checkout"),br=(e,t)=>{if(t){const n=(e=>dr[mr(e)].supportRegionId)(t);if(!_r(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,(e,t,i)=>`${t}/${n.toLowerCase()}/${i}`)}return e},wr=(e,t,n,i)=>{if(i){const r=i[mr(n)];return`${yr(n)}${r[e][t].price}`}},zr={CURRENCY_SYMBOL:({countryCode:e})=>yr(e),COUNTRY_NAME:({countryCode:e})=>vr(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>wr("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>wr("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>wr("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>wr("GuardianWeekly","Annual",e,t),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},Sr=(e,t,n)=>e?e.replace(kr,e=>{const i=e.substring(2,e.length-2),r=zr[i];if(r){const e=r({countryCode:t,prices:n});if(e)return e}return e}):"",kr=/%%.*?%%/g,Cr=e=>{const t=e.match(kr)?.filter(e=>"%%ARTICLE_COUNT%%"!==e);return!!t&&t.length>0},Tr="gu.contributions.views",Nr=e=>e.get(Tr)??void 0,Ir=e=>{const t=JSON.parse(localStorage.getItem(Tr)??""),n=t?t.value:[];n.push({date:(new Date).getTime(),testId:e});const i={value:n.slice(-50)};localStorage.setItem(Tr,JSON.stringify(i))},$r=e=>{const t=(e=>{const t=new Date(e,10,1).getDay();return new Date(e,10,22+(11-t)%7)})(e);return t.setDate(t.getDate()+5),t},Er=(e=new Date)=>{const t=(e=>{const t=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+t),e})(e),n=(t.getMonth()+1).toString().padStart(2,"0"),i=t.toLocaleString("default",{month:"long"}),r=t.getFullYear();return{reminderCta:`Remind me in ${i}`,reminderPeriod:`${r}-${n}-01`,reminderLabel:`${i} ${r}`}},Or=new Date("2023-12-31"),Ar=e=>e>=(e=>new Date(e.getFullYear(),10,15))(e)&&e<$r(e.getFullYear()),Pr=(e,t=new Date)=>{return"US"===e&&Ar(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${n=t.getFullYear()}-${($r(n).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${n}`}:"US"===e&&(e=>e>=$r(e.getFullYear())&&e<Or)(t)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(t.getFullYear()):Er(t);var n},Zr=Ri({text:ti(),baseUrl:ti()});let xr=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});var Mr;new Bi({type:"enum",entries:xr,...O(Mr)});const Rr=Li("type",[Ri({type:Ki(xr.Custom),cta:Zr}),Ri({type:Ki(xr.ContributionsReminder)})]),Ur=Ri({countLabel:ti(),goalCopy:ti().optional()}),Dr=Ri({total:Si(),goal:Si()}),Gr=Ji(["US","AU","global"]),Lr=Ri({currencySymbol:ti(),copy:Ur,name:Gr,tickerData:Dr.optional()}),Fr=Ri({for52Weeks:Si(),forTargetedWeeks:Si()}),jr=Ji(["for52Weeks","forTargetedWeeks"]),Br=Ri({type:Ki("above"),copy:ti().optional(),countType:jr.optional()}),Jr=Ji(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),Vr=Ji(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),Kr=Ri({abTestName:ti(),abTestVariant:ti(),campaignCode:ti(),componentType:Vr,products:xi(Jr).nullish(),labels:xi(ti()).nullish(),ophanPageId:ti(),platformId:ti(),referrerUrl:ti()}),Wr=Ri({mainUrl:ti(),mobileUrl:ti().optional(),tabletUrl:ti().optional(),desktopUrl:ti().optional(),leftColUrl:ti().optional(),wideUrl:ti().optional(),altText:ti()}),Yr=Ri({name:ti(),description:ti().optional(),headshot:Wr.optional()}),Hr=/^[0-9A-F]{2}$/,Qr=ti().refine(e=>Hr.test(e),{error:e=>`"${JSON.stringify(e.input)}" is not a valid hex value`}),Xr=Ri({r:Qr,g:Qr,b:Qr,kind:Ki("hex")}),qr=Ri({mobileUrl:ti(),tabletUrl:ti(),desktopUrl:ti(),altText:ti(),kind:Ki("Image")}),eo=Ri({buttonColour:Xr.nullish(),buttonTextColour:Xr.nullish(),buttonBorderColour:Xr.nullish(),buttonSelectColour:Xr.nullish(),buttonSelectTextColour:Xr.nullish(),buttonSelectBorderColour:Xr.nullish(),buttonSelectMarkerColour:Xr.nullish(),pillTextColour:Xr.nullish(),pillBackgroundColour:Xr.nullish(),kind:Ki("ChoiceCards")}),to=Ri({visual:Li("kind",[qr,eo]).nullish(),colours:Ri({basic:Ri({background:Xr,bodyText:Xr})})}),no=e=>`#${e.r}${e.g}${e.b}`,io=Ri({copy:ti()}),ro=Di([Ki("Monthly"),Ki("Annual")]),oo=Li("supportTier",[Ri({supportTier:Ki("Contribution"),ratePlan:ro}),Ri({supportTier:Ki("SupporterPlus"),ratePlan:ro}),Ri({supportTier:Ki("DigitalSubscription"),ratePlan:ro}),Ri({supportTier:Ki("OneOff")})]),so=Ri({copy:ti(),textColour:Xr.nullish(),backgroundColour:Xr.nullish()}),ao=Di([Ki("LandingPage"),Ki("Checkout")]),uo=Ri({testName:ti(),variantName:ti()}),co=Ri({product:oo,label:ti(),isDefault:Ni(),defaultExpanded:Ni().optional(),benefitsLabel:ti().nullish(),benefits:xi(io),pill:so.nullish(),destination:ao.nullish(),destinationTest:uo.nullish()}),lo=Ri({choiceCards:xi(co),mobileChoiceCards:xi(co).nullish()}),po=Ri({maxViewsCount:Si(),maxViewsDays:Si(),minDaysBetweenViews:Si()}),fo=Ri({reminderCta:ti(),reminderLabel:ti(),reminderPeriod:ti()}),ho=Ji(["ONE_OFF","MONTHLY","ANNUAL"]),mo=Ri({newsletterId:ti(),successDescription:ti()}),go=Ri({name:ti(),heading:ti().optional(),paragraphs:xi(ti()),highlightedText:ti().optional(),tickerSettings:Lr.optional(),cta:Zr.optional(),secondaryCta:Rr.optional(),newsletterSignup:mo.optional(),image:Wr.optional(),showReminderFields:fo.optional(),separateArticleCount:Br.optional(),promoCodes:xi(ti()).nullish(),maxViews:po.optional(),showSignInLink:Ni().optional(),bylineWithImage:Yr.optional(),showChoiceCards:Ni().optional(),choiceCardsSettings:lo.nullish(),defaultChoiceCardFrequency:ho.optional()}),yo=Ri({variant:go,tracking:Kr,countryCode:ti().nullish(),articleCounts:Fr,onReminderOpen:$i().nullish(),fetchEmail:$i().nullish(),submitComponentEvent:$i().nullish(),openCmp:$i().nullish(),hasConsentForArticleCount:Ni().nullish(),stage:ti().nullish()}),vo=Ji(["contributions","subscriptions","signIn","abandonedBasket"]),_o=Ri({heading:ti().optional(),messageText:ti().optional(),paragraphs:xi(ti()).optional(),mobileMessageText:ti().optional(),highlightedText:ti().optional(),cta:Zr.optional(),secondaryCta:Rr.optional()}),bo=Ri({tracking:Kr,bannerChannel:vo,content:_o.nullish(),mobileContent:_o.nullish(),countryCode:ti().nullish(),isSupporter:Ni().nullish(),tickerSettings:Lr.nullish(),submitComponentEvent:$i(),articleCounts:Fr,hasOptedOutOfArticleCount:Ni().nullish(),fetchEmail:$i().nullish(),separateArticleCount:Ni().nullish(),design:to.nullish(),choiceCardsSettings:lo.nullish(),promoCodes:xi(ti()).nullish(),isCollapsible:Ni().nullish(),contributionsServiceUrl:ti().nullish()}),wo=Ri({heading:ti(),subheading:ti(),primaryCta:Zr.optional(),secondaryCta:Zr.optional(),benefits:xi(ti()).optional()}),zo=Ri({content:wo,tracking:Kr,mobileContent:wo.optional(),countryCode:ti().optional(),submitComponentEvent:$i(),numArticles:Si().optional(),promoCodes:xi(ti()).nullish()}),So=Ri({image:Wr,bodyCopy:xi(ti()),cta:Zr.optional()});Ri({content:So,tracking:Kr,countryCode:ti().optional(),submitComponentEvent:$i(),promoCodes:xi(ti()).nullish()});const ko=Ji(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),Co=Ji(["new","guest","current"]),To=Ji(["Epic","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),No=Ji(["Live","Draft","Archived"]),Io=Ji(["Mobile","Desktop","All","iOS","Android"]),$o=Ji(["SignedIn","SignedOut","All"]),Eo=Ji(["HasConsented","HasNotConsented","All"]),Oo=ji(Li("name",[Ri({name:Ki("ABTest")}),Ri({name:Ki("EpsilonGreedyBandit"),epsilon:Si(),sampleCount:Si().optional()}),Ri({name:Ki("Roulette"),sampleCount:Si().optional()})]),Ri({testName:ti().optional()})),Ao=Ri({channel:To,name:ti(),status:No,priority:Si(),controlProportionSettings:Ri({proportion:Si(),offset:Si()}).optional(),deviceType:Io.optional(),signedInStatus:$o.optional(),consentStatus:Eo.optional(),methodologies:Oo.array().optional(),mParticleAudience:Si().nullish(),scheduler:Ri({start:ti().optional(),end:ti().optional()}).optional()}),Po=Ji(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Zo=Ri({minViews:Si(),maxViews:Si().optional(),periodInWeeks:Si(),tagIds:xi(ti()).optional()});Ri({userType:xi(Co),product:xi(ko)}),Ri({tagIds:xi(ti()),sectionIds:xi(ti()),excludedTagIds:xi(ti()),excludedSectionIds:xi(ti())});const xo=Ri({maxViewsCount:Si(),maxViewsDays:Si(),minDaysBetweenViews:Si()}),Mo=["ONE_OFF","MONTHLY","ANNUAL"];Ao.extend({name:ti(),status:No,locations:xi(cr).optional(),regionTargeting:lr.optional(),tagIds:xi(ti()),sections:xi(ti()),excludedTagIds:xi(ti()),excludedSections:xi(ti()),alwaysAsk:Ni(),maxViews:xo.optional(),userCohort:Po,hasCountryName:Ni(),highPriority:Ni(),useLocalViewLog:Ni(),articlesViewedSettings:Zo.optional(),priority:Si(),variants:go.array()});const Ro=Ri({amount:Di([Si(),Ki("other")]),billingPeriod:Di([Ki("ONE_OFF"),Ki("MONTHLY"),Ki("ANNUAL")]),product:Di([Ki("Contribution"),Ki("SupporterPlus"),Ki("PremiumTier"),Ki("DailyEdition"),Ki("GuardianWeekly"),Ki("Paper"),Ki("PaperAndDigital")]),region:Di([Ki("uk"),Ki("us"),Ki("au"),Ki("eu"),Ki("int"),Ki("nz"),Ki("ca")])}),Uo=(e,t,n,i)=>{const r=(e=>new URLSearchParams(window.location.search).get(`force-${e}`))(e),o=(e=>new URLSearchParams(window.location.search).get(`preview-${e}`))(e),s=new URLSearchParams;r?s.set("force",r):o&&s.set("preview",o);const a=s.toString();return fetch(a?`${t}/${e}?${a}`:`${t}/${e}`,{method:"post",headers:{"Content-Type":"application/json",...i},body:JSON.stringify(n)}).then(t=>{if(!t.ok)throw Error(t.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${t.status}`);return t}).then(e=>e.json())},Do=(e,t,n)=>Uo("epic",e,t,n),Go=(e,t)=>Uo("liveblog-epic",e,t),Lo=(e,t)=>Uo("banner",e,t),Fo=(e,t)=>Uo("gutter-liveblog",e,t),jo=(e,t)=>Uo("header",e,t);export{ur as CountryGroupId,xr as SecondaryCtaType,Ro as abandonedBasketSchema,br as addRegionIdToSupportUrl,bo as bannerSchema,Er as buildReminderFields,Cr as containsNonArticleCountPlaceholder,Mo as contributionTabFrequencies,mr as countryCodeToCountryGroupId,cr as countryGroupIdSchema,dr as countryGroups,yo as epicPropsSchema,Lo as getBanner,vr as getCountryName,Do as getEpic,Nr as getEpicViewLog,Fo as getGutterLiveblog,jo as getHeader,Go as getLiveblogEpic,yr as getLocalCurrencySymbol,Pr as getReminderFields,i as getWeeklyArticleHistory,zo as headerPropsSchema,no as hexColourToString,gr as inTargetedCountry,s as incrementWeeklyArticleCount,_r as isGWCheckoutUrl,hr as isoCurrencyToCurrencySymbol,Ir as logEpicView,Sr as replaceNonArticleCountPlaceholders,lr as targetedRegionsSchema};
|
|
1
|
+
const e="gu.history.weeklyArticleCount",t="gu.history.articleCountsThisWeek",n=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},i=t=>t.get(e)??void 0,r=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),o=(e,t={})=>(e.forEach(e=>{r.has(e)&&(t[e]=(t[e]??0)+1)}),t),s=(i,r,s)=>{const a=((e,i)=>{const r=n(new Date),o=e.get(t);if(o?.week===r){const n=o.articles[i]||0;return e.set(t,{week:r,articles:{...o.articles,[i]:n+1}}),n>0}return e.set(t,{week:r,articles:{[i]:1}}),!1})(i,r);if(!a){const t=n(new Date),r=i.get(e)??[],a=r.length>0?r[0]:null;if(a?.week&&a.week===t)a.count+=1,a.tags=o(s,a.tags),i.set(e,r);else{r.unshift({week:t,count:1,tags:o(s,{})});const n=t-365,a=r.filter(e=>e.week>=n);i.set(e,a)}}};var a;function u(e,t,n){function i(n,i){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:i,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,i);const r=s.prototype,o=Object.keys(r);for(let e=0;e<o.length;e++){const t=o[e];t in n||(n[t]=r[t].bind(n))}}const r=n?.Parent??Object;class o extends r{}function s(e){var t;const r=n?.Parent?new o:this;i(r,e),(t=r._zod).deferred??(t.deferred=[]);for(const e of r._zod.deferred)e();return r}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(s,"init",{value:i}),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 c extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class l extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(a=globalThis).__zod_globalConfig??(a.__zod_globalConfig={});const d=globalThis.__zod_globalConfig;function p(e){return d}function f(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 h(e,t){return"bigint"==typeof t?t.toString():t}function m(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function g(e){return null==e}function y(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const v=Symbol("evaluating");function _(e,t,n){let i;Object.defineProperty(e,t,{get(){if(i!==v)return void 0===i&&(i=v,i=n()),i},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function b(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function w(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function z(e){return JSON.stringify(e)}const S="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function k(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const T=m(()=>{if(d.jitless)return!1;if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function N(e){if(!1===k(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!==k(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function C(e){return N(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const I=new Set(["string","number","symbol"]);function $(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E(e,t,n){const i=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(i._zod.parent=e),i}function O(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 P(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 Z(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!1===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 M(e){return"string"==typeof e?e:e?.message}function R(e,t,n){const i=e.message?e.message:M(e.inst?._zod.def?.error?.(e))??M(t?.error?.(e))??M(n.customError?.(e))??M(n.localeError?.(e))??"Invalid input",{inst:r,continue:o,input:s,...a}=e;return a.path??(a.path=[]),a.message=i,t?.reportInput&&(a.input=s),a}function U(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function D(...e){const[t,n,i]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:i}:{...t}}const G=(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,h,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},L=u("$ZodError",G),F=u("$ZodError",G,{Parent:Error});const j=e=>(t,n,i,r)=>{const o=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise)throw new c;if(s.issues.length){const t=new(r?.Err??e)(s.issues.map(e=>R(e,o,p())));throw S(t,r?.callee),t}return s.value},B=e=>async(t,n,i,r)=>{const o=i?{...i,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){const t=new(r?.Err??e)(s.issues.map(e=>R(e,o,p())));throw S(t,r?.callee),t}return s.value},J=e=>(t,n,i)=>{const r=i?{...i,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},r);if(o instanceof Promise)throw new c;return o.issues.length?{success:!1,error:new(e??L)(o.issues.map(e=>R(e,r,p())))}:{success:!0,data:o.value}},V=J(F),K=e=>async(t,n,i)=>{const r=i?{...i,async:!0}:{async:!0};let o=t._zod.run({value:n,issues:[]},r);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>R(e,r,p())))}:{success:!0,data:o.value}},W=K(F),Y=e=>(t,n,i)=>{const r=i?{...i,direction:"backward"}:{direction:"backward"};return j(e)(t,n,r)},H=e=>(t,n,i)=>j(e)(t,n,i),Q=e=>async(t,n,i)=>{const r=i?{...i,direction:"backward"}:{direction:"backward"};return B(e)(t,n,r)},X=e=>async(t,n,i)=>B(e)(t,n,i),q=e=>(t,n,i)=>{const r=i?{...i,direction:"backward"}:{direction:"backward"};return J(e)(t,n,r)},ee=e=>(t,n,i)=>J(e)(t,n,i),te=e=>async(t,n,i)=>{const r=i?{...i,direction:"backward"}:{direction:"backward"};return K(e)(t,n,r)},ne=e=>async(t,n,i)=>K(e)(t,n,i),ie=/^[cC][0-9a-z]{6,}$/,re=/^[0-9a-z]+$/,oe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,se=/^[0-9a-vA-V]{20}$/,ae=/^[A-Za-z0-9]{27}$/,ue=/^[a-zA-Z0-9_-]{21}$/,ce=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,le=/^([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})$/,de=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)$/,pe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const fe=/^(?:(?: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])$/,he=/^(([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}|:))$/,me=/^((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])$/,ge=/^(([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])$/,ye=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ve=/^[A-Za-z0-9_-]*$/,_e=/^https?$/,be=/^\+[1-9]\d{6,14}$/,we="(?:(?:\\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])))",ze=new RegExp(`^${we}$`);function Se(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 ke=/^-?\d+$/,Te=/^-?\d+(?:\.\d+)?$/,Ne=/^(?:true|false)$/i,Ce=/^[^A-Z]*$/,Ie=/^[^a-z]*$/,$e=u("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ee={number:"number",bigint:"bigint",object:"date"},Oe=u("$ZodCheckLessThan",(e,t)=>{$e.init(e,t);const n=Ee[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value<=t.value:i.value<t.value)||i.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ae=u("$ZodCheckGreaterThan",(e,t)=>{$e.init(e,t);const n=Ee[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=i=>{(t.inclusive?i.value>=t.value:i.value>t.value)||i.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:i.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pe=u("$ZodCheckMultipleOf",(e,t)=>{$e.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/t,i=Math.round(n),r=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-i)<r?0:n-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})}}),Ze=u("$ZodCheckNumberFormat",(e,t)=>{$e.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),i=n?"int":"number",[r,o]=A[t.format];e._zod.onattach.push(e=>{const i=e._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o,n&&(i.pattern=ke)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:i,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:i,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:i,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>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),xe=u("$ZodCheckMaxLength",(e,t)=>{var n;$e.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!g(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 i=n.value;if(i.length<=t.maximum)return;const r=U(i);n.issues.push({origin:r,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Me=u("$ZodCheckMinLength",(e,t)=>{var n;$e.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!g(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 i=n.value;if(i.length>=t.minimum)return;const r=U(i);n.issues.push({origin:r,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),Re=u("$ZodCheckLengthEquals",(e,t)=>{var n;$e.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!g(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 i=n.value,r=i.length;if(r===t.length)return;const o=U(i),s=r>t.length;n.issues.push({origin:o,...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})}}),Ue=u("$ZodCheckStringFormat",(e,t)=>{var n,i;$e.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})}):(i=e._zod).check??(i.check=()=>{})}),De=u("$ZodCheckRegex",(e,t)=>{Ue.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})}}),Ge=u("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ce),Ue.init(e,t)}),Le=u("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ie),Ue.init(e,t)}),Fe=u("$ZodCheckIncludes",(e,t)=>{$e.init(e,t);const n=$(t.includes),i=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=i,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(i)}),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})}}),je=u("$ZodCheckStartsWith",(e,t)=>{$e.init(e,t);const n=new RegExp(`^${$(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})}}),Be=u("$ZodCheckEndsWith",(e,t)=>{$e.init(e,t);const n=new RegExp(`.*${$(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=u("$ZodCheckOverwrite",(e,t)=>{$e.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Ve{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)),i=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of i)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Ke={major:4,minor:4,patch:3},We=u("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ke;const i=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&i.unshift(e);for(const t of i)for(const n of t._zod.onattach)n(e);if(0===i.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let i,r=P(e);for(const o of t){if(o._zod.def.when){if(Z(e))continue;if(!o._zod.def.when(e))continue}else if(r)continue;const t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new c;if(i||s instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(r||(r=P(e,t)))});else{if(e.issues.length===t)continue;r||(r=P(e,t))}}return i?i.then(()=>e):e},n=(n,r,o)=>{if(P(n))return n.aborted=!0,n;const s=t(r,i,o);if(s instanceof Promise){if(!1===o.async)throw new c;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(r,o)=>{if(o.skipChecks)return e._zod.parse(r,o);if("backward"===o.direction){const t=e._zod.parse({value:r.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,o)):n(t,r,o)}const s=e._zod.parse(r,o);if(s instanceof Promise){if(!1===o.async)throw new c;return s.then(e=>t(e,i,o))}return t(s,i,o)}}_(e,"~standard",()=>({validate:t=>{try{const n=V(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return W(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Ye=u("$ZodString",(e,t)=>{var n;We.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,i)=>{if(t.coerce)try{n.value=String(n.value)}catch(i){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),He=u("$ZodStringFormat",(e,t)=>{Ue.init(e,t),Ye.init(e,t)}),Qe=u("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=le),He.init(e,t)}),Xe=u("$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=de(e))}else t.pattern??(t.pattern=de());He.init(e,t)}),qe=u("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=pe),He.init(e,t)}),et=u("$ZodURL",(e,t)=>{He.init(e,t),e._zod.check=n=>{try{const i=n.value.trim();if(!t.normalize&&t.protocol?.source===_e.source&&!/^https?:\/\//i.test(i))return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});const r=new URL(i);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=i)}catch(i){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),tt=u("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),He.init(e,t)}),nt=u("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=ue),He.init(e,t)}),it=u("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=ie),He.init(e,t)}),rt=u("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=re),He.init(e,t)}),ot=u("$ZodULID",(e,t)=>{t.pattern??(t.pattern=oe),He.init(e,t)}),st=u("$ZodXID",(e,t)=>{t.pattern??(t.pattern=se),He.init(e,t)}),at=u("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ae),He.init(e,t)}),ut=u("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=Se({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const i=`${t}(?:${n.join("|")})`;return new RegExp(`^${we}T(?:${i})$`)}(t)),He.init(e,t)}),ct=u("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=ze),He.init(e,t)}),lt=u("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${Se(t)}$`)),He.init(e,t)}),dt=u("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ce),He.init(e,t)}),pt=u("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=fe),He.init(e,t),e._zod.bag.format="ipv4"}),ft=u("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=he),He.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})}}}),ht=u("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=me),He.init(e,t)}),mt=u("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ge),He.init(e,t),e._zod.check=n=>{const i=n.value.split("/");try{if(2!==i.length)throw new Error;const[e,t]=i;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 gt(e){if(""===e)return!0;if(/\s/.test(e))return!1;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const yt=u("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ye),He.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{gt(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const vt=u("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ve),He.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!ve.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return gt(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})}}),_t=u("$ZodE164",(e,t)=>{t.pattern??(t.pattern=be),He.init(e,t)});const bt=u("$ZodJWT",(e,t)=>{He.init(e,t),e._zod.check=n=>{(function(e,t=null){try{const n=e.split(".");if(3!==n.length)return!1;const[i]=n;if(!i)return!1;const r=JSON.parse(atob(i));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})}}),wt=u("$ZodNumber",(e,t)=>{We.init(e,t),e._zod.pattern=e._zod.bag.pattern??Te,e._zod.parse=(n,i)=>{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 o="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,...o?{received:o}:{}}),n}}),zt=u("$ZodNumberFormat",(e,t)=>{Ze.init(e,t),wt.init(e,t)}),St=u("$ZodBoolean",(e,t)=>{We.init(e,t),e._zod.pattern=Ne,e._zod.parse=(n,i)=>{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}}),kt=u("$ZodAny",(e,t)=>{We.init(e,t),e._zod.parse=e=>e}),Tt=u("$ZodUnknown",(e,t)=>{We.init(e,t),e._zod.parse=e=>e}),Nt=u("$ZodNever",(e,t)=>{We.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Ct(e,t,n){e.issues.length&&t.issues.push(...x(n,e.issues)),t.value[n]=e.value}const It=u("$ZodArray",(e,t)=>{We.init(e,t),e._zod.parse=(n,i)=>{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 o=[];for(let e=0;e<r.length;e++){const s=r[e],a=t.element._zod.run({value:s,issues:[]},i);a instanceof Promise?o.push(a.then(t=>Ct(t,n,e))):Ct(a,n,e)}return o.length?Promise.all(o).then(()=>n):n}});function $t(e,t,n,i,r,o){const s=n in i;if(e.issues.length){if(r&&o&&!s)return;t.issues.push(...x(n,e.issues))}s||r?void 0===e.value?s&&(t.value[n]=void 0):t.value[n]=e.value:e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]})}function Et(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=(i=e.shape,Object.keys(i).filter(e=>"optional"===i[e]._zod.optin&&"optional"===i[e]._zod.optout));var i;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ot(e,t,n,i,r,o){const s=[],a=r.keySet,u=r.catchall._zod,c=u.def.type,l="optional"===u.optin,d="optional"===u.optout;for(const r in t){if("__proto__"===r)continue;if(a.has(r))continue;if("never"===c){s.push(r);continue}const o=u.run({value:t[r],issues:[]},i);o instanceof Promise?e.push(o.then(e=>$t(e,n,r,t,l,d))):$t(o,n,r,t,l,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length?Promise.all(e).then(()=>n):n}const At=u("$ZodObject",(e,t)=>{We.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 i=m(()=>Et(t));_(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const i=e[t]._zod;if(i.values){n[t]??(n[t]=new Set);for(const e of i.values)n[t].add(e)}}return n});const r=k,o=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=i.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 u=[],c=s.shape;for(const e of s.keys){const i=c[e],r="optional"===i._zod.optin,o="optional"===i._zod.optout,s=i._zod.run({value:a[e],issues:[]},n);s instanceof Promise?u.push(s.then(n=>$t(n,t,e,a,r,o))):$t(s,t,e,a,r,o)}return o?Ot(u,a,t,n,i.value,e):u.length?Promise.all(u).then(()=>t):t}}),Pt=u("$ZodObjectJIT",(e,t)=>{At.init(e,t);const n=e._zod.parse,i=m(()=>Et(t));let r;const o=k,s=!d.jitless,a=s&&T.value,u=t.catchall;let c;e._zod.parse=(l,d)=>{c??(c=i.value);const p=l.value;return o(p)?s&&a&&!1===d?.async&&!0!==d.jitless?(r||(r=(e=>{const t=new Ve(["shape","payload","ctx"]),n=i.value,r=e=>{const t=z(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");const o=Object.create(null);let s=0;for(const e of n.keys)o[e]="key_"+s++;t.write("const newResult = {};");for(const i of n.keys){const n=o[i],s=z(i),a=e[i],u="optional"===a?._zod?.optin,c="optional"===a?._zod?.optout;t.write(`const ${n} = ${r(i)};`),u&&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 `):u?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(`\n const ${n}_present = ${s} in input;\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 if (!${n}_present && !${n}.issues.length) {\n payload.issues.push({\n code: "invalid_type",\n expected: "nonoptional",\n input: undefined,\n path: [${s}]\n });\n }\n\n if (${n}_present) {\n if (${n}.value === undefined) {\n newResult[${s}] = undefined;\n } else {\n newResult[${s}] = ${n}.value;\n }\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)),l=r(l,d),u?Ot([],p,l,d,c,e):l):n(l,d):(l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l)}});function Zt(e,t,n,i){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const r=e.filter(e=>!P(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=>R(e,i,p())))}),t)}const xt=u("$ZodUnion",(e,t)=>{We.init(e,t),_(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),_(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),_(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),_(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=>y(e.source)).join("|")})$`)}});const n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(i,r)=>{if(n)return n(i,r);let o=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:i.value,issues:[]},r);if(t instanceof Promise)s.push(t),o=!0;else{if(0===t.issues.length)return t;s.push(t)}}return o?Promise.all(s).then(t=>Zt(t,i,e,r)):Zt(s,i,e,r)}}),Mt=u("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xt.init(e,t);const n=e._zod.parse;_(e._zod,"propValues",()=>{const e={};for(const n of t.options){const i=n._zod.propValues;if(!i||0===Object.keys(i).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(i)){e[t]||(e[t]=new Set);for(const i of n)e[t].add(i)}}return e});const i=m(()=>{const e=t.options,n=new Map;for(const i of e){const e=i._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,i)}}return n});e._zod.parse=(r,o)=>{const s=r.value;if(!k(s))return r.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),r;const a=i.value.get(s?.[t.discriminator]);return a?a._zod.run(r,o):t.unionFallback||"backward"===o.direction?n(r,o):(r.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(i.value.keys()),input:s,path:[t.discriminator],inst:e}),r)}}),Rt=u("$ZodIntersection",(e,t)=>{We.init(e,t),e._zod.parse=(e,n)=>{const i=e.value,r=t.left._zod.run({value:i,issues:[]},n),o=t.right._zod.run({value:i,issues:[]},n);return r instanceof Promise||o instanceof Promise?Promise.all([r,o]).then(([t,n])=>Dt(e,t,n)):Dt(e,r,o)}});function Ut(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(N(e)&&N(t)){const n=Object.keys(t),i=Object.keys(e).filter(e=>-1!==n.indexOf(e)),r={...e,...t};for(const n of i){const i=Ut(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r[n]=i.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 i=0;i<e.length;i++){const r=Ut(e[i],t[i]);if(!r.valid)return{valid:!1,mergeErrorPath:[i,...r.mergeErrorPath]};n.push(r.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Dt(e,t,n){const i=new Map;let r;for(const n of t.issues)if("unrecognized_keys"===n.code){r??(r=n);for(const e of n.keys)i.has(e)||i.set(e,{}),i.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)i.has(e)||i.set(e,{}),i.get(e).r=!0;else e.issues.push(t);const o=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&r&&e.issues.push({...r,keys:o}),P(e))return e;const s=Ut(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 Gt=u("$ZodEnum",(e,t)=>{We.init(e,t);const n=f(t.entries),i=new Set(n);e._zod.values=i,e._zod.pattern=new RegExp(`^(${n.filter(e=>I.has(typeof e)).map(e=>"string"==typeof e?$(e):e.toString()).join("|")})$`),e._zod.parse=(t,r)=>{const o=t.value;return i.has(o)||t.issues.push({code:"invalid_value",values:n,input:o,inst:e}),t}}),Lt=u("$ZodLiteral",(e,t)=>{if(We.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?$(e):e?$(e.toString()):String(e)).join("|")})$`),e._zod.parse=(i,r)=>{const o=i.value;return n.has(o)||i.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),i}}),Ft=u("$ZodTransform",(e,t)=>{We.init(e,t),e._zod.optin="optional",e._zod.parse=(n,i)=>{if("backward"===i.direction)throw new l(e.constructor.name);const r=t.transform(n.value,n);if(i.async){return(r instanceof Promise?r:Promise.resolve(r)).then(e=>(n.value=e,n.fallback=!0,n))}if(r instanceof Promise)throw new c;return n.value=r,n.fallback=!0,n}});function jt(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Bt=u("$ZodOptional",(e,t)=>{We.init(e,t),e._zod.optin="optional",e._zod.optout="optional",_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${y(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const i=e.value,r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>jt(e,i)):jt(r,i)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Jt=u("$ZodExactOptional",(e,t)=>{Bt.init(e,t),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Vt=u("$ZodNullable",(e,t)=>{We.init(e,t),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${y(e.source)}|null)$`):void 0}),_(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)}),Kt=u("$ZodDefault",(e,t)=>{We.init(e,t),e._zod.optin="optional",_(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 i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Wt(e,t)):Wt(i,t)}});function Wt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Yt=u("$ZodPrefault",(e,t)=>{We.init(e,t),e._zod.optin="optional",_(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=u("$ZodNonOptional",(e,t)=>{We.init(e,t),_(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,i)=>{const r=t.innerType._zod.run(n,i);return r instanceof Promise?r.then(t=>Qt(t,e)):Qt(r,e)}});function Qt(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 Xt=u("$ZodCatch",(e,t)=>{We.init(e,t),e._zod.optin="optional",_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(i=>(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(e=>R(e,n,p()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(e=>R(e,n,p()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),qt=u("$ZodPipe",(e,t)=>{We.init(e,t),_(e._zod,"values",()=>t.in._zod.values),_(e._zod,"optin",()=>t.in._zod.optin),_(e._zod,"optout",()=>t.out._zod.optout),_(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const i=t.out._zod.run(e,n);return i instanceof Promise?i.then(e=>en(e,t.in,n)):en(i,t.in,n)}const i=t.in._zod.run(e,n);return i instanceof Promise?i.then(e=>en(e,t.out,n)):en(i,t.out,n)}});function en(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const tn=u("$ZodReadonly",(e,t)=>{We.init(e,t),_(e._zod,"propValues",()=>t.innerType._zod.propValues),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"optin",()=>t.innerType?._zod?.optin),_(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(nn):nn(i)}});function nn(e){return e.value=Object.freeze(e.value),e}const rn=u("$ZodCustom",(e,t)=>{$e.init(e,t),We.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const i=n.value,r=t.fn(i);if(r instanceof Promise)return r.then(t=>on(t,n,i,e));on(r,n,i,e)}});function on(e,t,n,i){if(!e){const e={code:"custom",input:n,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(e.params=i._zod.def.params),t.issues.push(D(e))}}var sn;class an{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 i={...n,...this._map.get(e)};return Object.keys(i).length?i:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(sn=globalThis).__zod_globalRegistry??(sn.__zod_globalRegistry=new an);const un=globalThis.__zod_globalRegistry;function cn(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...O(t)})}function ln(e,t){return new Oe({check:"less_than",...O(t),value:e,inclusive:!1})}function dn(e,t){return new Oe({check:"less_than",...O(t),value:e,inclusive:!0})}function pn(e,t){return new Ae({check:"greater_than",...O(t),value:e,inclusive:!1})}function fn(e,t){return new Ae({check:"greater_than",...O(t),value:e,inclusive:!0})}function hn(e,t){return new Pe({check:"multiple_of",...O(t),value:e})}function mn(e,t){return new xe({check:"max_length",...O(t),maximum:e})}function gn(e,t){return new Me({check:"min_length",...O(t),minimum:e})}function yn(e,t){return new Re({check:"length_equals",...O(t),length:e})}function vn(e){return new Je({check:"overwrite",tx:e})}function _n(e,t){const n=function(e,t){const n=new $e({check:"custom",...O(t)});return n._zod.check=e,n}(t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(D(e,t.value,n._zod.def));else{const i=e;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=t.value),i.inst??(i.inst=n),i.continue??(i.continue=!n._zod.def.abort),t.issues.push(D(i))}},e(t.value,t)),t);return n}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??un,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 wn(e,t,n={path:[],schemaPath:[]}){var i;const r=e._zod.def,o=t.seen.get(e);if(o){o.count++;return n.schemaPath.includes(e)&&(o.cycle=n.path),o.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 i={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,i);else{const n=s.schema,o=t.processors[r.type];if(!o)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${r.type}`);o(e,t,n,i)}const o=e._zod.parent;o&&(s.ref||(s.ref=o),wn(o,t,i),t.seen.get(o).isParent=!0)}const u=t.metadataRegistry.get(e);u&&Object.assign(s.schema,u),"input"===t.io&&kn(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&"_prefault"in s.schema&&((i=s.schema).default??(i.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 i=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=i.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.`);i.set(n,t[0])}}const r=t=>{if(t[1].schema.$ref)return;const i=t[1],{ref:r,defId:o}=(t=>{const i="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 o=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=o,{defId:o,ref:`${r("__shared")}#/${i}/${o}`}}if(t[1]===n)return{ref:"#"};const r=`#/${i}/`,o=t[1].schema.id??"__schema"+e.counter++;return{defId:o,ref:r+o}})(t);i.def={...i.schema},o&&(i.defId=o);const s=i.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 i=n[1];if(t===n[0]){r(n);continue}if(e.external){const i=e.external.registry.get(n[0])?.id;if(t!==n[0]&&i){r(n);continue}}const o=e.metadataRegistry.get(n[0])?.id;o?r(n):(i.cycle||i.count>1&&"ref"===e.reused)&&r(n)}}function Sn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const i=t=>{const n=e.seen.get(t);if(null===n.ref)return;const r=n.def??n.schema,o={...r},s=n.ref;if(n.ref=null,s){i(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,o);if(t._zod.parent===s)for(const e in r)"$ref"!==e&&"allOf"!==e&&(e in o||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){i(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())i(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 o=e.metadataRegistry.get(t)?.id;void 0!==o&&r.id===o&&delete r.id;const s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?r.$defs=s:r.definitions=s);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 kn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const i=e._zod.def;if("transform"===i.type)return!0;if("array"===i.type)return kn(i.element,n);if("set"===i.type)return kn(i.valueType,n);if("lazy"===i.type)return kn(i.getter(),n);if("promise"===i.type||"optional"===i.type||"nonoptional"===i.type||"nullable"===i.type||"readonly"===i.type||"default"===i.type||"prefault"===i.type)return kn(i.innerType,n);if("intersection"===i.type)return kn(i.left,n)||kn(i.right,n);if("record"===i.type||"map"===i.type)return kn(i.keyType,n)||kn(i.valueType,n);if("pipe"===i.type)return!!e._zod.traits.has("$ZodCodec")||(kn(i.in,n)||kn(i.out,n));if("object"===i.type){for(const e in i.shape)if(kn(i.shape[e],n))return!0;return!1}if("union"===i.type){for(const e of i.options)if(kn(e,n))return!0;return!1}if("tuple"===i.type){for(const e of i.items)if(kn(e,n))return!0;return!(!i.rest||!kn(i.rest,n))}return!1}const Tn=(e,t,n={})=>i=>{const{libraryOptions:r,target:o}=i??{},s=bn({...r??{},target:o,io:t,processors:n});return wn(e,s),zn(s,e),Sn(s,e)},Nn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cn=(e,t,n,i)=>{const r=e._zod.def;wn(r.innerType,t,i);t.seen.get(e).ref=r.innerType},In=u("ZodISODateTime",(e,t)=>{ut.init(e,t),ni.init(e,t)});function $n(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...O(t)})}(In,e)}const En=u("ZodISODate",(e,t)=>{ct.init(e,t),ni.init(e,t)});function On(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...O(t)})}(En,e)}const An=u("ZodISOTime",(e,t)=>{lt.init(e,t),ni.init(e,t)});function Pn(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...O(t)})}(An,e)}const Zn=u("ZodISODuration",(e,t)=>{dt.init(e,t),ni.init(e,t)});function xn(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...O(t)})}(Zn,e)}const Mn=(e,t)=>{L.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},i=(e,r=[])=>{for(const o of e.issues)if("invalid_union"===o.code&&o.errors.length)o.errors.map(e=>i({issues:e},[...r,...o.path]));else if("invalid_key"===o.code)i({issues:o.issues},[...r,...o.path]);else if("invalid_element"===o.code)i({issues:o.issues},[...r,...o.path]);else{const e=[...r,...o.path];if(0===e.length)n._errors.push(t(o));else{let i=n,r=0;for(;r<e.length;){const n=e[r];r===e.length-1?(i[n]=i[n]||{_errors:[]},i[n]._errors.push(t(o))):i[n]=i[n]||{_errors:[]},i=i[n],r++}}}};return i(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},i=[];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))):i.push(t(r));return{formErrors:i,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,h,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,h,2)}},isEmpty:{get:()=>0===e.issues.length}})},Rn=u("ZodError",Mn,{Parent:Error}),Un=j(Rn),Dn=B(Rn),Gn=J(Rn),Ln=K(Rn),Fn=Y(Rn),jn=H(Rn),Bn=Q(Rn),Jn=X(Rn),Vn=q(Rn),Kn=ee(Rn),Wn=te(Rn),Yn=ne(Rn),Hn=new WeakMap;function Qn(e,t,n){const i=Object.getPrototypeOf(e);let r=Hn.get(i);if(r||(r=new Set,Hn.set(i,r)),!r.has(t)){r.add(t);for(const e in n){const t=n[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,get(){const n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const Xn=u("ZodType",(e,t)=>(We.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Tn(e,"input"),output:Tn(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const i=bn({...n,processors:t});return wn(e,i),zn(i,e),Sn(i,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Un(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Gn(e,t,n),e.parseAsync=async(t,n)=>Dn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Ln(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Fn(e,t,n),e.decode=(t,n)=>jn(e,t,n),e.encodeAsync=async(t,n)=>Bn(e,t,n),e.decodeAsync=async(t,n)=>Jn(e,t,n),e.safeEncode=(t,n)=>Vn(e,t,n),e.safeDecode=(t,n)=>Kn(e,t,n),e.safeEncodeAsync=async(t,n)=>Wn(e,t,n),e.safeDecodeAsync=async(t,n)=>Yn(e,t,n),Qn(e,"ZodType",{check(...e){const t=this.def;return this.clone(w(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return E(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...O(n)})}(ar,e,t)}(e,t))},superRefine(e,t){return this.check(function(e,t){return _n(e,t)}(e,t))},overwrite(e){return this.check(vn(e))},optional(){return Hi(this)},exactOptional(){return new Qi({type:"optional",innerType:this})},nullable(){return qi(this)},nullish(){return Hi(qi(this))},nonoptional(e){return function(e,t){return new nr({type:"nonoptional",innerType:e,...O(t)})}(this,e)},array(){return xi(this)},or(e){return Di([this,e])},and(e){return ji(this,e)},transform(e){return or(this,new Wi({type:"transform",transform:e}))},default(e){return t=e,new er({type:"default",innerType:this,get defaultValue(){return"function"==typeof t?t():C(t)}});var t},prefault(e){return t=e,new tr({type:"prefault",innerType:this,get defaultValue(){return"function"==typeof t?t():C(t)}});var t},catch(e){return new ir({type:"catch",innerType:this,catchValue:"function"==typeof(t=e)?t:()=>t});var t},pipe(e){return or(this,e)},readonly(){return new sr({type:"readonly",innerType:this})},describe(e){const t=this.clone();return un.add(t,{description:e}),t},meta(...e){if(0===e.length)return un.get(this);const t=this.clone();return un.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>un.get(e)?.description,configurable:!0}),e)),qn=u("_ZodString",(e,t)=>{Ye.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n)=>{const i=n;i.type="string";const{minimum:r,maximum:o,format:s,patterns:a,contentEncoding:u}=e._zod.bag;if("number"==typeof r&&(i.minLength=r),"number"==typeof o&&(i.maxLength=o),s&&(i.format=Nn[s]??s,""===i.format&&delete i.format,"time"===s&&delete i.format),u&&(i.contentEncoding=u),a&&a.size>0){const e=[...a];1===e.length?i.pattern=e[0].source:e.length>1&&(i.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,Qn(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new De({check:"string_format",format:"regex",...O(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new Fe({check:"string_format",format:"includes",...O(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new je({check:"string_format",format:"starts_with",...O(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new Be({check:"string_format",format:"ends_with",...O(t),suffix:e})}(...e))},min(...e){return this.check(gn(...e))},max(...e){return this.check(mn(...e))},length(...e){return this.check(yn(...e))},nonempty(...e){return this.check(gn(1,...e))},lowercase(e){return this.check(function(e){return new Ge({check:"string_format",format:"lowercase",...O(e)})}(e))},uppercase(e){return this.check(function(e){return new Le({check:"string_format",format:"uppercase",...O(e)})}(e))},trim(){return this.check(vn(e=>e.trim()))},normalize(...e){return this.check(function(e){return vn(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(vn(e=>e.toLowerCase()))},toUpperCase(){return this.check(vn(e=>e.toUpperCase()))},slugify(){return this.check(vn(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}})}),ei=u("ZodString",(e,t)=>{Ye.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,...O(t)})}(ii,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...O(t)})}(si,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...O(t)})}(wi,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...O(t)})}(ai,t)),e.guid=t=>e.check(cn(ri,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...O(t)})}(oi,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...O(t)})}(oi,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...O(t)})}(oi,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...O(t)})}(oi,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...O(t)})}(ui,t)),e.guid=t=>e.check(cn(ri,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...O(t)})}(ci,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...O(t)})}(li,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...O(t)})}(di,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...O(t)})}(vi,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...O(t)})}(_i,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...O(t)})}(pi,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...O(t)})}(fi,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...O(t)})}(hi,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...O(t)})}(mi,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...O(t)})}(gi,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...O(t)})}(yi,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...O(t)})}(bi,t)),e.datetime=t=>e.check($n(t)),e.date=t=>e.check(On(t)),e.time=t=>e.check(Pn(t)),e.duration=t=>e.check(xn(t))});function ti(e){return function(e,t){return new e({type:"string",...O(t)})}(ei,e)}const ni=u("ZodStringFormat",(e,t)=>{He.init(e,t),qn.init(e,t)}),ii=u("ZodEmail",(e,t)=>{qe.init(e,t),ni.init(e,t)}),ri=u("ZodGUID",(e,t)=>{Qe.init(e,t),ni.init(e,t)}),oi=u("ZodUUID",(e,t)=>{Xe.init(e,t),ni.init(e,t)}),si=u("ZodURL",(e,t)=>{et.init(e,t),ni.init(e,t)}),ai=u("ZodEmoji",(e,t)=>{tt.init(e,t),ni.init(e,t)}),ui=u("ZodNanoID",(e,t)=>{nt.init(e,t),ni.init(e,t)}),ci=u("ZodCUID",(e,t)=>{it.init(e,t),ni.init(e,t)}),li=u("ZodCUID2",(e,t)=>{rt.init(e,t),ni.init(e,t)}),di=u("ZodULID",(e,t)=>{ot.init(e,t),ni.init(e,t)}),pi=u("ZodXID",(e,t)=>{st.init(e,t),ni.init(e,t)}),fi=u("ZodKSUID",(e,t)=>{at.init(e,t),ni.init(e,t)}),hi=u("ZodIPv4",(e,t)=>{pt.init(e,t),ni.init(e,t)}),mi=u("ZodIPv6",(e,t)=>{ft.init(e,t),ni.init(e,t)}),gi=u("ZodCIDRv4",(e,t)=>{ht.init(e,t),ni.init(e,t)}),yi=u("ZodCIDRv6",(e,t)=>{mt.init(e,t),ni.init(e,t)}),vi=u("ZodBase64",(e,t)=>{yt.init(e,t),ni.init(e,t)}),_i=u("ZodBase64URL",(e,t)=>{vt.init(e,t),ni.init(e,t)}),bi=u("ZodE164",(e,t)=>{_t.init(e,t),ni.init(e,t)}),wi=u("ZodJWT",(e,t)=>{bt.init(e,t),ni.init(e,t)}),zi=u("ZodNumber",(e,t)=>{wt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n)=>{const i=n,{minimum:r,maximum:o,format:s,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;"string"==typeof s&&s.includes("int")?i.type="integer":i.type="number";const l="number"==typeof c&&c>=(r??Number.NEGATIVE_INFINITY),d="number"==typeof u&&u<=(o??Number.POSITIVE_INFINITY),p="draft-04"===t.target||"openapi-3.0"===t.target;l?p?(i.minimum=c,i.exclusiveMinimum=!0):i.exclusiveMinimum=c:"number"==typeof r&&(i.minimum=r),d?p?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u:"number"==typeof o&&(i.maximum=o),"number"==typeof a&&(i.multipleOf=a)})(e,t,n),Qn(e,"ZodNumber",{gt(e,t){return this.check(pn(e,t))},gte(e,t){return this.check(fn(e,t))},min(e,t){return this.check(fn(e,t))},lt(e,t){return this.check(ln(e,t))},lte(e,t){return this.check(dn(e,t))},max(e,t){return this.check(dn(e,t))},int(e){return this.check(Ti(e))},safe(e){return this.check(Ti(e))},positive(e){return this.check(pn(0,e))},nonnegative(e){return this.check(fn(0,e))},negative(e){return this.check(ln(0,e))},nonpositive(e){return this.check(dn(0,e))},multipleOf(e,t){return this.check(hn(e,t))},step(e,t){return this.check(hn(e,t))},finite(){return this}});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 Si(e){return function(e,t){return new e({type:"number",checks:[],...O(t)})}(zi,e)}const ki=u("ZodNumberFormat",(e,t)=>{zt.init(e,t),zi.init(e,t)});function Ti(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...O(t)})}(ki,e)}const Ni=u("ZodBoolean",(e,t)=>{St.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function Ci(e){return function(e,t){return new e({type:"boolean",...O(t)})}(Ni,e)}const Ii=u("ZodAny",(e,t)=>{kt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function $i(){return new Ii({type:"any"})}const Ei=u("ZodUnknown",(e,t)=>{Tt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Oi(){return new Ei({type:"unknown"})}const Ai=u("ZodNever",(e,t)=>{Nt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function Pi(e){return function(e,t){return new e({type:"never",...O(t)})}(Ai,e)}const Zi=u("ZodArray",(e,t)=>{It.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=n,o=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=wn(o.element,t,{...i,path:[...i.path,"items"]})})(e,t,n,i),e.element=t.element,Qn(e,"ZodArray",{min(e,t){return this.check(gn(e,t))},nonempty(e){return this.check(gn(1,e))},max(e,t){return this.check(mn(e,t))},length(e,t){return this.check(yn(e,t))},unwrap(){return this.element}})});function xi(e,t){return function(e,t,n){return new e({type:"array",element:t,...O(n)})}(Zi,e,t)}const Mi=u("ZodObject",(e,t)=>{Pt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=n,o=e._zod.def;r.type="object",r.properties={};const s=o.shape;for(const e in s)r.properties[e]=wn(s[e],t,{...i,path:[...i.path,"properties",e]});const a=new Set(Object.keys(s)),u=new Set([...a].filter(e=>{const n=o.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));u.size>0&&(r.required=Array.from(u)),"never"===o.catchall?._zod.def.type?r.additionalProperties=!1:o.catchall?o.catchall&&(r.additionalProperties=wn(o.catchall,t,{...i,path:[...i.path,"additionalProperties"]})):"output"===t.io&&(r.additionalProperties=!1)})(e,t,n,i),_(e,"shape",()=>t.shape),Qn(e,"ZodObject",{keyof(){return Ji(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Oi()})},loose(){return this.clone({...this._zod.def,catchall:Oi()})},strict(){return this.clone({...this._zod.def,catchall:Pi()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!N(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 i=w(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return b(this,"shape",n),n}});return E(e,i)}(this,e)},safeExtend(e){return function(e,t){if(!N(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=w(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return b(this,"shape",n),n}});return E(e,n)}(this,e)},merge(e){return function(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=w(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return b(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return E(e,n)}(this,e)},pick(e){return function(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return E(e,w(e._zod.def,{get shape(){const e={};for(const i in t){if(!(i in n.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(e[i]=n.shape[i])}return b(this,"shape",e),e},checks:[]}))}(this,e)},omit(e){return function(e,t){const n=e._zod.def,i=n.checks;if(i&&i.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const r=w(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete i[e]}return b(this,"shape",i),i},checks:[]});return E(e,r)}(this,e)},partial(...e){return function(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const r=w(t._zod.def,{get shape(){const i=t._zod.def.shape,r={...i};if(n)for(const t in n){if(!(t in i))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(r[t]=e?new e({type:"optional",innerType:i[t]}):i[t])}else for(const t in i)r[t]=e?new e({type:"optional",innerType:i[t]}):i[t];return b(this,"shape",r),r},checks:[]});return E(t,r)}(Yi,this,e[0])},required(...e){return function(e,t,n){const i=w(t._zod.def,{get shape(){const i=t._zod.def.shape,r={...i};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:i[t]}))}else for(const t in i)r[t]=new e({type:"nonoptional",innerType:i[t]});return b(this,"shape",r),r}});return E(t,i)}(nr,this,e[0])}})});function Ri(e,t){const n={type:"object",shape:e??{},...O(t)};return new Mi(n)}const Ui=u("ZodUnion",(e,t)=>{xt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def,o=!1===r.inclusive,s=r.options.map((e,n)=>wn(e,t,{...i,path:[...i.path,o?"oneOf":"anyOf",n]}));o?n.oneOf=s:n.anyOf=s})(e,t,n,i),e.options=t.options});function Di(e,t){return new Ui({type:"union",options:e,...O(t)})}const Gi=u("ZodDiscriminatedUnion",(e,t)=>{Ui.init(e,t),Mt.init(e,t)});function Li(e,t,n){return new Gi({type:"union",options:t,discriminator:e,...O(n)})}const Fi=u("ZodIntersection",(e,t)=>{Rt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def,o=wn(r.left,t,{...i,path:[...i.path,"allOf",0]}),s=wn(r.right,t,{...i,path:[...i.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,u=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];n.allOf=u})(e,t,n,i)});function ji(e,t){return new Fi({type:"intersection",left:e,right:t})}const Bi=u("ZodEnum",(e,t)=>{Gt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n)=>{const i=f(e._zod.def.entries);i.every(e=>"number"==typeof e)&&(n.type="number"),i.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=i})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,i)=>{const r={};for(const i of e){if(!n.has(i))throw new Error(`Key ${i} not found in enum`);r[i]=t.entries[i]}return new Bi({...t,checks:[],...O(i),entries:r})},e.exclude=(e,i)=>{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 Bi({...t,checks:[],...O(i),entries:r})}});function Ji(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Bi({type:"enum",entries:n,...O(t)})}const Vi=u("ZodLiteral",(e,t)=>{Lt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n)=>{const i=e._zod.def,r=[];for(const e of i.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 Ki(e,t){return new Vi({type:"literal",values:Array.isArray(e)?e:[e],...O(t)})}const Wi=u("ZodTransform",(e,t)=>{Ft.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,i)=>{if("backward"===i.direction)throw new l(e.constructor.name);n.addIssue=i=>{if("string"==typeof i)n.issues.push(D(i,n.value,t));else{const t=i;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(D(t))}};const r=t.transform(n.value,n);return r instanceof Promise?r.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=r,n.fallback=!0,n)}});const Yi=u("ZodOptional",(e,t)=>{Bt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>Cn(e,t,0,i),e.unwrap=()=>e._zod.def.innerType});function Hi(e){return new Yi({type:"optional",innerType:e})}const Qi=u("ZodExactOptional",(e,t)=>{Jt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>Cn(e,t,0,i),e.unwrap=()=>e._zod.def.innerType});const Xi=u("ZodNullable",(e,t)=>{Vt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def,o=wn(r.innerType,t,i),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=r.innerType,n.nullable=!0):n.anyOf=[o,{type:"null"}]})(e,t,n,i),e.unwrap=()=>e._zod.def.innerType});function qi(e){return new Xi({type:"nullable",innerType:e})}const er=u("ZodDefault",(e,t)=>{Kt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def;wn(r.innerType,t,i),t.seen.get(e).ref=r.innerType,n.default=JSON.parse(JSON.stringify(r.defaultValue))})(e,t,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const tr=u("ZodPrefault",(e,t)=>{Yt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def;wn(r.innerType,t,i),t.seen.get(e).ref=r.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(r.defaultValue)))})(e,t,n,i),e.unwrap=()=>e._zod.def.innerType});const nr=u("ZodNonOptional",(e,t)=>{Ht.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def;wn(r.innerType,t,i),t.seen.get(e).ref=r.innerType})(e,t,0,i),e.unwrap=()=>e._zod.def.innerType});const ir=u("ZodCatch",(e,t)=>{Xt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def;let o;wn(r.innerType,t,i),t.seen.get(e).ref=r.innerType;try{o=r.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o})(e,t,n,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const rr=u("ZodPipe",(e,t)=>{qt.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def,o=r.in._zod.traits.has("$ZodTransform"),s="input"===t.io?o?r.out:r.in:r.out;wn(s,t,i),t.seen.get(e).ref=s})(e,t,0,i),e.in=t.in,e.out=t.out});function or(e,t){return new rr({type:"pipe",in:e,out:t})}const sr=u("ZodReadonly",(e,t)=>{tn.init(e,t),Xn.init(e,t),e._zod.processJSONSchema=(t,n,i)=>((e,t,n,i)=>{const r=e._zod.def;wn(r.innerType,t,i),t.seen.get(e).ref=r.innerType,n.readOnly=!0})(e,t,n,i),e.unwrap=()=>e._zod.def.innerType});const ar=u("ZodCustom",(e,t)=>{rn.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 ur=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],cr=Ji(ur),lr=Ri({targetedCountryGroups:xi(cr),targetedCountryCodes:xi(ti()).optional()}).optional(),dr={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},pr={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},fr={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},hr={GBP:"£",USD:"$",AUD:"$",EUR:"€",NZD:"NZ$",CAD:"CA$"},mr=e=>Object.keys(dr).find(t=>dr[t].countries.includes(e??""))??"International",gr=(e,t=[],n=[])=>0===t.length&&0===n.length||!!e&&(!!t.includes(mr(e.toUpperCase()))||n.includes(e.toUpperCase())),yr=e=>{if(e){const t=mr(e);return fr[t]}return"£"},vr=e=>{if(e)return pr[e]},_r=e=>e.includes("subscribe/weekly/checkout"),br=(e,t)=>{if(t){const n=(e=>dr[mr(e)].supportRegionId)(t);if(!_r(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,(e,t,i)=>`${t}/${n.toLowerCase()}/${i}`)}return e},wr=(e,t,n,i)=>{if(i){const r=i[mr(n)];return`${yr(n)}${r[e][t].price}`}},zr={CURRENCY_SYMBOL:({countryCode:e})=>yr(e),COUNTRY_NAME:({countryCode:e})=>vr(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>wr("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>wr("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>wr("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>wr("GuardianWeekly","Annual",e,t),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},Sr=(e,t,n)=>e?e.replace(kr,e=>{const i=e.substring(2,e.length-2),r=zr[i];if(r){const e=r({countryCode:t,prices:n});if(e)return e}return e}):"",kr=/%%.*?%%/g,Tr=e=>{const t=e.match(kr)?.filter(e=>"%%ARTICLE_COUNT%%"!==e);return!!t&&t.length>0},Nr="gu.contributions.views",Cr=e=>e.get(Nr)??void 0,Ir=e=>{const t=JSON.parse(localStorage.getItem(Nr)??""),n=t?t.value:[];n.push({date:(new Date).getTime(),testId:e});const i={value:n.slice(-50)};localStorage.setItem(Nr,JSON.stringify(i))},$r=e=>{const t=(e=>{const t=new Date(e,10,1).getDay();return new Date(e,10,22+(11-t)%7)})(e);return t.setDate(t.getDate()+5),t},Er=(e=new Date)=>{const t=(e=>{const t=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+t),e})(e),n=(t.getMonth()+1).toString().padStart(2,"0"),i=t.toLocaleString("default",{month:"long"}),r=t.getFullYear();return{reminderCta:`Remind me in ${i}`,reminderPeriod:`${r}-${n}-01`,reminderLabel:`${i} ${r}`}},Or=new Date("2023-12-31"),Ar=e=>e>=(e=>new Date(e.getFullYear(),10,15))(e)&&e<$r(e.getFullYear()),Pr=(e,t=new Date)=>{return"US"===e&&Ar(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${n=t.getFullYear()}-${($r(n).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${n}`}:"US"===e&&(e=>e>=$r(e.getFullYear())&&e<Or)(t)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(t.getFullYear()):Er(t);var n},Zr=Ri({text:ti(),baseUrl:ti()});let xr=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});var Mr;new Bi({type:"enum",entries:xr,...O(Mr)});const Rr=Li("type",[Ri({type:Ki(xr.Custom),cta:Zr}),Ri({type:Ki(xr.ContributionsReminder)})]),Ur=Ri({countLabel:ti(),goalCopy:ti().optional()}),Dr=Ri({total:Si(),goal:Si()}),Gr=Ji(["US","AU","global"]),Lr=Ri({currencySymbol:ti(),copy:Ur,name:Gr,tickerData:Dr.optional()}),Fr=Ri({for52Weeks:Si(),forTargetedWeeks:Si()}),jr=Ji(["for52Weeks","forTargetedWeeks"]),Br=Ri({type:Ki("above"),copy:ti().optional(),countType:jr.optional()}),Jr=Ji(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),Vr=Ji(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),Kr=Ri({abTestName:ti(),abTestVariant:ti(),campaignCode:ti(),componentType:Vr,products:xi(Jr).nullish(),labels:xi(ti()).nullish(),ophanPageId:ti(),platformId:ti(),referrerUrl:ti()}),Wr=Ri({mainUrl:ti(),mobileUrl:ti().optional(),tabletUrl:ti().optional(),desktopUrl:ti().optional(),leftColUrl:ti().optional(),wideUrl:ti().optional(),altText:ti()}),Yr=Ri({name:ti(),description:ti().optional(),headshot:Wr.optional()}),Hr=/^[0-9A-F]{2}$/,Qr=ti().refine(e=>Hr.test(e),{error:e=>`"${JSON.stringify(e.input)}" is not a valid hex value`}),Xr=Ri({r:Qr,g:Qr,b:Qr,kind:Ki("hex")}),qr=Ri({mobileUrl:ti(),tabletUrl:ti(),desktopUrl:ti(),altText:ti(),kind:Ki("Image")}),eo=Ri({buttonColour:Xr.nullish(),buttonTextColour:Xr.nullish(),buttonBorderColour:Xr.nullish(),buttonSelectColour:Xr.nullish(),buttonSelectTextColour:Xr.nullish(),buttonSelectBorderColour:Xr.nullish(),buttonSelectMarkerColour:Xr.nullish(),pillTextColour:Xr.nullish(),pillBackgroundColour:Xr.nullish(),kind:Ki("ChoiceCards")}),to=Ri({visual:Li("kind",[qr,eo]).nullish(),colours:Ri({basic:Ri({background:Xr,bodyText:Xr})})}),no=e=>`#${e.r}${e.g}${e.b}`,io=Ri({copy:ti()}),ro=Di([Ki("Monthly"),Ki("Annual")]),oo=Li("supportTier",[Ri({supportTier:Ki("Contribution"),ratePlan:ro}),Ri({supportTier:Ki("SupporterPlus"),ratePlan:ro}),Ri({supportTier:Ki("DigitalSubscription"),ratePlan:ro}),Ri({supportTier:Ki("OneOff")})]),so=Ri({copy:ti(),textColour:Xr.nullish(),backgroundColour:Xr.nullish()}),ao=Di([Ki("LandingPage"),Ki("Checkout")]),uo=Ri({testName:ti(),variantName:ti()}),co=Ri({product:oo,label:ti(),isDefault:Ci(),defaultExpanded:Ci().optional(),benefitsLabel:ti().nullish(),benefits:xi(io),pill:so.nullish(),destination:ao.nullish(),destinationTest:uo.nullish()}),lo=Ri({choiceCards:xi(co),mobileChoiceCards:xi(co).nullish()}),po=Ri({maxViewsCount:Si(),maxViewsDays:Si(),minDaysBetweenViews:Si()}),fo=Ri({reminderCta:ti(),reminderLabel:ti(),reminderPeriod:ti()});Ji(["ONE_OFF","MONTHLY","ANNUAL"]);const ho=Ri({newsletterId:ti(),successDescription:ti()}),mo=Ri({name:ti(),heading:ti().optional(),paragraphs:xi(ti()),highlightedText:ti().optional(),tickerSettings:Lr.optional(),cta:Zr.optional(),secondaryCta:Rr.optional(),newsletterSignup:ho.optional(),image:Wr.optional(),showReminderFields:fo.optional(),separateArticleCount:Br.optional(),promoCodes:xi(ti()).nullish(),maxViews:po.optional(),showSignInLink:Ci().optional(),bylineWithImage:Yr.optional(),showChoiceCards:Ci().optional(),choiceCardsSettings:lo.nullish()}),go=Ri({variant:mo,tracking:Kr,countryCode:ti().nullish(),articleCounts:Fr,onReminderOpen:$i().nullish(),fetchEmail:$i().nullish(),submitComponentEvent:$i().nullish(),openCmp:$i().nullish(),hasConsentForArticleCount:Ci().nullish(),stage:ti().nullish()}),yo=Ji(["contributions","subscriptions","signIn","abandonedBasket"]),vo=Ri({heading:ti().optional(),messageText:ti().optional(),paragraphs:xi(ti()).optional(),mobileMessageText:ti().optional(),highlightedText:ti().optional(),cta:Zr.optional(),secondaryCta:Rr.optional()}),_o=Ri({tracking:Kr,bannerChannel:yo,content:vo.nullish(),mobileContent:vo.nullish(),countryCode:ti().nullish(),tickerSettings:Lr.nullish(),submitComponentEvent:$i(),articleCounts:Fr,hasOptedOutOfArticleCount:Ci().nullish(),fetchEmail:$i().nullish(),separateArticleCount:Ci().nullish(),design:to.nullish(),choiceCardsSettings:lo.nullish(),promoCodes:xi(ti()).nullish(),isCollapsible:Ci().nullish(),contributionsServiceUrl:ti().nullish()}),bo=Ri({heading:ti(),subheading:ti(),primaryCta:Zr.optional(),secondaryCta:Zr.optional(),benefits:xi(ti()).optional()}),wo=Ri({content:bo,tracking:Kr,mobileContent:bo.optional(),countryCode:ti().optional(),submitComponentEvent:$i(),promoCodes:xi(ti()).nullish()}),zo=Ri({image:Wr,bodyCopy:xi(ti()),cta:Zr.optional()});Ri({content:zo,tracking:Kr,countryCode:ti().optional(),submitComponentEvent:$i(),promoCodes:xi(ti()).nullish()});const So=Ji(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),ko=Ji(["new","guest","current"]),To=Ji(["Epic","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),No=Ji(["Live","Draft","Archived"]),Co=Ji(["Mobile","Desktop","All","iOS","Android"]),Io=Ji(["SignedIn","SignedOut","All"]),$o=Ji(["HasConsented","HasNotConsented","All"]),Eo=ji(Li("name",[Ri({name:Ki("ABTest")}),Ri({name:Ki("EpsilonGreedyBandit"),epsilon:Si(),sampleCount:Si().optional()}),Ri({name:Ki("Roulette"),sampleCount:Si().optional()})]),Ri({testName:ti().optional()})),Oo=Ri({channel:To,name:ti(),status:No,priority:Si(),controlProportionSettings:Ri({proportion:Si(),offset:Si()}).optional(),deviceType:Co.optional(),signedInStatus:Io.optional(),consentStatus:$o.optional(),methodologies:Eo.array().optional(),mParticleAudience:Si().nullish(),scheduler:Ri({start:ti().optional(),end:ti().optional()}).optional()}),Ao=Ji(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Po=Ri({minViews:Si(),maxViews:Si().optional(),periodInWeeks:Si(),tagIds:xi(ti()).optional()});Ri({userType:xi(ko),product:xi(So)}),Ri({tagIds:xi(ti()),sectionIds:xi(ti()),excludedTagIds:xi(ti()),excludedSectionIds:xi(ti())});const Zo=Ri({maxViewsCount:Si(),maxViewsDays:Si(),minDaysBetweenViews:Si()}),xo=["ONE_OFF","MONTHLY","ANNUAL"];Oo.extend({name:ti(),status:No,locations:xi(cr).optional(),regionTargeting:lr.optional(),tagIds:xi(ti()),sections:xi(ti()),excludedTagIds:xi(ti()),excludedSections:xi(ti()),alwaysAsk:Ci(),maxViews:Zo.optional(),userCohort:Ao,hasCountryName:Ci(),highPriority:Ci(),useLocalViewLog:Ci(),articlesViewedSettings:Po.optional(),priority:Si(),variants:mo.array()});const Mo=Ri({amount:Di([Si(),Ki("other")]),billingPeriod:Di([Ki("ONE_OFF"),Ki("MONTHLY"),Ki("ANNUAL")]),product:Di([Ki("Contribution"),Ki("SupporterPlus"),Ki("PremiumTier"),Ki("DailyEdition"),Ki("GuardianWeekly"),Ki("Paper"),Ki("PaperAndDigital")]),region:Di([Ki("uk"),Ki("us"),Ki("au"),Ki("eu"),Ki("int"),Ki("nz"),Ki("ca")])}),Ro=(e,t,n,i)=>{const r=(e=>new URLSearchParams(window.location.search).get(`force-${e}`))(e),o=(e=>new URLSearchParams(window.location.search).get(`preview-${e}`))(e),s=new URLSearchParams;r?s.set("force",r):o&&s.set("preview",o);const a=s.toString();return fetch(a?`${t}/${e}?${a}`:`${t}/${e}`,{method:"post",headers:{"Content-Type":"application/json",...i},body:JSON.stringify(n)}).then(t=>{if(!t.ok)throw Error(t.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${t.status}`);return t}).then(e=>e.json())},Uo=(e,t,n)=>Ro("epic",e,t,n),Do=(e,t)=>Ro("liveblog-epic",e,t),Go=(e,t)=>Ro("banner",e,t),Lo=(e,t)=>Ro("gutter-liveblog",e,t),Fo=(e,t)=>Ro("header",e,t);export{ur as CountryGroupId,xr as SecondaryCtaType,Mo as abandonedBasketSchema,br as addRegionIdToSupportUrl,_o as bannerSchema,Er as buildReminderFields,Tr as containsNonArticleCountPlaceholder,xo as contributionTabFrequencies,mr as countryCodeToCountryGroupId,cr as countryGroupIdSchema,dr as countryGroups,go as epicPropsSchema,Go as getBanner,vr as getCountryName,Uo as getEpic,Cr as getEpicViewLog,Lo as getGutterLiveblog,Fo as getHeader,Do as getLiveblogEpic,yr as getLocalCurrencySymbol,Pr as getReminderFields,i as getWeeklyArticleHistory,wo as headerPropsSchema,no as hexColourToString,gr as inTargetedCountry,s as incrementWeeklyArticleCount,_r as isGWCheckoutUrl,hr as isoCurrencyToCurrencySymbol,Ir as logEpicView,Sr as replaceNonArticleCountPlaceholders,lr as targetedRegionsSchema};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="gu.history.weeklyArticleCount",t="gu.history.articleCountsThisWeek",n=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},r=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),o=(e,t={})=>(e.forEach(e=>{r.has(e)&&(t[e]=(t[e]??0)+1)}),t);var i;function s(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const o=s.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=o[t].bind(n))}}const o=n?.Parent??Object;class i extends o{}function s(e){var t;const o=n?.Parent?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),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 a extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class u extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(i=globalThis).__zod_globalConfig??(i.__zod_globalConfig={});const c=globalThis.__zod_globalConfig;function l(e){return e&&Object.assign(c,e),c}function d(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 p(e,t){return"bigint"==typeof t?t.toString():t}function f(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function h(e){return null==e}function m(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const g=Symbol("evaluating");function y(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==g)return void 0===r&&(r=g,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function v(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function _(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function b(e){return JSON.stringify(e)}const w="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function z(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const S=f(()=>{if(c.jitless)return!1;if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function k(e){if(!1===z(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!==z(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function C(e){return k(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const T=new Set(["string","number","symbol"]);function N(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function I(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function E(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 $={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 A(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 O(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!1===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 P(e){return"string"==typeof e?e:e?.message}function Z(e,t,n){const r=e.message?e.message:P(e.inst?._zod.def?.error?.(e))??P(t?.error?.(e))??P(n.customError?.(e))??P(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=s),a}function M(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function R(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const U=(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,p,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},D=s("$ZodError",U),G=s("$ZodError",U,{Parent:Error});const L=e=>(t,n,r,o)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new a;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>Z(e,i,l())));throw w(t,o?.callee),t}return s.value},F=e=>async(t,n,r,o)=>{const i=r?{...r,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(o?.Err??e)(s.issues.map(e=>Z(e,i,l())));throw w(t,o?.callee),t}return s.value},j=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new a;return i.issues.length?{success:!1,error:new(e??D)(i.issues.map(e=>Z(e,o,l())))}:{success:!0,data:i.value}},B=j(G),J=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>Z(e,o,l())))}:{success:!0,data:i.value}},V=J(G),K=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return L(e)(t,n,o)},W=e=>(t,n,r)=>L(e)(t,n,r),Y=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return F(e)(t,n,o)},H=e=>async(t,n,r)=>F(e)(t,n,r),Q=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return j(e)(t,n,o)},q=e=>(t,n,r)=>j(e)(t,n,r),X=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return J(e)(t,n,o)},ee=e=>async(t,n,r)=>J(e)(t,n,r),te=/^[cC][0-9a-z]{6,}$/,ne=/^[0-9a-z]+$/,re=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,oe=/^[0-9a-vA-V]{20}$/,ie=/^[A-Za-z0-9]{27}$/,se=/^[a-zA-Z0-9_-]{21}$/,ae=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ue=/^([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})$/,ce=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)$/,le=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const 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])$/,pe=/^(([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}|:))$/,fe=/^((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])$/,he=/^(([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])$/,me=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ge=/^[A-Za-z0-9_-]*$/,ye=/^https?$/,ve=/^\+[1-9]\d{6,14}$/,_e="(?:(?:\\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])))",be=new RegExp(`^${_e}$`);function we(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 ze=/^-?\d+$/,Se=/^-?\d+(?:\.\d+)?$/,ke=/^(?:true|false)$/i,Ce=/^[^A-Z]*$/,Te=/^[^a-z]*$/,Ne=s("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ie={number:"number",bigint:"bigint",object:"date"},Ee=s("$ZodCheckLessThan",(e,t)=>{Ne.init(e,t);const n=Ie[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$e=s("$ZodCheckGreaterThan",(e,t)=>{Ne.init(e,t);const n=Ie[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ae=s("$ZodCheckMultipleOf",(e,t)=>{Ne.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/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}(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})}}),Oe=s("$ZodCheckNumberFormat",(e,t)=>{Ne.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=$[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=i,n&&(r.pattern=ze)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:r,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:r,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:r,inclusive:!0,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,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})}}),xe=s("$ZodCheckMaxLength",(e,t)=>{var n;Ne.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!h(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 r=n.value;if(r.length<=t.maximum)return;const o=M(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Pe=s("$ZodCheckMinLength",(e,t)=>{var n;Ne.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!h(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 r=n.value;if(r.length>=t.minimum)return;const o=M(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ze=s("$ZodCheckLengthEquals",(e,t)=>{var n;Ne.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!h(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 r=n.value,o=r.length;if(o===t.length)return;const i=M(r),s=o>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})}}),Me=s("$ZodCheckStringFormat",(e,t)=>{var n,r;Ne.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})}):(r=e._zod).check??(r.check=()=>{})}),Re=s("$ZodCheckRegex",(e,t)=>{Me.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})}}),Ue=s("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ce),Me.init(e,t)}),De=s("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Te),Me.init(e,t)}),Ge=s("$ZodCheckIncludes",(e,t)=>{Ne.init(e,t);const n=N(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Le=s("$ZodCheckStartsWith",(e,t)=>{Ne.init(e,t);const n=new RegExp(`^${N(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})}}),Fe=s("$ZodCheckEndsWith",(e,t)=>{Ne.init(e,t);const n=new RegExp(`.*${N(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=s("$ZodCheckOverwrite",(e,t)=>{Ne.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class Be{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)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Je={major:4,minor:4,patch:3},Ve=s("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Je;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,o=A(e);for(const i of t){if(i._zod.def.when){if(O(e))continue;if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new a;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(o||(o=A(e,t)))});else{if(e.issues.length===t)continue;o||(o=A(e,t))}}return r?r.then(()=>e):e},n=(n,o,i)=>{if(A(n))return n.aborted=!0,n;const s=t(o,r,i);if(s instanceof Promise){if(!1===i.async)throw new a;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){const t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,i)):n(t,o,i)}const s=e._zod.parse(o,i);if(s instanceof Promise){if(!1===i.async)throw new a;return s.then(e=>t(e,r,i))}return t(s,r,i)}}y(e,"~standard",()=>({validate:t=>{try{const n=B(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return V(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Ke=s("$ZodString",(e,t)=>{var n;Ve.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,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),We=s("$ZodStringFormat",(e,t)=>{Me.init(e,t),Ke.init(e,t)}),Ye=s("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ue),We.init(e,t)}),He=s("$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=ce(e))}else t.pattern??(t.pattern=ce());We.init(e,t)}),Qe=s("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=le),We.init(e,t)}),qe=s("$ZodURL",(e,t)=>{We.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===ye.source&&!/^https?:\/\//i.test(r))return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});const o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.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(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),Xe=s("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),We.init(e,t)}),et=s("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=se),We.init(e,t)}),tt=s("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=te),We.init(e,t)}),nt=s("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ne),We.init(e,t)}),rt=s("$ZodULID",(e,t)=>{t.pattern??(t.pattern=re),We.init(e,t)}),ot=s("$ZodXID",(e,t)=>{t.pattern??(t.pattern=oe),We.init(e,t)}),it=s("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ie),We.init(e,t)}),st=s("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=we({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${_e}T(?:${r})$`)}(t)),We.init(e,t)}),at=s("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=be),We.init(e,t)}),ut=s("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${we(t)}$`)),We.init(e,t)}),ct=s("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ae),We.init(e,t)}),lt=s("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=de),We.init(e,t),e._zod.bag.format="ipv4"}),dt=s("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=pe),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})}}}),pt=s("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fe),We.init(e,t)}),ft=s("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=he),We.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;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 ht(e){if(""===e)return!0;if(/\s/.test(e))return!1;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const mt=s("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=me),We.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{ht(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const gt=s("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ge),We.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!ge.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return ht(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})}}),yt=s("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ve),We.init(e,t)});const vt=s("$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[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.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})}}),_t=s("$ZodNumber",(e,t)=>{Ve.init(e,t),e._zod.pattern=e._zod.bag.pattern??Se,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),bt=s("$ZodNumberFormat",(e,t)=>{Oe.init(e,t),_t.init(e,t)}),wt=s("$ZodBoolean",(e,t)=>{Ve.init(e,t),e._zod.pattern=ke,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),zt=s("$ZodAny",(e,t)=>{Ve.init(e,t),e._zod.parse=e=>e}),St=s("$ZodUnknown",(e,t)=>{Ve.init(e,t),e._zod.parse=e=>e}),kt=s("$ZodNever",(e,t)=>{Ve.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Ct(e,t,n){e.issues.length&&t.issues.push(...x(n,e.issues)),t.value[n]=e.value}const Tt=s("$ZodArray",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?i.push(a.then(t=>Ct(t,n,e))):Ct(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function Nt(e,t,n,r,o,i){const s=n in r;if(e.issues.length){if(o&&i&&!s)return;t.issues.push(...x(n,e.issues))}s||o?void 0===e.value?s&&(t.value[n]=void 0):t.value[n]=e.value:e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]})}function It(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=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Et(e,t,n,r,o,i){const s=[],a=o.keySet,u=o.catchall._zod,c=u.def.type,l="optional"===u.optin,d="optional"===u.optout;for(const o in t){if("__proto__"===o)continue;if(a.has(o))continue;if("never"===c){s.push(o);continue}const i=u.run({value:t[o],issues:[]},r);i instanceof Promise?e.push(i.then(e=>Nt(e,n,o,t,l,d))):Nt(i,n,o,t,l,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const $t=s("$ZodObject",(e,t)=>{Ve.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 r=f(()=>It(t));y(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const o=z,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const u=[],c=s.shape;for(const e of s.keys){const r=c[e],o="optional"===r._zod.optin,i="optional"===r._zod.optout,s=r._zod.run({value:a[e],issues:[]},n);s instanceof Promise?u.push(s.then(n=>Nt(n,t,e,a,o,i))):Nt(s,t,e,a,o,i)}return i?Et(u,a,t,n,r.value,e):u.length?Promise.all(u).then(()=>t):t}}),At=s("$ZodObjectJIT",(e,t)=>{$t.init(e,t);const n=e._zod.parse,r=f(()=>It(t));let o;const i=z,s=!c.jitless,a=s&&S.value,u=t.catchall;let l;e._zod.parse=(c,d)=>{l??(l=r.value);const p=c.value;return i(p)?s&&a&&!1===d?.async&&!0!==d.jitless?(o||(o=(e=>{const t=new Be(["shape","payload","ctx"]),n=r.value,o=e=>{const t=b(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 r of n.keys){const n=i[r],s=b(r),a=e[r],u="optional"===a?._zod?.optin,c="optional"===a?._zod?.optout;t.write(`const ${n} = ${o(r)};`),u&&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 `):u?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(`\n const ${n}_present = ${s} in input;\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 if (!${n}_present && !${n}.issues.length) {\n payload.issues.push({\n code: "invalid_type",\n expected: "nonoptional",\n input: undefined,\n path: [${s}]\n });\n }\n\n if (${n}_present) {\n if (${n}.value === undefined) {\n newResult[${s}] = undefined;\n } else {\n newResult[${s}] = ${n}.value;\n }\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)),c=o(c,d),u?Et([],p,c,d,l,e):c):n(c,d):(c.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),c)}});function Ot(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter(e=>!A(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Z(e,r,l())))}),t)}const xt=s("$ZodUnion",(e,t)=>{Ve.init(e,t),y(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),y(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),y(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),y(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=>m(e.source)).join("|")})$`)}});const n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:r.value,issues:[]},o);if(t instanceof Promise)s.push(t),i=!0;else{if(0===t.issues.length)return t;s.push(t)}}return i?Promise.all(s).then(t=>Ot(t,r,e,o)):Ot(s,r,e,o)}}),Pt=s("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xt.init(e,t);const n=e._zod.parse;y(e._zod,"propValues",()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(const r of n)e[t].add(r)}}return e});const r=f(()=>{const e=t.options,n=new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(o,i)=>{const s=o.value;if(!z(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;const a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback||"backward"===i.direction?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:s,path:[t.discriminator],inst:e}),o)}}),Zt=s("$ZodIntersection",(e,t)=>{Ve.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>Rt(e,t,n)):Rt(e,o,i)}});function Mt(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(k(e)&&k(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const n of r){const r=Mt(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o[n]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=Mt(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Rt(e,t,n){const r=new Map;let o;for(const n of t.issues)if("unrecognized_keys"===n.code){o??(o=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.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)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const i=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&o&&e.issues.push({...o,keys:i}),A(e))return e;const s=Mt(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 Ut=s("$ZodEnum",(e,t)=>{Ve.init(e,t);const n=d(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>T.has(typeof e)).map(e=>"string"==typeof e?N(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),Dt=s("$ZodLiteral",(e,t)=>{if(Ve.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?N(e):e?N(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),Gt=s("$ZodTransform",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new u(e.constructor.name);const o=t.transform(n.value,n);if(r.async){return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n.fallback=!0,n))}if(o instanceof Promise)throw new a;return n.value=o,n.fallback=!0,n}});function Lt(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Ft=s("$ZodOptional",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",e._zod.optout="optional",y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),y(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${m(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=e.value,o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then(e=>Lt(e,r)):Lt(o,r)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),jt=s("$ZodExactOptional",(e,t)=>{Ft.init(e,t),y(e._zod,"values",()=>t.innerType._zod.values),y(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Bt=s("$ZodNullable",(e,t)=>{Ve.init(e,t),y(e._zod,"optin",()=>t.innerType._zod.optin),y(e._zod,"optout",()=>t.innerType._zod.optout),y(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${m(e.source)}|null)$`):void 0}),y(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)}),Jt=s("$ZodDefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",y(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 r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Vt(e,t)):Vt(r,t)}});function Vt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Kt=s("$ZodPrefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",y(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))}),Wt=s("$ZodNonOptional",(e,t)=>{Ve.init(e,t),y(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,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Yt(t,e)):Yt(o,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 Ht=s("$ZodCatch",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",y(e._zod,"optout",()=>t.innerType._zod.optout),y(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Z(e,n,l()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Z(e,n,l()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Qt=s("$ZodPipe",(e,t)=>{Ve.init(e,t),y(e._zod,"values",()=>t.in._zod.values),y(e._zod,"optin",()=>t.in._zod.optin),y(e._zod,"optout",()=>t.out._zod.optout),y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>qt(e,t.in,n)):qt(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>qt(e,t.out,n)):qt(r,t.out,n)}});function qt(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const Xt=s("$ZodReadonly",(e,t)=>{Ve.init(e,t),y(e._zod,"propValues",()=>t.innerType._zod.propValues),y(e._zod,"values",()=>t.innerType._zod.values),y(e._zod,"optin",()=>t.innerType?._zod?.optin),y(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(en):en(r)}});function en(e){return e.value=Object.freeze(e.value),e}const tn=s("$ZodCustom",(e,t)=>{Ne.init(e,t),Ve.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>nn(t,n,r,e));nn(o,n,r,e)}});function nn(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(R(e))}}var rn;class on{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 r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(rn=globalThis).__zod_globalRegistry??(rn.__zod_globalRegistry=new on);const sn=globalThis.__zod_globalRegistry;function an(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...E(t)})}function un(e,t){return new Ee({check:"less_than",...E(t),value:e,inclusive:!1})}function cn(e,t){return new Ee({check:"less_than",...E(t),value:e,inclusive:!0})}function ln(e,t){return new $e({check:"greater_than",...E(t),value:e,inclusive:!1})}function dn(e,t){return new $e({check:"greater_than",...E(t),value:e,inclusive:!0})}function pn(e,t){return new Ae({check:"multiple_of",...E(t),value:e})}function fn(e,t){return new xe({check:"max_length",...E(t),maximum:e})}function hn(e,t){return new Pe({check:"min_length",...E(t),minimum:e})}function mn(e,t){return new Ze({check:"length_equals",...E(t),length:e})}function gn(e){return new je({check:"overwrite",tx:e})}function yn(e,t){const n=function(e,t){const n=new Ne({check:"custom",...E(t)});return n._zod.check=e,n}(t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(R(e,t.value,n._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=t.value),r.inst??(r.inst=n),r.continue??(r.continue=!n._zod.def.abort),t.issues.push(R(r))}},e(t.value,t)),t);return n}function vn(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 _n(e,t,n={path:[],schemaPath:[]}){var r;const o=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 r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,r);else{const n=s.schema,i=t.processors[o.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(s.ref||(s.ref=i),_n(i,t,r),t.seen.get(i).isParent=!0)}const u=t.metadataRegistry.get(e);u&&Object.assign(s.schema,u),"input"===t.io&&zn(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault;return t.seen.get(e).schema}function bn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.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.`);r.set(n,t[0])}}const o=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:o,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${o("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const o=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:o+i}})(t);r.def={...r.schema},i&&(r.defId=i);const s=r.schema;for(const e in s)delete s[e];s.$ref=o};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 r=n[1];if(t===n[0]){o(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){o(n);continue}}const i=e.metadataRegistry.get(n[0])?.id;i?o(n):(r.cycle||r.count>1&&"ref"===e.reused)&&o(n)}}function wn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const o=n.def??n.schema,i={...o},s=n.ref;if(n.ref=null,s){r(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(o,a):(o.allOf=o.allOf??[],o.allOf.push(a)),Object.assign(o,i);if(t._zod.parent===s)for(const e in o)"$ref"!==e&&"allOf"!==e&&(e in i||delete o[e]);if(a.$ref&&n.def)for(const e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}const a=t._zod.parent;if(a&&a!==s){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(const e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$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");o.$id=e.external.uri(n)}Object.assign(o,n.def??n.schema);const i=e.metadataRegistry.get(t)?.id;void 0!==i&&o.id===i&&delete o.id;const s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?o.$defs=s:o.definitions=s);try{const n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Sn(t,"input",e.processors),output:Sn(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function zn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return zn(r.element,n);if("set"===r.type)return zn(r.valueType,n);if("lazy"===r.type)return zn(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return zn(r.innerType,n);if("intersection"===r.type)return zn(r.left,n)||zn(r.right,n);if("record"===r.type||"map"===r.type)return zn(r.keyType,n)||zn(r.valueType,n);if("pipe"===r.type)return!!e._zod.traits.has("$ZodCodec")||(zn(r.in,n)||zn(r.out,n));if("object"===r.type){for(const e in r.shape)if(zn(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(zn(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(zn(e,n))return!0;return!(!r.rest||!zn(r.rest,n))}return!1}const Sn=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=vn({...o??{},target:i,io:t,processors:n});return _n(e,s),bn(s,e),wn(s,e)},kn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cn=(e,t,n,r)=>{const o=e._zod.def;_n(o.innerType,t,r);t.seen.get(e).ref=o.innerType},Tn=s("ZodISODateTime",(e,t)=>{st.init(e,t),er.init(e,t)});function Nn(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(t)})}(Tn,e)}const In=s("ZodISODate",(e,t)=>{at.init(e,t),er.init(e,t)});function En(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...E(t)})}(In,e)}const $n=s("ZodISOTime",(e,t)=>{ut.init(e,t),er.init(e,t)});function An(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...E(t)})}($n,e)}const On=s("ZodISODuration",(e,t)=>{ct.init(e,t),er.init(e,t)});function xn(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...E(t)})}(On,e)}const Pn=(e,t)=>{D.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=(e,o=[])=>{for(const i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>r({issues:e},[...o,...i.path]));else if("invalid_key"===i.code)r({issues:i.issues},[...o,...i.path]);else if("invalid_element"===i.code)r({issues:i.issues},[...o,...i.path]);else{const e=[...o,...i.path];if(0===e.length)n._errors.push(t(i));else{let r=n,o=0;for(;o<e.length;){const n=e[o];o===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(i))):r[n]=r[n]||{_errors:[]},r=r[n],o++}}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,p,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,p,2)}},isEmpty:{get:()=>0===e.issues.length}})},Zn=s("ZodError",Pn,{Parent:Error}),Mn=L(Zn),Rn=F(Zn),Un=j(Zn),Dn=J(Zn),Gn=K(Zn),Ln=W(Zn),Fn=Y(Zn),jn=H(Zn),Bn=Q(Zn),Jn=q(Zn),Vn=X(Zn),Kn=ee(Zn),Wn=new WeakMap;function Yn(e,t,n){const r=Object.getPrototypeOf(e);let o=Wn.get(r);if(o||(o=new Set,Wn.set(r,o)),!o.has(t)){o.add(t);for(const e in n){const t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){const n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const Hn=s("ZodType",(e,t)=>(Ve.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Sn(e,"input"),output:Sn(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=vn({...n,processors:t});return _n(e,r),bn(r,e),wn(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Mn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Un(e,t,n),e.parseAsync=async(t,n)=>Rn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Dn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Gn(e,t,n),e.decode=(t,n)=>Ln(e,t,n),e.encodeAsync=async(t,n)=>Fn(e,t,n),e.decodeAsync=async(t,n)=>jn(e,t,n),e.safeEncode=(t,n)=>Bn(e,t,n),e.safeDecode=(t,n)=>Jn(e,t,n),e.safeEncodeAsync=async(t,n)=>Vn(e,t,n),e.safeDecodeAsync=async(t,n)=>Kn(e,t,n),Yn(e,"ZodType",{check(...e){const t=this.def;return this.clone(_(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return I(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...E(n)})}(io,e,t)}(e,t))},superRefine(e,t){return this.check(function(e,t){return yn(e,t)}(e,t))},overwrite(e){return this.check(gn(e))},optional(){return Wr(this)},exactOptional(){return new Yr({type:"optional",innerType:this})},nullable(){return Qr(this)},nullish(){return Wr(Qr(this))},nonoptional(e){return function(e,t){return new eo({type:"nonoptional",innerType:e,...E(t)})}(this,e)},array(){return xr(this)},or(e){return Rr([this,e])},and(e){return Lr(this,e)},transform(e){return ro(this,new Vr({type:"transform",transform:e}))},default(e){return t=e,new qr({type:"default",innerType:this,get defaultValue(){return"function"==typeof t?t():C(t)}});var t},prefault(e){return t=e,new Xr({type:"prefault",innerType:this,get defaultValue(){return"function"==typeof t?t():C(t)}});var t},catch(e){return new to({type:"catch",innerType:this,catchValue:"function"==typeof(t=e)?t:()=>t});var t},pipe(e){return ro(this,e)},readonly(){return new oo({type:"readonly",innerType:this})},describe(e){const t=this.clone();return sn.add(t,{description:e}),t},meta(...e){if(0===e.length)return sn.get(this);const t=this.clone();return sn.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>sn.get(e)?.description,configurable:!0}),e)),Qn=s("_ZodString",(e,t)=>{Ke.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:o,maximum:i,format:s,patterns:a,contentEncoding:u}=e._zod.bag;if("number"==typeof o&&(r.minLength=o),"number"==typeof i&&(r.maxLength=i),s&&(r.format=kn[s]??s,""===r.format&&delete r.format,"time"===s&&delete r.format),u&&(r.contentEncoding=u),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.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,Yn(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new Re({check:"string_format",format:"regex",...E(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new Ge({check:"string_format",format:"includes",...E(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new Le({check:"string_format",format:"starts_with",...E(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new Fe({check:"string_format",format:"ends_with",...E(t),suffix:e})}(...e))},min(...e){return this.check(hn(...e))},max(...e){return this.check(fn(...e))},length(...e){return this.check(mn(...e))},nonempty(...e){return this.check(hn(1,...e))},lowercase(e){return this.check(function(e){return new Ue({check:"string_format",format:"lowercase",...E(e)})}(e))},uppercase(e){return this.check(function(e){return new De({check:"string_format",format:"uppercase",...E(e)})}(e))},trim(){return this.check(gn(e=>e.trim()))},normalize(...e){return this.check(function(e){return gn(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(gn(e=>e.toLowerCase()))},toUpperCase(){return this.check(gn(e=>e.toUpperCase()))},slugify(){return this.check(gn(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}})}),qn=s("ZodString",(e,t)=>{Ke.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,...E(t)})}(tr,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...E(t)})}(or,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...E(t)})}(_r,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...E(t)})}(ir,t)),e.guid=t=>e.check(an(nr,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...E(t)})}(rr,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(t)})}(rr,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(t)})}(rr,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(t)})}(rr,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(t)})}(sr,t)),e.guid=t=>e.check(an(nr,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...E(t)})}(ar,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(t)})}(ur,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...E(t)})}(cr,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...E(t)})}(gr,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...E(t)})}(yr,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...E(t)})}(lr,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(t)})}(dr,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(t)})}(pr,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(t)})}(fr,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(t)})}(hr,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(t)})}(mr,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...E(t)})}(vr,t)),e.datetime=t=>e.check(Nn(t)),e.date=t=>e.check(En(t)),e.time=t=>e.check(An(t)),e.duration=t=>e.check(xn(t))});function Xn(e){return function(e,t){return new e({type:"string",...E(t)})}(qn,e)}const er=s("ZodStringFormat",(e,t)=>{We.init(e,t),Qn.init(e,t)}),tr=s("ZodEmail",(e,t)=>{Qe.init(e,t),er.init(e,t)}),nr=s("ZodGUID",(e,t)=>{Ye.init(e,t),er.init(e,t)}),rr=s("ZodUUID",(e,t)=>{He.init(e,t),er.init(e,t)}),or=s("ZodURL",(e,t)=>{qe.init(e,t),er.init(e,t)}),ir=s("ZodEmoji",(e,t)=>{Xe.init(e,t),er.init(e,t)}),sr=s("ZodNanoID",(e,t)=>{et.init(e,t),er.init(e,t)}),ar=s("ZodCUID",(e,t)=>{tt.init(e,t),er.init(e,t)}),ur=s("ZodCUID2",(e,t)=>{nt.init(e,t),er.init(e,t)}),cr=s("ZodULID",(e,t)=>{rt.init(e,t),er.init(e,t)}),lr=s("ZodXID",(e,t)=>{ot.init(e,t),er.init(e,t)}),dr=s("ZodKSUID",(e,t)=>{it.init(e,t),er.init(e,t)}),pr=s("ZodIPv4",(e,t)=>{lt.init(e,t),er.init(e,t)}),fr=s("ZodIPv6",(e,t)=>{dt.init(e,t),er.init(e,t)}),hr=s("ZodCIDRv4",(e,t)=>{pt.init(e,t),er.init(e,t)}),mr=s("ZodCIDRv6",(e,t)=>{ft.init(e,t),er.init(e,t)}),gr=s("ZodBase64",(e,t)=>{mt.init(e,t),er.init(e,t)}),yr=s("ZodBase64URL",(e,t)=>{gt.init(e,t),er.init(e,t)}),vr=s("ZodE164",(e,t)=>{yt.init(e,t),er.init(e,t)}),_r=s("ZodJWT",(e,t)=>{vt.init(e,t),er.init(e,t)}),br=s("ZodNumber",(e,t)=>{_t.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:o,maximum:i,format:s,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;"string"==typeof s&&s.includes("int")?r.type="integer":r.type="number";const l="number"==typeof c&&c>=(o??Number.NEGATIVE_INFINITY),d="number"==typeof u&&u<=(i??Number.POSITIVE_INFINITY),p="draft-04"===t.target||"openapi-3.0"===t.target;l?p?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c:"number"==typeof o&&(r.minimum=o),d?p?(r.maximum=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u:"number"==typeof i&&(r.maximum=i),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),Yn(e,"ZodNumber",{gt(e,t){return this.check(ln(e,t))},gte(e,t){return this.check(dn(e,t))},min(e,t){return this.check(dn(e,t))},lt(e,t){return this.check(un(e,t))},lte(e,t){return this.check(cn(e,t))},max(e,t){return this.check(cn(e,t))},int(e){return this.check(Sr(e))},safe(e){return this.check(Sr(e))},positive(e){return this.check(ln(0,e))},nonnegative(e){return this.check(dn(0,e))},negative(e){return this.check(un(0,e))},nonpositive(e){return this.check(cn(0,e))},multipleOf(e,t){return this.check(pn(e,t))},step(e,t){return this.check(pn(e,t))},finite(){return this}});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 wr(e){return function(e,t){return new e({type:"number",checks:[],...E(t)})}(br,e)}const zr=s("ZodNumberFormat",(e,t)=>{bt.init(e,t),br.init(e,t)});function Sr(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...E(t)})}(zr,e)}const kr=s("ZodBoolean",(e,t)=>{wt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function Cr(e){return function(e,t){return new e({type:"boolean",...E(t)})}(kr,e)}const Tr=s("ZodAny",(e,t)=>{zt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Nr(){return new Tr({type:"any"})}const Ir=s("ZodUnknown",(e,t)=>{St.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Er(){return new Ir({type:"unknown"})}const $r=s("ZodNever",(e,t)=>{kt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function Ar(e){return function(e,t){return new e({type:"never",...E(t)})}($r,e)}const Or=s("ZodArray",(e,t)=>{Tt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(o.minItems=s),"number"==typeof a&&(o.maxItems=a),o.type="array",o.items=_n(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,Yn(e,"ZodArray",{min(e,t){return this.check(hn(e,t))},nonempty(e){return this.check(hn(1,e))},max(e,t){return this.check(fn(e,t))},length(e,t){return this.check(mn(e,t))},unwrap(){return this.element}})});function xr(e,t){return function(e,t,n){return new e({type:"array",element:t,...E(n)})}(Or,e,t)}const Pr=s("ZodObject",(e,t)=>{At.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const e in s)o.properties[e]=_n(s[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(s)),u=new Set([...a].filter(e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));u.size>0&&(o.required=Array.from(u)),"never"===i.catchall?._zod.def.type?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=_n(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(o.additionalProperties=!1)})(e,t,n,r),y(e,"shape",()=>t.shape),Yn(e,"ZodObject",{keyof(){return jr(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Er()})},loose(){return this.clone({...this._zod.def,catchall:Er()})},strict(){return this.clone({...this._zod.def,catchall:Ar()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!k(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 r=_(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return v(this,"shape",n),n}});return I(e,r)}(this,e)},safeExtend(e){return function(e,t){if(!k(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=_(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return v(this,"shape",n),n}});return I(e,n)}(this,e)},merge(e){return function(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=_(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return v(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return I(e,n)}(this,e)},pick(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return I(e,_(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return v(this,"shape",e),e},checks:[]}))}(this,e)},omit(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=_(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return v(this,"shape",r),r},checks:[]});return I(e,o)}(this,e)},partial(...e){return function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=_(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return v(this,"shape",o),o},checks:[]});return I(t,o)}(Kr,this,e[0])},required(...e){return function(e,t,n){const r=_(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return v(this,"shape",o),o}});return I(t,r)}(eo,this,e[0])}})});function Zr(e,t){const n={type:"object",shape:e??{},...E(t)};return new Pr(n)}const Mr=s("ZodUnion",(e,t)=>{xt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=!1===o.inclusive,s=o.options.map((e,n)=>_n(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=s:n.anyOf=s})(e,t,n,r),e.options=t.options});function Rr(e,t){return new Mr({type:"union",options:e,...E(t)})}const Ur=s("ZodDiscriminatedUnion",(e,t)=>{Mr.init(e,t),Pt.init(e,t)});function Dr(e,t,n){return new Ur({type:"union",options:t,discriminator:e,...E(n)})}const Gr=s("ZodIntersection",(e,t)=>{Zt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=_n(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=_n(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,u=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=u})(e,t,n,r)});function Lr(e,t){return new Gr({type:"intersection",left:e,right:t})}const Fr=s("ZodEnum",(e,t)=>{Ut.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=d(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);o[r]=t.entries[r]}return new Fr({...t,checks:[],...E(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Fr({...t,checks:[],...E(r),entries:o})}});function jr(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Fr({type:"enum",entries:n,...E(t)})}const Br=s("ZodLiteral",(e,t)=>{Dt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,o=[];for(const e of r.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");o.push(Number(e))}else o.push(e);if(0===o.length);else if(1===o.length){const e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(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 Jr(e,t){return new Br({type:"literal",values:Array.isArray(e)?e:[e],...E(t)})}const Vr=s("ZodTransform",(e,t)=>{Gt.init(e,t),Hn.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,r)=>{if("backward"===r.direction)throw new u(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(R(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(R(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});const Kr=s("ZodOptional",(e,t)=>{Ft.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cn(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Wr(e){return new Kr({type:"optional",innerType:e})}const Yr=s("ZodExactOptional",(e,t)=>{jt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cn(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});const Hr=s("ZodNullable",(e,t)=>{Bt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=_n(o.innerType,t,r),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qr(e){return new Hr({type:"nullable",innerType:e})}const qr=s("ZodDefault",(e,t)=>{Jt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;_n(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const Xr=s("ZodPrefault",(e,t)=>{Kt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;_n(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});const eo=s("ZodNonOptional",(e,t)=>{Wt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;_n(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});const to=s("ZodCatch",(e,t)=>{Ht.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let i;_n(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const no=s("ZodPipe",(e,t)=>{Qt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s="input"===t.io?i?o.out:o.in:o.out;_n(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.in=t.in,e.out=t.out});function ro(e,t){return new no({type:"pipe",in:e,out:t})}const oo=s("ZodReadonly",(e,t)=>{Xt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;_n(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});const io=s("ZodCustom",(e,t)=>{tn.init(e,t),Hn.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 so=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],ao=jr(so),uo=Zr({targetedCountryGroups:xr(ao),targetedCountryCodes:xr(Xn()).optional()}).optional(),co={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},lo={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},po={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},fo=e=>Object.keys(co).find(t=>co[t].countries.includes(e??""))??"International",ho=e=>{if(e){const t=fo(e);return po[t]}return"£"},mo=e=>{if(e)return lo[e]},go=e=>e.includes("subscribe/weekly/checkout"),yo=(e,t,n,r)=>{if(r){const o=r[fo(n)];return`${ho(n)}${o[e][t].price}`}},vo={CURRENCY_SYMBOL:({countryCode:e})=>ho(e),COUNTRY_NAME:({countryCode:e})=>mo(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>yo("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>yo("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>yo("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>yo("GuardianWeekly","Annual",e,t),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},_o=/%%.*?%%/g,bo="gu.contributions.views",wo=e=>{const t=(e=>{const t=new Date(e,10,1).getDay();return new Date(e,10,22+(11-t)%7)})(e);return t.setDate(t.getDate()+5),t},zo=(e=new Date)=>{const t=(e=>{const t=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+t),e})(e),n=(t.getMonth()+1).toString().padStart(2,"0"),r=t.toLocaleString("default",{month:"long"}),o=t.getFullYear();return{reminderCta:`Remind me in ${r}`,reminderPeriod:`${o}-${n}-01`,reminderLabel:`${r} ${o}`}},So=new Date("2023-12-31"),ko=e=>e>=(e=>new Date(e.getFullYear(),10,15))(e)&&e<wo(e.getFullYear()),Co=Zr({text:Xn(),baseUrl:Xn()});let To=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});var No;new Fr({type:"enum",entries:To,...E(No)});const Io=Dr("type",[Zr({type:Jr(To.Custom),cta:Co}),Zr({type:Jr(To.ContributionsReminder)})]),Eo=Zr({countLabel:Xn(),goalCopy:Xn().optional()}),$o=Zr({total:wr(),goal:wr()}),Ao=jr(["US","AU","global"]),Oo=Zr({currencySymbol:Xn(),copy:Eo,name:Ao,tickerData:$o.optional()}),xo=Zr({for52Weeks:wr(),forTargetedWeeks:wr()}),Po=jr(["for52Weeks","forTargetedWeeks"]),Zo=Zr({type:Jr("above"),copy:Xn().optional(),countType:Po.optional()}),Mo=jr(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),Ro=jr(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),Uo=Zr({abTestName:Xn(),abTestVariant:Xn(),campaignCode:Xn(),componentType:Ro,products:xr(Mo).nullish(),labels:xr(Xn()).nullish(),ophanPageId:Xn(),platformId:Xn(),referrerUrl:Xn()}),Do=Zr({mainUrl:Xn(),mobileUrl:Xn().optional(),tabletUrl:Xn().optional(),desktopUrl:Xn().optional(),leftColUrl:Xn().optional(),wideUrl:Xn().optional(),altText:Xn()}),Go=Zr({name:Xn(),description:Xn().optional(),headshot:Do.optional()}),Lo=/^[0-9A-F]{2}$/,Fo=Xn().refine(e=>Lo.test(e),{error:e=>`"${JSON.stringify(e.input)}" is not a valid hex value`}),jo=Zr({r:Fo,g:Fo,b:Fo,kind:Jr("hex")}),Bo=Zr({mobileUrl:Xn(),tabletUrl:Xn(),desktopUrl:Xn(),altText:Xn(),kind:Jr("Image")}),Jo=Zr({buttonColour:jo.nullish(),buttonTextColour:jo.nullish(),buttonBorderColour:jo.nullish(),buttonSelectColour:jo.nullish(),buttonSelectTextColour:jo.nullish(),buttonSelectBorderColour:jo.nullish(),buttonSelectMarkerColour:jo.nullish(),pillTextColour:jo.nullish(),pillBackgroundColour:jo.nullish(),kind:Jr("ChoiceCards")}),Vo=Zr({visual:Dr("kind",[Bo,Jo]).nullish(),colours:Zr({basic:Zr({background:jo,bodyText:jo})})}),Ko=Zr({copy:Xn()}),Wo=Rr([Jr("Monthly"),Jr("Annual")]),Yo=Dr("supportTier",[Zr({supportTier:Jr("Contribution"),ratePlan:Wo}),Zr({supportTier:Jr("SupporterPlus"),ratePlan:Wo}),Zr({supportTier:Jr("DigitalSubscription"),ratePlan:Wo}),Zr({supportTier:Jr("OneOff")})]),Ho=Zr({copy:Xn(),textColour:jo.nullish(),backgroundColour:jo.nullish()}),Qo=Rr([Jr("LandingPage"),Jr("Checkout")]),qo=Zr({testName:Xn(),variantName:Xn()}),Xo=Zr({product:Yo,label:Xn(),isDefault:Cr(),defaultExpanded:Cr().optional(),benefitsLabel:Xn().nullish(),benefits:xr(Ko),pill:Ho.nullish(),destination:Qo.nullish(),destinationTest:qo.nullish()}),ei=Zr({choiceCards:xr(Xo),mobileChoiceCards:xr(Xo).nullish()}),ti=Zr({maxViewsCount:wr(),maxViewsDays:wr(),minDaysBetweenViews:wr()}),ni=Zr({reminderCta:Xn(),reminderLabel:Xn(),reminderPeriod:Xn()}),ri=jr(["ONE_OFF","MONTHLY","ANNUAL"]),oi=Zr({newsletterId:Xn(),successDescription:Xn()}),ii=Zr({name:Xn(),heading:Xn().optional(),paragraphs:xr(Xn()),highlightedText:Xn().optional(),tickerSettings:Oo.optional(),cta:Co.optional(),secondaryCta:Io.optional(),newsletterSignup:oi.optional(),image:Do.optional(),showReminderFields:ni.optional(),separateArticleCount:Zo.optional(),promoCodes:xr(Xn()).nullish(),maxViews:ti.optional(),showSignInLink:Cr().optional(),bylineWithImage:Go.optional(),showChoiceCards:Cr().optional(),choiceCardsSettings:ei.nullish(),defaultChoiceCardFrequency:ri.optional()}),si=Zr({variant:ii,tracking:Uo,countryCode:Xn().nullish(),articleCounts:xo,onReminderOpen:Nr().nullish(),fetchEmail:Nr().nullish(),submitComponentEvent:Nr().nullish(),openCmp:Nr().nullish(),hasConsentForArticleCount:Cr().nullish(),stage:Xn().nullish()}),ai=jr(["contributions","subscriptions","signIn","abandonedBasket"]),ui=Zr({heading:Xn().optional(),messageText:Xn().optional(),paragraphs:xr(Xn()).optional(),mobileMessageText:Xn().optional(),highlightedText:Xn().optional(),cta:Co.optional(),secondaryCta:Io.optional()}),ci=Zr({tracking:Uo,bannerChannel:ai,content:ui.nullish(),mobileContent:ui.nullish(),countryCode:Xn().nullish(),isSupporter:Cr().nullish(),tickerSettings:Oo.nullish(),submitComponentEvent:Nr(),articleCounts:xo,hasOptedOutOfArticleCount:Cr().nullish(),fetchEmail:Nr().nullish(),separateArticleCount:Cr().nullish(),design:Vo.nullish(),choiceCardsSettings:ei.nullish(),promoCodes:xr(Xn()).nullish(),isCollapsible:Cr().nullish(),contributionsServiceUrl:Xn().nullish()}),li=Zr({heading:Xn(),subheading:Xn(),primaryCta:Co.optional(),secondaryCta:Co.optional(),benefits:xr(Xn()).optional()}),di=Zr({content:li,tracking:Uo,mobileContent:li.optional(),countryCode:Xn().optional(),submitComponentEvent:Nr(),numArticles:wr().optional(),promoCodes:xr(Xn()).nullish()}),pi=Zr({image:Do,bodyCopy:xr(Xn()),cta:Co.optional()});Zr({content:pi,tracking:Uo,countryCode:Xn().optional(),submitComponentEvent:Nr(),promoCodes:xr(Xn()).nullish()});const fi=jr(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),hi=jr(["new","guest","current"]),mi=jr(["Epic","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),gi=jr(["Live","Draft","Archived"]),yi=jr(["Mobile","Desktop","All","iOS","Android"]),vi=jr(["SignedIn","SignedOut","All"]),_i=jr(["HasConsented","HasNotConsented","All"]),bi=Lr(Dr("name",[Zr({name:Jr("ABTest")}),Zr({name:Jr("EpsilonGreedyBandit"),epsilon:wr(),sampleCount:wr().optional()}),Zr({name:Jr("Roulette"),sampleCount:wr().optional()})]),Zr({testName:Xn().optional()})),wi=Zr({channel:mi,name:Xn(),status:gi,priority:wr(),controlProportionSettings:Zr({proportion:wr(),offset:wr()}).optional(),deviceType:yi.optional(),signedInStatus:vi.optional(),consentStatus:_i.optional(),methodologies:bi.array().optional(),mParticleAudience:wr().nullish(),scheduler:Zr({start:Xn().optional(),end:Xn().optional()}).optional()}),zi=jr(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),Si=Zr({minViews:wr(),maxViews:wr().optional(),periodInWeeks:wr(),tagIds:xr(Xn()).optional()});Zr({userType:xr(hi),product:xr(fi)}),Zr({tagIds:xr(Xn()),sectionIds:xr(Xn()),excludedTagIds:xr(Xn()),excludedSectionIds:xr(Xn())});const ki=Zr({maxViewsCount:wr(),maxViewsDays:wr(),minDaysBetweenViews:wr()});wi.extend({name:Xn(),status:gi,locations:xr(ao).optional(),regionTargeting:uo.optional(),tagIds:xr(Xn()),sections:xr(Xn()),excludedTagIds:xr(Xn()),excludedSections:xr(Xn()),alwaysAsk:Cr(),maxViews:ki.optional(),userCohort:zi,hasCountryName:Cr(),highPriority:Cr(),useLocalViewLog:Cr(),articlesViewedSettings:Si.optional(),priority:wr(),variants:ii.array()});const Ci=Zr({amount:Rr([wr(),Jr("other")]),billingPeriod:Rr([Jr("ONE_OFF"),Jr("MONTHLY"),Jr("ANNUAL")]),product:Rr([Jr("Contribution"),Jr("SupporterPlus"),Jr("PremiumTier"),Jr("DailyEdition"),Jr("GuardianWeekly"),Jr("Paper"),Jr("PaperAndDigital")]),region:Rr([Jr("uk"),Jr("us"),Jr("au"),Jr("eu"),Jr("int"),Jr("nz"),Jr("ca")])}),Ti=(e,t,n,r)=>{const o=(e=>new URLSearchParams(window.location.search).get(`force-${e}`))(e),i=(e=>new URLSearchParams(window.location.search).get(`preview-${e}`))(e),s=new URLSearchParams;o?s.set("force",o):i&&s.set("preview",i);const a=s.toString();return fetch(a?`${t}/${e}?${a}`:`${t}/${e}`,{method:"post",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(n)}).then(t=>{if(!t.ok)throw Error(t.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${t.status}`);return t}).then(e=>e.json())};exports.CountryGroupId=so,exports.SecondaryCtaType=To,exports.abandonedBasketSchema=Ci,exports.addRegionIdToSupportUrl=(e,t)=>{if(t){const n=(e=>co[fo(e)].supportRegionId)(t);if(!go(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,(e,t,r)=>`${t}/${n.toLowerCase()}/${r}`)}return e},exports.bannerSchema=ci,exports.buildReminderFields=zo,exports.containsNonArticleCountPlaceholder=e=>{const t=e.match(_o)?.filter(e=>"%%ARTICLE_COUNT%%"!==e);return!!t&&t.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=fo,exports.countryGroupIdSchema=ao,exports.countryGroups=co,exports.epicPropsSchema=si,exports.getBanner=(e,t)=>Ti("banner",e,t),exports.getCountryName=mo,exports.getEpic=(e,t,n)=>Ti("epic",e,t,n),exports.getEpicViewLog=e=>e.get(bo)??void 0,exports.getGutterLiveblog=(e,t)=>Ti("gutter-liveblog",e,t),exports.getHeader=(e,t)=>Ti("header",e,t),exports.getLiveblogEpic=(e,t)=>Ti("liveblog-epic",e,t),exports.getLocalCurrencySymbol=ho,exports.getReminderFields=(e,t=new Date)=>{return"US"===e&&ko(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${n=t.getFullYear()}-${(wo(n).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${n}`}:"US"===e&&(e=>e>=wo(e.getFullYear())&&e<So)(t)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(t.getFullYear()):zo(t);var n},exports.getWeeklyArticleHistory=t=>t.get(e)??void 0,exports.headerPropsSchema=di,exports.hexColourToString=e=>`#${e.r}${e.g}${e.b}`,exports.inTargetedCountry=(e,t=[],n=[])=>0===t.length&&0===n.length||!!e&&(!!t.includes(fo(e.toUpperCase()))||n.includes(e.toUpperCase())),exports.incrementWeeklyArticleCount=(r,i,s)=>{const a=((e,r)=>{const o=n(new Date),i=e.get(t);if(i?.week===o){const n=i.articles[r]||0;return e.set(t,{week:o,articles:{...i.articles,[r]:n+1}}),n>0}return e.set(t,{week:o,articles:{[r]:1}}),!1})(r,i);if(!a){const t=n(new Date),i=r.get(e)??[],a=i.length>0?i[0]:null;if(a?.week&&a.week===t)a.count+=1,a.tags=o(s,a.tags),r.set(e,i);else{i.unshift({week:t,count:1,tags:o(s,{})});const n=t-365,a=i.filter(e=>e.week>=n);r.set(e,a)}}},exports.isGWCheckoutUrl=go,exports.isoCurrencyToCurrencySymbol={GBP:"£",USD:"$",AUD:"$",EUR:"€",NZD:"NZ$",CAD:"CA$"},exports.logEpicView=e=>{const t=JSON.parse(localStorage.getItem(bo)??""),n=t?t.value:[];n.push({date:(new Date).getTime(),testId:e});const r={value:n.slice(-50)};localStorage.setItem(bo,JSON.stringify(r))},exports.replaceNonArticleCountPlaceholders=(e,t,n)=>e?e.replace(_o,e=>{const r=e.substring(2,e.length-2),o=vo[r];if(o){const e=o({countryCode:t,prices:n});if(e)return e}return e}):"",exports.targetedRegionsSchema=uo;
|
|
1
|
+
"use strict";const e="gu.history.weeklyArticleCount",t="gu.history.articleCountsThisWeek",n=e=>{const t=e.getDay()||7;return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()-(t-1))/864e5},r=new Set(["environment/climate-change","environment/climate-crisis","environment/environment","science/science","politics/politics","us-news/us-politics","australia-news/australian-politics","world/world","world/europe-news","world/russia","books/books","culture/culture","world/coronavirus-outbreak","world/race","inequality/inequality","technology/technology","business/business","tone/recipes","sport/sport","football/football","sport/olympic-games","sport/olympic-games-2024","tracking/commissioningdesk/uk-investigations"]),o=(e,t={})=>(e.forEach(e=>{r.has(e)&&(t[e]=(t[e]??0)+1)}),t);var i;function s(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:s,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);const o=s.prototype,i=Object.keys(o);for(let e=0;e<i.length;e++){const t=i[e];t in n||(n[t]=o[t].bind(n))}}const o=n?.Parent??Object;class i extends o{}function s(e){var t;const o=n?.Parent?new i:this;r(o,e),(t=o._zod).deferred??(t.deferred=[]);for(const e of o._zod.deferred)e();return o}return Object.defineProperty(i,"name",{value:e}),Object.defineProperty(s,"init",{value:r}),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 a extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class u extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}(i=globalThis).__zod_globalConfig??(i.__zod_globalConfig={});const c=globalThis.__zod_globalConfig;function l(e){return c}function d(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 p(e,t){return"bigint"==typeof t?t.toString():t}function f(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function h(e){return null==e}function m(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const g=Symbol("evaluating");function y(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==g)return void 0===r&&(r=g,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function v(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function _(...e){const t={};for(const n of e){const e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function b(e){return JSON.stringify(e)}const w="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function z(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}const S=f(()=>{if(c.jitless)return!1;if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function k(e){if(!1===z(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!==z(n)&&!1!==Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")}function C(e){return k(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const T=new Set(["string","number","symbol"]);function N(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function I(e,t,n){const r=new e._zod.constr(t??e._zod.def);return t&&!n?.parent||(r._zod.parent=e),r}function E(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 $={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 A(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 O(e,t=0){if(!0===e.aborted)return!0;for(let n=t;n<e.issues.length;n++)if(!1===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 P(e){return"string"==typeof e?e:e?.message}function Z(e,t,n){const r=e.message?e.message:P(e.inst?._zod.def?.error?.(e))??P(t?.error?.(e))??P(n.customError?.(e))??P(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:s,...a}=e;return a.path??(a.path=[]),a.message=r,t?.reportInput&&(a.input=s),a}function M(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function R(...e){const[t,n,r]=e;return"string"==typeof t?{message:t,code:"custom",input:n,inst:r}:{...t}}const U=(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,p,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},D=s("$ZodError",U),G=s("$ZodError",U,{Parent:Error});const L=e=>(t,n,r,o)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new a;if(s.issues.length){const t=new(o?.Err??e)(s.issues.map(e=>Z(e,i,l())));throw w(t,o?.callee),t}return s.value},F=e=>async(t,n,r,o)=>{const i=r?{...r,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(o?.Err??e)(s.issues.map(e=>Z(e,i,l())));throw w(t,o?.callee),t}return s.value},B=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new a;return i.issues.length?{success:!1,error:new(e??D)(i.issues.map(e=>Z(e,o,l())))}:{success:!0,data:i.value}},j=B(G),J=e=>async(t,n,r)=>{const o=r?{...r,async:!0}:{async:!0};let i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(e=>Z(e,o,l())))}:{success:!0,data:i.value}},V=J(G),K=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return L(e)(t,n,o)},W=e=>(t,n,r)=>L(e)(t,n,r),Y=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return F(e)(t,n,o)},H=e=>async(t,n,r)=>F(e)(t,n,r),Q=e=>(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return B(e)(t,n,o)},X=e=>(t,n,r)=>B(e)(t,n,r),q=e=>async(t,n,r)=>{const o=r?{...r,direction:"backward"}:{direction:"backward"};return J(e)(t,n,o)},ee=e=>async(t,n,r)=>J(e)(t,n,r),te=/^[cC][0-9a-z]{6,}$/,ne=/^[0-9a-z]+$/,re=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,oe=/^[0-9a-vA-V]{20}$/,ie=/^[A-Za-z0-9]{27}$/,se=/^[a-zA-Z0-9_-]{21}$/,ae=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,ue=/^([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})$/,ce=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)$/,le=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;const 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])$/,pe=/^(([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}|:))$/,fe=/^((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])$/,he=/^(([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])$/,me=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ge=/^[A-Za-z0-9_-]*$/,ye=/^https?$/,ve=/^\+[1-9]\d{6,14}$/,_e="(?:(?:\\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])))",be=new RegExp(`^${_e}$`);function we(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 ze=/^-?\d+$/,Se=/^-?\d+(?:\.\d+)?$/,ke=/^(?:true|false)$/i,Ce=/^[^A-Z]*$/,Te=/^[^a-z]*$/,Ne=s("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Ie={number:"number",bigint:"bigint",object:"date"},Ee=s("$ZodCheckLessThan",(e,t)=>{Ne.init(e,t);const n=Ie[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),$e=s("$ZodCheckGreaterThan",(e,t)=>{Ne.init(e,t);const n=Ie[typeof t.value];e._zod.onattach.push(e=>{const n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Ae=s("$ZodCheckMultipleOf",(e,t)=>{Ne.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/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}(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})}}),Oe=s("$ZodCheckNumberFormat",(e,t)=>{Ne.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[o,i]=$[t.format];e._zod.onattach.push(e=>{const r=e._zod.bag;r.format=t.format,r.minimum=o,r.maximum=i,n&&(r.pattern=ze)}),e._zod.check=s=>{const a=s.value;if(n){if(!Number.isInteger(a))return void s.issues.push({expected:r,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:r,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:r,inclusive:!0,continue:!t.abort}))}a<o&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,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})}}),xe=s("$ZodCheckMaxLength",(e,t)=>{var n;Ne.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!h(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 r=n.value;if(r.length<=t.maximum)return;const o=M(r);n.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Pe=s("$ZodCheckMinLength",(e,t)=>{var n;Ne.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!h(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 r=n.value;if(r.length>=t.minimum)return;const o=M(r);n.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ze=s("$ZodCheckLengthEquals",(e,t)=>{var n;Ne.init(e,t),(n=e._zod.def).when??(n.when=e=>{const t=e.value;return!h(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 r=n.value,o=r.length;if(o===t.length)return;const i=M(r),s=o>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})}}),Me=s("$ZodCheckStringFormat",(e,t)=>{var n,r;Ne.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})}):(r=e._zod).check??(r.check=()=>{})}),Re=s("$ZodCheckRegex",(e,t)=>{Me.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})}}),Ue=s("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ce),Me.init(e,t)}),De=s("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Te),Me.init(e,t)}),Ge=s("$ZodCheckIncludes",(e,t)=>{Ne.init(e,t);const n=N(t.includes),r=new RegExp("number"==typeof t.position?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{const t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Le=s("$ZodCheckStartsWith",(e,t)=>{Ne.init(e,t);const n=new RegExp(`^${N(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})}}),Fe=s("$ZodCheckEndsWith",(e,t)=>{Ne.init(e,t);const n=new RegExp(`.*${N(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})}}),Be=s("$ZodCheckOverwrite",(e,t)=>{Ne.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class je{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)),r=t.map(e=>e.slice(n)).map(e=>" ".repeat(2*this.indent)+e);for(const e of r)this.content.push(e)}compile(){const e=Function,t=this?.args;return new e(...t,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}const Je={major:4,minor:4,patch:3},Ve=s("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Je;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const t of r)for(const n of t._zod.onattach)n(e);if(0===r.length)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const t=(e,t,n)=>{let r,o=A(e);for(const i of t){if(i._zod.def.when){if(O(e))continue;if(!i._zod.def.when(e))continue}else if(o)continue;const t=e.issues.length,s=i._zod.check(e);if(s instanceof Promise&&!1===n?.async)throw new a;if(r||s instanceof Promise)r=(r??Promise.resolve()).then(async()=>{await s;e.issues.length!==t&&(o||(o=A(e,t)))});else{if(e.issues.length===t)continue;o||(o=A(e,t))}}return r?r.then(()=>e):e},n=(n,o,i)=>{if(A(n))return n.aborted=!0,n;const s=t(o,r,i);if(s instanceof Promise){if(!1===i.async)throw new a;return s.then(t=>e._zod.parse(t,i))}return e._zod.parse(s,i)};e._zod.run=(o,i)=>{if(i.skipChecks)return e._zod.parse(o,i);if("backward"===i.direction){const t=e._zod.parse({value:o.value,issues:[]},{...i,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,o,i)):n(t,o,i)}const s=e._zod.parse(o,i);if(s instanceof Promise){if(!1===i.async)throw new a;return s.then(e=>t(e,r,i))}return t(s,r,i)}}y(e,"~standard",()=>({validate:t=>{try{const n=j(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch(n){return V(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),Ke=s("$ZodString",(e,t)=>{var n;Ve.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,r)=>{if(t.coerce)try{n.value=String(n.value)}catch(r){}return"string"==typeof n.value||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),We=s("$ZodStringFormat",(e,t)=>{Me.init(e,t),Ke.init(e,t)}),Ye=s("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=ue),We.init(e,t)}),He=s("$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=ce(e))}else t.pattern??(t.pattern=ce());We.init(e,t)}),Qe=s("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=le),We.init(e,t)}),Xe=s("$ZodURL",(e,t)=>{We.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===ye.source&&!/^https?:\/\//i.test(r))return void n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});const o=new URL(r);return t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.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(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.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=o.href:n.value=r)}catch(r){n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),qe=s("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),We.init(e,t)}),et=s("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=se),We.init(e,t)}),tt=s("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=te),We.init(e,t)}),nt=s("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=ne),We.init(e,t)}),rt=s("$ZodULID",(e,t)=>{t.pattern??(t.pattern=re),We.init(e,t)}),ot=s("$ZodXID",(e,t)=>{t.pattern??(t.pattern=oe),We.init(e,t)}),it=s("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ie),We.init(e,t)}),st=s("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=function(e){const t=we({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${_e}T(?:${r})$`)}(t)),We.init(e,t)}),at=s("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=be),We.init(e,t)}),ut=s("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=new RegExp(`^${we(t)}$`)),We.init(e,t)}),ct=s("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ae),We.init(e,t)}),lt=s("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=de),We.init(e,t),e._zod.bag.format="ipv4"}),dt=s("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=pe),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})}}}),pt=s("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=fe),We.init(e,t)}),ft=s("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=he),We.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(2!==r.length)throw new Error;const[e,t]=r;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 ht(e){if(""===e)return!0;if(/\s/.test(e))return!1;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const mt=s("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=me),We.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{ht(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});const gt=s("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ge),We.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{(function(e){if(!ge.test(e))return!1;const t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return ht(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})}}),yt=s("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ve),We.init(e,t)});const vt=s("$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[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&"JWT"!==o?.typ||!o.alg||t&&(!("alg"in o)||o.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})}}),_t=s("$ZodNumber",(e,t)=>{Ve.init(e,t),e._zod.pattern=e._zod.bag.pattern??Se,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch(e){}const o=n.value;if("number"==typeof o&&!Number.isNaN(o)&&Number.isFinite(o))return n;const i="number"==typeof o?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...i?{received:i}:{}}),n}}),bt=s("$ZodNumberFormat",(e,t)=>{Oe.init(e,t),_t.init(e,t)}),wt=s("$ZodBoolean",(e,t)=>{Ve.init(e,t),e._zod.pattern=ke,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Boolean(n.value)}catch(e){}const o=n.value;return"boolean"==typeof o||n.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),n}}),zt=s("$ZodAny",(e,t)=>{Ve.init(e,t),e._zod.parse=e=>e}),St=s("$ZodUnknown",(e,t)=>{Ve.init(e,t),e._zod.parse=e=>e}),kt=s("$ZodNever",(e,t)=>{Ve.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)});function Ct(e,t,n){e.issues.length&&t.issues.push(...x(n,e.issues)),t.value[n]=e.value}const Tt=s("$ZodArray",(e,t)=>{Ve.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const i=[];for(let e=0;e<o.length;e++){const s=o[e],a=t.element._zod.run({value:s,issues:[]},r);a instanceof Promise?i.push(a.then(t=>Ct(t,n,e))):Ct(a,n,e)}return i.length?Promise.all(i).then(()=>n):n}});function Nt(e,t,n,r,o,i){const s=n in r;if(e.issues.length){if(o&&i&&!s)return;t.issues.push(...x(n,e.issues))}s||o?void 0===e.value?s&&(t.value[n]=void 0):t.value[n]=e.value:e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]})}function It(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=(r=e.shape,Object.keys(r).filter(e=>"optional"===r[e]._zod.optin&&"optional"===r[e]._zod.optout));var r;return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Et(e,t,n,r,o,i){const s=[],a=o.keySet,u=o.catchall._zod,c=u.def.type,l="optional"===u.optin,d="optional"===u.optout;for(const o in t){if("__proto__"===o)continue;if(a.has(o))continue;if("never"===c){s.push(o);continue}const i=u.run({value:t[o],issues:[]},r);i instanceof Promise?e.push(i.then(e=>Nt(e,n,o,t,l,d))):Nt(i,n,o,t,l,d)}return s.length&&n.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i}),e.length?Promise.all(e).then(()=>n):n}const $t=s("$ZodObject",(e,t)=>{Ve.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 r=f(()=>It(t));y(e._zod,"propValues",()=>{const e=t.shape,n={};for(const t in e){const r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(const e of r.values)n[t].add(e)}}return n});const o=z,i=t.catchall;let s;e._zod.parse=(t,n)=>{s??(s=r.value);const a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};const u=[],c=s.shape;for(const e of s.keys){const r=c[e],o="optional"===r._zod.optin,i="optional"===r._zod.optout,s=r._zod.run({value:a[e],issues:[]},n);s instanceof Promise?u.push(s.then(n=>Nt(n,t,e,a,o,i))):Nt(s,t,e,a,o,i)}return i?Et(u,a,t,n,r.value,e):u.length?Promise.all(u).then(()=>t):t}}),At=s("$ZodObjectJIT",(e,t)=>{$t.init(e,t);const n=e._zod.parse,r=f(()=>It(t));let o;const i=z,s=!c.jitless,a=s&&S.value,u=t.catchall;let l;e._zod.parse=(c,d)=>{l??(l=r.value);const p=c.value;return i(p)?s&&a&&!1===d?.async&&!0!==d.jitless?(o||(o=(e=>{const t=new je(["shape","payload","ctx"]),n=r.value,o=e=>{const t=b(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 r of n.keys){const n=i[r],s=b(r),a=e[r],u="optional"===a?._zod?.optin,c="optional"===a?._zod?.optout;t.write(`const ${n} = ${o(r)};`),u&&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 `):u?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(`\n const ${n}_present = ${s} in input;\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 if (!${n}_present && !${n}.issues.length) {\n payload.issues.push({\n code: "invalid_type",\n expected: "nonoptional",\n input: undefined,\n path: [${s}]\n });\n }\n\n if (${n}_present) {\n if (${n}.value === undefined) {\n newResult[${s}] = undefined;\n } else {\n newResult[${s}] = ${n}.value;\n }\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)),c=o(c,d),u?Et([],p,c,d,l,e):c):n(c,d):(c.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),c)}});function Ot(e,t,n,r){for(const n of e)if(0===n.issues.length)return t.value=n.value,t;const o=e.filter(e=>!A(e));return 1===o.length?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Z(e,r,l())))}),t)}const xt=s("$ZodUnion",(e,t)=>{Ve.init(e,t),y(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),y(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),y(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),y(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=>m(e.source)).join("|")})$`)}});const n=1===t.options.length?t.options[0]._zod.run:null;e._zod.parse=(r,o)=>{if(n)return n(r,o);let i=!1;const s=[];for(const e of t.options){const t=e._zod.run({value:r.value,issues:[]},o);if(t instanceof Promise)s.push(t),i=!0;else{if(0===t.issues.length)return t;s.push(t)}}return i?Promise.all(s).then(t=>Ot(t,r,e,o)):Ot(s,r,e,o)}}),Pt=s("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,xt.init(e,t);const n=e._zod.parse;y(e._zod,"propValues",()=>{const e={};for(const n of t.options){const r=n._zod.propValues;if(!r||0===Object.keys(r).length)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(const[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(const r of n)e[t].add(r)}}return e});const r=f(()=>{const e=t.options,n=new Map;for(const r of e){const e=r._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(const t of e){if(n.has(t))throw new Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(o,i)=>{const s=o.value;if(!z(s))return o.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),o;const a=r.value.get(s?.[t.discriminator]);return a?a._zod.run(o,i):t.unionFallback||"backward"===i.direction?n(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:s,path:[t.discriminator],inst:e}),o)}}),Zt=s("$ZodIntersection",(e,t)=>{Ve.init(e,t),e._zod.parse=(e,n)=>{const r=e.value,o=t.left._zod.run({value:r,issues:[]},n),i=t.right._zod.run({value:r,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([t,n])=>Rt(e,t,n)):Rt(e,o,i)}});function Mt(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(k(e)&&k(t)){const n=Object.keys(t),r=Object.keys(e).filter(e=>-1!==n.indexOf(e)),o={...e,...t};for(const n of r){const r=Mt(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};o[n]=r.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=Mt(e[r],t[r]);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Rt(e,t,n){const r=new Map;let o;for(const n of t.issues)if("unrecognized_keys"===n.code){o??(o=n);for(const e of n.keys)r.has(e)||r.set(e,{}),r.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)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);const i=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(i.length&&o&&e.issues.push({...o,keys:i}),A(e))return e;const s=Mt(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 Ut=s("$ZodEnum",(e,t)=>{Ve.init(e,t);const n=d(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(e=>T.has(typeof e)).map(e=>"string"==typeof e?N(e):e.toString()).join("|")})$`),e._zod.parse=(t,o)=>{const i=t.value;return r.has(i)||t.issues.push({code:"invalid_value",values:n,input:i,inst:e}),t}}),Dt=s("$ZodLiteral",(e,t)=>{if(Ve.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?N(e):e?N(e.toString()):String(e)).join("|")})$`),e._zod.parse=(r,o)=>{const i=r.value;return n.has(i)||r.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),r}}),Gt=s("$ZodTransform",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if("backward"===r.direction)throw new u(e.constructor.name);const o=t.transform(n.value,n);if(r.async){return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n.fallback=!0,n))}if(o instanceof Promise)throw new a;return n.value=o,n.fallback=!0,n}});function Lt(e,t){return void 0===t&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Ft=s("$ZodOptional",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",e._zod.optout="optional",y(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),y(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${m(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if("optional"===t.innerType._zod.optin){const r=e.value,o=t.innerType._zod.run(e,n);return o instanceof Promise?o.then(e=>Lt(e,r)):Lt(o,r)}return void 0===e.value?e:t.innerType._zod.run(e,n)}}),Bt=s("$ZodExactOptional",(e,t)=>{Ft.init(e,t),y(e._zod,"values",()=>t.innerType._zod.values),y(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),jt=s("$ZodNullable",(e,t)=>{Ve.init(e,t),y(e._zod,"optin",()=>t.innerType._zod.optin),y(e._zod,"optout",()=>t.innerType._zod.optout),y(e._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${m(e.source)}|null)$`):void 0}),y(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)}),Jt=s("$ZodDefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",y(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 r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Vt(e,t)):Vt(r,t)}});function Vt(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}const Kt=s("$ZodPrefault",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",y(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))}),Wt=s("$ZodNonOptional",(e,t)=>{Ve.init(e,t),y(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,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(t=>Yt(t,e)):Yt(o,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 Ht=s("$ZodCatch",(e,t)=>{Ve.init(e,t),e._zod.optin="optional",y(e._zod,"optout",()=>t.innerType._zod.optout),y(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Z(e,n,l()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Z(e,n,l()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Qt=s("$ZodPipe",(e,t)=>{Ve.init(e,t),y(e._zod,"values",()=>t.in._zod.values),y(e._zod,"optin",()=>t.in._zod.optin),y(e._zod,"optout",()=>t.out._zod.optout),y(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if("backward"===n.direction){const r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Xt(e,t.in,n)):Xt(r,t.in,n)}const r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Xt(e,t.out,n)):Xt(r,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,fallback:e.fallback},n)}const qt=s("$ZodReadonly",(e,t)=>{Ve.init(e,t),y(e._zod,"propValues",()=>t.innerType._zod.propValues),y(e._zod,"values",()=>t.innerType._zod.values),y(e._zod,"optin",()=>t.innerType?._zod?.optin),y(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if("backward"===n.direction)return t.innerType._zod.run(e,n);const r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(en):en(r)}});function en(e){return e.value=Object.freeze(e.value),e}const tn=s("$ZodCustom",(e,t)=>{Ne.init(e,t),Ve.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(t=>nn(t,n,r,e));nn(o,n,r,e)}});function nn(e,t,n,r){if(!e){const e={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(R(e))}}var rn;class on{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 r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}(rn=globalThis).__zod_globalRegistry??(rn.__zod_globalRegistry=new on);const sn=globalThis.__zod_globalRegistry;function an(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...E(t)})}function un(e,t){return new Ee({check:"less_than",...E(t),value:e,inclusive:!1})}function cn(e,t){return new Ee({check:"less_than",...E(t),value:e,inclusive:!0})}function ln(e,t){return new $e({check:"greater_than",...E(t),value:e,inclusive:!1})}function dn(e,t){return new $e({check:"greater_than",...E(t),value:e,inclusive:!0})}function pn(e,t){return new Ae({check:"multiple_of",...E(t),value:e})}function fn(e,t){return new xe({check:"max_length",...E(t),maximum:e})}function hn(e,t){return new Pe({check:"min_length",...E(t),minimum:e})}function mn(e,t){return new Ze({check:"length_equals",...E(t),length:e})}function gn(e){return new Be({check:"overwrite",tx:e})}function yn(e,t){const n=function(e,t){const n=new Ne({check:"custom",...E(t)});return n._zod.check=e,n}(t=>(t.addIssue=e=>{if("string"==typeof e)t.issues.push(R(e,t.value,n._zod.def));else{const r=e;r.fatal&&(r.continue=!1),r.code??(r.code="custom"),r.input??(r.input=t.value),r.inst??(r.inst=n),r.continue??(r.continue=!n._zod.def.abort),t.issues.push(R(r))}},e(t.value,t)),t);return n}function vn(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 _n(e,t,n={path:[],schemaPath:[]}){var r;const o=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 r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,r);else{const n=s.schema,i=t.processors[o.type];if(!i)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);i(e,t,n,r)}const i=e._zod.parent;i&&(s.ref||(s.ref=i),_n(i,t,r),t.seen.get(i).isParent=!0)}const u=t.metadataRegistry.get(e);u&&Object.assign(s.schema,u),"input"===t.io&&zn(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&"_prefault"in s.schema&&((r=s.schema).default??(r.default=s.schema._prefault)),delete s.schema._prefault;return t.seen.get(e).schema}function bn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const t of e.seen.entries()){const n=e.metadataRegistry.get(t[0])?.id;if(n){const e=r.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.`);r.set(n,t[0])}}const o=t=>{if(t[1].schema.$ref)return;const r=t[1],{ref:o,defId:i}=(t=>{const r="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){const n=e.external.registry.get(t[0])?.id,o=e.external.uri??(e=>e);if(n)return{ref:o(n)};const i=t[1].defId??t[1].schema.id??"schema"+e.counter++;return t[1].defId=i,{defId:i,ref:`${o("__shared")}#/${r}/${i}`}}if(t[1]===n)return{ref:"#"};const o=`#/${r}/`,i=t[1].schema.id??"__schema"+e.counter++;return{defId:i,ref:o+i}})(t);r.def={...r.schema},i&&(r.defId=i);const s=r.schema;for(const e in s)delete s[e];s.$ref=o};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 r=n[1];if(t===n[0]){o(n);continue}if(e.external){const r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){o(n);continue}}const i=e.metadataRegistry.get(n[0])?.id;i?o(n):(r.cycle||r.count>1&&"ref"===e.reused)&&o(n)}}function wn(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=t=>{const n=e.seen.get(t);if(null===n.ref)return;const o=n.def??n.schema,i={...o},s=n.ref;if(n.ref=null,s){r(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(o,a):(o.allOf=o.allOf??[],o.allOf.push(a)),Object.assign(o,i);if(t._zod.parent===s)for(const e in o)"$ref"!==e&&"allOf"!==e&&(e in i||delete o[e]);if(a.$ref&&n.def)for(const e in o)"$ref"!==e&&"allOf"!==e&&e in n.def&&JSON.stringify(o[e])===JSON.stringify(n.def[e])&&delete o[e]}const a=t._zod.parent;if(a&&a!==s){r(a);const t=e.seen.get(a);if(t?.schema.$ref&&(o.$ref=t.schema.$ref,t.def))for(const e in o)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(o[e])===JSON.stringify(t.def[e])&&delete o[e]}e.override({zodSchema:t,jsonSchema:o,path:n.path??[]})};for(const t of[...e.seen.entries()].reverse())r(t[0]);const o={};if("draft-2020-12"===e.target?o.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?o.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?o.$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");o.$id=e.external.uri(n)}Object.assign(o,n.def??n.schema);const i=e.metadataRegistry.get(t)?.id;void 0!==i&&o.id===i&&delete o.id;const s=e.external?.defs??{};for(const t of e.seen.entries()){const e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,s[e.defId]=e.def)}e.external||Object.keys(s).length>0&&("draft-2020-12"===e.target?o.$defs=s:o.definitions=s);try{const n=JSON.parse(JSON.stringify(o));return Object.defineProperty(n,"~standard",{value:{...t["~standard"],jsonSchema:{input:Sn(t,"input",e.processors),output:Sn(t,"output",e.processors)}},enumerable:!1,writable:!1}),n}catch(e){throw new Error("Error converting schema to JSON.")}}function zn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if("transform"===r.type)return!0;if("array"===r.type)return zn(r.element,n);if("set"===r.type)return zn(r.valueType,n);if("lazy"===r.type)return zn(r.getter(),n);if("promise"===r.type||"optional"===r.type||"nonoptional"===r.type||"nullable"===r.type||"readonly"===r.type||"default"===r.type||"prefault"===r.type)return zn(r.innerType,n);if("intersection"===r.type)return zn(r.left,n)||zn(r.right,n);if("record"===r.type||"map"===r.type)return zn(r.keyType,n)||zn(r.valueType,n);if("pipe"===r.type)return!!e._zod.traits.has("$ZodCodec")||(zn(r.in,n)||zn(r.out,n));if("object"===r.type){for(const e in r.shape)if(zn(r.shape[e],n))return!0;return!1}if("union"===r.type){for(const e of r.options)if(zn(e,n))return!0;return!1}if("tuple"===r.type){for(const e of r.items)if(zn(e,n))return!0;return!(!r.rest||!zn(r.rest,n))}return!1}const Sn=(e,t,n={})=>r=>{const{libraryOptions:o,target:i}=r??{},s=vn({...o??{},target:i,io:t,processors:n});return _n(e,s),bn(s,e),wn(s,e)},kn={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Cn=(e,t,n,r)=>{const o=e._zod.def;_n(o.innerType,t,r);t.seen.get(e).ref=o.innerType},Tn=s("ZodISODateTime",(e,t)=>{st.init(e,t),er.init(e,t)});function Nn(e){return function(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...E(t)})}(Tn,e)}const In=s("ZodISODate",(e,t)=>{at.init(e,t),er.init(e,t)});function En(e){return function(e,t){return new e({type:"string",format:"date",check:"string_format",...E(t)})}(In,e)}const $n=s("ZodISOTime",(e,t)=>{ut.init(e,t),er.init(e,t)});function An(e){return function(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...E(t)})}($n,e)}const On=s("ZodISODuration",(e,t)=>{ct.init(e,t),er.init(e,t)});function xn(e){return function(e,t){return new e({type:"string",format:"duration",check:"string_format",...E(t)})}(On,e)}const Pn=(e,t)=>{D.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>function(e,t=e=>e.message){const n={_errors:[]},r=(e,o=[])=>{for(const i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>r({issues:e},[...o,...i.path]));else if("invalid_key"===i.code)r({issues:i.issues},[...o,...i.path]);else if("invalid_element"===i.code)r({issues:i.issues},[...o,...i.path]);else{const e=[...o,...i.path];if(0===e.length)n._errors.push(t(i));else{let r=n,o=0;for(;o<e.length;){const n=e[o];o===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(i))):r[n]=r[n]||{_errors:[]},r=r[n],o++}}}};return r(e),n}(e,t)},flatten:{value:t=>function(e,t=e=>e.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,p,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,p,2)}},isEmpty:{get:()=>0===e.issues.length}})},Zn=s("ZodError",Pn,{Parent:Error}),Mn=L(Zn),Rn=F(Zn),Un=B(Zn),Dn=J(Zn),Gn=K(Zn),Ln=W(Zn),Fn=Y(Zn),Bn=H(Zn),jn=Q(Zn),Jn=X(Zn),Vn=q(Zn),Kn=ee(Zn),Wn=new WeakMap;function Yn(e,t,n){const r=Object.getPrototypeOf(e);let o=Wn.get(r);if(o||(o=new Set,Wn.set(r,o)),!o.has(t)){o.add(t);for(const e in n){const t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){const n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}const Hn=s("ZodType",(e,t)=>(Ve.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Sn(e,"input"),output:Sn(e,"output")}}),e.toJSONSchema=((e,t={})=>n=>{const r=vn({...n,processors:t});return _n(e,r),bn(r,e),wn(r,e)})(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Mn(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Un(e,t,n),e.parseAsync=async(t,n)=>Rn(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Dn(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Gn(e,t,n),e.decode=(t,n)=>Ln(e,t,n),e.encodeAsync=async(t,n)=>Fn(e,t,n),e.decodeAsync=async(t,n)=>Bn(e,t,n),e.safeEncode=(t,n)=>jn(e,t,n),e.safeDecode=(t,n)=>Jn(e,t,n),e.safeEncodeAsync=async(t,n)=>Vn(e,t,n),e.safeDecodeAsync=async(t,n)=>Kn(e,t,n),Yn(e,"ZodType",{check(...e){const t=this.def;return this.clone(_(t,{checks:[...t.checks??[],...e.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return I(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(function(e,t={}){return function(e,t,n){return new e({type:"custom",check:"custom",fn:t,...E(n)})}(io,e,t)}(e,t))},superRefine(e,t){return this.check(function(e,t){return yn(e,t)}(e,t))},overwrite(e){return this.check(gn(e))},optional(){return Wr(this)},exactOptional(){return new Yr({type:"optional",innerType:this})},nullable(){return Qr(this)},nullish(){return Wr(Qr(this))},nonoptional(e){return function(e,t){return new eo({type:"nonoptional",innerType:e,...E(t)})}(this,e)},array(){return xr(this)},or(e){return Rr([this,e])},and(e){return Lr(this,e)},transform(e){return ro(this,new Vr({type:"transform",transform:e}))},default(e){return t=e,new Xr({type:"default",innerType:this,get defaultValue(){return"function"==typeof t?t():C(t)}});var t},prefault(e){return t=e,new qr({type:"prefault",innerType:this,get defaultValue(){return"function"==typeof t?t():C(t)}});var t},catch(e){return new to({type:"catch",innerType:this,catchValue:"function"==typeof(t=e)?t:()=>t});var t},pipe(e){return ro(this,e)},readonly(){return new oo({type:"readonly",innerType:this})},describe(e){const t=this.clone();return sn.add(t,{description:e}),t},meta(...e){if(0===e.length)return sn.get(this);const t=this.clone();return sn.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get:()=>sn.get(e)?.description,configurable:!0}),e)),Qn=s("_ZodString",(e,t)=>{Ke.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n;r.type="string";const{minimum:o,maximum:i,format:s,patterns:a,contentEncoding:u}=e._zod.bag;if("number"==typeof o&&(r.minLength=o),"number"==typeof i&&(r.maxLength=i),s&&(r.format=kn[s]??s,""===r.format&&delete r.format,"time"===s&&delete r.format),u&&(r.contentEncoding=u),a&&a.size>0){const e=[...a];1===e.length?r.pattern=e[0].source:e.length>1&&(r.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,Yn(e,"_ZodString",{regex(...e){return this.check(function(e,t){return new Re({check:"string_format",format:"regex",...E(t),pattern:e})}(...e))},includes(...e){return this.check(function(e,t){return new Ge({check:"string_format",format:"includes",...E(t),includes:e})}(...e))},startsWith(...e){return this.check(function(e,t){return new Le({check:"string_format",format:"starts_with",...E(t),prefix:e})}(...e))},endsWith(...e){return this.check(function(e,t){return new Fe({check:"string_format",format:"ends_with",...E(t),suffix:e})}(...e))},min(...e){return this.check(hn(...e))},max(...e){return this.check(fn(...e))},length(...e){return this.check(mn(...e))},nonempty(...e){return this.check(hn(1,...e))},lowercase(e){return this.check(function(e){return new Ue({check:"string_format",format:"lowercase",...E(e)})}(e))},uppercase(e){return this.check(function(e){return new De({check:"string_format",format:"uppercase",...E(e)})}(e))},trim(){return this.check(gn(e=>e.trim()))},normalize(...e){return this.check(function(e){return gn(t=>t.normalize(e))}(...e))},toLowerCase(){return this.check(gn(e=>e.toLowerCase()))},toUpperCase(){return this.check(gn(e=>e.toUpperCase()))},slugify(){return this.check(gn(e=>function(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}(e)))}})}),Xn=s("ZodString",(e,t)=>{Ke.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,...E(t)})}(tr,t)),e.url=t=>e.check(function(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...E(t)})}(or,t)),e.jwt=t=>e.check(function(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...E(t)})}(_r,t)),e.emoji=t=>e.check(function(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...E(t)})}(ir,t)),e.guid=t=>e.check(an(nr,t)),e.uuid=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...E(t)})}(rr,t)),e.uuidv4=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...E(t)})}(rr,t)),e.uuidv6=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...E(t)})}(rr,t)),e.uuidv7=t=>e.check(function(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...E(t)})}(rr,t)),e.nanoid=t=>e.check(function(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...E(t)})}(sr,t)),e.guid=t=>e.check(an(nr,t)),e.cuid=t=>e.check(function(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...E(t)})}(ar,t)),e.cuid2=t=>e.check(function(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...E(t)})}(ur,t)),e.ulid=t=>e.check(function(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...E(t)})}(cr,t)),e.base64=t=>e.check(function(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...E(t)})}(gr,t)),e.base64url=t=>e.check(function(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...E(t)})}(yr,t)),e.xid=t=>e.check(function(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...E(t)})}(lr,t)),e.ksuid=t=>e.check(function(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...E(t)})}(dr,t)),e.ipv4=t=>e.check(function(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...E(t)})}(pr,t)),e.ipv6=t=>e.check(function(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...E(t)})}(fr,t)),e.cidrv4=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...E(t)})}(hr,t)),e.cidrv6=t=>e.check(function(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...E(t)})}(mr,t)),e.e164=t=>e.check(function(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...E(t)})}(vr,t)),e.datetime=t=>e.check(Nn(t)),e.date=t=>e.check(En(t)),e.time=t=>e.check(An(t)),e.duration=t=>e.check(xn(t))});function qn(e){return function(e,t){return new e({type:"string",...E(t)})}(Xn,e)}const er=s("ZodStringFormat",(e,t)=>{We.init(e,t),Qn.init(e,t)}),tr=s("ZodEmail",(e,t)=>{Qe.init(e,t),er.init(e,t)}),nr=s("ZodGUID",(e,t)=>{Ye.init(e,t),er.init(e,t)}),rr=s("ZodUUID",(e,t)=>{He.init(e,t),er.init(e,t)}),or=s("ZodURL",(e,t)=>{Xe.init(e,t),er.init(e,t)}),ir=s("ZodEmoji",(e,t)=>{qe.init(e,t),er.init(e,t)}),sr=s("ZodNanoID",(e,t)=>{et.init(e,t),er.init(e,t)}),ar=s("ZodCUID",(e,t)=>{tt.init(e,t),er.init(e,t)}),ur=s("ZodCUID2",(e,t)=>{nt.init(e,t),er.init(e,t)}),cr=s("ZodULID",(e,t)=>{rt.init(e,t),er.init(e,t)}),lr=s("ZodXID",(e,t)=>{ot.init(e,t),er.init(e,t)}),dr=s("ZodKSUID",(e,t)=>{it.init(e,t),er.init(e,t)}),pr=s("ZodIPv4",(e,t)=>{lt.init(e,t),er.init(e,t)}),fr=s("ZodIPv6",(e,t)=>{dt.init(e,t),er.init(e,t)}),hr=s("ZodCIDRv4",(e,t)=>{pt.init(e,t),er.init(e,t)}),mr=s("ZodCIDRv6",(e,t)=>{ft.init(e,t),er.init(e,t)}),gr=s("ZodBase64",(e,t)=>{mt.init(e,t),er.init(e,t)}),yr=s("ZodBase64URL",(e,t)=>{gt.init(e,t),er.init(e,t)}),vr=s("ZodE164",(e,t)=>{yt.init(e,t),er.init(e,t)}),_r=s("ZodJWT",(e,t)=>{vt.init(e,t),er.init(e,t)}),br=s("ZodNumber",(e,t)=>{_t.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=n,{minimum:o,maximum:i,format:s,multipleOf:a,exclusiveMaximum:u,exclusiveMinimum:c}=e._zod.bag;"string"==typeof s&&s.includes("int")?r.type="integer":r.type="number";const l="number"==typeof c&&c>=(o??Number.NEGATIVE_INFINITY),d="number"==typeof u&&u<=(i??Number.POSITIVE_INFINITY),p="draft-04"===t.target||"openapi-3.0"===t.target;l?p?(r.minimum=c,r.exclusiveMinimum=!0):r.exclusiveMinimum=c:"number"==typeof o&&(r.minimum=o),d?p?(r.maximum=u,r.exclusiveMaximum=!0):r.exclusiveMaximum=u:"number"==typeof i&&(r.maximum=i),"number"==typeof a&&(r.multipleOf=a)})(e,t,n),Yn(e,"ZodNumber",{gt(e,t){return this.check(ln(e,t))},gte(e,t){return this.check(dn(e,t))},min(e,t){return this.check(dn(e,t))},lt(e,t){return this.check(un(e,t))},lte(e,t){return this.check(cn(e,t))},max(e,t){return this.check(cn(e,t))},int(e){return this.check(Sr(e))},safe(e){return this.check(Sr(e))},positive(e){return this.check(ln(0,e))},nonnegative(e){return this.check(dn(0,e))},negative(e){return this.check(un(0,e))},nonpositive(e){return this.check(cn(0,e))},multipleOf(e,t){return this.check(pn(e,t))},step(e,t){return this.check(pn(e,t))},finite(){return this}});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 wr(e){return function(e,t){return new e({type:"number",checks:[],...E(t)})}(br,e)}const zr=s("ZodNumberFormat",(e,t)=>{bt.init(e,t),br.init(e,t)});function Sr(e){return function(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...E(t)})}(zr,e)}const kr=s("ZodBoolean",(e,t)=>{wt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.type="boolean"})(0,0,t)});function Cr(e){return function(e,t){return new e({type:"boolean",...E(t)})}(kr,e)}const Tr=s("ZodAny",(e,t)=>{zt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Nr(){return new Tr({type:"any"})}const Ir=s("ZodUnknown",(e,t)=>{St.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>{}});function Er(){return new Ir({type:"unknown"})}const $r=s("ZodNever",(e,t)=>{kt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(e,t,n)=>((e,t,n)=>{n.not={}})(0,0,t)});function Ar(e){return function(e,t){return new e({type:"never",...E(t)})}($r,e)}const Or=s("ZodArray",(e,t)=>{Tt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(o.minItems=s),"number"==typeof a&&(o.maxItems=a),o.type="array",o.items=_n(i.element,t,{...r,path:[...r.path,"items"]})})(e,t,n,r),e.element=t.element,Yn(e,"ZodArray",{min(e,t){return this.check(hn(e,t))},nonempty(e){return this.check(hn(1,e))},max(e,t){return this.check(fn(e,t))},length(e,t){return this.check(mn(e,t))},unwrap(){return this.element}})});function xr(e,t){return function(e,t,n){return new e({type:"array",element:t,...E(n)})}(Or,e,t)}const Pr=s("ZodObject",(e,t)=>{At.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=n,i=e._zod.def;o.type="object",o.properties={};const s=i.shape;for(const e in s)o.properties[e]=_n(s[e],t,{...r,path:[...r.path,"properties",e]});const a=new Set(Object.keys(s)),u=new Set([...a].filter(e=>{const n=i.shape[e]._zod;return"input"===t.io?void 0===n.optin:void 0===n.optout}));u.size>0&&(o.required=Array.from(u)),"never"===i.catchall?._zod.def.type?o.additionalProperties=!1:i.catchall?i.catchall&&(o.additionalProperties=_n(i.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):"output"===t.io&&(o.additionalProperties=!1)})(e,t,n,r),y(e,"shape",()=>t.shape),Yn(e,"ZodObject",{keyof(){return Br(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Er()})},loose(){return this.clone({...this._zod.def,catchall:Er()})},strict(){return this.clone({...this._zod.def,catchall:Ar()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return function(e,t){if(!k(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 r=_(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return v(this,"shape",n),n}});return I(e,r)}(this,e)},safeExtend(e){return function(e,t){if(!k(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=_(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return v(this,"shape",n),n}});return I(e,n)}(this,e)},merge(e){return function(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=_(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return v(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return I(e,n)}(this,e)},pick(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");return I(e,_(e._zod.def,{get shape(){const e={};for(const r in t){if(!(r in n.shape))throw new Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return v(this,"shape",e),e},checks:[]}))}(this,e)},omit(e){return function(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=_(e._zod.def,{get shape(){const r={...e._zod.def.shape};for(const e in t){if(!(e in n.shape))throw new Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return v(this,"shape",r),r},checks:[]});return I(e,o)}(this,e)},partial(...e){return function(e,t,n){const r=t._zod.def.checks;if(r&&r.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=_(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in r))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=e?new e({type:"optional",innerType:r[t]}):r[t])}else for(const t in r)o[t]=e?new e({type:"optional",innerType:r[t]}):r[t];return v(this,"shape",o),o},checks:[]});return I(t,o)}(Kr,this,e[0])},required(...e){return function(e,t,n){const r=_(t._zod.def,{get shape(){const r=t._zod.def.shape,o={...r};if(n)for(const t in n){if(!(t in o))throw new Error(`Unrecognized key: "${t}"`);n[t]&&(o[t]=new e({type:"nonoptional",innerType:r[t]}))}else for(const t in r)o[t]=new e({type:"nonoptional",innerType:r[t]});return v(this,"shape",o),o}});return I(t,r)}(eo,this,e[0])}})});function Zr(e,t){const n={type:"object",shape:e??{},...E(t)};return new Pr(n)}const Mr=s("ZodUnion",(e,t)=>{xt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=!1===o.inclusive,s=o.options.map((e,n)=>_n(e,t,{...r,path:[...r.path,i?"oneOf":"anyOf",n]}));i?n.oneOf=s:n.anyOf=s})(e,t,n,r),e.options=t.options});function Rr(e,t){return new Mr({type:"union",options:e,...E(t)})}const Ur=s("ZodDiscriminatedUnion",(e,t)=>{Mr.init(e,t),Pt.init(e,t)});function Dr(e,t,n){return new Ur({type:"union",options:t,discriminator:e,...E(n)})}const Gr=s("ZodIntersection",(e,t)=>{Zt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=_n(o.left,t,{...r,path:[...r.path,"allOf",0]}),s=_n(o.right,t,{...r,path:[...r.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,u=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];n.allOf=u})(e,t,n,r)});function Lr(e,t){return new Gr({type:"intersection",left:e,right:t})}const Fr=s("ZodEnum",(e,t)=>{Ut.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=d(e._zod.def.entries);r.every(e=>"number"==typeof e)&&(n.type="number"),r.every(e=>"string"==typeof e)&&(n.type="string"),n.enum=r})(e,0,n),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{const o={};for(const r of e){if(!n.has(r))throw new Error(`Key ${r} not found in enum`);o[r]=t.entries[r]}return new Fr({...t,checks:[],...E(r),entries:o})},e.exclude=(e,r)=>{const o={...t.entries};for(const t of e){if(!n.has(t))throw new Error(`Key ${t} not found in enum`);delete o[t]}return new Fr({...t,checks:[],...E(r),entries:o})}});function Br(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e;return new Fr({type:"enum",entries:n,...E(t)})}const jr=s("ZodLiteral",(e,t)=>{Dt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n)=>{const r=e._zod.def,o=[];for(const e of r.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");o.push(Number(e))}else o.push(e);if(0===o.length);else if(1===o.length){const e=o[0];n.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?n.enum=[e]:n.const=e}else o.every(e=>"number"==typeof e)&&(n.type="number"),o.every(e=>"string"==typeof e)&&(n.type="string"),o.every(e=>"boolean"==typeof e)&&(n.type="boolean"),o.every(e=>null===e)&&(n.type="null"),n.enum=o})(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 Jr(e,t){return new jr({type:"literal",values:Array.isArray(e)?e:[e],...E(t)})}const Vr=s("ZodTransform",(e,t)=>{Gt.init(e,t),Hn.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,r)=>{if("backward"===r.direction)throw new u(e.constructor.name);n.addIssue=r=>{if("string"==typeof r)n.issues.push(R(r,n.value,t));else{const t=r;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=n.value),t.inst??(t.inst=e),n.issues.push(R(t))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=o,n.fallback=!0,n)}});const Kr=s("ZodOptional",(e,t)=>{Ft.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cn(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});function Wr(e){return new Kr({type:"optional",innerType:e})}const Yr=s("ZodExactOptional",(e,t)=>{Bt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cn(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});const Hr=s("ZodNullable",(e,t)=>{jt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=_n(o.innerType,t,r),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=o.innerType,n.nullable=!0):n.anyOf=[i,{type:"null"}]})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qr(e){return new Hr({type:"nullable",innerType:e})}const Xr=s("ZodDefault",(e,t)=>{Jt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;_n(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});const qr=s("ZodPrefault",(e,t)=>{Kt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;_n(o.innerType,t,r),t.seen.get(e).ref=o.innerType,"input"===t.io&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});const eo=s("ZodNonOptional",(e,t)=>{Wt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;_n(o.innerType,t,r),t.seen.get(e).ref=o.innerType})(e,t,0,r),e.unwrap=()=>e._zod.def.innerType});const to=s("ZodCatch",(e,t)=>{Ht.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;let i;_n(o.innerType,t,r),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});const no=s("ZodPipe",(e,t)=>{Qt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def,i=o.in._zod.traits.has("$ZodTransform"),s="input"===t.io?i?o.out:o.in:o.out;_n(s,t,r),t.seen.get(e).ref=s})(e,t,0,r),e.in=t.in,e.out=t.out});function ro(e,t){return new no({type:"pipe",in:e,out:t})}const oo=s("ZodReadonly",(e,t)=>{qt.init(e,t),Hn.init(e,t),e._zod.processJSONSchema=(t,n,r)=>((e,t,n,r)=>{const o=e._zod.def;_n(o.innerType,t,r),t.seen.get(e).ref=o.innerType,n.readOnly=!0})(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});const io=s("ZodCustom",(e,t)=>{tn.init(e,t),Hn.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 so=["GBPCountries","UnitedStates","AUDCountries","EURCountries","International","NZDCountries","Canada"],ao=Br(so),uo=Zr({targetedCountryGroups:xr(ao),targetedCountryCodes:xr(qn()).optional()}).optional(),co={GBPCountries:{name:"United Kingdom",currency:"GBP",countries:["GB","FK","GI","GG","IM","JE","SH"],supportRegionId:"UK"},UnitedStates:{name:"United States",currency:"USD",countries:["US"],supportRegionId:"US"},AUDCountries:{name:"Australia",currency:"AUD",countries:["AU","KI","NR","NF","TV"],supportRegionId:"AU"},EURCountries:{name:"Europe",currency:"EUR",countries:["AD","AL","AT","BA","BE","BG","BL","CH","CY","CZ","DE","DK","EE","ES","FI","FO","FR","GF","GL","GP","GR","HR","HU","IE","IT","LI","LT","LU","LV","MC","ME","MF","IS","MQ","MT","NL","NO","PF","PL","PM","PT","RE","RO","RS","SE","SI","SJ","SK","SM","TF","TR","WF","YT","VA","AX","AZ","AM","GE","BY","MD","UA","MK"],supportRegionId:"EU"},International:{name:"International",currency:"USD",countries:["AE","AF","AG","AI","AO","AQ","AR","AS","AW","BB","BD","BF","BH","BI","BJ","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BZ","CC","CD","CF","CG","CI","CL","CM","CN","CO","CR","CU","CV","CW","CX","DJ","DM","DO","DZ","EC","EG","EH","ER","ET","FJ","FM","GA","GD","GH","GM","GN","GQ","GS","GT","GU","GW","GY","HK","HM","HN","HT","ID","IL","IN","IO","IQ","IR","JM","JO","JP","KE","KG","KH","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LK","LR","LS","LY","MA","MG","MH","ML","MM","MN","MO","MP","MR","MS","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NG","NI","NP","NU","OM","PA","PE","PG","PH","PK","PN","PR","PS","PW","PY","QA","RU","RW","SA","SB","SC","SD","SG","SL","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TG","TH","TJ","TK","TL","TM","TN","TO","TT","TW","TZ","UG","UM","UY","UZ","VC","VE","VG","VI","VN","VU","WS","YE","ZA","ZM","ZW"],supportRegionId:"INT"},NZDCountries:{name:"New Zealand",currency:"NZD",countries:["NZ","CK"],supportRegionId:"NZ"},Canada:{name:"Canada",currency:"CAD",countries:["CA"],supportRegionId:"CA"}},lo={AD:"Andorra",AE:"the UAE",AF:"Afghanistan",AG:"Antigua and Barbuda",AI:"Anguilla",AL:"Albania",AM:"Armenia",AO:"Angola",AR:"Argentina",AS:"the US",AT:"Austria",AU:"Australia",AW:"Aruba",AX:"Åland Islands",AZ:"Azerbaijan",BA:"Bosnia and Herzegovina",BB:"Barbados",BD:"Bangladesh",BE:"Belgium",BF:"Burkina Faso",BG:"Bulgaria",BH:"Bahrain",BI:"Burundi",BJ:"Benin",BL:"Saint Barthélemy",BM:"Bermuda",BN:"Brunei Darussalam",BO:"Bolivia",BQ:"Bonaire, Sint Eustatius and Saba",BR:"Brazil",BS:"the Bahamas",BT:"Bhutan",BV:"Bouvet Island",BW:"Botswana",BY:"Belarus",BZ:"Belize",CA:"Canada",CD:"the Democratic Republic of the Congo",CF:"the Central Africa Republic",CG:"the Congo",CH:"Switzerland",CI:"Côte d'Ivoire",CK:"the Cook Islands",CL:"Chile",CM:"Cameroon",CN:"China",CO:"Colombia",CR:"Costa Rica",CU:"Cuba",CV:"Cabo Verde",CW:"Curaçao",CX:"Christmas Island",CY:"Cyprus",CZ:"the Czech Republic",DE:"Germany",DJ:"Djibouti",DK:"Denmark",DM:"Dominica",DO:"the Dominican Republic",DZ:"Algeria",EC:"Ecuador",EE:"Estonia",EG:"Egypt",EH:"the Western Sahara",ER:"Eritrea",ES:"Spain",ET:"Ethiopia",FI:"Finland",FJ:"Fiji",FK:"the UK",FO:"the UK",FR:"France",GA:"Gabon",GB:"the UK",GD:"Grenada",GE:"Georgia",GF:"French Guiana",GG:"Guernsey",GH:"Ghana",GI:"Gibraltar",GL:"Greenland",GM:"the Gambia",GN:"Guinea",GP:"Guadeloupe",GQ:"Equatorial Guinea",GR:"Greece",GT:"Guatemala",GU:"Guam",GW:"Guinea-Bissau",GY:"Guyana",HK:"Hong Kong",HN:"Honduras",HR:"Croatia",HT:"Haiti",HU:"Hungary",ID:"Indonesia",IE:"Ireland",IM:"the Isle of Man",IN:"India",IQ:"Iraq",IR:"Iran",IS:"Iceland",IT:"Italy",JE:"Jersey",JM:"Jamaica",JO:"Jordan",JP:"Japan",KE:"Kenya",KG:"Kyrgyzstan",KH:"Cambodia",KI:"Kiribati",KN:"Saint Kitts and Nevis",KP:"Korea",KR:"Korea",KW:"Kuwait",KY:"the Cayman Ialnds",KZ:"Kazakhstan",LB:"Lebanon",LC:"Saint Lucia",LI:"Liechtenstein",LK:"Sri Lanka",LR:"Liberia",LS:"Lesotho",LT:"Lithuania",LU:"Luxembourg",LV:"Latvia",LY:"Libya",MA:"Morocco",MC:"Monaco",MD:"Moldova",ME:"Montenegro",MG:"Madagascar",MK:"the Republic of North Macedonia",ML:"Mali",MM:"Myanmar",MN:"Mongolia",MO:"Macao",MQ:"Martinique",MR:"Mauritania",MS:"Montserrat",MT:"Malta",MU:"Mauritius",MV:"Maldives",MW:"Malawi",MX:"Mexico",MY:"Malaysia",MZ:"Mozambique",NA:"Namibia",NC:"New Caledonia",NE:"Niger",NF:"Norfolk Island",NG:"Nigeria",NI:"Nicaragua",NL:"the Netherlands",NO:"Norway",NP:"Nepal",NR:"Nauru",NU:"Niue",NZ:"New Zealand",OM:"Oman",PA:"Panama",PE:"Peru",PF:"French Polynesia",PG:"Papua New Guinea",PH:"the Philippines",PK:"Pakistan",PL:"Poland",PM:"Saint Pierre and Miquelon",PN:"Pitcairn",PR:"Puerto Rico",PT:"Portugal",PW:"Palau",PY:"Paraguay",QA:"Qatar",RE:"Réunion",RO:"Romania",RU:"Russia",RW:"Rwanda",SA:"Saudi Arabia",SB:"Solomon Islands",SC:"Seychelles",SD:"Sudan",SE:"Sweden",SG:"Singapore",SH:"Saint Helena",SI:"Slovenia",SJ:"Svalbard and Jan Mayen",SK:"Slovakia",SL:"Sierra Leone",SM:"San Marino",SN:"Senegal",SO:"Somalia",SR:"Suriname",SS:"South Sudan",ST:"Sao Tome and Principe",SV:"El Salvador",SY:"Syrian Arab Republic",SZ:"Eswatini",TD:"Chad",TG:"Togo",TH:"Thailand",TJ:"Tajikistan",TK:"Tokelau",TL:"Timor-Leste",TM:"Turkmenistan",TN:"Tunisia",TO:"Tonga",TR:"Turkey",TT:"Trinidad and Tobago",TV:"Tuvalu",TW:"Taiwan",TZ:"Tanzania ",UG:"Uganda",US:"the US",UY:"Uruguay",UZ:"Uzbekistan",VC:"Saint Vincent and the Grenadines",VE:"Venezuela",VG:"the Virgin Islands",VI:"the Virgin Islands",VN:"Vietnam",VU:"Vanuatu",WF:"Wallis and Futuna",WS:"Samoa",YE:"Yemen",YT:"Mayotte",ZA:"South Africa",ZM:"Zambia",ZW:"Zimbabwe"},po={GBPCountries:"£",UnitedStates:"$",AUDCountries:"$",Canada:"CA$",EURCountries:"€",NZDCountries:"NZ$",International:"$"},fo=e=>Object.keys(co).find(t=>co[t].countries.includes(e??""))??"International",ho=e=>{if(e){const t=fo(e);return po[t]}return"£"},mo=e=>{if(e)return lo[e]},go=e=>e.includes("subscribe/weekly/checkout"),yo=(e,t,n,r)=>{if(r){const o=r[fo(n)];return`${ho(n)}${o[e][t].price}`}},vo={CURRENCY_SYMBOL:({countryCode:e})=>ho(e),COUNTRY_NAME:({countryCode:e})=>mo(e),PRICE_DIGISUB_MONTHLY:({countryCode:e,prices:t})=>yo("Digisub","Monthly",e,t),PRICE_DIGISUB_ANNUAL:({countryCode:e,prices:t})=>yo("Digisub","Annual",e,t),PRICE_GUARDIANWEEKLY_MONTHLY:({countryCode:e,prices:t})=>yo("GuardianWeekly","Monthly",e,t),PRICE_GUARDIANWEEKLY_ANNUAL:({countryCode:e,prices:t})=>yo("GuardianWeekly","Annual",e,t),DAY_OF_THE_WEEK:()=>((e=new Date)=>e.toLocaleString("en-GB",{weekday:"long"}))(),DATE:()=>((e=new Date)=>e.toLocaleString("en-GB",{day:"numeric",month:"long",year:"numeric"}))()},_o=/%%.*?%%/g,bo="gu.contributions.views",wo=e=>{const t=(e=>{const t=new Date(e,10,1).getDay();return new Date(e,10,22+(11-t)%7)})(e);return t.setDate(t.getDate()+5),t},zo=(e=new Date)=>{const t=(e=>{const t=e.getDate()<20?1:2;return e.setMonth(e.getMonth()+t),e})(e),n=(t.getMonth()+1).toString().padStart(2,"0"),r=t.toLocaleString("default",{month:"long"}),o=t.getFullYear();return{reminderCta:`Remind me in ${r}`,reminderPeriod:`${o}-${n}-01`,reminderLabel:`${r} ${o}`}},So=new Date("2023-12-31"),ko=e=>e>=(e=>new Date(e.getFullYear(),10,15))(e)&&e<wo(e.getFullYear()),Co=Zr({text:qn(),baseUrl:qn()});let To=function(e){return e.Custom="CustomSecondaryCta",e.ContributionsReminder="ContributionsReminderSecondaryCta",e}({});var No;new Fr({type:"enum",entries:To,...E(No)});const Io=Dr("type",[Zr({type:Jr(To.Custom),cta:Co}),Zr({type:Jr(To.ContributionsReminder)})]),Eo=Zr({countLabel:qn(),goalCopy:qn().optional()}),$o=Zr({total:wr(),goal:wr()}),Ao=Br(["US","AU","global"]),Oo=Zr({currencySymbol:qn(),copy:Eo,name:Ao,tickerData:$o.optional()}),xo=Zr({for52Weeks:wr(),forTargetedWeeks:wr()}),Po=Br(["for52Weeks","forTargetedWeeks"]),Zo=Zr({type:Jr("above"),copy:qn().optional(),countType:Po.optional()}),Mo=Br(["CONTRIBUTION","MEMBERSHIP_SUPPORTER","DIGITAL_SUBSCRIPTION","PRINT_SUBSCRIPTION"]),Ro=Br(["ACQUISITIONS_EPIC","ACQUISITIONS_ENGAGEMENT_BANNER","ACQUISITIONS_SUBSCRIPTIONS_BANNER","ACQUISITIONS_HEADER","ACQUISITIONS_OTHER"]),Uo=Zr({abTestName:qn(),abTestVariant:qn(),campaignCode:qn(),componentType:Ro,products:xr(Mo).nullish(),labels:xr(qn()).nullish(),ophanPageId:qn(),platformId:qn(),referrerUrl:qn()}),Do=Zr({mainUrl:qn(),mobileUrl:qn().optional(),tabletUrl:qn().optional(),desktopUrl:qn().optional(),leftColUrl:qn().optional(),wideUrl:qn().optional(),altText:qn()}),Go=Zr({name:qn(),description:qn().optional(),headshot:Do.optional()}),Lo=/^[0-9A-F]{2}$/,Fo=qn().refine(e=>Lo.test(e),{error:e=>`"${JSON.stringify(e.input)}" is not a valid hex value`}),Bo=Zr({r:Fo,g:Fo,b:Fo,kind:Jr("hex")}),jo=Zr({mobileUrl:qn(),tabletUrl:qn(),desktopUrl:qn(),altText:qn(),kind:Jr("Image")}),Jo=Zr({buttonColour:Bo.nullish(),buttonTextColour:Bo.nullish(),buttonBorderColour:Bo.nullish(),buttonSelectColour:Bo.nullish(),buttonSelectTextColour:Bo.nullish(),buttonSelectBorderColour:Bo.nullish(),buttonSelectMarkerColour:Bo.nullish(),pillTextColour:Bo.nullish(),pillBackgroundColour:Bo.nullish(),kind:Jr("ChoiceCards")}),Vo=Zr({visual:Dr("kind",[jo,Jo]).nullish(),colours:Zr({basic:Zr({background:Bo,bodyText:Bo})})}),Ko=Zr({copy:qn()}),Wo=Rr([Jr("Monthly"),Jr("Annual")]),Yo=Dr("supportTier",[Zr({supportTier:Jr("Contribution"),ratePlan:Wo}),Zr({supportTier:Jr("SupporterPlus"),ratePlan:Wo}),Zr({supportTier:Jr("DigitalSubscription"),ratePlan:Wo}),Zr({supportTier:Jr("OneOff")})]),Ho=Zr({copy:qn(),textColour:Bo.nullish(),backgroundColour:Bo.nullish()}),Qo=Rr([Jr("LandingPage"),Jr("Checkout")]),Xo=Zr({testName:qn(),variantName:qn()}),qo=Zr({product:Yo,label:qn(),isDefault:Cr(),defaultExpanded:Cr().optional(),benefitsLabel:qn().nullish(),benefits:xr(Ko),pill:Ho.nullish(),destination:Qo.nullish(),destinationTest:Xo.nullish()}),ei=Zr({choiceCards:xr(qo),mobileChoiceCards:xr(qo).nullish()}),ti=Zr({maxViewsCount:wr(),maxViewsDays:wr(),minDaysBetweenViews:wr()}),ni=Zr({reminderCta:qn(),reminderLabel:qn(),reminderPeriod:qn()});Br(["ONE_OFF","MONTHLY","ANNUAL"]);const ri=Zr({newsletterId:qn(),successDescription:qn()}),oi=Zr({name:qn(),heading:qn().optional(),paragraphs:xr(qn()),highlightedText:qn().optional(),tickerSettings:Oo.optional(),cta:Co.optional(),secondaryCta:Io.optional(),newsletterSignup:ri.optional(),image:Do.optional(),showReminderFields:ni.optional(),separateArticleCount:Zo.optional(),promoCodes:xr(qn()).nullish(),maxViews:ti.optional(),showSignInLink:Cr().optional(),bylineWithImage:Go.optional(),showChoiceCards:Cr().optional(),choiceCardsSettings:ei.nullish()}),ii=Zr({variant:oi,tracking:Uo,countryCode:qn().nullish(),articleCounts:xo,onReminderOpen:Nr().nullish(),fetchEmail:Nr().nullish(),submitComponentEvent:Nr().nullish(),openCmp:Nr().nullish(),hasConsentForArticleCount:Cr().nullish(),stage:qn().nullish()}),si=Br(["contributions","subscriptions","signIn","abandonedBasket"]),ai=Zr({heading:qn().optional(),messageText:qn().optional(),paragraphs:xr(qn()).optional(),mobileMessageText:qn().optional(),highlightedText:qn().optional(),cta:Co.optional(),secondaryCta:Io.optional()}),ui=Zr({tracking:Uo,bannerChannel:si,content:ai.nullish(),mobileContent:ai.nullish(),countryCode:qn().nullish(),tickerSettings:Oo.nullish(),submitComponentEvent:Nr(),articleCounts:xo,hasOptedOutOfArticleCount:Cr().nullish(),fetchEmail:Nr().nullish(),separateArticleCount:Cr().nullish(),design:Vo.nullish(),choiceCardsSettings:ei.nullish(),promoCodes:xr(qn()).nullish(),isCollapsible:Cr().nullish(),contributionsServiceUrl:qn().nullish()}),ci=Zr({heading:qn(),subheading:qn(),primaryCta:Co.optional(),secondaryCta:Co.optional(),benefits:xr(qn()).optional()}),li=Zr({content:ci,tracking:Uo,mobileContent:ci.optional(),countryCode:qn().optional(),submitComponentEvent:Nr(),promoCodes:xr(qn()).nullish()}),di=Zr({image:Do,bodyCopy:xr(qn()),cta:Co.optional()});Zr({content:di,tracking:Uo,countryCode:qn().optional(),submitComponentEvent:Nr(),promoCodes:xr(qn()).nullish()});const pi=Br(["Contribution","SupporterPlus","GuardianWeekly","Paper"]),fi=Br(["new","guest","current"]),hi=Br(["Epic","EpicAppleNews","EpicLiveblog","Banner1","Banner2","Header","GutterLiveblog"]),mi=Br(["Live","Draft","Archived"]),gi=Br(["Mobile","Desktop","All","iOS","Android"]),yi=Br(["SignedIn","SignedOut","All"]),vi=Br(["HasConsented","HasNotConsented","All"]),_i=Lr(Dr("name",[Zr({name:Jr("ABTest")}),Zr({name:Jr("EpsilonGreedyBandit"),epsilon:wr(),sampleCount:wr().optional()}),Zr({name:Jr("Roulette"),sampleCount:wr().optional()})]),Zr({testName:qn().optional()})),bi=Zr({channel:hi,name:qn(),status:mi,priority:wr(),controlProportionSettings:Zr({proportion:wr(),offset:wr()}).optional(),deviceType:gi.optional(),signedInStatus:yi.optional(),consentStatus:vi.optional(),methodologies:_i.array().optional(),mParticleAudience:wr().nullish(),scheduler:Zr({start:qn().optional(),end:qn().optional()}).optional()}),wi=Br(["AllExistingSupporters","AllNonSupporters","Everyone","PostAskPauseSingleContributors"]),zi=Zr({minViews:wr(),maxViews:wr().optional(),periodInWeeks:wr(),tagIds:xr(qn()).optional()});Zr({userType:xr(fi),product:xr(pi)}),Zr({tagIds:xr(qn()),sectionIds:xr(qn()),excludedTagIds:xr(qn()),excludedSectionIds:xr(qn())});const Si=Zr({maxViewsCount:wr(),maxViewsDays:wr(),minDaysBetweenViews:wr()});bi.extend({name:qn(),status:mi,locations:xr(ao).optional(),regionTargeting:uo.optional(),tagIds:xr(qn()),sections:xr(qn()),excludedTagIds:xr(qn()),excludedSections:xr(qn()),alwaysAsk:Cr(),maxViews:Si.optional(),userCohort:wi,hasCountryName:Cr(),highPriority:Cr(),useLocalViewLog:Cr(),articlesViewedSettings:zi.optional(),priority:wr(),variants:oi.array()});const ki=Zr({amount:Rr([wr(),Jr("other")]),billingPeriod:Rr([Jr("ONE_OFF"),Jr("MONTHLY"),Jr("ANNUAL")]),product:Rr([Jr("Contribution"),Jr("SupporterPlus"),Jr("PremiumTier"),Jr("DailyEdition"),Jr("GuardianWeekly"),Jr("Paper"),Jr("PaperAndDigital")]),region:Rr([Jr("uk"),Jr("us"),Jr("au"),Jr("eu"),Jr("int"),Jr("nz"),Jr("ca")])}),Ci=(e,t,n,r)=>{const o=(e=>new URLSearchParams(window.location.search).get(`force-${e}`))(e),i=(e=>new URLSearchParams(window.location.search).get(`preview-${e}`))(e),s=new URLSearchParams;o?s.set("force",o):i&&s.set("preview",i);const a=s.toString();return fetch(a?`${t}/${e}?${a}`:`${t}/${e}`,{method:"post",headers:{"Content-Type":"application/json",...r},body:JSON.stringify(n)}).then(t=>{if(!t.ok)throw Error(t.statusText||`Supporter Revenue ${e} | Api call returned HTTP status ${t.status}`);return t}).then(e=>e.json())};exports.CountryGroupId=so,exports.SecondaryCtaType=To,exports.abandonedBasketSchema=ki,exports.addRegionIdToSupportUrl=(e,t)=>{if(t){const n=(e=>co[fo(e)].supportRegionId)(t);if(!go(e))return e.replace(/(support\.theguardian\.com)\/(contribute-in-epic|contribute|subscribe|checkout)/,(e,t,r)=>`${t}/${n.toLowerCase()}/${r}`)}return e},exports.bannerSchema=ui,exports.buildReminderFields=zo,exports.containsNonArticleCountPlaceholder=e=>{const t=e.match(_o)?.filter(e=>"%%ARTICLE_COUNT%%"!==e);return!!t&&t.length>0},exports.contributionTabFrequencies=["ONE_OFF","MONTHLY","ANNUAL"],exports.countryCodeToCountryGroupId=fo,exports.countryGroupIdSchema=ao,exports.countryGroups=co,exports.epicPropsSchema=ii,exports.getBanner=(e,t)=>Ci("banner",e,t),exports.getCountryName=mo,exports.getEpic=(e,t,n)=>Ci("epic",e,t,n),exports.getEpicViewLog=e=>e.get(bo)??void 0,exports.getGutterLiveblog=(e,t)=>Ci("gutter-liveblog",e,t),exports.getHeader=(e,t)=>Ci("header",e,t),exports.getLiveblogEpic=(e,t)=>Ci("liveblog-epic",e,t),exports.getLocalCurrencySymbol=ho,exports.getReminderFields=(e,t=new Date)=>{return"US"===e&&ko(t)?{reminderCta:"Remind me on Giving Tuesday",reminderPeriod:`${n=t.getFullYear()}-${(wo(n).getMonth()+1).toString().padStart(0,"2")}-01`,reminderLabel:"on Giving Tuesday",reminderOption:`giving-tuesday-${n}`}:"US"===e&&(e=>e>=wo(e.getFullYear())&&e<So)(t)?(e=>({reminderCta:"Remind me on New Years Eve",reminderPeriod:`${e}-12-01`,reminderLabel:"on New Years Eve",reminderOption:`new-years-eve-${e}`}))(t.getFullYear()):zo(t);var n},exports.getWeeklyArticleHistory=t=>t.get(e)??void 0,exports.headerPropsSchema=li,exports.hexColourToString=e=>`#${e.r}${e.g}${e.b}`,exports.inTargetedCountry=(e,t=[],n=[])=>0===t.length&&0===n.length||!!e&&(!!t.includes(fo(e.toUpperCase()))||n.includes(e.toUpperCase())),exports.incrementWeeklyArticleCount=(r,i,s)=>{const a=((e,r)=>{const o=n(new Date),i=e.get(t);if(i?.week===o){const n=i.articles[r]||0;return e.set(t,{week:o,articles:{...i.articles,[r]:n+1}}),n>0}return e.set(t,{week:o,articles:{[r]:1}}),!1})(r,i);if(!a){const t=n(new Date),i=r.get(e)??[],a=i.length>0?i[0]:null;if(a?.week&&a.week===t)a.count+=1,a.tags=o(s,a.tags),r.set(e,i);else{i.unshift({week:t,count:1,tags:o(s,{})});const n=t-365,a=i.filter(e=>e.week>=n);r.set(e,a)}}},exports.isGWCheckoutUrl=go,exports.isoCurrencyToCurrencySymbol={GBP:"£",USD:"$",AUD:"$",EUR:"€",NZD:"NZ$",CAD:"CA$"},exports.logEpicView=e=>{const t=JSON.parse(localStorage.getItem(bo)??""),n=t?t.value:[];n.push({date:(new Date).getTime(),testId:e});const r={value:n.slice(-50)};localStorage.setItem(bo,JSON.stringify(r))},exports.replaceNonArticleCountPlaceholders=(e,t,n)=>e?e.replace(_o,e=>{const r=e.substring(2,e.length-2),o=vo[r];if(o){const e=o({countryCode:t,prices:n});if(e)return e}return e}):"",exports.targetedRegionsSchema=uo;
|
|
@@ -323,11 +323,6 @@ export declare const epicTestFromToolSchema: z.ZodObject<{
|
|
|
323
323
|
}, z.core.$strip>>>;
|
|
324
324
|
}, z.core.$strip>>>>;
|
|
325
325
|
}, z.core.$strip>>>;
|
|
326
|
-
defaultChoiceCardFrequency: z.ZodOptional<z.ZodEnum<{
|
|
327
|
-
ONE_OFF: "ONE_OFF";
|
|
328
|
-
MONTHLY: "MONTHLY";
|
|
329
|
-
ANNUAL: "ANNUAL";
|
|
330
|
-
}>>;
|
|
331
326
|
}, z.core.$strip>>;
|
|
332
327
|
}, z.core.$strip>;
|
|
333
328
|
export type EpicVariant = z.infer<typeof variantSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../../shared/types/abTests/epic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQlD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE9C,eAAO,MAAM,cAAc;;;;iBAIzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErE,eAAO,MAAM,0BAA0B,EAAE,qBAAqB,EAAqC,CAAC;AAEpG,UAAU,oBAAoB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,CAAC;AA4BnF,UAAU,kBAAkB;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAC;AAEhF,MAAM,WAAW,cAAc;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,EAAE,qBAAqB,CAAC;IAC/C,uBAAuB,EAAE,qBAAqB,EAAE,CAAC;IACjD,eAAe,EAAE,eAAe,CAAC;CACpC;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC1D,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,oBAAoB,GAC1B;IAAE,aAAa,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GACnD;IAAE,aAAa,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAExD,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,oBAAoB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,EAAE,CAAC;AAGzC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGtE,MAAM,WAAW,QAAS,SAAQ,gBAAgB;IAC9C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,OAAO,CAAC;IAGhD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,sBAAsB
|
|
1
|
+
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../../shared/types/abTests/epic.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAQlD,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;AAE9C,eAAO,MAAM,cAAc;;;;iBAIzB,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AAErE,eAAO,MAAM,0BAA0B,EAAE,qBAAqB,EAAqC,CAAC;AAEpG,UAAU,oBAAoB;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAClB;AACD,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,CAAC;AA4BnF,UAAU,kBAAkB;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,qBAAqB,EAAE,kBAAkB,CAAC,CAAC;AAEhF,MAAM,WAAW,cAAc;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB,EAAE,qBAAqB,CAAC;IAC/C,uBAAuB,EAAE,qBAAqB,EAAE,CAAC;IACjD,eAAe,EAAE,eAAe,CAAC;CACpC;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC1D,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,oBAAoB,GAC1B;IAAE,aAAa,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,cAAc,CAAA;CAAE,GACnD;IAAE,aAAa,EAAE,SAAS,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC;AAExD,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,oBAAoB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,EAAE,CAAC;CAC9B;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,EAAE,CAAC;AAGzC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGtE,MAAM,WAAW,QAAS,SAAQ,gBAAgB;IAC9C,qBAAqB,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,aAAa,KAAK,OAAO,CAAC;IAGhD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBjC,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -48,7 +48,6 @@ export interface BannerProps {
|
|
|
48
48
|
content?: BannerContent;
|
|
49
49
|
mobileContent?: BannerContent;
|
|
50
50
|
countryCode?: string;
|
|
51
|
-
isSupporter?: boolean;
|
|
52
51
|
tickerSettings?: TickerSettings;
|
|
53
52
|
articleCounts: ArticleCounts;
|
|
54
53
|
hasOptedOutOfArticleCount?: boolean;
|
|
@@ -133,7 +132,6 @@ export declare const bannerSchema: z.ZodObject<{
|
|
|
133
132
|
}, z.core.$strip>], "type">>;
|
|
134
133
|
}, z.core.$strip>>>;
|
|
135
134
|
countryCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
136
|
-
isSupporter: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
137
135
|
tickerSettings: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
138
136
|
currencySymbol: z.ZodString;
|
|
139
137
|
copy: z.ZodObject<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../shared/types/props/banner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,KAAK,EACR,aAAa,EACb,GAAG,EACH,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACX,MAAM,UAAU,CAAC;AASlB,eAAO,MAAM,mBAAmB;;;;;EAK9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,wBAAwB,kBAAmB,aAAa,KAAG,OACX,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;iBAQ9B,CAAC;AAEH,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,QAAQ,CAAC;IAEnB,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,
|
|
1
|
+
{"version":3,"file":"banner.d.ts","sourceRoot":"","sources":["../../../../../shared/types/props/banner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAEnD,OAAO,KAAK,EACR,aAAa,EACb,GAAG,EACH,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,QAAQ,EACX,MAAM,UAAU,CAAC;AASlB,eAAO,MAAM,mBAAmB;;;;;EAK9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,eAAO,MAAM,wBAAwB,kBAAmB,aAAa,KAAG,OACX,CAAC;AAE9D,MAAM,WAAW,aAAa;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;iBAQ9B,CAAC;AAEH,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,QAAQ,CAAC;IAEnB,aAAa,EAAE,aAAa,CAAC;IAC7B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,4BAA4B,CAAC,EAAE,oBAAoB,CAAC;IACpD,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAC1C,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1C,uBAAuB,CAAC,EAAE,MAAM,CAAC;CACpC;AAED,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBvB,CAAC"}
|
|
@@ -184,11 +184,6 @@ export declare const variantSchema: z.ZodObject<{
|
|
|
184
184
|
}, z.core.$strip>>>;
|
|
185
185
|
}, z.core.$strip>>>>;
|
|
186
186
|
}, z.core.$strip>>>;
|
|
187
|
-
defaultChoiceCardFrequency: z.ZodOptional<z.ZodEnum<{
|
|
188
|
-
ONE_OFF: "ONE_OFF";
|
|
189
|
-
MONTHLY: "MONTHLY";
|
|
190
|
-
ANNUAL: "ANNUAL";
|
|
191
|
-
}>>;
|
|
192
187
|
}, z.core.$strip>;
|
|
193
188
|
export declare const epicPropsSchema: z.ZodObject<{
|
|
194
189
|
variant: z.ZodObject<{
|
|
@@ -356,11 +351,6 @@ export declare const epicPropsSchema: z.ZodObject<{
|
|
|
356
351
|
}, z.core.$strip>>>;
|
|
357
352
|
}, z.core.$strip>>>>;
|
|
358
353
|
}, z.core.$strip>>>;
|
|
359
|
-
defaultChoiceCardFrequency: z.ZodOptional<z.ZodEnum<{
|
|
360
|
-
ONE_OFF: "ONE_OFF";
|
|
361
|
-
MONTHLY: "MONTHLY";
|
|
362
|
-
ANNUAL: "ANNUAL";
|
|
363
|
-
}>>;
|
|
364
354
|
}, z.core.$strip>;
|
|
365
355
|
tracking: z.ZodObject<{
|
|
366
356
|
abTestName: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../../shared/types/props/epic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAY/D,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1C,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB;AAkBD,eAAO,MAAM,2BAA2B;;;;EAA2C,CAAC;AAOpF,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../../shared/types/props/epic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAY/D,MAAM,WAAW,SAAS;IACtB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAC1C,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,KAAK,CAAC,EAAE,KAAK,CAAC;CACjB;AAkBD,eAAO,MAAM,2BAA2B;;;;EAA2C,CAAC;AAOpF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAkBxB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW1B,CAAC"}
|
|
@@ -27,7 +27,6 @@ export interface HeaderProps {
|
|
|
27
27
|
mobileContent?: HeaderContent;
|
|
28
28
|
countryCode?: string;
|
|
29
29
|
submitComponentEvent?: (componentEvent: ComponentEvent) => Promise<void>;
|
|
30
|
-
numArticles?: number;
|
|
31
30
|
promoCodes?: string[];
|
|
32
31
|
}
|
|
33
32
|
export declare const headerPropsSchema: z.ZodObject<{
|
|
@@ -81,7 +80,6 @@ export declare const headerPropsSchema: z.ZodObject<{
|
|
|
81
80
|
}, z.core.$strip>>;
|
|
82
81
|
countryCode: z.ZodOptional<z.ZodString>;
|
|
83
82
|
submitComponentEvent: z.ZodAny;
|
|
84
|
-
numArticles: z.ZodOptional<z.ZodNumber>;
|
|
85
83
|
promoCodes: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
86
84
|
}, z.core.$strip>;
|
|
87
85
|
//# sourceMappingURL=header.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../shared/types/props/header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG9C,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;iBAM9B,CAAC;AAEH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../shared/types/props/header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAG9C,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,YAAY,CAAC,EAAE,GAAG,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;iBAM9B,CAAC;AAEH,MAAM,WAAW,WAAW;IACxB,OAAO,EAAE,aAAa,CAAC;IACvB,QAAQ,EAAE,QAAQ,CAAC;IACnB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,CAAC,cAAc,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzE,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAO5B,CAAC"}
|
|
@@ -5,11 +5,8 @@ type Tag = {
|
|
|
5
5
|
type: string;
|
|
6
6
|
};
|
|
7
7
|
export type EpicTargeting = {
|
|
8
|
-
contentType: string;
|
|
9
|
-
sectionName?: string;
|
|
10
8
|
sectionId?: string;
|
|
11
9
|
shouldHideReaderRevenue: boolean;
|
|
12
|
-
isMinuteArticle: boolean;
|
|
13
10
|
isPaidContent: boolean;
|
|
14
11
|
tags: Tag[];
|
|
15
12
|
mvtId?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../../shared/types/targeting/epic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,KAAK,GAAG,GAAG;IACP,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,
|
|
1
|
+
{"version":3,"file":"epic.d.ts","sourceRoot":"","sources":["../../../../../shared/types/targeting/epic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErD,KAAK,GAAG,GAAG;IACP,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB,EAAE,OAAO,CAAC;IACjC,aAAa,EAAE,OAAO,CAAC;IACvB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,yBAAyB,EAAE,OAAO,CAAC;IACnC,oBAAoB,EAAE,OAAO,CAAC;IAC9B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACtB,SAAS,EAAE,aAAa,CAAC;CAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../shared/types/targeting/header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,WAAW,eAAe;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,
|
|
1
|
+
{"version":3,"file":"header.d.ts","sourceRoot":"","sources":["../../../../../shared/types/targeting/header.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAE7C,MAAM,WAAW,eAAe;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,MAAM,aAAa,GAAG;IACxB,SAAS,EAAE,eAAe,CAAC;CAC9B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guardian/support-dotcom-components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.0",
|
|
4
4
|
"description": "Reader Revenue components for dotcom",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/guardian/support-dotcom-components"
|
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"@babel/core": "
|
|
18
|
+
"@babel/core": "7.29.6",
|
|
19
19
|
"@babel/preset-typescript": "7.28.5",
|
|
20
20
|
"@rollup/plugin-babel": "7.1.0",
|
|
21
21
|
"@rollup/plugin-commonjs": "29.0.2",
|
|
22
22
|
"@rollup/plugin-node-resolve": "16.0.3",
|
|
23
23
|
"@rollup/plugin-replace": "6.0.3",
|
|
24
|
-
"rollup": "
|
|
24
|
+
"rollup": "4.62.2",
|
|
25
25
|
"rollup-plugin-external-globals": "0.13.0",
|
|
26
26
|
"rollup-plugin-peer-deps-external": "2.2.4",
|
|
27
27
|
"rollup-plugin-terser": "7.0.2"
|
|
@@ -32,6 +32,6 @@
|
|
|
32
32
|
"zod": "^4.1.12"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
|
-
"build": "pnpm -w exec rollup --config rollup.config.js"
|
|
35
|
+
"build": "pnpm -w exec rollup --config rollup.config.js --bundleConfigAsCjs"
|
|
36
36
|
}
|
|
37
37
|
}
|