@epic-web/workshop-app 6.64.0 → 6.64.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/build/client/assets/{_exerciseNumber-CcPKmB4n.js → _exerciseNumber-D3f2-zl6.js} +2 -2
  2. package/build/client/assets/{_exerciseNumber-CcPKmB4n.js.map → _exerciseNumber-D3f2-zl6.js.map} +1 -1
  3. package/build/client/assets/{_exerciseNumber_.finished-knzx8riV.js → _exerciseNumber_.finished-DBaOwcf2.js} +2 -2
  4. package/build/client/assets/{_exerciseNumber_.finished-knzx8riV.js.map → _exerciseNumber_.finished-DBaOwcf2.js.map} +1 -1
  5. package/build/client/assets/{_extra-DB6-IJuV.js → _extra-B4vZXPjV.js} +2 -2
  6. package/build/client/assets/{_extra-DB6-IJuV.js.map → _extra-B4vZXPjV.js.map} +1 -1
  7. package/build/client/assets/{_layout-Be0gsSoP.js → _layout-C6NSVF79.js} +2 -2
  8. package/build/client/assets/{_layout-Be0gsSoP.js.map → _layout-C6NSVF79.js.map} +1 -1
  9. package/build/client/assets/{_layout-D05w5xUz.js → _layout-oPmquiOE.js} +2 -2
  10. package/build/client/assets/{_layout-D05w5xUz.js.map → _layout-oPmquiOE.js.map} +1 -1
  11. package/build/client/assets/app-BcJkSksP.js +2 -0
  12. package/build/client/assets/{app-rrQthl25.js.map → app-BcJkSksP.js.map} +1 -1
  13. package/build/client/assets/{diff-De24Mp-s.js → diff-Ba99U4EI.js} +2 -2
  14. package/build/client/assets/{diff-De24Mp-s.js.map → diff-Ba99U4EI.js.map} +1 -1
  15. package/build/client/assets/{diff-Bd9VlQ-I.js → diff-DmmI9IU6.js} +2 -2
  16. package/build/client/assets/{diff-Bd9VlQ-I.js.map → diff-DmmI9IU6.js.map} +1 -1
  17. package/build/client/assets/{epic-video-DdpYdAlg.js → epic-video-5HutgMR0.js} +2 -2
  18. package/build/client/assets/{epic-video-DdpYdAlg.js.map → epic-video-5HutgMR0.js.map} +1 -1
  19. package/build/client/assets/{epic-video-Bndfj6GR.js → epic-video-BX2A437e.js} +2 -2
  20. package/build/client/assets/{epic-video-Bndfj6GR.js.map → epic-video-BX2A437e.js.map} +1 -1
  21. package/build/client/assets/{finished-HnwwiFtu.js → finished-BLRyuOTb.js} +2 -2
  22. package/build/client/assets/{finished-HnwwiFtu.js.map → finished-BLRyuOTb.js.map} +1 -1
  23. package/build/client/assets/index-DVd41HZN.js +68 -0
  24. package/build/client/assets/index-DVd41HZN.js.map +1 -0
  25. package/build/client/assets/{index-CvFJy3s8.js → index-Dt_ngnka.js} +2 -2
  26. package/build/client/assets/{index-CvFJy3s8.js.map → index-Dt_ngnka.js.map} +1 -1
  27. package/build/client/assets/{index-BL399UJV.js → index-InnNe6aG.js} +2 -2
  28. package/build/client/assets/{index-BL399UJV.js.map → index-InnNe6aG.js.map} +1 -1
  29. package/build/client/assets/{index-B1TztMYA.js → index-T3LlCTSm.js} +2 -2
  30. package/build/client/assets/{index-B1TztMYA.js.map → index-T3LlCTSm.js.map} +1 -1
  31. package/build/client/assets/{loading-IJRzD1mm.js → loading-BiVU3Oa8.js} +2 -2
  32. package/build/client/assets/{loading-IJRzD1mm.js.map → loading-BiVU3Oa8.js.map} +1 -1
  33. package/build/client/assets/{login-VlyrGJvd.js → login-Ej63Q5LC.js} +2 -2
  34. package/build/client/assets/{login-VlyrGJvd.js.map → login-Ej63Q5LC.js.map} +1 -1
  35. package/build/client/assets/manifest-9482f5db.js +1 -0
  36. package/build/client/assets/{mdx-CbaVHkqG.js → mdx-BlaeOyqK.js} +2 -2
  37. package/build/client/assets/{mdx-CbaVHkqG.js.map → mdx-BlaeOyqK.js.map} +1 -1
  38. package/build/client/assets/{playground-xNPUi1cK.js → playground-DIm_r4fy.js} +2 -2
  39. package/build/client/assets/{playground-xNPUi1cK.js.map → playground-DIm_r4fy.js.map} +1 -1
  40. package/build/client/assets/{preview-DUByetdK.js → preview-D11Pscbe.js} +2 -2
  41. package/build/client/assets/{preview-DUByetdK.js.map → preview-D11Pscbe.js.map} +1 -1
  42. package/build/client/assets/{product-DlgtjMXY.js → product-CNG57fZy.js} +2 -2
  43. package/build/client/assets/{product-DlgtjMXY.js.map → product-CNG57fZy.js.map} +1 -1
  44. package/build/client/assets/{root-B-fnUAyN.js → root-hU3hrO-C.js} +2 -2
  45. package/build/client/assets/{root-B-fnUAyN.js.map → root-hU3hrO-C.js.map} +1 -1
  46. package/build/client/assets/{test-wFDk9A6D.js → test-CpoHBC_8.js} +2 -2
  47. package/build/client/assets/{test-wFDk9A6D.js.map → test-CpoHBC_8.js.map} +1 -1
  48. package/build/client/assets/{tests-BldZ_klJ.js → tests-CITG_DX3.js} +2 -2
  49. package/build/client/assets/{tests-BldZ_klJ.js.map → tests-CITG_DX3.js.map} +1 -1
  50. package/build/server/index.js +22 -23
  51. package/build/server/index.js.map +1 -1
  52. package/package.json +3 -3
  53. package/build/client/assets/app-rrQthl25.js +0 -2
  54. package/build/client/assets/index-Cg-9mI3Y.js +0 -68
  55. package/build/client/assets/index-Cg-9mI3Y.js.map +0 -1
  56. package/build/client/assets/manifest-3610e2d1.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epic-web/workshop-app",
3
- "version": "6.64.0",
3
+ "version": "6.64.1",
4
4
  "sideEffects": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -42,8 +42,8 @@
42
42
  "@epic-web/invariant": "^1.0.0",
43
43
  "@epic-web/remember": "^1.1.0",
44
44
  "@epic-web/restore-scroll": "^2.0.0",
45
- "@epic-web/workshop-presence": "6.64.0",
46
- "@epic-web/workshop-utils": "6.64.0",
45
+ "@epic-web/workshop-presence": "6.64.1",
46
+ "@epic-web/workshop-utils": "6.64.1",
47
47
  "@mdx-js/mdx": "^3.1.1",
48
48
  "@mux/mux-player-react": "^3.10.2",
49
49
  "@nasa-gcn/remix-seo": "^2.0.1",
@@ -1,2 +0,0 @@
1
- import{w as t,b as p}from"./chunk-EPOLDU6W-C4NOdiis.js";import{j as s}from"./jsx-runtime-C5WNSv3b.js";import{r as i}from"./index-CqIc3cxq.js";import{P as m}from"./preview-DUByetdK.js";import"./misc-CRhJChs6.js";import"./button-CVorsvM4.js";import"./loading-IJRzD1mm.js";import"./index-Cg-9mI3Y.js";import"./tooltip-f3C9W-4C.js";import"./index-vDCSPjrM.js";import"./root-loader-BObzljW3.js";import"./pe-UQCAhDPv.js";import"./progress-bar-Cxy0ZpqZ.js";const E=t(function(){const{appInfo:r}=p(),o=i.useRef(null);return s.jsx(m,{appInfo:r,inBrowserBrowserRef:o})});export{E as default};
2
- //# sourceMappingURL=app-rrQthl25.js.map
@@ -1,68 +0,0 @@
1
- import{j as Y}from"./jsx-runtime-C5WNSv3b.js";import{l as On,f as Sn,g as Cn}from"./chunk-EPOLDU6W-C4NOdiis.js";import{I as Rt}from"./misc-CRhJChs6.js";import{S as Tn}from"./tooltip-f3C9W-4C.js";import{r as Q}from"./index-CqIc3cxq.js";import{a as sr}from"./root-loader-BObzljW3.js";import{u as An}from"./pe-UQCAhDPv.js";function fr(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function R(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?fr(Object(r),!0).forEach(function(n){Nn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fr(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Nn(t,e,r){return e=En(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zn(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function En(t){var e=Zn(t,"string");return typeof e=="symbol"?e:String(e)}function Et(t,e){if(!t)throw new Error(e)}function he(){return(Date.now()*Math.random()).toString(36)}function st(t){return JSON.parse(JSON.stringify(t))}function me(t){return!!t&&t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function ir(t){return t.tagName==="INPUT"}function or(t){return t.tagName==="SELECT"}function Qr(t){return t.tagName==="TEXTAREA"}function In(t){return"type"in t&&t.type==="submit"}function et(t){if(t instanceof Element){if(ir(t))return t.type!=="submit"&&t.type!=="button"&&t.type!=="reset";if(or(t)||Qr(t))return!0}return!1}function _t(t,e){var r=globalThis[e];return typeof r=="function"&&t instanceof r}function $n(t){var e,r,n=t.target,a=t.submitter;return(e=(r=a?.getAttribute("formaction"))!==null&&r!==void 0?r:n.getAttribute("action"))!==null&&e!==void 0?e:"".concat(location.pathname).concat(location.search)}function jn(t){var e,r=t.target,n=t.submitter,a=(e=n?.getAttribute("formenctype"))!==null&&e!==void 0?e:r.enctype;return a==="multipart/form-data"?a:"application/x-www-form-urlencoded"}function Rn(t){var e,r,n=t.target,a=t.submitter,s=(e=(r=a?.getAttribute("formmethod"))!==null&&r!==void 0?r:n.getAttribute("method"))===null||e===void 0?void 0:e.toUpperCase();switch(s){case"POST":case"PUT":case"PATCH":case"DELETE":return s}return"GET"}function Pn(t){return new SubmitEvent("submit",{bubbles:!0,cancelable:!0,submitter:t})}function Vn(t,e){Et(!!t,"Failed to submit the form. The element provided is null or undefined."),typeof t.requestSubmit=="function"?t.requestSubmit(e):t.dispatchEvent(Pn(e))}function Ln(t){var e=new DataTransfer;if(Array.isArray(t))for(var r of t)e.items.add(r);else e.items.add(t);return e.files}function Ie(t){if(!(typeof t>"u")){if(t===null)return[];if(typeof t=="string")return[t];if(Array.isArray(t)&&t.every(e=>typeof e=="string"))return Array.from(t);throw new Error("Expected string or string[] value for string based input")}}function Mn(t){if(!(typeof t>"u")){if(t===null)return[];if(_t(t,"File"))return t.name===""&&t.size===0?[]:[t];if(_t(t,"FileList"))return Array.from(t);if(Array.isArray(t)&&t.every(e=>_t(e,"File")))return t;throw new Error("Expected File, FileList or File[] for file input")}}function hr(t,e){var r=!1;if(ir(t))switch(t.type){case"file":{var n,a=Mn(e.value),s=Array.from((n=t.files)!==null&&n!==void 0?n:[]);return a&&(a.length!==s.length||a.some(($t,h)=>$t!==s[h]))&&(t.files=Ln(a),r=!0),r}case"checkbox":case"radio":{var i=Ie(e.value),o=Ie(e.defaultValue);if(i){var d=i.includes(t.value);(t.type==="checkbox"?d!==t.checked:d)&&(t.click(),r=!0),t.checked=d}return o&&(t.defaultChecked=o.includes(t.value)),r}}else if(or(t)){var u=Ie(e.value),c=Ie(e.defaultValue),C=u&&u.length===0;for(var P of t.options){if(u){var U=u.indexOf(P.value),V=U>-1;P.selected!==V&&(P.selected=V,r=!0),V&&u.splice(U,1)}if(c){var q=c.indexOf(P.value),we=q>-1;P.defaultSelected!==we&&(P.defaultSelected=we),we&&c.splice(q,1)}}var Je=new Set([...u??[],...c??[]]);for(var Ee of Je)t.options.add(new Option(Ee,Ee,c?.includes(Ee),u?.includes(Ee))),r=!0;return C&&t.selectedIndex!==-1&&(t.selectedIndex=-1,r=!0),r}var Ye=Ie(e.value),yt=Ie(e.defaultValue);if(Ye){var Ge,Ke=(Ge=Ye[0])!==null&&Ge!==void 0?Ge:"";if(t.value!==Ke){var{set:Oe}=Object.getOwnPropertyDescriptor(t,"value")||{},gt=Object.getPrototypeOf(t),{set:te}=Object.getOwnPropertyDescriptor(gt,"value")||{};if(te&&Oe!==te)te.call(t,Ke);else if(Oe)Oe.call(t,Ke);else throw new Error("The given element does not have a value setter");r=!0}}if(yt){var Xe;t.defaultValue=(Xe=yt[0])!==null&&Xe!==void 0?Xe:""}return r}function Dn(t){var e,r;if(ir(t))switch(t.type){case"checkbox":case"radio":return t.checked!==t.defaultChecked;case"file":return((e=(r=t.files)===null||r===void 0?void 0:r.length)!==null&&e!==void 0?e:0)>0;default:return t.value!==t.defaultValue}else{if(or(t))return Array.from(t.options).some(n=>n.selected!==n.defaultSelected);if(Qr(t))return t.value!==t.defaultValue}return!1}function zn(t,e){var r=new FormData(t,e);if(e){if(!In(e))throw new TypeError("The submitter must be an input or button element with type submit.");if(e.name){var n=r.getAll(e.name);n.includes(e.value)||r.append(e.name,e.value)}}return r}function de(t){if(!t)return[];for(var e=/([^.[\]]+)|\[(\d*)\]/g,r=[],n=0,a;a=e.exec(t);){if(a.index!==n&&!(a.index===n+1&&t[n]==="."))throw new Error("Invalid path syntax at position ".concat(n,' in "').concat(t,'"'));var[,s,i]=a;if(s!==void 0){if(s==="__proto__"||s==="constructor")throw new Error('Invalid path segment "'.concat(s,'"'));r.push(s)}else if(i==="")r.push("");else{var o=Number(i);if(!Number.isInteger(o)||o<0)throw new Error("Invalid path segment: array index must be a non-negative integer, got ".concat(o));r.push(o)}n=e.lastIndex}if(n!==t.length)throw new Error("Invalid path syntax at position ".concat(n,' in "').concat(t,'"'));return r}function Le(t){return t.reduce((e,r)=>pe(e,r),"")}function pe(t,e){return typeof e>"u"?t??"":e===""?"".concat(t,"[]"):typeof e=="number"?"".concat(t,"[").concat(e,"]"):t?"".concat(t,".").concat(e):e}function He(t,e){return en(t,de(e))!==null}function en(t,e){var r=de(t);return r.length>=e.length&&e.every((n,a)=>n===r[a])?r.slice(e.length):null}function ve(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};try{var a=typeof e=="string"?de(e):e;if(a.length===0)throw new Error("Cannot set value at the object root");if(a.some((V,q)=>V===""&&q<a.length-1))throw new Error(`Empty brackets '[]' only allowed at end of path ("`.concat(e,'")'));for(var s=n.clone?R({},t):t,i=s,o=0;o<a.length-1;o++){var d=a[o],u=a[o+1],c=i[d];Array.isArray(c)?c=n.clone?c.slice():c:me(c)?c=n.clone?R({},c):c:c=typeof u=="number"||u===""?[]:{},i[d]=c,i=c}var C=a[a.length-1],P=i[C],U=typeof r=="function"?r(P):r;if(C===""){if(!Array.isArray(i))throw new Error('Cannot push to non-array at "'.concat(e,'"'));i.push(U)}else i[C]=U;return s}catch(V){if(n!=null&&n.silent)return t;throw V}}function Me(t,e){var r=t,n=typeof e=="string"?de(e):e;for(var a of n){if(a==="")throw new Error('Cannot access empty segment "[]" in "'.concat(e,'"'));if(r==null||!Object.prototype.hasOwnProperty.call(r,a))return;r=r[a]}return r}var it="__intent__",Pt="__state__";function tn(t){var e=t.get(it),r=t.get(Pt);Et((typeof e=="string"||e===null)&&(typeof r=="string"||r===null),'The input name "'.concat(it,'" and "').concat(Pt,'" are reserved by Conform. Please use another name for your input.'));var n={payload:{},fields:new Set,intent:Bn(e)};r&&(n.state=JSON.parse(r));var a=function(d){if(s===it||s===Pt)return 1;n.fields.add(s),ve(n.payload,s,u=>u?Array.isArray(u)?u.concat(d):[u,d]:d,{silent:!0})};for(var[s,i]of t.entries())a(i);return n}function Fn(t,e){var r=tn(t),n=r.intent;if(n)switch(n.type){case"update":{var a=pe(n.payload.name,n.payload.index),s=n.payload.value;typeof n.payload.value<"u"&&(a?ve(r.payload,a,()=>s):r.payload=s);break}case"reset":{var i=pe(n.payload.name,n.payload.index);i?ve(r.payload,i,()=>{}):r.payload={};break}case"insert":case"remove":case"reorder":{rn(r.payload,n);break}}var o=e.resolve(r.payload,n),d=u=>Un(R(R({},r),{},{value:u.value,error:u.error}));return o instanceof Promise?o.then(d):d(o)}function Un(t){return t.intent||t.error!==void 0?{status:t.intent?void 0:"error",payload:t.payload,error:typeof t.error<"u"?t.error:{},reply(e){return mr(t,e)}}:{status:"success",payload:t.payload,value:t.value,reply(e){return mr(t,e)}}}function mr(t){var e,r,n,a,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if("resetForm"in s&&s.resetForm||((e=t.intent)===null||e===void 0?void 0:e.type)==="reset"&&((r=t.intent.payload.name)!==null&&r!==void 0?r:"")==="")return{initialValue:null};if("hideFields"in s&&s.hideFields)for(var i of s.hideFields){var o=Me(t.payload,i);typeof o<"u"&&ve(t.payload,i,()=>{})}var d="formErrors"in s||"fieldErrors"in s?De(R({"":(n=s.formErrors)!==null&&n!==void 0?n:null},s.fieldErrors)):null,u=t.error||d?R(R({},t.error),d):void 0,c=(a=De(t.payload,typeof document<"u"))!==null&&a!==void 0?a:{};return{status:t.intent?void 0:u?"error":"success",intent:t.intent?t.intent:void 0,initialValue:c,error:u,state:t.state,fields:Array.from(t.fields)}}function Bn(t){if(!t)return null;var e=JSON.parse(t);if(typeof e.type!="string"||typeof e.payload>"u")throw new Error("Unknown form control intent");return e}function Wn(t){switch(t.type){case"insert":return JSON.stringify({type:t.type,payload:R(R({},t.payload),{},{defaultValue:ot(t.payload.defaultValue)})});case"update":return JSON.stringify({type:t.type,payload:R(R({},t.payload),{},{value:ot(t.payload.value)})});default:return JSON.stringify(t)}}function Dt(t,e){var r;switch(Et(Array.isArray(t),"Failed to update list. The value is not an array."),e.type){case"insert":t.splice((r=e.payload.index)!==null&&r!==void 0?r:t.length,0,e.payload.defaultValue);break;case"remove":t.splice(e.payload.index,1);break;case"reorder":t.splice(e.payload.to,0,...t.splice(e.payload.from,1));break;default:throw new Error("Unknown list intent received")}}function rn(t,e){ve(t,e.payload.name,r=>{var n=r??[];return Dt(n,e),n})}var zt=Symbol.for("root");function kt(t,e,r){var n=Object.keys(t).sort((d,u)=>u.localeCompare(d)),a={},s=function(){var u=t[i];He(i,e)&&i!==e&&(ve(a,i,c=>typeof c>"u"?u:(c[zt]=u,c)),delete t[i])};for(var i of n)s();var o=r(Me(a,e));Object.assign(t,dr(o,{resolve(d){if(me(d)||Array.isArray(d)){var u;return(u=d[zt])!==null&&u!==void 0?u:null}return d},prefix:e}))}function pr(t,e,r){kt(t,e.payload.name,n=>{var a=n??[];switch(e.type){case"insert":Dt(a,{type:e.type,payload:R(R({},e.payload),{},{defaultValue:r?.(e.payload.defaultValue)})});break;default:Dt(a,e);break}return a})}function ot(t){return me(t)?Object.entries(t).reduce((e,r)=>{var[n,a]=r;return e[n]=ot(a),e},{}):Array.isArray(t)?t.map(ot):t instanceof Date?t.toISOString():typeof t=="boolean"?t?"on":void 0:typeof t=="number"||typeof t=="bigint"?t.toString():t??void 0}function De(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(me(t)){var r=Object.keys(t).sort().reduce((n,a)=>{var s=De(t[a],e);return typeof s<"u"&&(n[a]=s),n},{});return Object.keys(r).length===0?void 0:r}if(Array.isArray(t))return t.length===0?void 0:t.map(n=>De(n,e));if(!(typeof t=="string"&&t===""||t===null||_t(t,"File")&&(!e||t.size===0)))return t}function dr(t){var e,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n={},a=(e=r.resolve)!==null&&e!==void 0?e:o=>o;function s(o,d){var u=De(a(o));if(typeof u<"u"&&(n[d]=u),Array.isArray(o))for(var c=0;c<o.length;c++)s(o[c],"".concat(d,"[").concat(c,"]"));else if(me(o))for(var[C,P]of Object.entries(o))s(P,d?"".concat(d,".").concat(C):C)}if(t){var i;s(t,(i=r.prefix)!==null&&i!==void 0?i:"")}return n}function vr(t,e){var r,n,a,s,i,o=e?void 0:t.lastResult,d=t.defaultValue?ot(t.defaultValue):{},u=(r=o?.initialValue)!==null&&r!==void 0?r:d,c={formId:t.formId,pendingIntents:e?[{type:"reset",payload:{}}]:[],isValueUpdated:!1,submissionStatus:o?.status,defaultValue:d,initialValue:u,value:u,constraint:(n=t.constraint)!==null&&n!==void 0?n:{},validated:(a=o==null||(s=o.state)===null||s===void 0?void 0:s.validated)!==null&&a!==void 0?a:{},key:e?R({"":he()},dt(d)):dt(d),error:(i=o?.error)!==null&&i!==void 0?i:{}};return nn(c,o?.intent,o?.fields),c}function dt(t,e){return Object.entries(dr(t,{prefix:e})).reduce((r,n)=>{var[a,s]=n;if(Array.isArray(s))for(var i=0;i<s.length;i++)r[pe(a,i)]=he();return r},{})}function yr(t,e){for(var r of Object.keys(t.error).concat(e??[]))t.validated[r]=!0}function nn(t,e,r,n){var a;if(!e){yr(t,r);return}switch(e.type){case"validate":{e.payload.name?t.validated[e.payload.name]=!0:yr(t,r);break}case"update":{var{validated:s,value:i}=e.payload,o=pe(e.payload.name,e.payload.index);typeof i<"u"&&gr(t,o??"",i),typeof s<"u"&&(o?kt(t.validated,o,()=>{}):t.validated={},s?((me(i)||Array.isArray(i))&&Object.assign(t.validated,dr(i,{resolve(){return!0},prefix:o})),t.validated[o??""]=!0):o&&delete t.validated[o]);break}case"reset":{var d=pe(e.payload.name,e.payload.index),u=Me(t.defaultValue,d);gr(t,d,u),d?(kt(t.validated,d,()=>{}),delete t.validated[d]):t.validated={};break}case"insert":case"remove":case"reorder":{n&&(t.initialValue=st(t.initialValue),t.key=st(t.key),pr(t.key,e,C=>!Array.isArray(C)&&!me(C)?he():Object.assign(dt(C),{[zt]:he()})),rn(t.initialValue,e)),pr(t.validated,e),t.validated[e.payload.name]=!0;break}}var c=(a=r?.filter(C=>t.validated[C]))!==null&&a!==void 0?a:[];t.error=Object.entries(t.error).reduce((C,P)=>{var[U,V]=P;return(t.validated[U]||c.some(q=>He(U,q)))&&(C[U]=V),C},{})}function gr(t,e,r){if(e===""){t.initialValue=r,t.value=r,t.key=R(R({},dt(r)),{},{"":he()});return}t.initialValue=st(t.initialValue),t.value=st(t.value),t.key=st(t.key),ve(t.initialValue,e,()=>r),ve(t.value,e,()=>r),(me(r)||Array.isArray(r))&&(kt(t.key,e,()=>{}),Object.assign(t.key,dt(r,e))),t.key[e]=he()}function vt(t){var e={};return new Proxy(e,{get(r,n,a){var s;if(typeof n=="string")return(s=e[n])!==null&&s!==void 0?s:e[n]=t(n,a)}})}function Vt(t){var e=De(t);return vt((r,n)=>{if(r==="")return e;var a=de(r),s=Le(a.slice(0,-1)),i=Le(a.slice(-1)),o=n[s];return Me(o,i)})}function qn(t){return vt((e,r)=>{var n,a=t[e];if(!a){for(var s=de(e),i=s.length-1;i>=0;i--){var o=s[i];if(typeof o=="number"){s[i]="";break}}var d=Le(s);e!==d&&(a=r[d])}return(n=a)!==null&&n!==void 0?n:{}})}function Hn(t){return vt((e,r)=>{var n=t[e],a=de(e);if(a.length===0)return n;var s=r[Le(a.slice(0,-1))];return typeof s>"u"?n:"".concat(s,"/").concat(n??a.at(-1))})}function Jn(t){return vt(e=>{var r=Object.keys(t);if(e==="")return r.length===0;for(var n of r)if(He(n,e)&&typeof t[n]<"u")return!1;return!0})}function Yn(t,e,r){return vt(n=>JSON.stringify(t[n])!==JSON.stringify(e[n],(a,s)=>n===""&&a===""&&s?Object.entries(s).reduce((i,o)=>{var[d,u]=o;return r(d)?Object.assign(i??{},{[d]:u}):i},void 0):s))}function $e(t,e,r,n){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:(U,V)=>JSON.stringify(U)!==JSON.stringify(V);if(n&&t!==e){var s,i,o=(s=n.prefix)!==null&&s!==void 0?s:[],d=(i=n.name)!==null&&i!==void 0?i:[],u=o.length===0?d:Array.from(new Set([...Object.keys(t),...Object.keys(e)])),c=function(V){if(o.length===0||d.includes(V)||o.some(we=>He(V,we))){var q;if((q=r[V])!==null&&q!==void 0||(r[V]=a(t[V],e[V])),r[V])return{v:!0}}},C;for(var P of u)if(C=c(P),C)return C.v}return!1}function Gn(t){var e=[],r=t,n=new Set,a=vr(t),s=o(a);function i(){return document.forms.namedItem(r.formId)}function o(h){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:h,p=arguments.length>2?arguments[2]:void 0,N=!p||y.defaultValue!==h.defaultValue?Vt(h.defaultValue):p.defaultValue,D=h.initialValue===h.defaultValue?N:!p||y.initialValue!==h.initialValue?Vt(h.initialValue):p.initialValue,L=h.value===h.initialValue?D:!p||y.value!==h.value?Vt(h.value):p.value;return{submissionStatus:h.submissionStatus,pendingIntents:h.pendingIntents,defaultValue:N,initialValue:D,value:L,error:!p||y.error!==h.error?h.error:p.error,validated:h.validated,constraint:!p||y.constraint!==h.constraint?qn(h.constraint):p.constraint,key:!p||y.key!==h.key?Hn(h.key):p.key,valid:!p||y.error!==h.error?Jn(h.error):p.valid,dirty:!p||y.defaultValue!==h.defaultValue||y.value!==h.value?Yn(N,L,z=>{var M,W;return(M=(W=r.shouldDirtyConsider)===null||W===void 0?void 0:W.call(r,z))!==null&&M!==void 0?M:!0}):p.dirty}}function d(h){var y=a,p=s,N=o(h,y,p);a=h,s=N;var D={value:{},error:{},initialValue:{},key:{},valid:{},dirty:{}};for(var L of e){var z,M=(z=L.getSubject)===null||z===void 0?void 0:z.call(L);(!M||M.formId&&y.formId!==h.formId||M.status&&p.submissionStatus!==N.submissionStatus||M.pendingIntents&&y.pendingIntents!==h.pendingIntents||$e(p.error,N.error,D.error,M.error)||$e(p.initialValue,N.initialValue,D.initialValue,M.initialValue)||$e(p.key,N.key,D.key,M.key,(W,Qe)=>W!==Qe)||$e(p.valid,N.valid,D.valid,M.valid,u)||$e(p.dirty,N.dirty,D.dirty,M.dirty,u)||$e(p.value,N.value,D.value,M.value))&&L.callback()}}function u(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return h!==y}function c(){return JSON.stringify({validated:a.validated})}function C(h){var y=h.target,p=h.submitter;Et(y===i(),"The submit event is dispatched by form#".concat(y.id," instead of form#").concat(r.formId));var N=zn(y,p),D={formData:N,action:$n(h),encType:jn(h),method:Rn(h)};if(typeof r?.onValidate>"u")return D;var L=r.onValidate({form:y,formData:N,submitter:p});if(L.status==="success"||L.error!==null){var z=L.reply();Ye(R(R({},z),{},{status:z.status!=="success"?z.status:void 0}))}return R(R({},D),{},{submission:L})}function P(h){var y=i(),p=h.target;return!y||!et(p)||p.form!==y||!p.form.isConnected||p.name===""?null:p}function U(h,y){var{shouldValidate:p="onSubmit",shouldRevalidate:N=p}=r,D=a.validated[h.name];return D?N===y&&(y==="onInput"||a.isValueUpdated):p===y}function V(h){var y=new FormData(h),p=tn(y);d(R(R({},a),{},{isValueUpdated:!0,value:p.payload}))}function q(h){var y=P(h);!y||!y.form||(h.defaultPrevented||!U(y,"onInput")?V(y.form):Oe({type:"validate",payload:{name:y.name}}))}function we(h){var y=P(h);!y||h.defaultPrevented||!U(y,"onBlur")||Oe({type:"validate",payload:{name:y.name}})}function Je(){n.clear(),d(vr(r,!0))}function Ee(h){var y=i();h.type!=="reset"||h.target!==y||h.defaultPrevented||Je()}function Ye(h){var y,p,N=i();if(!h.initialValue){Je();return}var D=Object.entries((y=h.error)!==null&&y!==void 0?y:{}).reduce((W,Qe)=>{var[J,Se]=Qe,ue=Se===null?a.error[J]:Se;return ue&&(W[J]=ue),W},{}),L=h.intent?a.pendingIntents.filter(W=>!n.has(W)).concat(h.intent):a.pendingIntents,z=R(R({},a),{},{pendingIntents:L,isValueUpdated:!1,submissionStatus:h.status,value:h.initialValue,validated:R(R({},a.validated),(p=h.state)===null||p===void 0?void 0:p.validated),error:D});if(nn(z,h.intent,h.fields,!0),d(z),N&&h.status==="error"){for(var M of N.elements)if(et(M)&&a.error[M.name]){M.focus();break}}}function yt(h){var y=r.formId,p=r.lastResult;Object.assign(r,h),r.formId!==y?Je():h.lastResult&&h.lastResult!==p&&Ye(h.lastResult)}function Ge(h,y){var p={callback:h,getSubject:y};return e.push(p),()=>{e=e.filter(N=>N!==p)}}function Ke(){return s}function Oe(h){var y=i(),p=document.createElement("button"),N=gt(h);p.name=N.name,p.value=N.value,p.hidden=!0,p.formNoValidate=!0,y?.appendChild(p),Vn(y,p),y?.removeChild(p)}function gt(h){return{name:it,value:Wn(h),form:r.formId,formNoValidate:!0}}function te(h){var y=function(){var N=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Oe({type:h,payload:N})};return Object.assign(y,{getButtonProps(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return gt({type:h,payload:p})}})}function Xe(){var h=new MutationObserver(y=>{var p=i();if(p)for(var N of y){var D=N.type==="childList"?[...N.addedNodes,...N.removedNodes]:[N.target];for(var L of D){var z=et(L)?L:L instanceof HTMLElement?L.querySelector("input,select,textarea"):null;if(z?.form===p){V(p);return}}}});return h.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["form","name"]}),()=>{h.disconnect()}}function $t(h){var y=i();if(y)for(var p of h){switch(p.type){case"update":{var N=pe(p.payload.name,p.payload.index),D=de(N);for(var L of y.elements)if(et(L)){var z=en(L.name,D);if(z){var M=Me(p.payload.value,z),W=typeof M=="string"||Array.isArray(M)&&M.every(jt=>typeof jt=="string")?M:void 0;(typeof W<"u"||N===""&&z.length>1)&&(hr(L,{value:W??null}),L.dataset.conform=he())}}break}case"reset":{var Qe=pe(p.payload.name,p.payload.index);for(var J of y.elements)if(et(J)&&J.name&&He(J.name,Qe)){var Se=Me(a.defaultValue,J.name),ue=typeof Se=="string"||Array.isArray(Se)&&Se.every(jt=>typeof jt=="string")?Se:void 0;if(typeof ue>"u"&&!J.dataset.conform&&"defaultValue"in J&&!Dn(J))continue;hr(J,{defaultValue:ue,value:ue??null}),J.dataset.conform=he()}break}}n.add(p)}}return{getFormId(){return a.formId},submit:C,onReset:Ee,onInput:q,onBlur:we,onUpdate:yt,validate:te("validate"),reset:te("reset"),update:te("update"),insert:te("insert"),remove:te("remove"),reorder:te("reorder"),runSideEffect:$t,subscribe:Ge,getState:Ke,getSerializedState:c,observe:Xe}}function _r(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function se(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_r(Object(r),!0).forEach(function(n){Kn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_r(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Kn(t,e,r){return e=ta(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xn(t,e){if(t==null)return{};var r={},n=Object.keys(t),a,s;for(s=0;s<n.length;s++)a=n[s],!(e.indexOf(a)>=0)&&(r[a]=t[a]);return r}function Qn(t,e){if(t==null)return{};var r=Xn(t,e),n,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)n=s[a],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ea(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function ta(t){var e=ea(t,"string");return typeof e=="symbol"?e:String(e)}var ra=Symbol("wrapped");function na(t,e){var r=Q.useCallback(n=>t.subscribe(n,()=>e?.current),[t,e]);return Q.useSyncExternalStore(r,t.getState,t.getState)}function aa(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=Q.useRef(t);return e.current=t,e}function Ve(t,e,r,n){if(e==="status"||e==="formId"||e==="pendingIntents")t.current[e]=!0;else if(typeof r<"u"&&typeof n<"u"){var a,s;t.current[e]=se(se({},t.current[e]),{},{[r]:((a=(s=t.current[e])===null||s===void 0?void 0:s[r])!==null&&a!==void 0?a:[]).concat(n)})}}function an(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",a=n?"".concat(t.getFormId(),"-").concat(n):t.getFormId(),s=t.getState();return new Proxy({id:a,name:n,errorId:"".concat(a,"-error"),descriptionId:"".concat(a,"-description"),get defaultValue(){var i=this.initialValue;if(typeof i=="string")return i;if(Array.isArray(i))return i[0]},get defaultOptions(){var i=this.initialValue;if(typeof i=="string")return[i];if(Array.isArray(i)&&i.every(o=>typeof o=="string"))return i},get defaultChecked(){if(this.initialValue==="on")return!0},get initialValue(){return s.initialValue[n]},get value(){return s.value[n]},get errors(){return s.error[n]},get key(){return s.key[n]},get valid(){return s.valid[n]},get dirty(){return s.dirty[n]},get allErrors(){if(n==="")return s.error;var i={};for(var[o,d]of Object.entries(s.error))He(o,n)&&(i[o]=d);return i},get getFieldset(){return()=>new Proxy({},{get(i,o,d){return typeof o=="string"?sn(t,e,r,n,o):Reflect.get(i,o,d)}})}},{get(i,o,d){if(s===r)switch(o){case"id":case"errorId":case"descriptionId":Ve(e,"formId");break;case"key":case"initialValue":case"value":case"valid":case"dirty":Ve(e,o,"name",n);break;case"errors":case"allErrors":Ve(e,"error",o==="errors"?"name":"prefix",n);break}return Reflect.get(i,o,d)}})}function sn(t,e,r){var n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"",a=arguments.length>4?arguments[4]:void 0,s=typeof a>"u"?n:Le([...de(n),a]);return new Proxy({},{get(i,o,d){var u,c=an(t,e,r,s),C=t.getState();switch(o){case"formId":return C===r&&Ve(e,"formId"),t.getFormId();case"required":case"minLength":case"maxLength":case"min":case"max":case"pattern":case"step":case"multiple":return(u=C.constraint[s])===null||u===void 0?void 0:u[o];case"getFieldList":return()=>{var P,U=(P=C.initialValue[s])!==null&&P!==void 0?P:[];if(C===r&&Ve(e,"initialValue","name",s),!Array.isArray(U))throw new Error("The initial value at the given name is not a list");return Array(U.length).fill(0).map((V,q)=>sn(t,e,r,s,q))}}return Reflect.get(c,o,d)}})}function sa(t,e,r,n){return new Proxy({},{get(a,s,i){var o=an(t,e,r),d=t.getState();switch(s){case"context":return{[ra]:t};case"status":return d===r&&Ve(e,"status"),d.submissionStatus;case"validate":case"update":case"reset":case"insert":case"remove":case"reorder":return t[s];case"onSubmit":return t.submit;case"noValidate":return n}return Reflect.get(o,s,i)}})}function ia(t){var{onSubmit:e}=t,r=Gn(t);return se(se({},r),{},{submit(n){var a=n.nativeEvent,s=r.submit(a);if(!s.submission||s.submission.status==="success"||s.submission.error===null){if(!s.formData.has(it)){var i;(i=e)===null||i===void 0||i(n,s)}}else n.preventDefault()},onUpdate(n){e=n.onSubmit,r.onUpdate(n)}})}var oa=["id"],Ft=typeof document>"u"?Q.useEffect:Q.useLayoutEffect;function da(t){var e=Q.useId();return t??e}function ua(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0,[e,r]=Q.useState(t);return Ft(()=>{e||r(!0)},[e]),e}function ca(t){var{id:e}=t,r=Qn(t,oa),n=da(e),[a]=Q.useState(()=>ia(se(se({},r),{},{formId:n})));Ft(()=>{var u=a.observe();return document.addEventListener("input",a.onInput),document.addEventListener("focusout",a.onBlur),document.addEventListener("reset",a.onReset),()=>{u(),document.removeEventListener("input",a.onInput),document.removeEventListener("focusout",a.onBlur),document.removeEventListener("reset",a.onReset)}},[a]),Ft(()=>{a.onUpdate(se(se({},r),{},{formId:n}))});var s=aa({pendingIntents:!0}),i=na(a,s),o=ua(t.defaultNoValidate),d=sa(a,s,i,o);return Q.useEffect(()=>{a.runSideEffect(i.pendingIntents)},[a,i.pendingIntents]),[d,d.getFieldset()]}function on(t){for(var e in t)t[e]===void 0&&delete t[e];return t}function la(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(typeof e.ariaAttributes<"u"&&!e.ariaAttributes)return{};var n=e.ariaInvalid==="allErrors"?!t.valid:typeof t.errors<"u",a=e.ariaDescribedBy;return on({"aria-invalid":r&&n||void 0,"aria-describedby":n?"".concat(t.errorId," ").concat(a??"").trim():a})}function fa(t,e){return on(se({id:t.id,onSubmit:t.onSubmit,noValidate:t.noValidate},la(t,e)))}function br(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),r.push.apply(r,n)}return r}function j(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?br(Object(r),!0).forEach(function(n){ha(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):br(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ha(t,e,r){return e=pa(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ma(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function pa(t){var e=ma(t,"string");return typeof e=="symbol"?e:String(e)}var E;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const s={};for(const i of a)s[i]=i;return s},t.getValidEnumValues=a=>{const s=t.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of s)i[o]=a[o];return t.objectValues(i)},t.objectValues=a=>t.objectKeys(a).map(function(s){return a[s]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},t.find=(a,s)=>{for(const i of a)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})(E||(E={}));var kr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(kr||(kr={}));const g=E.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ce=t=>{switch(typeof t){case"undefined":return g.undefined;case"string":return g.string;case"number":return Number.isNaN(t)?g.nan:g.number;case"boolean":return g.boolean;case"function":return g.function;case"bigint":return g.bigint;case"symbol":return g.symbol;case"object":return Array.isArray(t)?g.array:t===null?g.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?g.promise:typeof Map<"u"&&t instanceof Map?g.map:typeof Set<"u"&&t instanceof Set?g.set:typeof Date<"u"&&t instanceof Date?g.date:g.object;default:return g.unknown}},l=E.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);let Ae=class dn extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(s){return s.message},n={_errors:[]},a=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,d=0;for(;d<i.path.length;){const u=i.path[d];d===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],d++}}};return a(this),n}static assert(e){if(!(e instanceof dn))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,E.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const a of this.issues)if(a.path.length>0){const s=a.path[0];r[s]=r[s]||[],r[s].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};Ae.create=t=>new Ae(t);const Ut=(t,e)=>{let r;switch(t.code){case l.invalid_type:t.received===g.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case l.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,E.jsonStringifyReplacer)}`;break;case l.unrecognized_keys:r=`Unrecognized key(s) in object: ${E.joinValues(t.keys,", ")}`;break;case l.invalid_union:r="Invalid input";break;case l.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${E.joinValues(t.options)}`;break;case l.invalid_enum_value:r=`Invalid enum value. Expected ${E.joinValues(t.options)}, received '${t.received}'`;break;case l.invalid_arguments:r="Invalid function arguments";break;case l.invalid_return_type:r="Invalid function return type";break;case l.invalid_date:r="Invalid date";break;case l.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:E.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case l.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case l.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case l.custom:r="Invalid input";break;case l.invalid_intersection_types:r="Intersection results could not be merged";break;case l.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case l.not_finite:r="Number must be finite";break;default:r=e.defaultError,E.assertNever(t)}return{message:r}};let va=Ut;function ya(){return va}const ga=t=>{const{data:e,path:r,errorMaps:n,issueData:a}=t,s=[...r,...a.path||[]],i={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let o="";const d=n.filter(u=>!!u).slice().reverse();for(const u of d)o=u(i,{data:e,defaultError:o}).message;return{...a,path:s,message:o}};function m(t,e){const r=ya(),n=ga({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Ut?void 0:Ut].filter(a=>!!a)});t.common.issues.push(n)}let ee=class un{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return x;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const s=await a.key,i=await a.value;n.push({key:s,value:i})}return un.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return x;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}};const x=Object.freeze({status:"aborted"}),rt=t=>({status:"dirty",value:t}),G=t=>({status:"valid",value:t}),xr=t=>t.status==="aborted",wr=t=>t.status==="dirty",ze=t=>t.status==="valid",xt=t=>typeof Promise<"u"&&t instanceof Promise;var b;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(b||(b={}));let ye=class{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const Or=(t,e)=>{if(ze(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new Ae(t.common.issues);return this._error=r,this._error}}};function T(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,o)=>{const{message:d}=t;return i.code==="invalid_enum_value"?{message:d??o.defaultError}:typeof o.data>"u"?{message:d??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:d??r??o.defaultError}},description:a}}let Z=class{get description(){return this._def.description}_getType(e){return ce(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ee,ctx:{common:e.parent.common,data:e.data,parsedType:ce(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(xt(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ce(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Or(n,a)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ce(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return ze(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>ze(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ce(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(xt(a)?a:Promise.resolve(a));return Or(n,s)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,s)=>{const i=e(a),o=()=>s.addIssue({code:l.custom,...n(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(d=>d?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new _e({schema:this,typeName:w.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return re.create(this,this._def)}nullable(){return be.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ne.create(this)}promise(){return Ot.create(this,this._def)}or(e){return ut.create([this,e],this._def)}and(e){return ct.create(this,e,this._def)}transform(e){return new _e({...T(this._def),schema:this,typeName:w.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new lt({...T(this._def),innerType:this,defaultValue:r,typeName:w.ZodDefault})}brand(){return new cr({typeName:w.ZodBranded,type:this,...T(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new ft({...T(this._def),innerType:this,catchValue:r,typeName:w.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return pn.create(this,e)}readonly(){return St.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const _a=/^c[^\s-]{8,}$/i,ba=/^[0-9a-z]+$/,ka=/^[0-9A-HJKMNP-TV-Z]{26}$/i,xa=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,wa=/^[a-z0-9_-]{21}$/i,Oa=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Sa=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ca=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ta="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Lt;const Aa=/^(?:(?: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])$/,Na=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Za=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ea=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ia=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,$a=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,cn="((\\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])))",ja=new RegExp(`^${cn}$`);function ln(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function Ra(t){return new RegExp(`^${ln(t)}$`)}function Pa(t){let e=`${cn}T${ln(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function Va(t,e){return!!((e==="v4"||!e)&&Aa.test(t)||(e==="v6"||!e)&&Za.test(t))}function La(t,e){if(!Oa.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function Ma(t,e){return!!((e==="v4"||!e)&&Na.test(t)||(e==="v6"||!e)&&Ea.test(t))}let Sr=class nt extends Z{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==g.string){const s=this._getOrReturnCtx(e);return m(s,{code:l.invalid_type,expected:g.string,received:s.parsedType}),x}const n=new ee;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),m(a,{code:l.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),m(a,{code:l.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?m(a,{code:l.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&m(a,{code:l.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")Ca.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"email",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Lt||(Lt=new RegExp(Ta,"u")),Lt.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"emoji",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")xa.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"uuid",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")wa.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"nanoid",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")_a.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"cuid",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")ba.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"cuid2",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")ka.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"ulid",code:l.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),m(a,{validation:"url",code:l.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"regex",code:l.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),m(a,{code:l.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),m(a,{code:l.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),m(a,{code:l.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?Pa(s).test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{code:l.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?ja.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{code:l.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?Ra(s).test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{code:l.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?Sa.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"duration",code:l.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?Va(e.data,s.version)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"ip",code:l.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?La(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"jwt",code:l.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?Ma(e.data,s.version)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"cidr",code:l.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?Ia.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"base64",code:l.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?$a.test(e.data)||(a=this._getOrReturnCtx(e,a),m(a,{validation:"base64url",code:l.invalid_string,message:s.message}),n.dirty()):E.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:l.invalid_string,...b.errToObj(n)})}_addCheck(e){return new nt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...b.errToObj(e)})}url(e){return this._addCheck({kind:"url",...b.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...b.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...b.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...b.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...b.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...b.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...b.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...b.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...b.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...b.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...b.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...b.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...b.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...b.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...b.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...b.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...b.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...b.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...b.errToObj(r)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new nt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new nt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new nt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Sr.create=t=>new Sr({checks:[],typeName:w.ZodString,coerce:t?.coerce??!1,...T(t)});function Da(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,s=Number.parseInt(t.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return s%i/10**a}let Cr=class Bt extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==g.number){const s=this._getOrReturnCtx(e);return m(s,{code:l.invalid_type,expected:g.number,received:s.parsedType}),x}let n;const a=new ee;for(const s of this._def.checks)s.kind==="int"?E.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:l.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:l.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:l.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?Da(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),m(n,{code:l.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),m(n,{code:l.not_finite,message:s.message}),a.dirty()):E.assertNever(s);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,b.toString(r))}gt(e,r){return this.setLimit("min",e,!1,b.toString(r))}lte(e,r){return this.setLimit("max",e,!0,b.toString(r))}lt(e,r){return this.setLimit("max",e,!1,b.toString(r))}setLimit(e,r,n,a){return new Bt({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:b.toString(a)}]})}_addCheck(e){return new Bt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&E.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};Cr.create=t=>new Cr({checks:[],typeName:w.ZodNumber,coerce:t?.coerce||!1,...T(t)});let Tr=class Wt extends Z{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==g.bigint)return this._getInvalidInput(e);let n;const a=new ee;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:l.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),m(n,{code:l.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),m(n,{code:l.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):E.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return m(r,{code:l.invalid_type,expected:g.bigint,received:r.parsedType}),x}gte(e,r){return this.setLimit("min",e,!0,b.toString(r))}gt(e,r){return this.setLimit("min",e,!1,b.toString(r))}lte(e,r){return this.setLimit("max",e,!0,b.toString(r))}lt(e,r){return this.setLimit("max",e,!1,b.toString(r))}setLimit(e,r,n,a){return new Wt({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:b.toString(a)}]})}_addCheck(e){return new Wt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};Tr.create=t=>new Tr({checks:[],typeName:w.ZodBigInt,coerce:t?.coerce??!1,...T(t)});let Ar=class extends Z{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==g.boolean){const n=this._getOrReturnCtx(e);return m(n,{code:l.invalid_type,expected:g.boolean,received:n.parsedType}),x}return G(e.data)}};Ar.create=t=>new Ar({typeName:w.ZodBoolean,coerce:t?.coerce||!1,...T(t)});let Nr=class fn extends Z{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==g.date){const s=this._getOrReturnCtx(e);return m(s,{code:l.invalid_type,expected:g.date,received:s.parsedType}),x}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return m(s,{code:l.invalid_date}),x}const n=new ee;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),m(a,{code:l.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),m(a,{code:l.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):E.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new fn({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};Nr.create=t=>new Nr({checks:[],coerce:t?.coerce||!1,typeName:w.ZodDate,...T(t)});let Zr=class extends Z{_parse(e){if(this._getType(e)!==g.symbol){const n=this._getOrReturnCtx(e);return m(n,{code:l.invalid_type,expected:g.symbol,received:n.parsedType}),x}return G(e.data)}};Zr.create=t=>new Zr({typeName:w.ZodSymbol,...T(t)});let qt=class extends Z{_parse(e){if(this._getType(e)!==g.undefined){const n=this._getOrReturnCtx(e);return m(n,{code:l.invalid_type,expected:g.undefined,received:n.parsedType}),x}return G(e.data)}};qt.create=t=>new qt({typeName:w.ZodUndefined,...T(t)});let Ht=class extends Z{_parse(e){if(this._getType(e)!==g.null){const n=this._getOrReturnCtx(e);return m(n,{code:l.invalid_type,expected:g.null,received:n.parsedType}),x}return G(e.data)}};Ht.create=t=>new Ht({typeName:w.ZodNull,...T(t)});let Jt=class extends Z{constructor(){super(...arguments),this._any=!0}_parse(e){return G(e.data)}};Jt.create=t=>new Jt({typeName:w.ZodAny,...T(t)});let Er=class extends Z{constructor(){super(...arguments),this._unknown=!0}_parse(e){return G(e.data)}};Er.create=t=>new Er({typeName:w.ZodUnknown,...T(t)});let ge=class extends Z{_parse(e){const r=this._getOrReturnCtx(e);return m(r,{code:l.invalid_type,expected:g.never,received:r.parsedType}),x}};ge.create=t=>new ge({typeName:w.ZodNever,...T(t)});let Ir=class extends Z{_parse(e){if(this._getType(e)!==g.undefined){const n=this._getOrReturnCtx(e);return m(n,{code:l.invalid_type,expected:g.void,received:n.parsedType}),x}return G(e.data)}};Ir.create=t=>new Ir({typeName:w.ZodVoid,...T(t)});let Ne=class bt extends Z{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==g.array)return m(r,{code:l.invalid_type,expected:g.array,received:r.parsedType}),x;if(a.exactLength!==null){const i=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(i||o)&&(m(r,{code:i?l.too_big:l.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(m(r,{code:l.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(m(r,{code:l.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>a.type._parseAsync(new ye(r,i,r.path,o)))).then(i=>ee.mergeArray(n,i));const s=[...r.data].map((i,o)=>a.type._parseSync(new ye(r,i,r.path,o)));return ee.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new bt({...this._def,minLength:{value:e,message:b.toString(r)}})}max(e,r){return new bt({...this._def,maxLength:{value:e,message:b.toString(r)}})}length(e,r){return new bt({...this._def,exactLength:{value:e,message:b.toString(r)}})}nonempty(e){return this.min(1,e)}};Ne.create=(t,e)=>new Ne({type:t,minLength:null,maxLength:null,exactLength:null,typeName:w.ZodArray,...T(e)});function Re(t){if(t instanceof ie){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=re.create(Re(n))}return new ie({...t._def,shape:()=>e})}else return t instanceof Ne?new Ne({...t._def,type:Re(t.element)}):t instanceof re?re.create(Re(t.unwrap())):t instanceof be?be.create(Re(t.unwrap())):t instanceof Fe?Fe.create(t.items.map(e=>Re(e))):t}let ie=class X extends Z{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=E.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==g.object){const u=this._getOrReturnCtx(e);return m(u,{code:l.invalid_type,expected:g.object,received:u.parsedType}),x}const{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ge&&this._def.unknownKeys==="strip"))for(const u in a.data)i.includes(u)||o.push(u);const d=[];for(const u of i){const c=s[u],C=a.data[u];d.push({key:{status:"valid",value:u},value:c._parse(new ye(a,C,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof ge){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of o)d.push({key:{status:"valid",value:c},value:{status:"valid",value:a.data[c]}});else if(u==="strict")o.length>0&&(m(a,{code:l.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of o){const C=a.data[c];d.push({key:{status:"valid",value:c},value:u._parse(new ye(a,C,a.path,c)),alwaysSet:c in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of d){const C=await c.key,P=await c.value;u.push({key:C,value:P,alwaysSet:c.alwaysSet})}return u}).then(u=>ee.mergeObjectSync(n,u)):ee.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new X({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:b.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new X({...this._def,unknownKeys:"strip"})}passthrough(){return new X({...this._def,unknownKeys:"passthrough"})}extend(e){return new X({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new X({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:w.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new X({...this._def,catchall:e})}pick(e){const r={};for(const n of E.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new X({...this._def,shape:()=>r})}omit(e){const r={};for(const n of E.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new X({...this._def,shape:()=>r})}deepPartial(){return Re(this)}partial(e){const r={};for(const n of E.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}return new X({...this._def,shape:()=>r})}required(e){const r={};for(const n of E.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof re;)s=s._def.innerType;r[n]=s}return new X({...this._def,shape:()=>r})}keyof(){return mn(E.objectKeys(this.shape))}};ie.create=(t,e)=>new ie({shape:()=>t,unknownKeys:"strip",catchall:ge.create(),typeName:w.ZodObject,...T(e)});ie.strictCreate=(t,e)=>new ie({shape:()=>t,unknownKeys:"strict",catchall:ge.create(),typeName:w.ZodObject,...T(e)});ie.lazycreate=(t,e)=>new ie({shape:t,unknownKeys:"strip",catchall:ge.create(),typeName:w.ZodObject,...T(e)});let ut=class extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(o=>new Ae(o.ctx.common.issues));return m(r,{code:l.invalid_union,unionErrors:i}),x}if(r.common.async)return Promise.all(n.map(async s=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(a);{let s;const i=[];for(const d of n){const u={...r,common:{...r.common,issues:[]},parent:null},c=d._parseSync({data:r.data,path:r.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(d=>new Ae(d));return m(r,{code:l.invalid_union,unionErrors:o}),x}}get options(){return this._def.options}};ut.create=(t,e)=>new ut({options:t,typeName:w.ZodUnion,...T(e)});const ae=t=>t instanceof wt?ae(t.schema):t instanceof _e?ae(t.innerType()):t instanceof Kt?[t.value]:t instanceof It?t.options:t instanceof Qt?E.objectValues(t.enum):t instanceof lt?ae(t._def.innerType):t instanceof qt?[void 0]:t instanceof Ht?[null]:t instanceof re?[void 0,...ae(t.unwrap())]:t instanceof be?[null,...ae(t.unwrap())]:t instanceof cr||t instanceof St?ae(t.unwrap()):t instanceof ft?ae(t._def.innerType):[];class ur extends Z{_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.object)return m(r,{code:l.invalid_type,expected:g.object,received:r.parsedType}),x;const n=this.discriminator,a=r.data[n],s=this.optionsMap.get(a);return s?r.common.async?s._parseAsync({data:r.data,path:r.path,parent:r}):s._parseSync({data:r.data,path:r.path,parent:r}):(m(r,{code:l.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){const a=new Map;for(const s of r){const i=ae(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const o of i){if(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,s)}}return new ur({typeName:w.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:a,...T(n)})}}function Yt(t,e){const r=ce(t),n=ce(e);if(t===e)return{valid:!0,data:t};if(r===g.object&&n===g.object){const a=E.objectKeys(e),s=E.objectKeys(t).filter(o=>a.indexOf(o)!==-1),i={...t,...e};for(const o of s){const d=Yt(t[o],e[o]);if(!d.valid)return{valid:!1};i[o]=d.data}return{valid:!0,data:i}}else if(r===g.array&&n===g.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<t.length;s++){const i=t[s],o=e[s],d=Yt(i,o);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return r===g.date&&n===g.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}let ct=class extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(s,i)=>{if(xr(s)||xr(i))return x;const o=Yt(s.value,i.value);return o.valid?((wr(s)||wr(i))&&r.dirty(),{status:r.value,value:o.data}):(m(n,{code:l.invalid_intersection_types}),x)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>a(s,i)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};ct.create=(t,e,r)=>new ct({left:t,right:e,typeName:w.ZodIntersection,...T(r)});let Fe=class hn extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.array)return m(n,{code:l.invalid_type,expected:g.array,received:n.parsedType}),x;if(n.data.length<this._def.items.length)return m(n,{code:l.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&n.data.length>this._def.items.length&&(m(n,{code:l.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((i,o)=>{const d=this._def.items[o]||this._def.rest;return d?d._parse(new ye(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>ee.mergeArray(r,i)):ee.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new hn({...this._def,rest:e})}};Fe.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fe({items:t,typeName:w.ZodTuple,rest:null,...T(e)})};let $r=class extends Z{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.map)return m(n,{code:l.invalid_type,expected:g.map,received:n.parsedType}),x;const a=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([o,d],u)=>({key:a._parse(new ye(n,o,n.path,[u,"key"])),value:s._parse(new ye(n,d,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const d of i){const u=await d.key,c=await d.value;if(u.status==="aborted"||c.status==="aborted")return x;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(u.value,c.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const d of i){const u=d.key,c=d.value;if(u.status==="aborted"||c.status==="aborted")return x;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(u.value,c.value)}return{status:r.value,value:o}}}};$r.create=(t,e,r)=>new $r({valueType:e,keyType:t,typeName:w.ZodMap,...T(r)});let jr=class Gt extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==g.set)return m(n,{code:l.invalid_type,expected:g.set,received:n.parsedType}),x;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(m(n,{code:l.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(m(n,{code:l.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const s=this._def.valueType;function i(d){const u=new Set;for(const c of d){if(c.status==="aborted")return x;c.status==="dirty"&&r.dirty(),u.add(c.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((d,u)=>s._parse(new ye(n,d,n.path,u)));return n.common.async?Promise.all(o).then(d=>i(d)):i(o)}min(e,r){return new Gt({...this._def,minSize:{value:e,message:b.toString(r)}})}max(e,r){return new Gt({...this._def,maxSize:{value:e,message:b.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};jr.create=(t,e)=>new jr({valueType:t,minSize:null,maxSize:null,typeName:w.ZodSet,...T(e)});let wt=class extends Z{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};wt.create=(t,e)=>new wt({getter:t,typeName:w.ZodLazy,...T(e)});let Kt=class extends Z{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return m(r,{received:r.data,code:l.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}};Kt.create=(t,e)=>new Kt({value:t,typeName:w.ZodLiteral,...T(e)});function mn(t,e){return new It({values:t,typeName:w.ZodEnum,...T(e)})}let It=class Xt extends Z{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return m(r,{expected:E.joinValues(n),received:r.parsedType,code:l.invalid_type}),x}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return m(r,{received:r.data,code:l.invalid_enum_value,options:n}),x}return G(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Xt.create(e,{...this._def,...r})}exclude(e,r=this._def){return Xt.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};It.create=mn;let Qt=class extends Z{_parse(e){const r=E.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==g.string&&n.parsedType!==g.number){const a=E.objectValues(r);return m(n,{expected:E.joinValues(a),received:n.parsedType,code:l.invalid_type}),x}if(this._cache||(this._cache=new Set(E.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=E.objectValues(r);return m(n,{received:n.data,code:l.invalid_enum_value,options:a}),x}return G(e.data)}get enum(){return this._def.values}};Qt.create=(t,e)=>new Qt({values:t,typeName:w.ZodNativeEnum,...T(e)});let Ot=class extends Z{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==g.promise&&r.common.async===!1)return m(r,{code:l.invalid_type,expected:g.promise,received:r.parsedType}),x;const n=r.parsedType===g.promise?r.data:Promise.resolve(r.data);return G(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Ot.create=(t,e)=>new Ot({type:t,typeName:w.ZodPromise,...T(e)});let _e=class extends Z{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===w.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:i=>{m(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const i=a.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return x;const d=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return d.status==="aborted"?x:d.status==="dirty"||r.value==="dirty"?rt(d.value):d});{if(r.value==="aborted")return x;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?x:o.status==="dirty"||r.value==="dirty"?rt(o.value):o}}if(a.type==="refinement"){const i=o=>{const d=a.refinement(o,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?x:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?x:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!ze(i))return x;const o=a.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>ze(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:r.value,value:o})):x);E.assertNever(a)}};_e.create=(t,e,r)=>new _e({schema:t,typeName:w.ZodEffects,effect:e,...T(r)});_e.createWithPreprocess=(t,e,r)=>new _e({schema:e,effect:{type:"preprocess",transform:t},typeName:w.ZodEffects,...T(r)});let re=class extends Z{_parse(e){return this._getType(e)===g.undefined?G(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};re.create=(t,e)=>new re({innerType:t,typeName:w.ZodOptional,...T(e)});let be=class extends Z{_parse(e){return this._getType(e)===g.null?G(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};be.create=(t,e)=>new be({innerType:t,typeName:w.ZodNullable,...T(e)});let lt=class extends Z{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===g.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};lt.create=(t,e)=>new lt({innerType:t,typeName:w.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...T(e)});let ft=class extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return xt(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ae(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new Ae(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};ft.create=(t,e)=>new ft({innerType:t,typeName:w.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...T(e)});let Rr=class extends Z{_parse(e){if(this._getType(e)!==g.nan){const n=this._getOrReturnCtx(e);return m(n,{code:l.invalid_type,expected:g.nan,received:n.parsedType}),x}return{status:"valid",value:e.data}}};Rr.create=t=>new Rr({typeName:w.ZodNaN,...T(t)});let cr=class extends Z{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},pn=class vn extends Z{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?x:s.status==="dirty"?(r.dirty(),rt(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?x:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new vn({in:e,out:r,typeName:w.ZodPipeline})}},St=class extends Z{_parse(e){const r=this._def.innerType._parse(e),n=a=>(ze(a)&&(a.value=Object.freeze(a.value)),a);return xt(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}};St.create=(t,e)=>new St({innerType:t,typeName:w.ZodReadonly,...T(e)});var w;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(w||(w={}));const je=Jt.create;ge.create;Ne.create;ut.create;ct.create;Fe.create;const za=wt.create;It.create;Ot.create;re.create;be.create;function tt(t){if(typeof t!="string")return t;if(t!=="")return t}function Fa(t){if(!(typeof File<"u"&&t instanceof File&&t.name===""&&t.size===0))return t}function Ua(t){return typeof t!="string"||t.trim()===""?t:Number(t)}function Ba(t){return typeof t!="string"?t:t==="on"?!0:t}function Wa(t){if(typeof t!="string")return t;var e=new Date(t);return isNaN(e.getTime())?t:e}function qa(t){if(typeof t!="string"||t.trim()==="")return t;try{return BigInt(t)}catch{return t}}function Ha(t){return typeof File>"u"?!1:t._def.effect.type==="refinement"&&t.innerType()._def.typeName==="ZodAny"&&t.safeParse(new File([],"")).success&&!t.safeParse("").success}function Ce(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:n=>n;return n=>r(e(t(n)))}function Ja(t,e){var r=t._def;if(r.typeName==="ZodString"||r.typeName==="ZodEnum"||r.typeName==="ZodNativeEnum")return e.string;if(r.typeName==="ZodLiteral"){var n=t.value;return typeof n=="number"?e.number:typeof n=="boolean"?e.boolean:typeof n=="bigint"?e.bigint:e.string}else{if(r.typeName==="ZodEffects"&&Ha(t))return e.file;if(r.typeName==="ZodNumber")return e.number;if(r.typeName==="ZodBoolean")return e.boolean;if(r.typeName==="ZodDate")return e.date;if(r.typeName==="ZodBigInt")return e.bigint}return null}function B(t,e){var r=e.cache.get(t);if(r)return r;var n=t,a=t._def,s=e.coerce(t);if(s)n=je().transform(s).pipe(t);else if(a.typeName==="ZodArray")n=je().transform(d=>Array.isArray(d)?d:typeof d>"u"||typeof e.stripEmptyValue(d)>"u"?[]:[d]).pipe(new Ne(j(j({},a),{},{type:B(a.type,e)})));else if(a.typeName==="ZodObject")n=je().transform(d=>typeof d>"u"?{}:d).pipe(new ie(j(j({},a),{},{shape:()=>Object.fromEntries(Object.entries(a.shape()).map(d=>{var[u,c]=d;return[u,B(c,e)]}))})));else if(a.typeName==="ZodEffects")n=new _e(j(j({},a),{},{schema:B(a.schema,e)}));else if(a.typeName==="ZodOptional")n=je().transform(e.stripEmptyValue).pipe(new re(j(j({},a),{},{innerType:B(a.innerType,e)})));else if(a.typeName==="ZodDefault"){var i=a.defaultValue();n=je().transform(e.stripEmptyValue).pipe(new lt(j(j({},a),{},{innerType:i!==""?B(a.innerType,e):a.innerType})))}else if(a.typeName==="ZodCatch")n=new ft(j(j({},a),{},{innerType:B(a.innerType,e)}));else if(a.typeName==="ZodIntersection")n=new ct(j(j({},a),{},{left:B(a.left,e),right:B(a.right,e)}));else if(a.typeName==="ZodUnion")n=new ut(j(j({},a),{},{options:a.options.map(d=>B(d,e))}));else if(a.typeName==="ZodDiscriminatedUnion")n=je().transform(d=>typeof d>"u"?{}:d).pipe(new ur(j(j({},a),{},{options:a.options.map(d=>B(d,e)),optionsMap:new Map(Array.from(a.optionsMap.entries()).map(d=>{var[u,c]=d;return[u,B(c,e)]}))})));else if(a.typeName==="ZodBranded")n=new cr(j(j({},a),{},{type:B(a.type,e)}));else if(a.typeName==="ZodTuple")n=new Fe(j(j({},a),{},{items:a.items.map(d=>B(d,e))}));else if(a.typeName==="ZodNullable")n=new be(j(j({},a),{},{innerType:B(a.innerType,e)}));else if(a.typeName==="ZodPipeline")n=new pn(j(j({},a),{},{in:B(a.in,e),out:B(a.out,e)}));else if(a.typeName==="ZodLazy"){var o=a.getter();n=za(()=>B(o,e))}return t!==n&&e.cache.set(t,n),n}function Ya(t,e){var r=(a,s)=>s||(i=>i),n={string:Ce(tt,r()),file:Ce(Fa,r()),number:Ce(tt,r(),r("number",Ua)),boolean:Ce(tt,r(),r("boolean",Ba)),date:Ce(tt,r(),r("date",Wa)),bigint:Ce(tt,r(),r("bigint",qa))};return B(t,{cache:new Map,stripEmptyValue:Ce(n.string,n.file),coerce:a=>{var s,i=(s=void 0)!==null&&s!==void 0?s:null;return i===null&&(i=Ja(a,n)),i}})}function Ga(t,e){var r={};for(var n of t.errors){var a=Le(n.path);switch(n.message){case Pr.VALIDATION_UNDEFINED:return null;case Pr.VALIDATION_SKIPPED:r[a]=null;break;default:{var s=r[a];s!==null&&(s?r[a]=s.concat(n):r[a]=[n]);break}}}return Object.entries(r).reduce((i,o)=>{var[d,u]=o;return i[d]=u?e(u):null,i},{})}function Ka(t,e){return Fn(t,{resolve(r,n){var a=e.errorMap,s=typeof e.schema=="function"?e.schema(n):e.schema,i=e.disableAutoCoercion?s:Ya(s),o=d=>{var u;return{value:d.success?d.data:void 0,error:d.success?void 0:Ga(d.error,(u=e.formatError)!==null&&u!==void 0?u:c=>c.map(C=>C.message))}};return e.async?i.safeParseAsync(r,{errorMap:a}).then(d=>o(d)):o(i.safeParse(r,{errorMap:a}))}})}var Pr={VALIDATION_SKIPPED:"__skipped__",VALIDATION_UNDEFINED:"__undefined__"},$;(function(t){t.assertEqual=a=>{};function e(a){}t.assertIs=e;function r(a){throw new Error}t.assertNever=r,t.arrayToEnum=a=>{const s={};for(const i of a)s[i]=i;return s},t.getValidEnumValues=a=>{const s=t.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),i={};for(const o of s)i[o]=a[o];return t.objectValues(i)},t.objectValues=a=>t.objectKeys(a).map(function(s){return a[s]}),t.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{const s=[];for(const i in a)Object.prototype.hasOwnProperty.call(a,i)&&s.push(i);return s},t.find=(a,s)=>{for(const i of a)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,s=" | "){return a.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=n,t.jsonStringifyReplacer=(a,s)=>typeof s=="bigint"?s.toString():s})($||($={}));var Vr;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Vr||(Vr={}));const _=$.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),le=t=>{switch(typeof t){case"undefined":return _.undefined;case"string":return _.string;case"number":return Number.isNaN(t)?_.nan:_.number;case"boolean":return _.boolean;case"function":return _.function;case"bigint":return _.bigint;case"symbol":return _.symbol;case"object":return Array.isArray(t)?_.array:t===null?_.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?_.promise:typeof Map<"u"&&t instanceof Map?_.map:typeof Set<"u"&&t instanceof Set?_.set:typeof Date<"u"&&t instanceof Date?_.date:_.object;default:return _.unknown}},f=$.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class oe extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(s){return s.message},n={_errors:[]},a=s=>{for(const i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(a);else if(i.code==="invalid_return_type")a(i.returnTypeError);else if(i.code==="invalid_arguments")a(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let o=n,d=0;for(;d<i.path.length;){const u=i.path[d];d===i.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(i))):o[u]=o[u]||{_errors:[]},o=o[u],d++}}};return a(this),n}static assert(e){if(!(e instanceof oe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,$.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r=Object.create(null),n=[];for(const a of this.issues)if(a.path.length>0){const s=a.path[0];r[s]=r[s]||[],r[s].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}oe.create=t=>new oe(t);const er=(t,e)=>{let r;switch(t.code){case f.invalid_type:t.received===_.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case f.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,$.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:r=`Unrecognized key(s) in object: ${$.joinValues(t.keys,", ")}`;break;case f.invalid_union:r="Invalid input";break;case f.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${$.joinValues(t.options)}`;break;case f.invalid_enum_value:r=`Invalid enum value. Expected ${$.joinValues(t.options)}, received '${t.received}'`;break;case f.invalid_arguments:r="Invalid function arguments";break;case f.invalid_return_type:r="Invalid function return type";break;case f.invalid_date:r="Invalid date";break;case f.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:$.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case f.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case f.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case f.custom:r="Invalid input";break;case f.invalid_intersection_types:r="Intersection results could not be merged";break;case f.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case f.not_finite:r="Number must be finite";break;default:r=e.defaultError,$.assertNever(t)}return{message:r}};let Xa=er;function Qa(){return Xa}const es=t=>{const{data:e,path:r,errorMaps:n,issueData:a}=t,s=[...r,...a.path||[]],i={...a,path:s};if(a.message!==void 0)return{...a,path:s,message:a.message};let o="";const d=n.filter(u=>!!u).slice().reverse();for(const u of d)o=u(i,{data:e,defaultError:o}).message;return{...a,path:s,message:o}};function v(t,e){const r=Qa(),n=es({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===er?void 0:er].filter(a=>!!a)});t.common.issues.push(n)}class H{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const a of r){if(a.status==="aborted")return O;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const a of r){const s=await a.key,i=await a.value;n.push({key:s,value:i})}return H.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const a of r){const{key:s,value:i}=a;if(s.status==="aborted"||i.status==="aborted")return O;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||a.alwaysSet)&&(n[s.value]=i.value)}return{status:e.value,value:n}}}const O=Object.freeze({status:"aborted"}),at=t=>({status:"dirty",value:t}),K=t=>({status:"valid",value:t}),Lr=t=>t.status==="aborted",Mr=t=>t.status==="dirty",Ue=t=>t.status==="valid",Ct=t=>typeof Promise<"u"&&t instanceof Promise;var k;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(k||(k={}));class ke{constructor(e,r,n,a){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const Dr=(t,e)=>{if(Ue(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new oe(t.common.issues);return this._error=r,this._error}}};function A(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:a}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(i,o)=>{const{message:d}=t;return i.code==="invalid_enum_value"?{message:d??o.defaultError}:typeof o.data>"u"?{message:d??n??o.defaultError}:i.code!=="invalid_type"?{message:o.defaultError}:{message:d??r??o.defaultError}},description:a}}class I{get description(){return this._def.description}_getType(e){return le(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new H,ctx:{common:e.parent.common,data:e.data,parsedType:le(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(Ct(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:le(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Dr(n,a)}"~validate"(e){const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:le(e)};if(!this["~standard"].async)try{const n=this._parseSync({data:e,path:[],parent:r});return Ue(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>Ue(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:le(e)},a=this._parse({data:e,path:n.path,parent:n}),s=await(Ct(a)?a:Promise.resolve(a));return Dr(n,s)}refine(e,r){const n=a=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(a):r;return this._refinement((a,s)=>{const i=e(a),o=()=>s.addIssue({code:f.custom,...n(a)});return typeof Promise<"u"&&i instanceof Promise?i.then(d=>d?!0:(o(),!1)):i?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof r=="function"?r(n,a):r),!1))}_refinement(e){return new We({schema:this,typeName:S.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return fe.create(this,this._def)}nullable(){return qe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ne.create(this)}promise(){return Zt.create(this,this._def)}or(e){return At.create([this,e],this._def)}and(e){return Nt.create(this,e,this._def)}transform(e){return new We({...A(this._def),schema:this,typeName:S.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new rr({...A(this._def),innerType:this,defaultValue:r,typeName:S.ZodDefault})}brand(){return new ws({typeName:S.ZodBranded,type:this,...A(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new nr({...A(this._def),innerType:this,catchValue:r,typeName:S.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return lr.create(this,e)}readonly(){return ar.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const ts=/^c[^\s-]{8,}$/i,rs=/^[0-9a-z]+$/,ns=/^[0-9A-HJKMNP-TV-Z]{26}$/i,as=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,ss=/^[a-z0-9_-]{21}$/i,is=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,os=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,ds=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,us="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Mt;const cs=/^(?:(?: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])$/,ls=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,fs=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,hs=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ms=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ps=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,yn="((\\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])))",vs=new RegExp(`^${yn}$`);function gn(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function ys(t){return new RegExp(`^${gn(t)}$`)}function gs(t){let e=`${yn}T${gn(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function _s(t,e){return!!((e==="v4"||!e)&&cs.test(t)||(e==="v6"||!e)&&fs.test(t))}function bs(t,e){if(!is.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&a?.typ!=="JWT"||!a.alg||e&&a.alg!==e)}catch{return!1}}function ks(t,e){return!!((e==="v4"||!e)&&ls.test(t)||(e==="v6"||!e)&&hs.test(t))}class Te extends I{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==_.string){const s=this._getOrReturnCtx(e);return v(s,{code:f.invalid_type,expected:_.string,received:s.parsedType}),O}const n=new H;let a;for(const s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:f.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="max")e.data.length>s.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:f.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),n.dirty());else if(s.kind==="length"){const i=e.data.length>s.value,o=e.data.length<s.value;(i||o)&&(a=this._getOrReturnCtx(e,a),i?v(a,{code:f.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):o&&v(a,{code:f.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),n.dirty())}else if(s.kind==="email")ds.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"email",code:f.invalid_string,message:s.message}),n.dirty());else if(s.kind==="emoji")Mt||(Mt=new RegExp(us,"u")),Mt.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"emoji",code:f.invalid_string,message:s.message}),n.dirty());else if(s.kind==="uuid")as.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"uuid",code:f.invalid_string,message:s.message}),n.dirty());else if(s.kind==="nanoid")ss.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"nanoid",code:f.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid")ts.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid",code:f.invalid_string,message:s.message}),n.dirty());else if(s.kind==="cuid2")rs.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid2",code:f.invalid_string,message:s.message}),n.dirty());else if(s.kind==="ulid")ns.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ulid",code:f.invalid_string,message:s.message}),n.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),v(a,{validation:"url",code:f.invalid_string,message:s.message}),n.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"regex",code:f.invalid_string,message:s.message}),n.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(a=this._getOrReturnCtx(e,a),v(a,{code:f.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),n.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:f.invalid_string,validation:{startsWith:s.value},message:s.message}),n.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:f.invalid_string,validation:{endsWith:s.value},message:s.message}),n.dirty()):s.kind==="datetime"?gs(s).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:f.invalid_string,validation:"datetime",message:s.message}),n.dirty()):s.kind==="date"?vs.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:f.invalid_string,validation:"date",message:s.message}),n.dirty()):s.kind==="time"?ys(s).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:f.invalid_string,validation:"time",message:s.message}),n.dirty()):s.kind==="duration"?os.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"duration",code:f.invalid_string,message:s.message}),n.dirty()):s.kind==="ip"?_s(e.data,s.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ip",code:f.invalid_string,message:s.message}),n.dirty()):s.kind==="jwt"?bs(e.data,s.alg)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"jwt",code:f.invalid_string,message:s.message}),n.dirty()):s.kind==="cidr"?ks(e.data,s.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cidr",code:f.invalid_string,message:s.message}),n.dirty()):s.kind==="base64"?ms.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64",code:f.invalid_string,message:s.message}),n.dirty()):s.kind==="base64url"?ps.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64url",code:f.invalid_string,message:s.message}),n.dirty()):$.assertNever(s);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(a=>e.test(a),{validation:r,code:f.invalid_string,...k.errToObj(n)})}_addCheck(e){return new Te({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...k.errToObj(e)})}url(e){return this._addCheck({kind:"url",...k.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...k.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...k.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...k.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...k.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...k.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...k.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...k.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...k.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...k.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...k.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...k.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...k.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...k.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...k.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...k.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...k.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...k.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...k.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...k.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...k.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...k.errToObj(r)})}nonempty(e){return this.min(1,k.errToObj(e))}trim(){return new Te({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Te({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Te({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Te.create=t=>new Te({checks:[],typeName:S.ZodString,coerce:t?.coerce??!1,...A(t)});function xs(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=r>n?r:n,s=Number.parseInt(t.toFixed(a).replace(".","")),i=Number.parseInt(e.toFixed(a).replace(".",""));return s%i/10**a}class ht extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==_.number){const s=this._getOrReturnCtx(e);return v(s,{code:f.invalid_type,expected:_.number,received:s.parsedType}),O}let n;const a=new H;for(const s of this._def.checks)s.kind==="int"?$.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:f.invalid_type,expected:"integer",received:"float",message:s.message}),a.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:f.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:f.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),a.dirty()):s.kind==="multipleOf"?xs(e.data,s.value)!==0&&(n=this._getOrReturnCtx(e,n),v(n,{code:f.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:f.not_finite,message:s.message}),a.dirty()):$.assertNever(s);return{status:a.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,k.toString(r))}gt(e,r){return this.setLimit("min",e,!1,k.toString(r))}lte(e,r){return this.setLimit("max",e,!0,k.toString(r))}lt(e,r){return this.setLimit("max",e,!1,k.toString(r))}setLimit(e,r,n,a){return new ht({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:k.toString(a)}]})}_addCheck(e){return new ht({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:k.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:k.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:k.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:k.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:k.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&$.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}ht.create=t=>new ht({checks:[],typeName:S.ZodNumber,coerce:t?.coerce||!1,...A(t)});class mt extends I{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==_.bigint)return this._getInvalidInput(e);let n;const a=new H;for(const s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:f.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:f.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),a.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),v(n,{code:f.not_multiple_of,multipleOf:s.value,message:s.message}),a.dirty()):$.assertNever(s);return{status:a.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return v(r,{code:f.invalid_type,expected:_.bigint,received:r.parsedType}),O}gte(e,r){return this.setLimit("min",e,!0,k.toString(r))}gt(e,r){return this.setLimit("min",e,!1,k.toString(r))}lte(e,r){return this.setLimit("max",e,!0,k.toString(r))}lt(e,r){return this.setLimit("max",e,!1,k.toString(r))}setLimit(e,r,n,a){return new mt({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:k.toString(a)}]})}_addCheck(e){return new mt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:k.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:k.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:k.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:k.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:k.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}mt.create=t=>new mt({checks:[],typeName:S.ZodBigInt,coerce:t?.coerce??!1,...A(t)});class zr extends I{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==_.boolean){const n=this._getOrReturnCtx(e);return v(n,{code:f.invalid_type,expected:_.boolean,received:n.parsedType}),O}return K(e.data)}}zr.create=t=>new zr({typeName:S.ZodBoolean,coerce:t?.coerce||!1,...A(t)});class Tt extends I{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==_.date){const s=this._getOrReturnCtx(e);return v(s,{code:f.invalid_type,expected:_.date,received:s.parsedType}),O}if(Number.isNaN(e.data.getTime())){const s=this._getOrReturnCtx(e);return v(s,{code:f.invalid_date}),O}const n=new H;let a;for(const s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:f.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),n.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:f.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),n.dirty()):$.assertNever(s);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new Tt({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:k.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:k.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}Tt.create=t=>new Tt({checks:[],coerce:t?.coerce||!1,typeName:S.ZodDate,...A(t)});class Fr extends I{_parse(e){if(this._getType(e)!==_.symbol){const n=this._getOrReturnCtx(e);return v(n,{code:f.invalid_type,expected:_.symbol,received:n.parsedType}),O}return K(e.data)}}Fr.create=t=>new Fr({typeName:S.ZodSymbol,...A(t)});class Ur extends I{_parse(e){if(this._getType(e)!==_.undefined){const n=this._getOrReturnCtx(e);return v(n,{code:f.invalid_type,expected:_.undefined,received:n.parsedType}),O}return K(e.data)}}Ur.create=t=>new Ur({typeName:S.ZodUndefined,...A(t)});class Br extends I{_parse(e){if(this._getType(e)!==_.null){const n=this._getOrReturnCtx(e);return v(n,{code:f.invalid_type,expected:_.null,received:n.parsedType}),O}return K(e.data)}}Br.create=t=>new Br({typeName:S.ZodNull,...A(t)});class Wr extends I{constructor(){super(...arguments),this._any=!0}_parse(e){return K(e.data)}}Wr.create=t=>new Wr({typeName:S.ZodAny,...A(t)});class qr extends I{constructor(){super(...arguments),this._unknown=!0}_parse(e){return K(e.data)}}qr.create=t=>new qr({typeName:S.ZodUnknown,...A(t)});class xe extends I{_parse(e){const r=this._getOrReturnCtx(e);return v(r,{code:f.invalid_type,expected:_.never,received:r.parsedType}),O}}xe.create=t=>new xe({typeName:S.ZodNever,...A(t)});class Hr extends I{_parse(e){if(this._getType(e)!==_.undefined){const n=this._getOrReturnCtx(e);return v(n,{code:f.invalid_type,expected:_.void,received:n.parsedType}),O}return K(e.data)}}Hr.create=t=>new Hr({typeName:S.ZodVoid,...A(t)});class ne extends I{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),a=this._def;if(r.parsedType!==_.array)return v(r,{code:f.invalid_type,expected:_.array,received:r.parsedType}),O;if(a.exactLength!==null){const i=r.data.length>a.exactLength.value,o=r.data.length<a.exactLength.value;(i||o)&&(v(r,{code:i?f.too_big:f.too_small,minimum:o?a.exactLength.value:void 0,maximum:i?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&r.data.length<a.minLength.value&&(v(r,{code:f.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&r.data.length>a.maxLength.value&&(v(r,{code:f.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,o)=>a.type._parseAsync(new ke(r,i,r.path,o)))).then(i=>H.mergeArray(n,i));const s=[...r.data].map((i,o)=>a.type._parseSync(new ke(r,i,r.path,o)));return H.mergeArray(n,s)}get element(){return this._def.type}min(e,r){return new ne({...this._def,minLength:{value:e,message:k.toString(r)}})}max(e,r){return new ne({...this._def,maxLength:{value:e,message:k.toString(r)}})}length(e,r){return new ne({...this._def,exactLength:{value:e,message:k.toString(r)}})}nonempty(e){return this.min(1,e)}}ne.create=(t,e)=>new ne({type:t,minLength:null,maxLength:null,exactLength:null,typeName:S.ZodArray,...A(e)});function Pe(t){if(t instanceof F){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=fe.create(Pe(n))}return new F({...t._def,shape:()=>e})}else return t instanceof ne?new ne({...t._def,type:Pe(t.element)}):t instanceof fe?fe.create(Pe(t.unwrap())):t instanceof qe?qe.create(Pe(t.unwrap())):t instanceof Ze?Ze.create(t.items.map(e=>Pe(e))):t}class F extends I{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=$.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==_.object){const u=this._getOrReturnCtx(e);return v(u,{code:f.invalid_type,expected:_.object,received:u.parsedType}),O}const{status:n,ctx:a}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof xe&&this._def.unknownKeys==="strip"))for(const u in a.data)i.includes(u)||o.push(u);const d=[];for(const u of i){const c=s[u],C=a.data[u];d.push({key:{status:"valid",value:u},value:c._parse(new ke(a,C,a.path,u)),alwaysSet:u in a.data})}if(this._def.catchall instanceof xe){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of o)d.push({key:{status:"valid",value:c},value:{status:"valid",value:a.data[c]}});else if(u==="strict")o.length>0&&(v(a,{code:f.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of o){const C=a.data[c];d.push({key:{status:"valid",value:c},value:u._parse(new ke(a,C,a.path,c)),alwaysSet:c in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of d){const C=await c.key,P=await c.value;u.push({key:C,value:P,alwaysSet:c.alwaysSet})}return u}).then(u=>H.mergeObjectSync(n,u)):H.mergeObjectSync(n,d)}get shape(){return this._def.shape()}strict(e){return k.errToObj,new F({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{const a=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:k.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new F({...this._def,unknownKeys:"strip"})}passthrough(){return new F({...this._def,unknownKeys:"passthrough"})}extend(e){return new F({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new F({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:S.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new F({...this._def,catchall:e})}pick(e){const r={};for(const n of $.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new F({...this._def,shape:()=>r})}omit(e){const r={};for(const n of $.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new F({...this._def,shape:()=>r})}deepPartial(){return Pe(this)}partial(e){const r={};for(const n of $.objectKeys(this.shape)){const a=this.shape[n];e&&!e[n]?r[n]=a:r[n]=a.optional()}return new F({...this._def,shape:()=>r})}required(e){const r={};for(const n of $.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let s=this.shape[n];for(;s instanceof fe;)s=s._def.innerType;r[n]=s}return new F({...this._def,shape:()=>r})}keyof(){return _n($.objectKeys(this.shape))}}F.create=(t,e)=>new F({shape:()=>t,unknownKeys:"strip",catchall:xe.create(),typeName:S.ZodObject,...A(e)});F.strictCreate=(t,e)=>new F({shape:()=>t,unknownKeys:"strict",catchall:xe.create(),typeName:S.ZodObject,...A(e)});F.lazycreate=(t,e)=>new F({shape:t,unknownKeys:"strip",catchall:xe.create(),typeName:S.ZodObject,...A(e)});class At extends I{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function a(s){for(const o of s)if(o.result.status==="valid")return o.result;for(const o of s)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const i=s.map(o=>new oe(o.ctx.common.issues));return v(r,{code:f.invalid_union,unionErrors:i}),O}if(r.common.async)return Promise.all(n.map(async s=>{const i={...r,common:{...r.common,issues:[]},parent:null};return{result:await s._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}})).then(a);{let s;const i=[];for(const d of n){const u={...r,common:{...r.common,issues:[]},parent:null},c=d._parseSync({data:r.data,path:r.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!s&&(s={result:c,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return r.common.issues.push(...s.ctx.common.issues),s.result;const o=i.map(d=>new oe(d));return v(r,{code:f.invalid_union,unionErrors:o}),O}}get options(){return this._def.options}}At.create=(t,e)=>new At({options:t,typeName:S.ZodUnion,...A(e)});function tr(t,e){const r=le(t),n=le(e);if(t===e)return{valid:!0,data:t};if(r===_.object&&n===_.object){const a=$.objectKeys(e),s=$.objectKeys(t).filter(o=>a.indexOf(o)!==-1),i={...t,...e};for(const o of s){const d=tr(t[o],e[o]);if(!d.valid)return{valid:!1};i[o]=d.data}return{valid:!0,data:i}}else if(r===_.array&&n===_.array){if(t.length!==e.length)return{valid:!1};const a=[];for(let s=0;s<t.length;s++){const i=t[s],o=e[s],d=tr(i,o);if(!d.valid)return{valid:!1};a.push(d.data)}return{valid:!0,data:a}}else return r===_.date&&n===_.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class Nt extends I{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=(s,i)=>{if(Lr(s)||Lr(i))return O;const o=tr(s.value,i.value);return o.valid?((Mr(s)||Mr(i))&&r.dirty(),{status:r.value,value:o.data}):(v(n,{code:f.invalid_intersection_types}),O)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([s,i])=>a(s,i)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Nt.create=(t,e,r)=>new Nt({left:t,right:e,typeName:S.ZodIntersection,...A(r)});class Ze extends I{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.array)return v(n,{code:f.invalid_type,expected:_.array,received:n.parsedType}),O;if(n.data.length<this._def.items.length)return v(n,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),O;!this._def.rest&&n.data.length>this._def.items.length&&(v(n,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const s=[...n.data].map((i,o)=>{const d=this._def.items[o]||this._def.rest;return d?d._parse(new ke(n,i,n.path,o)):null}).filter(i=>!!i);return n.common.async?Promise.all(s).then(i=>H.mergeArray(r,i)):H.mergeArray(r,s)}get items(){return this._def.items}rest(e){return new Ze({...this._def,rest:e})}}Ze.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Ze({items:t,typeName:S.ZodTuple,rest:null,...A(e)})};class Jr extends I{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.map)return v(n,{code:f.invalid_type,expected:_.map,received:n.parsedType}),O;const a=this._def.keyType,s=this._def.valueType,i=[...n.data.entries()].map(([o,d],u)=>({key:a._parse(new ke(n,o,n.path,[u,"key"])),value:s._parse(new ke(n,d,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const d of i){const u=await d.key,c=await d.value;if(u.status==="aborted"||c.status==="aborted")return O;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(u.value,c.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const d of i){const u=d.key,c=d.value;if(u.status==="aborted"||c.status==="aborted")return O;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(u.value,c.value)}return{status:r.value,value:o}}}}Jr.create=(t,e,r)=>new Jr({valueType:e,keyType:t,typeName:S.ZodMap,...A(r)});class pt extends I{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==_.set)return v(n,{code:f.invalid_type,expected:_.set,received:n.parsedType}),O;const a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(v(n,{code:f.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),r.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(v(n,{code:f.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),r.dirty());const s=this._def.valueType;function i(d){const u=new Set;for(const c of d){if(c.status==="aborted")return O;c.status==="dirty"&&r.dirty(),u.add(c.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((d,u)=>s._parse(new ke(n,d,n.path,u)));return n.common.async?Promise.all(o).then(d=>i(d)):i(o)}min(e,r){return new pt({...this._def,minSize:{value:e,message:k.toString(r)}})}max(e,r){return new pt({...this._def,maxSize:{value:e,message:k.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}pt.create=(t,e)=>new pt({valueType:t,minSize:null,maxSize:null,typeName:S.ZodSet,...A(e)});class Yr extends I{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}Yr.create=(t,e)=>new Yr({getter:t,typeName:S.ZodLazy,...A(e)});class Gr extends I{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return v(r,{received:r.data,code:f.invalid_literal,expected:this._def.value}),O}return{status:"valid",value:e.data}}get value(){return this._def.value}}Gr.create=(t,e)=>new Gr({value:t,typeName:S.ZodLiteral,...A(e)});function _n(t,e){return new Be({values:t,typeName:S.ZodEnum,...A(e)})}class Be extends I{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return v(r,{expected:$.joinValues(n),received:r.parsedType,code:f.invalid_type}),O}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return v(r,{received:r.data,code:f.invalid_enum_value,options:n}),O}return K(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return Be.create(e,{...this._def,...r})}exclude(e,r=this._def){return Be.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}Be.create=_n;class Kr extends I{_parse(e){const r=$.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==_.string&&n.parsedType!==_.number){const a=$.objectValues(r);return v(n,{expected:$.joinValues(a),received:n.parsedType,code:f.invalid_type}),O}if(this._cache||(this._cache=new Set($.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const a=$.objectValues(r);return v(n,{received:n.data,code:f.invalid_enum_value,options:a}),O}return K(e.data)}get enum(){return this._def.values}}Kr.create=(t,e)=>new Kr({values:t,typeName:S.ZodNativeEnum,...A(e)});class Zt extends I{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==_.promise&&r.common.async===!1)return v(r,{code:f.invalid_type,expected:_.promise,received:r.parsedType}),O;const n=r.parsedType===_.promise?r.data:Promise.resolve(r.data);return K(n.then(a=>this._def.type.parseAsync(a,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Zt.create=(t,e)=>new Zt({type:t,typeName:S.ZodPromise,...A(e)});class We extends I{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===S.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),a=this._def.effect||null,s={addIssue:i=>{v(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),a.type==="preprocess"){const i=a.transform(n.data,s);if(n.common.async)return Promise.resolve(i).then(async o=>{if(r.value==="aborted")return O;const d=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return d.status==="aborted"?O:d.status==="dirty"||r.value==="dirty"?at(d.value):d});{if(r.value==="aborted")return O;const o=this._def.schema._parseSync({data:i,path:n.path,parent:n});return o.status==="aborted"?O:o.status==="dirty"||r.value==="dirty"?at(o.value):o}}if(a.type==="refinement"){const i=o=>{const d=a.refinement(o,s);if(n.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?O:(o.status==="dirty"&&r.dirty(),i(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?O:(o.status==="dirty"&&r.dirty(),i(o.value).then(()=>({status:r.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){const i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Ue(i))return O;const o=a.transform(i.value,s);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Ue(i)?Promise.resolve(a.transform(i.value,s)).then(o=>({status:r.value,value:o})):O);$.assertNever(a)}}We.create=(t,e,r)=>new We({schema:t,typeName:S.ZodEffects,effect:e,...A(r)});We.createWithPreprocess=(t,e,r)=>new We({schema:e,effect:{type:"preprocess",transform:t},typeName:S.ZodEffects,...A(r)});class fe extends I{_parse(e){return this._getType(e)===_.undefined?K(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}fe.create=(t,e)=>new fe({innerType:t,typeName:S.ZodOptional,...A(e)});class qe extends I{_parse(e){return this._getType(e)===_.null?K(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}qe.create=(t,e)=>new qe({innerType:t,typeName:S.ZodNullable,...A(e)});class rr extends I{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===_.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}rr.create=(t,e)=>new rr({innerType:t,typeName:S.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...A(e)});class nr extends I{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},a=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ct(a)?a.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new oe(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new oe(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}nr.create=(t,e)=>new nr({innerType:t,typeName:S.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...A(e)});class Xr extends I{_parse(e){if(this._getType(e)!==_.nan){const n=this._getOrReturnCtx(e);return v(n,{code:f.invalid_type,expected:_.nan,received:n.parsedType}),O}return{status:"valid",value:e.data}}}Xr.create=t=>new Xr({typeName:S.ZodNaN,...A(t)});class ws extends I{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class lr extends I{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const s=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?O:s.status==="dirty"?(r.dirty(),at(s.value)):this._def.out._parseAsync({data:s.value,path:n.path,parent:n})})();{const a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?O:a.status==="dirty"?(r.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,r){return new lr({in:e,out:r,typeName:S.ZodPipeline})}}class ar extends I{_parse(e){const r=this._def.innerType._parse(e),n=a=>(Ue(a)&&(a.value=Object.freeze(a.value)),a);return Ct(r)?r.then(a=>n(a)):n(r)}unwrap(){return this._def.innerType}}ar.create=(t,e)=>new ar({innerType:t,typeName:S.ZodReadonly,...A(e)});var S;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(S||(S={}));xe.create;ne.create;const Os=F.create;At.create;Nt.create;Ze.create;const Ss=Be.create;Zt.create;fe.create;qe.create;function Cs(t){function e(a,s){const i=t[s];if(!i)throw new Error(`Unknown client hint: ${typeof s=="string"?s:"Unknown"}`);const o=a.split(";").map(d=>d.trim()).find(d=>d.startsWith(i.cookieName+"="))?.split("=")[1];if(!o)return null;try{return decodeURIComponent(o)}catch(d){return console.warn(`Failed to decode cookie value for ${i.cookieName}:`,d),null}}function r(a){const s=typeof document<"u"?document.cookie:typeof a<"u"?a.headers.get("Cookie")??"":"";return Object.entries(t).reduce((i,[o,d])=>{const u=o;return"transform"in d?i[u]=d.transform(e(s,u)??d.fallback):i[u]=e(s,u)??d.fallback,i},{})}function n(){return`
2
- // This block of code allows us to check if the client hints have changed and
3
- // force a reload of the page with updated hints if they have so you don't get
4
- // a flash of incorrect content.
5
- function checkClientHints() {
6
- if (!navigator.cookieEnabled) return;
7
-
8
- // set a short-lived cookie to make sure we can set cookies
9
- document.cookie = "canSetCookies=1; Max-Age=60; SameSite=Lax; path=/";
10
- const canSetCookies = document.cookie.includes("canSetCookies=1");
11
- document.cookie = "canSetCookies=; Max-Age=-1; path=/";
12
- if (!canSetCookies) return;
13
-
14
- const cookies = document.cookie.split(';').map(c => c.trim()).reduce((acc, cur) => {
15
- const [key, value] = cur.split('=');
16
- acc[key] = value;
17
- return acc;
18
- }, {});
19
-
20
- let cookieChanged = false;
21
- const hints = [
22
- ${Object.values(t).map(a=>{const s=JSON.stringify(a.cookieName);return`{ name: ${s}, actual: String(${a.getValueCode}), value: cookies[${s}] != null ? cookies[${s}] : encodeURIComponent("${a.fallback}") }`}).join(`,
23
- `)}
24
- ];
25
-
26
- // Add safety check to prevent infinite refresh scenarios
27
- let reloadAttempts = parseInt(sessionStorage.getItem('clientHintReloadAttempts') || '0');
28
- if (reloadAttempts > 3) {
29
- console.warn('Too many client hint reload attempts, skipping reload to prevent infinite loop');
30
- return;
31
- }
32
-
33
- for (const hint of hints) {
34
- document.cookie = encodeURIComponent(hint.name) + '=' + encodeURIComponent(hint.actual) + '; Max-Age=31536000; SameSite=Lax; path=/';
35
-
36
- try {
37
- const decodedValue = decodeURIComponent(hint.value);
38
- if (decodedValue !== hint.actual) {
39
- cookieChanged = true;
40
- }
41
- } catch (error) {
42
- // Handle malformed URI gracefully
43
- console.warn('Failed to decode cookie value during client hint check:', error);
44
- // If we can't decode the value, assume it's different to be safe
45
- cookieChanged = true;
46
- }
47
- }
48
-
49
- if (cookieChanged) {
50
- // Increment reload attempts counter
51
- sessionStorage.setItem('clientHintReloadAttempts', String(reloadAttempts + 1));
52
-
53
- // Hide the page content immediately to prevent visual flicker
54
- const style = document.createElement('style');
55
- style.textContent = 'html { visibility: hidden !important; }';
56
- document.head.appendChild(style);
57
-
58
- // Trigger the reload
59
- window.location.reload();
60
- } else {
61
- // Reset reload attempts counter if no reload was needed
62
- sessionStorage.removeItem('clientHintReloadAttempts');
63
- }
64
- }
65
-
66
- checkClientHints();
67
- `}return{getHints:r,getClientHintCheckScript:n}}const bn={cookieName:"CH-prefers-color-scheme",getValueCode:"window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'",fallback:"light",transform(t){return t==="dark"?"dark":"light"}};function Ts(t,e=bn.cookieName){const r=window.matchMedia("(prefers-color-scheme: dark)");function n(){const a=r.matches?"dark":"light";document.cookie=`${e}=${a}; Max-Age=31536000; SameSite=Lax; Path=/`,t(a)}return r.addEventListener("change",n),function(){r.removeEventListener("change",n)}}const kn={cookieName:"CH-reduced-motion",getValueCode:"window.matchMedia('(prefers-reduced-motion: reduce)').matches ? 'reduce' : 'no-preference'",fallback:"no-preference",transform(t){return t==="reduce"?"reduce":"no-preference"}};function As(t,e=kn.cookieName){const r=window.matchMedia("(prefers-reduced-motion: reduce)");function n(){const a=r.matches?"reduce":"no-preference";document.cookie=`${e}=${a}; Max-Age=31536000; SameSite=Lax; Path=/`,t(a)}return r.addEventListener("change",n),function(){r.removeEventListener("change",n)}}const Ns={cookieName:"CH-time-zone",getValueCode:"Intl.DateTimeFormat().resolvedOptions().timeZone",fallback:"UTC"},xn="EpicShop_CH-prefers-color-scheme",wn="EpicShop_CH-reduced-motion",Zs=Cs({theme:{...bn,cookieName:xn},timeZone:{...Ns,cookieName:"EpicShop_CH-time-zone"},reducedMotion:{...kn,cookieName:wn}});function Es(){return sr().hints}function pi(){const{revalidate:t}=On();return Q.useEffect(()=>Ts(()=>t(),xn),[t]),Q.useEffect(()=>As(()=>t(),wn),[t]),Y.jsx("script",{dangerouslySetInnerHTML:{__html:Zs.getClientHintCheckScript()}})}function Is({id:t,errors:e}){const r=e?.filter(Boolean);return r?.length?Y.jsx("ul",{id:t,className:"space-y-1",children:r.map(n=>Y.jsx("li",{className:"text-foreground-destructive text-[10px]",children:n},n))}):null}const $s="/theme",js=Os({theme:Ss(["system","light","dark"])}),Rs=js,Ps=Ka;function vi(){const t=sr(),e=An(),r=Sn(),[n]=ca({lastResult:r.data,onValidate({formData:o}){return Ps(o,{schema:Rs})}}),a=t.session.theme??"system",s=a==="system"?"light":a==="light"?"dark":"system",i={light:Y.jsx(Rt,{size:"md",name:"Sun",title:"Light mode"}),dark:Y.jsx(Rt,{size:"md",name:"Moon",title:"Dark mode"}),system:Y.jsx(Rt,{size:"md",name:"Laptop",title:"System mode"})};return Y.jsxs(r.Form,{method:"POST",action:$s,...fa(n),children:[Y.jsxs("div",{className:"flex gap-2",children:[e,Y.jsx("input",{type:"hidden",name:"theme",value:s}),Y.jsx(Tn,{content:`Change theme from ${a} mode`,children:Y.jsx("button",{type:"submit",name:"intent",value:"update-theme",className:"flex h-8 w-8 cursor-pointer items-center justify-center",children:i[a]})})]}),Y.jsx(Is,{errors:n.errors,id:n.errorId})]})}function yi(){const t=Es(),e=sr(),a=Cn().find(s=>s.formData?.get("intent")==="update-theme")?.formData?.get("theme");return a==="system"?t.theme:a==="light"||a==="dark"?a:e.session.theme??t.theme}export{pi as C,vi as T,Es as a,yi as u};
68
- //# sourceMappingURL=index-Cg-9mI3Y.js.map