@marimo-team/frontend 0.13.16-dev73 → 0.13.16-dev76

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 (106) hide show
  1. package/dist/assets/ConnectedDataExplorerComponent-DygrhNea.js +19 -0
  2. package/dist/assets/{ImageComparisonComponent-DIyMmRWn.js → ImageComparisonComponent-CrY0mRYm.js} +1 -1
  3. package/dist/assets/VegaLite-C2PYUoKf.js +189 -0
  4. package/dist/assets/{_baseEach-BYWXNEbG.js → _baseEach-DRkvoR9Q.js} +1 -1
  5. package/dist/assets/_baseMap-DCyLkaAp.js +1 -0
  6. package/dist/assets/{_baseUniq-BbiRSJL5.js → _baseUniq-E7gEZPb0.js} +1 -1
  7. package/dist/assets/{_createAggregator-rpokZFiK.js → _createAggregator-CTXl5mi3.js} +1 -1
  8. package/dist/assets/{any-language-editor-BYK9dvUU.js → any-language-editor-DtRnBkb4.js} +1 -1
  9. package/dist/assets/architectureDiagram-IEHRJDOE-BCF8LCLJ.js +36 -0
  10. package/dist/assets/{blockDiagram-JOT3LUYC-Cw5hrvLf.js → blockDiagram-JOT3LUYC-D_bSQBSZ.js} +2 -2
  11. package/dist/assets/{c4Diagram-VJAJSXHY-BcvXM90c.js → c4Diagram-VJAJSXHY-DCec95Jv.js} +2 -2
  12. package/dist/assets/channel-ALX2KGBt.js +1 -0
  13. package/dist/assets/{chunk-4BMEZGHF-B0f4IZYk.js → chunk-4BMEZGHF-DjfNZybC.js} +1 -1
  14. package/dist/assets/{chunk-A2AXSNBT-CjZCh4KY.js → chunk-A2AXSNBT-BkoSpDSu.js} +1 -1
  15. package/dist/assets/{chunk-AEK57VVT-e_EJ6vv4.js → chunk-AEK57VVT-Cs_v-pbx.js} +1 -1
  16. package/dist/assets/{chunk-D6G4REZN-SHP1AEu6.js → chunk-D6G4REZN-7U1X8C4_.js} +1 -1
  17. package/dist/assets/{chunk-RZ5BOZE2-BkuNT_xq.js → chunk-RZ5BOZE2-BHAsdxCN.js} +1 -1
  18. package/dist/assets/{chunk-XZIHB7SX-CDHSRDvI.js → chunk-XZIHB7SX-rMWoJuKP.js} +1 -1
  19. package/dist/assets/{circle-play-Dp_Huf0t.js → circle-play-CoNNHqHV.js} +1 -1
  20. package/dist/assets/classDiagram-GIVACNV2-Csyx8kaD.js +1 -0
  21. package/dist/assets/classDiagram-v2-COTLJTTW-Csyx8kaD.js +1 -0
  22. package/dist/assets/clone-COylespf.js +1 -0
  23. package/dist/assets/compile-DJyTA_9Z.js +10 -0
  24. package/dist/assets/{cytoscape.esm-C5gjFiAL.js → cytoscape.esm-C11VZyMT.js} +1 -1
  25. package/dist/assets/{dagre-OKDRZEBW-A0tDXujM.js → dagre-OKDRZEBW-CK9uVBg9.js} +1 -1
  26. package/dist/assets/{data-editor-Nh7Kn3y-.js → data-editor-Bkr6jOqo.js} +3 -3
  27. package/dist/assets/{diagram-SSKATNLV-CDPhzmzM.js → diagram-SSKATNLV-DmW47eWd.js} +1 -1
  28. package/dist/assets/{diagram-VNBRO52H-hDAUBb7l.js → diagram-VNBRO52H-BFGW3TTb.js} +1 -1
  29. package/dist/assets/{edit-page-D327hTi6.js → edit-page-Bonf4Fyv.js} +22 -22
  30. package/dist/assets/{erDiagram-Q7BY3M3F-D6pmU7re.js → erDiagram-Q7BY3M3F-CNBomuGp.js} +1 -1
  31. package/dist/assets/{flowDiagram-4HSFHLVR-BFLWjiwa.js → flowDiagram-4HSFHLVR-zAqEljXZ.js} +1 -1
  32. package/dist/assets/{ganttDiagram-APWFNJXF-DmDfQojU.js → ganttDiagram-APWFNJXF-DVylT33c.js} +1 -1
  33. package/dist/assets/{gitGraphDiagram-7IBYFJ6S-DBTbQsBn.js → gitGraphDiagram-7IBYFJ6S-BKw7Cv0S.js} +1 -1
  34. package/dist/assets/{graph-Bhv-82YC.js → graph-DQDCj4Ym.js} +1 -1
  35. package/dist/assets/home-page-DBvLyhRL.js +9 -0
  36. package/dist/assets/{index-CsCpmHHr.js → index-BKevcuE2.js} +1 -1
  37. package/dist/assets/{index-Dvj_UpLv.js → index-BQAYhLHU.js} +1 -1
  38. package/dist/assets/{index-Dbu8kB_c.js → index-BiV4dU49.js} +1 -1
  39. package/dist/assets/{index-Coapw6LB.js → index-BlU5et8E.js} +1 -1
  40. package/dist/assets/{index-oBnzdwiL.js → index-Bm3pP4h0.js} +1 -1
  41. package/dist/assets/{index-2h75G6cI.js → index-BtvmvCgL.js} +1 -1
  42. package/dist/assets/{index-CiP6OsUd.js → index-BuBwfb0L.js} +1 -1
  43. package/dist/assets/{index-BCk5yGbP.js → index-CDiaICMi.js} +1 -1
  44. package/dist/assets/{index-Cfq03Abz.js → index-CSuf2-g_.js} +1 -1
  45. package/dist/assets/{index-KWYYgHFN.js → index-CdBazdrj.js} +1 -1
  46. package/dist/assets/{index-BGmlc_Mr.js → index-Cvo3H1Kf.js} +1 -1
  47. package/dist/assets/{index-BAC0XeNr.js → index-D45lrE_h.js} +1 -1
  48. package/dist/assets/{index-6ffD6v2U.js → index-DN5r2hxG.js} +1 -1
  49. package/dist/assets/{index-C5ey_n6K.js → index-DW03ZSyb.js} +127 -127
  50. package/dist/assets/{index-DDkn7pYI.js → index-Dpz5y2Ca.js} +1 -1
  51. package/dist/assets/{index-D-VWa8Wp.js → index-Dy9nNPyy.js} +1 -1
  52. package/dist/assets/index-GWhnzhCh.js +1 -0
  53. package/dist/assets/{index-DdJ7dWLU.js → index-Sus-Utma.js} +1 -1
  54. package/dist/assets/{index-Hq8WFa40.js → index-XBcdlnCt.js} +1 -1
  55. package/dist/assets/infoDiagram-PH2N3AL5-BsLWWcbP.js +2 -0
  56. package/dist/assets/{journeyDiagram-U35MCT3I-BbYRJpZ0.js → journeyDiagram-U35MCT3I-Cg_fPusL.js} +1 -1
  57. package/dist/assets/{kanban-definition-NDS4AKOZ-BTUV6vt8.js → kanban-definition-NDS4AKOZ-DVjhi6zJ.js} +1 -1
  58. package/dist/assets/layout-ruYqBvm2.js +1 -0
  59. package/dist/assets/{linear-CkVp18Sm.js → linear-gD9xs2Em.js} +1 -1
  60. package/dist/assets/{mermaid-Dj7jjx8c.js → mermaid-DRaMHky5.js} +5 -5
  61. package/dist/assets/{min-DRVPqPNx.js → min-9NCZkD0B.js} +1 -1
  62. package/dist/assets/mindmap-definition-ALO5MXBD-I2rQd6ri.js +95 -0
  63. package/dist/assets/{panels-BHdTHY91.js → panels-DJQSq8w2.js} +6 -6
  64. package/dist/assets/{pieDiagram-IB7DONF6-rtqcDP_8.js → pieDiagram-IB7DONF6-DaIPoAyJ.js} +1 -1
  65. package/dist/assets/{quadrantDiagram-7GDLP6J5-OFQUHza9.js → quadrantDiagram-7GDLP6J5-B3Gb5Xnd.js} +1 -1
  66. package/dist/assets/{radar-MK3ICKWK-C4plwqaP.js → radar-MK3ICKWK-62hm4W22.js} +1 -1
  67. package/dist/assets/{react-plotly-sQQCM37r.js → react-plotly-DKJ2M2CI.js} +20 -20
  68. package/dist/assets/{requirementDiagram-KVF5MWMF-BmMZ8iaA.js → requirementDiagram-KVF5MWMF-p-YooZ5p.js} +1 -1
  69. package/dist/assets/{run-page-CJ20uCSu.js → run-page-DPj_loRk.js} +1 -1
  70. package/dist/assets/{sankeyDiagram-QLVOVGJD-DJSv-o6n.js → sankeyDiagram-QLVOVGJD-B_hTeia_.js} +1 -1
  71. package/dist/assets/{save-worker-CULn6QYm.js → save-worker-DtAsG4LO.js} +1 -1
  72. package/dist/assets/{sequenceDiagram-X6HHIX6F-CLM0ZXZ-.js → sequenceDiagram-X6HHIX6F-Cs3CJ8bN.js} +1 -1
  73. package/dist/assets/slides-component-k2KY1mNy.js +1 -0
  74. package/dist/assets/{sortBy-DpgitUwG.js → sortBy-OllC7LvH.js} +1 -1
  75. package/dist/assets/{stateDiagram-DGXRK772-BxtauUCZ.js → stateDiagram-DGXRK772-BhKdd6gD.js} +1 -1
  76. package/dist/assets/stateDiagram-v2-YXO3MK2T-cY1bjdoF.js +1 -0
  77. package/dist/assets/{terminal-C24tPKkq.js → terminal-BctcbuLu.js} +1 -1
  78. package/dist/assets/{time-D_mcjoZY.js → time-DaCoXj6Q.js} +1 -1
  79. package/dist/assets/{timeline-definition-BDJGKUSR-By7avtAR.js → timeline-definition-BDJGKUSR-BbB4OE_f.js} +1 -1
  80. package/dist/assets/{tracing-BzQAuS1h.js → tracing-B_I1i8Eg.js} +2 -2
  81. package/dist/assets/{transform-Cyp0GDF-.js → transform-C4Tsj3kK.js} +1 -1
  82. package/dist/assets/{tree-BcBdyFrg.js → tree-BgOsMoCZ.js} +2 -2
  83. package/dist/assets/{vega-component-BI9MdAtH.js → vega-component-KLbmSfHV.js} +1 -1
  84. package/dist/assets/worker-DIeMFpcF.js +1 -0
  85. package/dist/assets/{worker-DsmMBHp1.js → worker-s2VOegFx.js} +1 -1
  86. package/dist/assets/{xychartDiagram-VJFVF3MP-BvbmdI6T.js → xychartDiagram-VJFVF3MP-B29hXZZE.js} +1 -1
  87. package/dist/index.html +1 -1
  88. package/package.json +6 -6
  89. package/dist/assets/ConnectedDataExplorerComponent-BzAfJwPb.js +0 -19
  90. package/dist/assets/VegaLite-CBcA1zbz.js +0 -189
  91. package/dist/assets/_baseMap-DGGLREyL.js +0 -1
  92. package/dist/assets/architectureDiagram-IEHRJDOE-DvEZbBxK.js +0 -36
  93. package/dist/assets/channel-BDXLM3IE.js +0 -1
  94. package/dist/assets/classDiagram-GIVACNV2-DTpqVAlJ.js +0 -1
  95. package/dist/assets/classDiagram-v2-COTLJTTW-DTpqVAlJ.js +0 -1
  96. package/dist/assets/clone-CdyDSJ05.js +0 -1
  97. package/dist/assets/compile-CzJA3-He.js +0 -10
  98. package/dist/assets/home-page-B-r_0k2p.js +0 -9
  99. package/dist/assets/index-uJ4rGdAX.js +0 -1
  100. package/dist/assets/infoDiagram-PH2N3AL5-D88b76UY.js +0 -2
  101. package/dist/assets/layout-BAdgtGN7.js +0 -1
  102. package/dist/assets/mindmap-definition-ALO5MXBD-BcbC1UUP.js +0 -95
  103. package/dist/assets/slides-component-CEfJMlCA.js +0 -1
  104. package/dist/assets/stateDiagram-v2-YXO3MK2T-CaOXOTb9.js +0 -1
  105. package/dist/assets/worker-C9vrNVln.js +0 -1
  106. /package/dist/assets/{timer-DFzT7np-.js → timer-BI-lUAZ7.js} +0 -0
@@ -1 +1 @@
1
- var e,t;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(e||(e={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(t||(t={}));const r=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),n=e=>{switch(typeof e){case"undefined":return r.undefined;case"string":return r.string;case"number":return isNaN(e)?r.nan:r.number;case"boolean":return r.boolean;case"function":return r.function;case"bigint":return r.bigint;case"symbol":return r.symbol;case"object":return Array.isArray(e)?r.array:null===e?r.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?r.promise:"undefined"!=typeof Map&&e instanceof Map?r.map:"undefined"!=typeof Set&&e instanceof Set?r.set:"undefined"!=typeof Date&&e instanceof Date?r.date:r.object;default:return r.unknown}},a=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"]);class s extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(n);else if("invalid_return_type"===a.code)n(a.returnTypeError);else if("invalid_arguments"===a.code)n(a.argumentsError);else if(0===a.path.length)r._errors.push(t(a));else{let e=r,n=0;for(;n<a.path.length;){const r=a.path[n];n===a.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(a))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof s))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}s.create=e=>new s(e);const i=(t,n)=>{let s;switch(t.code){case a.invalid_type:s=t.received===r.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case a.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case a.unrecognized_keys:s=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case a.invalid_union:s="Invalid input";break;case a.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case a.invalid_enum_value:s=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case a.invalid_arguments:s="Invalid function arguments";break;case a.invalid_return_type:s="Invalid function return type";break;case a.invalid_date:s="Invalid date";break;case a.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):s="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case a.too_small:s="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case a.too_big:s="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case a.custom:s="Invalid input";break;case a.invalid_intersection_types:s="Intersection results could not be merged";break;case a.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case a.not_finite:s="Number must be finite";break;default:s=n.defaultError,e.assertNever(t)}return{message:s}};let o=i;function d(){return o}const c=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],i={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let o="";const d=n.filter((e=>!!e)).slice().reverse();for(const c of d)o=c(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}};function u(e,t){const r=d(),n=c({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===i?void 0:i].filter((e=>!!e))});e.common.issues.push(n)}class l{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return p;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const e=await n.key,t=await n.value;r.push({key:e,value:t})}return l.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:a}=n;if("aborted"===t.status)return p;if("aborted"===a.status)return p;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!n.alwaysSet||(r[t.value]=a.value)}return{status:e.value,value:r}}}const p=Object.freeze({status:"aborted"}),h=e=>({status:"dirty",value:e}),f=e=>({status:"valid",value:e}),m=e=>"aborted"===e.status,y=e=>"dirty"===e.status,g=e=>"valid"===e.status,v=e=>"undefined"!=typeof Promise&&e instanceof Promise;function _(e,t,r,n){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function w(e,t,r,n,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var b,k,x;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(b||(b={}));class S{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const T=(e,t)=>{if(g(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new s(e.common.issues);return this._error=t,this._error}}};function E(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(t,a)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(s=null!=o?o:n)&&void 0!==s?s:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:r)&&void 0!==i?i:a.defaultError}},description:a}}class O{get description(){return this._def.description}_getType(e){return n(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new l,ctx:{common:e.parent.common,data:e.data,parsedType:n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(v(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const a={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)},s=this._parseSync({data:e,path:a.path,parent:a});return T(a,s)}"~validate"(e){var t,r;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:a});return g(t)?{value:t.value}:{issues:a.common.issues}}catch(s){(null===(r=null===(t=null==s?void 0:s.message)||void 0===t?void 0:t.toLowerCase())||void 0===r?void 0:r.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then((e=>g(e)?{value:e.value}:{issues:a.common.issues}))}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(v(a)?a:Promise.resolve(a));return T(r,s)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const s=e(t),i=()=>n.addIssue({code:a.custom,...r(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(i(),!1))):!!s||(i(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new Oe({schema:this,typeName:De.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:e=>this["~validate"](e)}}optional(){return Ze.create(this,this._def)}nullable(){return Ne.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return de.create(this)}promise(){return Ee.create(this,this._def)}or(e){return le.create([this,e],this._def)}and(e){return me.create(this,e,this._def)}transform(e){return new Oe({...E(this._def),schema:this,typeName:De.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new je({...E(this._def),innerType:this,defaultValue:t,typeName:De.ZodDefault})}brand(){return new Ie({typeName:De.ZodBranded,type:this,...E(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Pe({...E(this._def),innerType:this,catchValue:t,typeName:De.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Re.create(this,e)}readonly(){return Fe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z=/^c[^\s-]{8,}$/i,N=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Z]{26}$/i,P=/^[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,A=/^[a-z0-9_-]{21}$/i,C=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,I=/^[-+]?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)?)??$/,R=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let F;const $=/^(?:(?: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])$/,L=/^(?:(?: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])$/,M=/^(([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]))$/,D=/^(([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])$/,U=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,q="((\\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])))",V=new RegExp(`^${q}$`);function H(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function B(e){let t=`${q}T${H(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function W(e,t){if(!C.test(e))return!1;try{const[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return"object"==typeof a&&null!==a&&(!(!a.typ||!a.alg)&&(!t||a.alg===t))}catch(r){return!1}}function K(e,t){return!("v4"!==t&&t||!L.test(e))||!("v6"!==t&&t||!D.test(e))}class J extends O{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==r.string){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:r.string,received:e.parsedType}),p}const n=new l;let s;for(const r of this._def.checks)if("min"===r.kind)t.data.length<r.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if("max"===r.kind)t.data.length>r.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if("length"===r.kind){const e=t.data.length>r.value,i=t.data.length<r.value;(e||i)&&(s=this._getOrReturnCtx(t,s),e?u(s,{code:a.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):i&&u(s,{code:a.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if("email"===r.kind)R.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"email",code:a.invalid_string,message:r.message}),n.dirty());else if("emoji"===r.kind)F||(F=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),F.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"emoji",code:a.invalid_string,message:r.message}),n.dirty());else if("uuid"===r.kind)P.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"uuid",code:a.invalid_string,message:r.message}),n.dirty());else if("nanoid"===r.kind)A.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"nanoid",code:a.invalid_string,message:r.message}),n.dirty());else if("cuid"===r.kind)Z.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cuid",code:a.invalid_string,message:r.message}),n.dirty());else if("cuid2"===r.kind)N.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cuid2",code:a.invalid_string,message:r.message}),n.dirty());else if("ulid"===r.kind)j.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"ulid",code:a.invalid_string,message:r.message}),n.dirty());else if("url"===r.kind)try{new URL(t.data)}catch(d){s=this._getOrReturnCtx(t,s),u(s,{validation:"url",code:a.invalid_string,message:r.message}),n.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"regex",code:a.invalid_string,message:r.message}),n.dirty())}else if("trim"===r.kind)t.data=t.data.trim();else if("includes"===r.kind)t.data.includes(r.value,r.position)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty());else if("toLowerCase"===r.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===r.kind)t.data=t.data.toUpperCase();else if("startsWith"===r.kind)t.data.startsWith(r.value)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty());else if("endsWith"===r.kind)t.data.endsWith(r.value)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty());else if("datetime"===r.kind){B(r).test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"datetime",message:r.message}),n.dirty())}else if("date"===r.kind){V.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"date",message:r.message}),n.dirty())}else if("time"===r.kind){new RegExp(`^${H(r)}$`).test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"time",message:r.message}),n.dirty())}else"duration"===r.kind?I.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"duration",code:a.invalid_string,message:r.message}),n.dirty()):"ip"===r.kind?(i=t.data,("v4"!==(o=r.version)&&o||!$.test(i))&&("v6"!==o&&o||!M.test(i))&&(s=this._getOrReturnCtx(t,s),u(s,{validation:"ip",code:a.invalid_string,message:r.message}),n.dirty())):"jwt"===r.kind?W(t.data,r.alg)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"jwt",code:a.invalid_string,message:r.message}),n.dirty()):"cidr"===r.kind?K(t.data,r.version)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cidr",code:a.invalid_string,message:r.message}),n.dirty()):"base64"===r.kind?U.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"base64",code:a.invalid_string,message:r.message}),n.dirty()):"base64url"===r.kind?z.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"base64url",code:a.invalid_string,message:r.message}),n.dirty()):e.assertNever(r);var i,o;return{status:n.value,value:t.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:a.invalid_string,...b.errToObj(r)})}_addCheck(e){return new J({...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){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...b.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...b.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...b.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...b.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...b.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...b.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...b.errToObj(t)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new J({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Y(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}J.create=e=>{var t;return new J({checks:[],typeName:De.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class G extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==r.number){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:r.number,received:e.parsedType}),p}let n;const s=new l;for(const r of this._def.checks)if("int"===r.kind)e.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),u(n,{code:a.invalid_type,expected:"integer",received:"float",message:r.message}),s.dirty());else if("min"===r.kind){(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty())}else if("max"===r.kind){(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty())}else"multipleOf"===r.kind?0!==Y(t.data,r.value)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):"finite"===r.kind?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),u(n,{code:a.not_finite,message:r.message}),s.dirty()):e.assertNever(r);return{status:s.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,r,n){return new G({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:b.toString(n)}]})}_addCheck(e){return new G({...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,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}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 t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((t=>"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}G.create=e=>new G({checks:[],typeName:De.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class X extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(i){return this._getInvalidInput(t)}if(this._getType(t)!==r.bigint)return this._getInvalidInput(t);let n;const s=new l;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty())}else if("max"===r.kind){(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty())}else"multipleOf"===r.kind?t.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):e.assertNever(r);return{status:s.value,value:t.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,r,n){return new X({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:b.toString(n)}]})}_addCheck(e){return new X({...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,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}X.create=e=>{var t;return new X({checks:[],typeName:De.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class Q extends O{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==r.boolean){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.boolean,received:t.parsedType}),p}return f(e.data)}}Q.create=e=>new Q({typeName:De.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class ee extends O{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==r.date){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:r.date,received:e.parsedType}),p}if(isNaN(t.data.getTime())){return u(this._getOrReturnCtx(t),{code:a.invalid_date}),p}const n=new l;let s;for(const r of this._def.checks)"min"===r.kind?t.data.getTime()<r.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):"max"===r.kind?t.data.getTime()>r.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):e.assertNever(r);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ee.create=e=>new ee({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:De.ZodDate,...E(e)});class te extends O{_parse(e){if(this._getType(e)!==r.symbol){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.symbol,received:t.parsedType}),p}return f(e.data)}}te.create=e=>new te({typeName:De.ZodSymbol,...E(e)});class re extends O{_parse(e){if(this._getType(e)!==r.undefined){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.undefined,received:t.parsedType}),p}return f(e.data)}}re.create=e=>new re({typeName:De.ZodUndefined,...E(e)});class ne extends O{_parse(e){if(this._getType(e)!==r.null){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.null,received:t.parsedType}),p}return f(e.data)}}ne.create=e=>new ne({typeName:De.ZodNull,...E(e)});class ae extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return f(e.data)}}ae.create=e=>new ae({typeName:De.ZodAny,...E(e)});class se extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return f(e.data)}}se.create=e=>new se({typeName:De.ZodUnknown,...E(e)});class ie extends O{_parse(e){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.never,received:t.parsedType}),p}}ie.create=e=>new ie({typeName:De.ZodNever,...E(e)});class oe extends O{_parse(e){if(this._getType(e)!==r.undefined){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.void,received:t.parsedType}),p}return f(e.data)}}oe.create=e=>new oe({typeName:De.ZodVoid,...E(e)});class de extends O{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==r.array)return u(t,{code:a.invalid_type,expected:r.array,received:t.parsedType}),p;if(null!==s.exactLength){const e=t.data.length>s.exactLength.value,r=t.data.length<s.exactLength.value;(e||r)&&(u(t,{code:e?a.too_big:a.too_small,minimum:r?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(null!==s.minLength&&t.data.length<s.minLength.value&&(u(t,{code:a.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),null!==s.maxLength&&t.data.length>s.maxLength.value&&(u(t,{code:a.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>s.type._parseAsync(new S(t,e,t.path,r))))).then((e=>l.mergeArray(n,e)));const i=[...t.data].map(((e,r)=>s.type._parseSync(new S(t,e,t.path,r))));return l.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new de({...this._def,minLength:{value:e,message:b.toString(t)}})}max(e,t){return new de({...this._def,maxLength:{value:e,message:b.toString(t)}})}length(e,t){return new de({...this._def,exactLength:{value:e,message:b.toString(t)}})}nonempty(e){return this.min(1,e)}}function ce(e){if(e instanceof ue){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Ze.create(ce(n))}return new ue({...e._def,shape:()=>t})}return e instanceof de?new de({...e._def,type:ce(e.element)}):e instanceof Ze?Ze.create(ce(e.unwrap())):e instanceof Ne?Ne.create(ce(e.unwrap())):e instanceof ye?ye.create(e.items.map((e=>ce(e)))):e}de.create=(e,t)=>new de({type:e,minLength:null,maxLength:null,exactLength:null,typeName:De.ZodArray,...E(t)});class ue extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),r=e.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(e){if(this._getType(e)!==r.object){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.object,received:t.parsedType}),p}const{status:t,ctx:n}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ie&&"strip"===this._def.unknownKeys))for(const r in n.data)i.includes(r)||o.push(r);const d=[];for(const r of i){const e=s[r],t=n.data[r];d.push({key:{status:"valid",value:r},value:e._parse(new S(n,t,n.path,r)),alwaysSet:r in n.data})}if(this._def.catchall instanceof ie){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of o)d.push({key:{status:"valid",value:t},value:{status:"valid",value:n.data[t]}});else if("strict"===e)o.length>0&&(u(n,{code:a.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new S(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>l.mergeObjectSync(t,e))):l.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new ue({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,a,s,i;const o=null!==(s=null===(a=(n=this._def).errorMap)||void 0===a?void 0:a.call(n,t,r).message)&&void 0!==s?s:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=b.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new ue({...this._def,unknownKeys:"strip"})}passthrough(){return new ue({...this._def,unknownKeys:"passthrough"})}extend(e){return new ue({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ue({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:De.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ue({...this._def,catchall:e})}pick(t){const r={};return e.objectKeys(t).forEach((e=>{t[e]&&this.shape[e]&&(r[e]=this.shape[e])})),new ue({...this._def,shape:()=>r})}omit(t){const r={};return e.objectKeys(this.shape).forEach((e=>{t[e]||(r[e]=this.shape[e])})),new ue({...this._def,shape:()=>r})}deepPartial(){return ce(this)}partial(t){const r={};return e.objectKeys(this.shape).forEach((e=>{const n=this.shape[e];t&&!t[e]?r[e]=n:r[e]=n.optional()})),new ue({...this._def,shape:()=>r})}required(t){const r={};return e.objectKeys(this.shape).forEach((e=>{if(t&&!t[e])r[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Ze;)t=t._def.innerType;r[e]=t}})),new ue({...this._def,shape:()=>r})}keyof(){return xe(e.objectKeys(this.shape))}}ue.create=(e,t)=>new ue({shape:()=>e,unknownKeys:"strip",catchall:ie.create(),typeName:De.ZodObject,...E(t)}),ue.strictCreate=(e,t)=>new ue({shape:()=>e,unknownKeys:"strict",catchall:ie.create(),typeName:De.ZodObject,...E(t)}),ue.lazycreate=(e,t)=>new ue({shape:e,unknownKeys:"strip",catchall:ie.create(),typeName:De.ZodObject,...E(t)});class le extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const r=e.map((e=>new s(e.ctx.common.issues)));return u(t,{code:a.invalid_union,unionErrors:r}),p}));{let e;const n=[];for(const a of r){const r={...t,common:{...t.common,issues:[]},parent:null},s=a._parseSync({data:t.data,path:t.path,parent:r});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=n.map((e=>new s(e)));return u(t,{code:a.invalid_union,unionErrors:i}),p}}get options(){return this._def.options}}le.create=(e,t)=>new le({options:e,typeName:De.ZodUnion,...E(t)});const pe=t=>t instanceof be?pe(t.schema):t instanceof Oe?pe(t.innerType()):t instanceof ke?[t.value]:t instanceof Se?t.options:t instanceof Te?e.objectValues(t.enum):t instanceof je?pe(t._def.innerType):t instanceof re?[void 0]:t instanceof ne?[null]:t instanceof Ze?[void 0,...pe(t.unwrap())]:t instanceof Ne?[null,...pe(t.unwrap())]:t instanceof Ie||t instanceof Fe?pe(t.unwrap()):t instanceof Pe?pe(t._def.innerType):[];class he extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==r.object)return u(t,{code:a.invalid_type,expected:r.object,received:t.parsedType}),p;const n=this.discriminator,s=t.data[n],i=this.optionsMap.get(s);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(u(t,{code:a.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const a of t){const t=pe(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const r of t){if(n.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);n.set(r,a)}}return new he({typeName:De.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...E(r)})}}function fe(t,a){const s=n(t),i=n(a);if(t===a)return{valid:!0,data:t};if(s===r.object&&i===r.object){const r=e.objectKeys(a),n=e.objectKeys(t).filter((e=>-1!==r.indexOf(e))),s={...t,...a};for(const e of n){const r=fe(t[e],a[e]);if(!r.valid)return{valid:!1};s[e]=r.data}return{valid:!0,data:s}}if(s===r.array&&i===r.array){if(t.length!==a.length)return{valid:!1};const e=[];for(let r=0;r<t.length;r++){const n=fe(t[r],a[r]);if(!n.valid)return{valid:!1};e.push(n.data)}return{valid:!0,data:e}}return s===r.date&&i===r.date&&+t==+a?{valid:!0,data:t}:{valid:!1}}class me extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(m(e)||m(n))return p;const s=fe(e.value,n.value);return s.valid?((y(e)||y(n))&&t.dirty(),{status:t.value,value:s.data}):(u(r,{code:a.invalid_intersection_types}),p)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}me.create=(e,t,r)=>new me({left:e,right:t,typeName:De.ZodIntersection,...E(r)});class ye extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.array)return u(n,{code:a.invalid_type,expected:r.array,received:n.parsedType}),p;if(n.data.length<this._def.items.length)return u(n,{code:a.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&n.data.length>this._def.items.length&&(u(n,{code:a.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new S(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(s).then((e=>l.mergeArray(t,e))):l.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ye({...this._def,rest:e})}}ye.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ye({items:e,typeName:De.ZodTuple,rest:null,...E(t)})};class ge extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.object)return u(n,{code:a.invalid_type,expected:r.object,received:n.parsedType}),p;const s=[],i=this._def.keyType,o=this._def.valueType;for(const r in n.data)s.push({key:i._parse(new S(n,r,n.path,r)),value:o._parse(new S(n,n.data[r],n.path,r)),alwaysSet:r in n.data});return n.common.async?l.mergeObjectAsync(t,s):l.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,r){return new ge(t instanceof O?{keyType:e,valueType:t,typeName:De.ZodRecord,...E(r)}:{keyType:J.create(),valueType:e,typeName:De.ZodRecord,...E(t)})}}class ve extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.map)return u(n,{code:a.invalid_type,expected:r.map,received:n.parsedType}),p;const s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],r)=>({key:s._parse(new S(n,e,n.path,[r,"key"])),value:i._parse(new S(n,t,n.path,[r,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of o){const n=await r.key,a=await r.value;if("aborted"===n.status||"aborted"===a.status)return p;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of o){const n=r.key,a=r.value;if("aborted"===n.status||"aborted"===a.status)return p;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}}}ve.create=(e,t,r)=>new ve({valueType:t,keyType:e,typeName:De.ZodMap,...E(r)});class _e extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.set)return u(n,{code:a.invalid_type,expected:r.set,received:n.parsedType}),p;const s=this._def;null!==s.minSize&&n.data.size<s.minSize.value&&(u(n,{code:a.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),null!==s.maxSize&&n.data.size>s.maxSize.value&&(u(n,{code:a.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const r=new Set;for(const n of e){if("aborted"===n.status)return p;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const d=[...n.data.values()].map(((e,t)=>i._parse(new S(n,e,n.path,t))));return n.common.async?Promise.all(d).then((e=>o(e))):o(d)}min(e,t){return new _e({...this._def,minSize:{value:e,message:b.toString(t)}})}max(e,t){return new _e({...this._def,maxSize:{value:e,message:b.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}_e.create=(e,t)=>new _e({valueType:e,minSize:null,maxSize:null,typeName:De.ZodSet,...E(t)});class we extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==r.function)return u(t,{code:a.invalid_type,expected:r.function,received:t.parsedType}),p;function n(e,r){return c({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),i].filter((e=>!!e)),issueData:{code:a.invalid_arguments,argumentsError:r}})}function o(e,r){return c({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),i].filter((e=>!!e)),issueData:{code:a.invalid_return_type,returnTypeError:r}})}const l={errorMap:t.common.contextualErrorMap},h=t.data;if(this._def.returns instanceof Ee){const e=this;return f((async function(...t){const r=new s([]),a=await e._def.args.parseAsync(t,l).catch((e=>{throw r.addIssue(n(t,e)),r})),i=await Reflect.apply(h,this,a);return await e._def.returns._def.type.parseAsync(i,l).catch((e=>{throw r.addIssue(o(i,e)),r}))}))}{const e=this;return f((function(...t){const r=e._def.args.safeParse(t,l);if(!r.success)throw new s([n(t,r.error)]);const a=Reflect.apply(h,this,r.data),i=e._def.returns.safeParse(a,l);if(!i.success)throw new s([o(a,i.error)]);return i.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new we({...this._def,args:ye.create(e).rest(se.create())})}returns(e){return new we({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new we({args:e||ye.create([]).rest(se.create()),returns:t||se.create(),typeName:De.ZodFunction,...E(r)})}}class be extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}be.create=(e,t)=>new be({getter:e,typeName:De.ZodLazy,...E(t)});class ke extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:a.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}function xe(e,t){return new Se({values:e,typeName:De.ZodEnum,...E(t)})}ke.create=(e,t)=>new ke({value:e,typeName:De.ZodLiteral,...E(t)});class Se extends O{constructor(){super(...arguments),k.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const r=this._getOrReturnCtx(t),n=this._def.values;return u(r,{expected:e.joinValues(n),received:r.parsedType,code:a.invalid_type}),p}if(_(this,k)||w(this,k,new Set(this._def.values)),!_(this,k).has(t.data)){const e=this._getOrReturnCtx(t),r=this._def.values;return u(e,{received:e.data,code:a.invalid_enum_value,options:r}),p}return f(t.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Se.create(e,{...this._def,...t})}exclude(e,t=this._def){return Se.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}k=new WeakMap,Se.create=xe;class Te extends O{constructor(){super(...arguments),x.set(this,void 0)}_parse(t){const n=e.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==r.string&&s.parsedType!==r.number){const t=e.objectValues(n);return u(s,{expected:e.joinValues(t),received:s.parsedType,code:a.invalid_type}),p}if(_(this,x)||w(this,x,new Set(e.getValidEnumValues(this._def.values))),!_(this,x).has(t.data)){const t=e.objectValues(n);return u(s,{received:s.data,code:a.invalid_enum_value,options:t}),p}return f(t.data)}get enum(){return this._def.values}}x=new WeakMap,Te.create=(e,t)=>new Te({values:e,typeName:De.ZodNativeEnum,...E(t)});class Ee extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==r.promise&&!1===t.common.async)return u(t,{code:a.invalid_type,expected:r.promise,received:t.parsedType}),p;const n=t.parsedType===r.promise?t.data:Promise.resolve(t.data);return f(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ee.create=(e,t)=>new Ee({type:e,typeName:De.ZodPromise,...E(t)});class Oe extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===De.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:e=>{u(n,e),e.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){const e=a.transform(n.data,s);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===r.value)return p;const t=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===t.status?p:"dirty"===t.status||"dirty"===r.value?h(t.value):t}));{if("aborted"===r.value)return p;const t=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===t.status?p:"dirty"===t.status||"dirty"===r.value?h(t.value):t}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,s);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const t=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===t.status?p:("dirty"===t.status&&r.dirty(),e(t.value),{status:r.value,value:t.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((t=>"aborted"===t.status?p:("dirty"===t.status&&r.dirty(),e(t.value).then((()=>({status:r.value,value:t.value}))))))}if("transform"===a.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!g(e))return e;const t=a.transform(e.value,s);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:t}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>g(e)?Promise.resolve(a.transform(e.value,s)).then((e=>({status:r.value,value:e}))):e))}e.assertNever(a)}}Oe.create=(e,t,r)=>new Oe({schema:e,typeName:De.ZodEffects,effect:t,...E(r)}),Oe.createWithPreprocess=(e,t,r)=>new Oe({schema:t,effect:{type:"preprocess",transform:e},typeName:De.ZodEffects,...E(r)});class Ze extends O{_parse(e){return this._getType(e)===r.undefined?f(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:De.ZodOptional,...E(t)});class Ne extends O{_parse(e){return this._getType(e)===r.null?f(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ne.create=(e,t)=>new Ne({innerType:e,typeName:De.ZodNullable,...E(t)});class je extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===r.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}je.create=(e,t)=>new je({innerType:e,typeName:De.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...E(t)});class Pe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return v(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new s(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new s(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Pe.create=(e,t)=>new Pe({innerType:e,typeName:De.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...E(t)});class Ae extends O{_parse(e){if(this._getType(e)!==r.nan){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.nan,received:t.parsedType}),p}return{status:"valid",value:e.data}}}Ae.create=e=>new Ae({typeName:De.ZodNaN,...E(e)});const Ce=Symbol("zod_brand");class Ie extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Re extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),h(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Re({in:e,out:t,typeName:De.ZodPipeline})}}class Fe extends O{_parse(e){const t=this._def.innerType._parse(e),r=e=>(g(e)&&(e.value=Object.freeze(e.value)),e);return v(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function $e(e,t){const r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function Le(e,t={},r){return e?ae.create().superRefine(((n,a)=>{var s,i;const o=e(n);if(o instanceof Promise)return o.then((e=>{var s,i;if(!e){const e=$e(t,n),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:r)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}}));if(!o){const e=$e(t,n),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:r)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}})):ae.create()}Fe.create=(e,t)=>new Fe({innerType:e,typeName:De.ZodReadonly,...E(t)});const Me={object:ue.lazycreate};var De;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(De||(De={}));const Ue=J.create,ze=G.create,qe=Ae.create,Ve=X.create,He=Q.create,Be=ee.create,We=te.create,Ke=re.create,Je=ne.create,Ye=ae.create,Ge=se.create,Xe=ie.create,Qe=oe.create,et=de.create,tt=ue.create,rt=ue.strictCreate,nt=le.create,at=he.create,st=me.create,it=ye.create,ot=ge.create,dt=ve.create,ct=_e.create,ut=we.create,lt=be.create,pt=ke.create,ht=Se.create,ft=Te.create,mt=Ee.create,yt=Oe.create,gt=Ze.create,vt=Ne.create,_t=Oe.createWithPreprocess,wt=Re.create,bt={string:e=>J.create({...e,coerce:!0}),number:e=>G.create({...e,coerce:!0}),boolean:e=>Q.create({...e,coerce:!0}),bigint:e=>X.create({...e,coerce:!0}),date:e=>ee.create({...e,coerce:!0})},kt=p;var xt=Object.freeze({__proto__:null,defaultErrorMap:i,setErrorMap:function(e){o=e},getErrorMap:d,makeIssue:c,EMPTY_PATH:[],addIssueToContext:u,ParseStatus:l,INVALID:p,DIRTY:h,OK:f,isAborted:m,isDirty:y,isValid:g,isAsync:v,get util(){return e},get objectUtil(){return t},ZodParsedType:r,getParsedType:n,ZodType:O,datetimeRegex:B,ZodString:J,ZodNumber:G,ZodBigInt:X,ZodBoolean:Q,ZodDate:ee,ZodSymbol:te,ZodUndefined:re,ZodNull:ne,ZodAny:ae,ZodUnknown:se,ZodNever:ie,ZodVoid:oe,ZodArray:de,ZodObject:ue,ZodUnion:le,ZodDiscriminatedUnion:he,ZodIntersection:me,ZodTuple:ye,ZodRecord:ge,ZodMap:ve,ZodSet:_e,ZodFunction:we,ZodLazy:be,ZodLiteral:ke,ZodEnum:Se,ZodNativeEnum:Te,ZodPromise:Ee,ZodEffects:Oe,ZodTransformer:Oe,ZodOptional:Ze,ZodNullable:Ne,ZodDefault:je,ZodCatch:Pe,ZodNaN:Ae,BRAND:Ce,ZodBranded:Ie,ZodPipeline:Re,ZodReadonly:Fe,custom:Le,Schema:O,ZodSchema:O,late:Me,get ZodFirstPartyTypeKind(){return De},coerce:bt,any:Ye,array:et,bigint:Ve,boolean:He,date:Be,discriminatedUnion:at,effect:yt,enum:ht,function:ut,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Le((t=>t instanceof e),t),intersection:st,lazy:lt,literal:pt,map:dt,nan:qe,nativeEnum:ft,never:Xe,null:Je,nullable:vt,number:ze,object:tt,oboolean:()=>He().optional(),onumber:()=>ze().optional(),optional:gt,ostring:()=>Ue().optional(),pipeline:wt,preprocess:_t,promise:mt,record:ot,set:ct,strictObject:rt,string:Ue,symbol:We,transformer:yt,tuple:it,undefined:Ke,union:nt,unknown:Ge,void:Qe,NEVER:kt,ZodIssueCode:a,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:s});const St=xt.object({detail:xt.string()}),Tt=xt.object({error:xt.string()});function Et(e){if(!e)return"Unknown error";if(e instanceof Error){const t=St.safeParse(e.cause);return t.success?t.data.detail:function(e){const t=function(e){try{return JSON.parse(e)}catch{return e}}(e);if(!t)return e;const r=St.safeParse(t);if(r.success)return r.data.detail;const n=Tt.safeParse(t);if(n.success)return n.data.error;return e}(e.message)}if("object"==typeof e){const t=St.safeParse(e);if(t.success)return t.data.detail;const r=Tt.safeParse(e);if(r.success)return r.data.error}try{return JSON.stringify(e)}catch{return String(e)}}const Ot=1e3;function Zt(e,t){const r=e.map((e=>`"${e}"`)).join(", ");return new Error(`This RPC instance cannot ${t} because the transport did not provide one or more of these methods: ${r}`)}function Nt(e={}){let t={};function r(e){t=e}let n,a={};function s(e){a.unregisterHandler&&a.unregisterHandler(),a=e,a.registerHandler?.(_)}function i(e){n="function"!=typeof e?(t,r)=>{const n=e[t];if(n)return n(r);const a=e._;if(!a)throw new Error(`The requested method has no handler: ${t}`);return a(t,r)}:e}const{maxRequestTime:o=Ot}=e;e.transport&&s(e.transport),e.requestHandler&&i(e.requestHandler),e._debugHooks&&r(e._debugHooks);let d=0;const c=new Map,u=new Map;function l(e,...r){const n=r[0];return new Promise(((r,s)=>{if(!a.send)throw Zt(["send"],"make requests");const i=d<=1e10?++d:d=0,l={type:"request",id:i,method:e,params:n};c.set(i,{resolve:r,reject:s}),o!==1/0&&u.set(i,setTimeout((()=>{u.delete(i),s(new Error("RPC request timed out."))}),o)),t.onSend?.(l),a.send(l)}))}const p=new Proxy(l,{get:(e,t,r)=>t in e?Reflect.get(e,t,r):e=>l(t,e)}),h=p;function f(e,...r){const n=r[0];if(!a.send)throw Zt(["send"],"send messages");const s={type:"message",id:e,payload:n};t.onSend?.(s),a.send(s)}const m=new Proxy(f,{get:(e,t,r)=>t in e?Reflect.get(e,t,r):e=>f(t,e)}),y=m,g=new Map,v=new Set;async function _(e){if(t.onReceive?.(e),!("type"in e))throw new Error("Message does not contain a type.");if("request"===e.type){if(!a.send||!n)throw Zt(["send","requestHandler"],"handle requests");const{id:s,method:i,params:o}=e;let d;try{d={type:"response",id:s,success:!0,payload:await n(i,o)}}catch(r){if(!(r instanceof Error))throw r;d={type:"response",id:s,success:!1,error:r.message}}return t.onSend?.(d),void a.send(d)}if("response"!==e.type){if("message"!==e.type)throw new Error(`Unexpected RPC message type: ${e.type}`);{for(const r of v)r(e.id,e.payload);const t=g.get(e.id);if(!t)return;for(const r of t)r(e.payload)}}else{const t=u.get(e.id);null!=t&&clearTimeout(t);const{resolve:r,reject:n}=c.get(e.id)??{};e.success?r?.(e.payload):n?.(new Error(e.error))}}return{setTransport:s,setRequestHandler:i,request:p,requestProxy:h,send:m,sendProxy:y,addMessageListener:function(e,t){if(!a.registerHandler)throw Zt(["registerHandler"],"register message listeners");"*"!==e?(g.has(e)||g.set(e,new Set),g.get(e)?.add(t)):v.add(t)},removeMessageListener:function(e,t){"*"!==e?(g.get(e)?.delete(t),0===g.get(e)?.size&&g.delete(e)):v.delete(t)},proxy:{send:y,request:h},_setDebugHooks:r}}const jt="[transport-id]";function Pt(e,t={}){const{transportId:r,filter:n,remotePort:a}=t,s=e,i=a??e;let o;return{send(e){i.postMessage(function(e,t){const{transportId:r}=t;return null!=r?{[jt]:r,data:e}:e}(e,{transportId:r}))},registerHandler(e){o=t=>{const a=t.data,[s,i]=function(e,t){const{transportId:r,filter:n}=t,a=n?.();if(null!=r&&null!=a)throw new Error("Cannot use both `transportId` and `filter` at the same time");let s=e;if(r){if(e[jt]!==r)return[!0];s=e.data}return!1===a?[!0]:[!1,s]}(a,{transportId:r,filter:()=>n?.(t)});s||e(i)},s.addEventListener("message",o)},unregisterHandler(){o&&s.removeEventListener("message",o)}}}const At=()=>{},Ct=(e,t)=>{const r=`[${e}]`;return{debug:(...e)=>t.debug(r,...e),log:(...e)=>t.log(r,...e),warn:(...e)=>t.warn(r,...e),error:(...e)=>t.error(r,...e),trace:(...e)=>t.trace(r,...e),get:r=>Ct(`${e}.${r}`,t),disabled:(e=!0)=>e?Rt:t}},It={debug:(...e)=>{},log:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)},error:(...e)=>{console.error(...e)},trace:(...e)=>{console.trace(...e)},get:e=>Ct(e,It),disabled:(e=!0)=>e?Rt:It},Rt={debug:()=>At,log:()=>At,warn:()=>At,error:()=>At,trace:()=>At,get:()=>Rt,disabled:()=>Rt};const Ft="undefined"!=typeof window&&window.Logger||It;var $t,Lt=Object.defineProperty,Mt=(e,t)=>Lt(e,"name",{value:t,configurable:!0}),Dt=($t=function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')},typeof require<"u"?require:typeof Proxy<"u"?new Proxy($t,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):$t);function Ut(e){return!isNaN(parseFloat(e))&&isFinite(e)}function zt(e){return e.charAt(0).toUpperCase()+e.substring(1)}function qt(e){return function(){return this[e]}}Mt(Ut,"_isNumber"),Mt(zt,"_capitalize"),Mt(qt,"_getter");var Vt,Ht,Bt=["isConstructor","isEval","isNative","isToplevel"],Wt=["columnNumber","lineNumber"],Kt=["fileName","functionName","source"],Jt=Bt.concat(Wt,Kt,["args"],["evalOrigin"]);function Yt(e){if(e)for(var t=0;t<Jt.length;t++)void 0!==e[Jt[t]]&&this["set"+zt(Jt[t])](e[Jt[t]])}for(Mt(Yt,"StackFrame"),Yt.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof Yt)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new Yt(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",n=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:n?n+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r}},Yt.fromString=Mt((function(e){var t=e.indexOf("("),r=e.lastIndexOf(")"),n=e.substring(0,t),a=e.substring(t+1,r).split(","),s=e.substring(r+1);if(0===s.indexOf("@"))var i=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s,""),o=i[1],d=i[2],c=i[3];return new Yt({functionName:n,args:a||void 0,fileName:o,lineNumber:d||void 0,columnNumber:c||void 0})}),"StackFrame$$fromString"),Vt=0;Vt<Bt.length;Vt++)Yt.prototype["get"+zt(Bt[Vt])]=qt(Bt[Vt]),Yt.prototype["set"+zt(Bt[Vt])]=function(e){return function(t){this[e]=!!t}}(Bt[Vt]);for(Ht=0;Ht<Wt.length;Ht++)Yt.prototype["get"+zt(Wt[Ht])]=qt(Wt[Ht]),Yt.prototype["set"+zt(Wt[Ht])]=function(e){return function(t){if(!Ut(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(Wt[Ht]);for(Gt=0;Gt<Kt.length;Gt++)Yt.prototype["get"+zt(Kt[Gt])]=qt(Kt[Gt]),Yt.prototype["set"+zt(Kt[Gt])]=function(e){return function(t){this[e]=String(t)}}(Kt[Gt]);var Gt,Xt=Yt;function Qt(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:Mt((function(t){if(t.stack&&t.stack.match(e))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")}),"ErrorStackParser$$parse"),extractLocation:Mt((function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]}),"ErrorStackParser$$extractLocation"),parseV8OrIE:Mt((function(t){return t.stack.split("\n").filter((function(t){return!!t.match(e)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=t.match(/ (\(.+\)$)/);t=r?t.replace(r[0],""):t;var n=this.extractLocation(r?r[1]:t),a=r&&t||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Xt({functionName:a,fileName:s,lineNumber:n[1],columnNumber:n[2],source:e})}),this)}),"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:Mt((function(e){return e.stack.split("\n").filter((function(e){return!e.match(t)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Xt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,a=this.extractLocation(e.replace(t,""));return new Xt({functionName:n,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:e})}),this)}),"ErrorStackParser$$parseFFOrSafari")}}Mt(Qt,"ErrorStackParser");var er,tr,rr,nr,ar,sr,ir,or,dr,cr=new Qt,ur="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&!process.browser,lr=ur&&typeof module<"u"&&typeof module.exports<"u"&&typeof Dt<"u"&&typeof __dirname<"u",pr=ur&&!lr,hr=typeof Deno<"u",fr=!ur&&!hr,mr=fr&&"object"==typeof window&&"object"==typeof document&&"function"==typeof document.createElement&&"sessionStorage"in window&&"function"!=typeof importScripts,yr=fr&&"function"==typeof importScripts&&"object"==typeof self;async function gr(){if(!ur||(er=(await import("./__vite-browser-external-CIEyP2s7.js")).default,nr=await import("./__vite-browser-external-CIEyP2s7.js"),ar=await import("./__vite-browser-external-CIEyP2s7.js"),rr=(await import("./__vite-browser-external-CIEyP2s7.js")).default,tr=await import("./__vite-browser-external-CIEyP2s7.js"),ir=tr.sep,typeof Dt<"u"))return;let e={fs:nr,crypto:await import("./__vite-browser-external-CIEyP2s7.js"),ws:await import("./__vite-browser-external-CIEyP2s7.js"),child_process:await import("./__vite-browser-external-CIEyP2s7.js")};globalThis.require=function(t){return e[t]}}function vr(e,t){return tr.resolve(t||".",e)}function _r(e,t){return void 0===t&&(t=location),new URL(e,t).toString()}function wr(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:ar.readFile(e).then((e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))}}function br(e,t){let r=new URL(e,location);return{response:fetch(r,t?{integrity:t}:{})}}async function kr(e,t){let{response:r,binary:n}=or(e,t);if(n)return n;let a=await r;if(!a.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await a.arrayBuffer())}if("object"==typeof navigator&&"string"==typeof navigator.userAgent&&-1==navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Safari"),Mt(gr,"initNodeModules"),Mt(vr,"node_resolvePath"),Mt(_r,"browser_resolvePath"),sr=ur?vr:_r,ur||(ir="/"),Mt(wr,"node_getBinaryResponse"),Mt(br,"browser_getBinaryResponse"),or=ur?wr:br,Mt(kr,"loadBinaryFile"),mr)dr=Mt((async e=>await import(e)),"loadScript");else if(yr)dr=Mt((async e=>{try{globalThis.importScripts(e)}catch(Jr){if(!(Jr instanceof TypeError))throw Jr;await import(e)}}),"loadScript");else{if(!ur)throw new Error("Cannot determine runtime environment");dr=xr}async function xr(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?rr.runInThisContext(await(await fetch(e)).text()):await import(er.pathToFileURL(e).href)}async function Sr(e){if(ur){await gr();let t=await ar.readFile(e,{encoding:"utf8"});return JSON.parse(t)}return await(await fetch(e)).json()}async function Tr(){if(lr)return __dirname;let e;try{throw new Error}catch(n){e=n}let t=cr.parse(e)[0].fileName;if(ur&&!t.startsWith("file://")&&(t=`file://${t}`),pr){let e=await import("./__vite-browser-external-CIEyP2s7.js");return(await import("./__vite-browser-external-CIEyP2s7.js")).fileURLToPath(e.dirname(t))}let r=t.lastIndexOf(ir);if(-1===r)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,r)}function Er(e){let t=e.FS,r=e.FS.filesystems.MEMFS,n=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:function(e){if(!e.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return r.mount.apply(null,arguments)},syncfs:async(e,t,r)=>{try{let n=a.getLocalSet(e),s=await a.getRemoteSet(e),i=t?s:n,o=t?n:s;await a.reconcile(e,i,o),r(null)}catch(n){r(n)}},getLocalSet:e=>{let r=Object.create(null);function a(e){return"."!==e&&".."!==e}function s(e){return t=>n.join2(e,t)}Mt(a,"isRealDir"),Mt(s,"toAbsolute");let i=t.readdir(e.mountpoint).filter(a).map(s(e.mountpoint));for(;i.length;){let e=i.pop(),n=t.stat(e);t.isDir(n.mode)&&i.push.apply(i,t.readdir(e).filter(a).map(s(e))),r[e]={timestamp:n.mtime,mode:n.mode}}return{type:"local",entries:r}},getRemoteSet:async e=>{let t=Object.create(null),r=await Or(e.opts.fileSystemHandle);for(let[s,i]of r)"."!==s&&(t[n.join2(e.mountpoint,s)]={timestamp:"file"===i.kind?new Date((await i.getFile()).lastModified):new Date,mode:"file"===i.kind?a.FILE_MODE:a.DIR_MODE});return{type:"remote",entries:t,handles:r}},loadLocalEntry:e=>{let n=t.lookupPath(e).node,a=t.stat(e);if(t.isDir(a.mode))return{timestamp:a.mtime,mode:a.mode};if(t.isFile(a.mode))return n.contents=r.getFileDataAsTypedArray(n),{timestamp:a.mtime,mode:a.mode,contents:n.contents};throw new Error("node type not supported")},storeLocalEntry:(e,r)=>{if(t.isDir(r.mode))t.mkdirTree(e,r.mode);else{if(!t.isFile(r.mode))throw new Error("node type not supported");t.writeFile(e,r.contents,{canOwn:!0})}t.chmod(e,r.mode),t.utime(e,r.timestamp,r.timestamp)},removeLocalEntry:e=>{var r=t.stat(e);t.isDir(r.mode)?t.rmdir(e):t.isFile(r.mode)&&t.unlink(e)},loadRemoteEntry:async e=>{if("file"===e.kind){let t=await e.getFile();return{contents:new Uint8Array(await t.arrayBuffer()),mode:a.FILE_MODE,timestamp:new Date(t.lastModified)}}if("directory"===e.kind)return{mode:a.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+e.kind)},storeRemoteEntry:async(e,r,a)=>{let s=e.get(n.dirname(r)),i=t.isFile(a.mode)?await s.getFileHandle(n.basename(r),{create:!0}):await s.getDirectoryHandle(n.basename(r),{create:!0});if("file"===i.kind){let e=await i.createWritable();await e.write(a.contents),await e.close()}e.set(r,i)},removeRemoteEntry:async(e,t)=>{await e.get(n.dirname(t)).removeEntry(n.basename(t)),e.delete(t)},reconcile:async(e,r,s)=>{let i=0,o=[];Object.keys(r.entries).forEach((function(e){let n=r.entries[e],a=s.entries[e];(!a||t.isFile(n.mode)&&n.timestamp.getTime()>a.timestamp.getTime())&&(o.push(e),i++)})),o.sort();let d=[];if(Object.keys(s.entries).forEach((function(e){r.entries[e]||(d.push(e),i++)})),d.sort().reverse(),!i)return;let c="remote"===r.type?r.handles:s.handles;for(let t of o){let r=n.normalize(t.replace(e.mountpoint,"/")).substring(1);if("local"===s.type){let e=c.get(r),n=await a.loadRemoteEntry(e);a.storeLocalEntry(t,n)}else{let e=a.loadLocalEntry(t);await a.storeRemoteEntry(c,r,e)}}for(let t of d)if("local"===s.type)a.removeLocalEntry(t);else{let r=n.normalize(t.replace(e.mountpoint,"/")).substring(1);await a.removeRemoteEntry(c,r)}}};e.FS.filesystems.NATIVEFS_ASYNC=a}Mt(xr,"nodeLoadScript"),Mt(Sr,"loadLockFile"),Mt(Tr,"calculateDirname"),Mt(Er,"initializeNativeFS");var Or=Mt((async e=>{let t=[];async function r(e){for await(let n of e.values())t.push(n),"directory"===n.kind&&await r(n)}Mt(r,"collect"),await r(e);let n=new Map;n.set(".",e);for(let a of t){let t=(await e.resolve(a)).join("/");n.set(t,a)}return n}),"getFsHandles");function Zr(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Cr(e),quit(e,r){throw t.exited={status:e,toThrow:r},r},print:e.stdout,printErr:e.stderr,thisProgram:e._sysExecutable,arguments:e.args,API:{config:e},locateFile:t=>e.indexURL+t,instantiateWasm:Ir(e.indexURL)};return t}function Nr(e){return function(t){try{t.FS.mkdirTree(e)}catch(r){console.error(`Error occurred while making a home directory '${e}':`),console.error(r),console.error("Using '/' for a home directory instead"),e="/"}t.FS.chdir(e)}}function jr(e){return function(t){Object.assign(t.ENV,e)}}function Pr(e){return e?[async t=>{t.addRunDependency("fsInitHook");try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency("fsInitHook")}}]:[]}function Ar(e){let t=kr(e);return async e=>{let r=e._py_version_major(),n=e._py_version_minor();e.FS.mkdirTree("/lib"),e.API.sitePackages=`/lib/python${r}.${n}/site-packages`,e.FS.mkdirTree(e.API.sitePackages),e.addRunDependency("install-stdlib");try{let a=await t;e.FS.writeFile(`/lib/python${r}${n}.zip`,a)}catch(a){console.error("Error occurred while installing the standard library:"),console.error(a)}finally{e.removeRunDependency("install-stdlib")}}}function Cr(e){let t;return t=null!=e.stdLibURL?e.stdLibURL:e.indexURL+"python_stdlib.zip",[...Pr(e.fsInit),Ar(t),Nr(e.env.HOME),jr(e.env),Er]}function Ir(e){if(typeof WasmOffsetConverter<"u")return;let{binary:t,response:r}=or(e+"pyodide.asm.wasm");return function(e,n){return async function(){try{let a;a=r?await WebAssembly.instantiateStreaming(r,e):await WebAssembly.instantiate(await t,e);let{instance:s,module:i}=a;n(s,i)}catch(a){console.warn("wasm instantiation failed!"),console.warn(a)}}(),{}}}Mt(Zr,"createSettings"),Mt(Nr,"createHomeDirectory"),Mt(jr,"setEnvironment"),Mt(Pr,"callFsInitHook"),Mt(Ar,"installStdlib"),Mt(Cr,"getFileSystemInitializationFuncs"),Mt(Ir,"getInstantiateWasmFunc");var Rr="0.27.5";async function Fr(e={}){var t,r;await gr();let n=e.indexURL||await Tr();n=sr(n),n.endsWith("/")||(n+="/"),e.indexURL=n;let a={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:n+"pyodide-lock.json",args:[],env:{},packageCacheDir:n,packages:[],enableRunUntilComplete:!1,checkAPIVersion:!0,BUILD_ID:"bd0388b62e760f8ba04185eb443fec955f25434f49c7b951efe5b1f792dbe5d4"},s=Object.assign(a,e);(t=s.env).HOME??(t.HOME="/home/pyodide"),(r=s.env).PYTHONINSPECT??(r.PYTHONINSPECT="1");let i,o=Zr(s),d=o.API;if(d.lockFilePromise=Sr(s.lockFileURL),"function"!=typeof _createPyodideModule){let e=`${s.indexURL}pyodide.asm.js`;await dr(e)}if(e._loadSnapshot){let t=await e._loadSnapshot;i=ArrayBuffer.isView(t)?t:new Uint8Array(t),o.noInitialRun=!0,o.INITIAL_MEMORY=i.length}let c,u=await _createPyodideModule(o);if(o.exited)throw o.exited.toThrow;if(e.pyproxyToStringRepr&&d.setPyProxyToStringMethod(!0),d.version!==Rr&&s.checkAPIVersion)throw new Error(`Pyodide version does not match: '${Rr}' <==> '${d.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);u.locateFile=e=>{throw new Error("Didn't expect to load any more file_packager files!")},i&&(c=d.restoreSnapshot(i));let l=d.finalizeBootstrap(c,e._snapshotDeserializer);return d.sys.path.insert(0,d.config.env.HOME),l.version.includes("dev")||d.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${l.version}/full/`),d._pyodide.set_excepthook(),await d.packageIndexReady,d.initializeStreams(s.stdin,s.stdout,s.stderr),l}Mt(Fr,"loadPyodide");function $r(e){return e.FS}const Lr=e=>(new TextDecoder).decode(e),Mr="notebook.py",Dr="/marimo",Ur=Mr,zr=e=>{const t=$r(e);try{t.mkdirTree(Dr)}catch{}t.chdir(Dr)},qr=e=>{$r(e).mount(e.FS.filesystems.IDBFS,{root:"."},Dr)},Vr=async e=>{await Kr(e,!0)},Hr=async e=>{await Kr(e,!1)},Br=e=>{const t=$r(e),r=`${Dr}/${Mr}`;return Lr(t.readFile(r))},Wr=e=>{const{pyodide:t,filename:r,code:n}=e,a=$r(t);if(r&&r!==Mr){const e=(e=>{try{return Lr(a.readFile(e))}catch{return null}})(r);if(e)return{code:e,filename:r}}return a.writeFile(Mr,n),{code:n,filename:Mr}};function Kr(e,t){return new Promise(((r,n)=>{$r(e).syncfs(t,(e=>{e instanceof Error?n(e):r()}))}))}const Jr=new class{constructor(){this.spans=[]}startSpan(e,t={}){const r={name:e,startTime:Date.now(),attributes:t,end:(e="ok")=>this.endSpan(r,e)};return this.spans.push(r),r}endSpan(e,t="ok"){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,r={}){const n=this.startSpan(t||e.name,r);try{const t=e();return this.endSpan(n),t}catch(a){throw this.endSpan(n,"error"),a}}wrapAsync(e,t,r={}){return async(...n)=>{const a=this.startSpan(t||e.name,r);try{const t=await e(...n);return this.endSpan(a),t}catch(s){throw this.endSpan(a,"error"),s}}}logSpans(){}};globalThis.t=Jr;class Yr{constructor(){this.pyodide=null}get requirePyodide(){return function(e,t){if(!e)throw new Error(t)}(this.pyodide,"Pyodide not loaded"),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!Fr)throw new Error("loadPyodide is not defined");const t=Jr.startSpan("loadPyodide");try{const r=await Fr({packages:["micropip","marimo-base","Markdown","pymdown-extensions","narwhals","packaging"],_makeSnapshot:false,lockFileURL:`https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,indexURL:`https://cdn.jsdelivr.net/pyodide/${e.pyodideVersion}/full/`});return this.pyodide=r,t.end("ok"),r}catch(r){throw Ft.error("Failed to load Pyodide",r),r}}async mountFilesystem(e){const t=Jr.startSpan("mountFilesystem");return zr(this.requirePyodide),qr(this.requirePyodide),await Vr(this.requirePyodide),t.end("ok"),Wr({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){const{code:t,filename:r,onMessage:n,queryParameters:a,userConfig:s}=e;self.messenger={callback:n},self.query_params=a,self.user_config=s;const i=Jr.startSpan("startSession.runPython"),o=r||Ur,[d,c,u]=this.requirePyodide.runPython(`\n print("[py] Starting marimo...")\n import asyncio\n import js\n from marimo._pyodide.bootstrap import create_session, instantiate\n\n assert js.messenger, "messenger is not defined"\n assert js.query_params, "query_params is not defined"\n\n session, bridge = create_session(\n filename="${o}",\n query_params=js.query_params.to_py(),\n message_callback=js.messenger.callback,\n user_config=js.user_config.to_py(),\n )\n\n def init(auto_instantiate=True):\n instantiate(session, auto_instantiate)\n asyncio.create_task(session.start())\n\n # Find the packages to install\n with open("${o}", "r") as f:\n packages = session.find_packages(f.read())\n\n bridge, init, packages`);i.end();const l=new Set(u.toJs());return this.loadNotebookDeps(t,l).then((()=>c(s.runtime.auto_instantiate))),d}async loadNotebookDeps(e,t){const r=this.requirePyodide;e.includes("mo.sql")&&(e=`import sqlglot\n${e=`import duckdb\n${e=`import pandas\n${e}`}`}`).includes("polars")&&(e=`import pyarrow\n${e}`),e=`import pyodide_http\n${e=`import jedi\n${e=`import pygments\n${e=`import docutils\n${e}`}`}`}`;const n=[...t];let a=Jr.startSpan("pyodide.loadPackage");await r.loadPackagesFromImports(e,{errorCallback:Ft.error,messageCallback:Ft.log}),a.end(),a=Jr.startSpan("micropip.install");const s=n.filter((e=>!r.loadedPackages[e]));s.length>0&&await r.runPythonAsync(`\n import micropip\n import sys\n # Filter out builtins\n missing = [p for p in ${JSON.stringify(s)} if p not in sys.modules]\n if len(missing) > 0:\n print("Loading from micropip:", missing)\n await micropip.install(missing)\n `).catch((e=>{Ft.error("Failed to load packages from micropip",e)})),a.end()}}const Gr=async function(){try{const e=self.name,t=function(e){return e.includes("dev"),`v${Rr}`}(e),r=await async function(e){try{return await import(`/wasm/controller.js?version=${e}`)}catch{return new Yr}}(e);self.controller=r,self.pyodide=await r.bootstrap({version:e,pyodideVersion:t}),await(r.mountFilesystem?.({code:"",filename:null})),Qr.send.initialized({})}catch(e){Ft.error("Error bootstrapping",e),Qr.send.initializedError({error:Et(e)})}}(),Xr={readFile:async e=>{await Gr;return Lr(self.pyodide.FS.readFile(e))},readNotebook:async()=>(await Gr,Br(self.pyodide)),saveNotebook:async e=>{await Gr;const t=self.pyodide.runPython("\n from marimo._pyodide.bootstrap import save_file\n\n save_file\n ");await t(JSON.stringify(e),Ur),await Hr(self.pyodide)}},Qr=function(e){return Nt(e)}({transport:(en={transportId:"marimo-transport"},Pt(self,en)),requestHandler:Xr});var en;Qr.send("ready",{});
1
+ var e,t;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(e||(e={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(t||(t={}));const r=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),n=e=>{switch(typeof e){case"undefined":return r.undefined;case"string":return r.string;case"number":return isNaN(e)?r.nan:r.number;case"boolean":return r.boolean;case"function":return r.function;case"bigint":return r.bigint;case"symbol":return r.symbol;case"object":return Array.isArray(e)?r.array:null===e?r.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?r.promise:"undefined"!=typeof Map&&e instanceof Map?r.map:"undefined"!=typeof Set&&e instanceof Set?r.set:"undefined"!=typeof Date&&e instanceof Date?r.date:r.object;default:return r.unknown}},a=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"]);class s extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(n);else if("invalid_return_type"===a.code)n(a.returnTypeError);else if("invalid_arguments"===a.code)n(a.argumentsError);else if(0===a.path.length)r._errors.push(t(a));else{let e=r,n=0;for(;n<a.path.length;){const r=a.path[n];n===a.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(a))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof s))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}s.create=e=>new s(e);const i=(t,n)=>{let s;switch(t.code){case a.invalid_type:s=t.received===r.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case a.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case a.unrecognized_keys:s=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case a.invalid_union:s="Invalid input";break;case a.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case a.invalid_enum_value:s=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case a.invalid_arguments:s="Invalid function arguments";break;case a.invalid_return_type:s="Invalid function return type";break;case a.invalid_date:s="Invalid date";break;case a.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):s="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case a.too_small:s="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case a.too_big:s="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case a.custom:s="Invalid input";break;case a.invalid_intersection_types:s="Intersection results could not be merged";break;case a.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case a.not_finite:s="Number must be finite";break;default:s=n.defaultError,e.assertNever(t)}return{message:s}};let o=i;function d(){return o}const c=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],i={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let o="";const d=n.filter((e=>!!e)).slice().reverse();for(const c of d)o=c(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}};function u(e,t){const r=d(),n=c({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===i?void 0:i].filter((e=>!!e))});e.common.issues.push(n)}class l{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return p;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const e=await n.key,t=await n.value;r.push({key:e,value:t})}return l.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:a}=n;if("aborted"===t.status)return p;if("aborted"===a.status)return p;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!n.alwaysSet||(r[t.value]=a.value)}return{status:e.value,value:r}}}const p=Object.freeze({status:"aborted"}),h=e=>({status:"dirty",value:e}),f=e=>({status:"valid",value:e}),m=e=>"aborted"===e.status,y=e=>"dirty"===e.status,g=e=>"valid"===e.status,v=e=>"undefined"!=typeof Promise&&e instanceof Promise;function _(e,t,r,n){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function w(e,t,r,n,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var b,k,x;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(b||(b={}));class S{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const T=(e,t)=>{if(g(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new s(e.common.issues);return this._error=t,this._error}}};function E(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(t,a)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(s=null!=o?o:n)&&void 0!==s?s:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:r)&&void 0!==i?i:a.defaultError}},description:a}}class O{get description(){return this._def.description}_getType(e){return n(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new l,ctx:{common:e.parent.common,data:e.data,parsedType:n(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(v(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const a={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)},s=this._parseSync({data:e,path:a.path,parent:a});return T(a,s)}"~validate"(e){var t,r;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:a});return g(t)?{value:t.value}:{issues:a.common.issues}}catch(s){(null===(r=null===(t=null==s?void 0:s.message)||void 0===t?void 0:t.toLowerCase())||void 0===r?void 0:r.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then((e=>g(e)?{value:e.value}:{issues:a.common.issues}))}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:n(e)},a=this._parse({data:e,path:r.path,parent:r}),s=await(v(a)?a:Promise.resolve(a));return T(r,s)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const s=e(t),i=()=>n.addIssue({code:a.custom,...r(t)});return"undefined"!=typeof Promise&&s instanceof Promise?s.then((e=>!!e||(i(),!1))):!!s||(i(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new Oe({schema:this,typeName:De.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:e=>this["~validate"](e)}}optional(){return Ze.create(this,this._def)}nullable(){return Ne.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return de.create(this)}promise(){return Ee.create(this,this._def)}or(e){return le.create([this,e],this._def)}and(e){return me.create(this,e,this._def)}transform(e){return new Oe({...E(this._def),schema:this,typeName:De.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new je({...E(this._def),innerType:this,defaultValue:t,typeName:De.ZodDefault})}brand(){return new Ie({typeName:De.ZodBranded,type:this,...E(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Pe({...E(this._def),innerType:this,catchValue:t,typeName:De.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Re.create(this,e)}readonly(){return Fe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z=/^c[^\s-]{8,}$/i,N=/^[0-9a-z]+$/,j=/^[0-9A-HJKMNP-TV-Z]{26}$/i,P=/^[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,A=/^[a-z0-9_-]{21}$/i,C=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,I=/^[-+]?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)?)??$/,R=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let F;const $=/^(?:(?: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])$/,L=/^(?:(?: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])$/,M=/^(([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]))$/,D=/^(([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])$/,U=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,z=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,q="((\\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])))",V=new RegExp(`^${q}$`);function H(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function B(e){let t=`${q}T${H(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function W(e,t){if(!C.test(e))return!1;try{const[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return"object"==typeof a&&null!==a&&(!(!a.typ||!a.alg)&&(!t||a.alg===t))}catch(r){return!1}}function K(e,t){return!("v4"!==t&&t||!L.test(e))||!("v6"!==t&&t||!D.test(e))}class J extends O{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==r.string){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:r.string,received:e.parsedType}),p}const n=new l;let s;for(const r of this._def.checks)if("min"===r.kind)t.data.length<r.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if("max"===r.kind)t.data.length>r.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),n.dirty());else if("length"===r.kind){const e=t.data.length>r.value,i=t.data.length<r.value;(e||i)&&(s=this._getOrReturnCtx(t,s),e?u(s,{code:a.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):i&&u(s,{code:a.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),n.dirty())}else if("email"===r.kind)R.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"email",code:a.invalid_string,message:r.message}),n.dirty());else if("emoji"===r.kind)F||(F=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),F.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"emoji",code:a.invalid_string,message:r.message}),n.dirty());else if("uuid"===r.kind)P.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"uuid",code:a.invalid_string,message:r.message}),n.dirty());else if("nanoid"===r.kind)A.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"nanoid",code:a.invalid_string,message:r.message}),n.dirty());else if("cuid"===r.kind)Z.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cuid",code:a.invalid_string,message:r.message}),n.dirty());else if("cuid2"===r.kind)N.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cuid2",code:a.invalid_string,message:r.message}),n.dirty());else if("ulid"===r.kind)j.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"ulid",code:a.invalid_string,message:r.message}),n.dirty());else if("url"===r.kind)try{new URL(t.data)}catch(d){s=this._getOrReturnCtx(t,s),u(s,{validation:"url",code:a.invalid_string,message:r.message}),n.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"regex",code:a.invalid_string,message:r.message}),n.dirty())}else if("trim"===r.kind)t.data=t.data.trim();else if("includes"===r.kind)t.data.includes(r.value,r.position)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),n.dirty());else if("toLowerCase"===r.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===r.kind)t.data=t.data.toUpperCase();else if("startsWith"===r.kind)t.data.startsWith(r.value)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{startsWith:r.value},message:r.message}),n.dirty());else if("endsWith"===r.kind)t.data.endsWith(r.value)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:{endsWith:r.value},message:r.message}),n.dirty());else if("datetime"===r.kind){B(r).test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"datetime",message:r.message}),n.dirty())}else if("date"===r.kind){V.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"date",message:r.message}),n.dirty())}else if("time"===r.kind){new RegExp(`^${H(r)}$`).test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{code:a.invalid_string,validation:"time",message:r.message}),n.dirty())}else"duration"===r.kind?I.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"duration",code:a.invalid_string,message:r.message}),n.dirty()):"ip"===r.kind?(i=t.data,("v4"!==(o=r.version)&&o||!$.test(i))&&("v6"!==o&&o||!M.test(i))&&(s=this._getOrReturnCtx(t,s),u(s,{validation:"ip",code:a.invalid_string,message:r.message}),n.dirty())):"jwt"===r.kind?W(t.data,r.alg)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"jwt",code:a.invalid_string,message:r.message}),n.dirty()):"cidr"===r.kind?K(t.data,r.version)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"cidr",code:a.invalid_string,message:r.message}),n.dirty()):"base64"===r.kind?U.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"base64",code:a.invalid_string,message:r.message}),n.dirty()):"base64url"===r.kind?z.test(t.data)||(s=this._getOrReturnCtx(t,s),u(s,{validation:"base64url",code:a.invalid_string,message:r.message}),n.dirty()):e.assertNever(r);var i,o;return{status:n.value,value:t.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:a.invalid_string,...b.errToObj(r)})}_addCheck(e){return new J({...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){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...b.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...b.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...b.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...b.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...b.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...b.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...b.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...b.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...b.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...b.errToObj(t)})}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new J({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new J({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Y(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}J.create=e=>{var t;return new J({checks:[],typeName:De.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class G extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==r.number){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:r.number,received:e.parsedType}),p}let n;const s=new l;for(const r of this._def.checks)if("int"===r.kind)e.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),u(n,{code:a.invalid_type,expected:"integer",received:"float",message:r.message}),s.dirty());else if("min"===r.kind){(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty())}else if("max"===r.kind){(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),s.dirty())}else"multipleOf"===r.kind?0!==Y(t.data,r.value)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):"finite"===r.kind?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),u(n,{code:a.not_finite,message:r.message}),s.dirty()):e.assertNever(r);return{status:s.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,r,n){return new G({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:b.toString(n)}]})}_addCheck(e){return new G({...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,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}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 t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((t=>"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}G.create=e=>new G({checks:[],typeName:De.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class X extends O{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch(i){return this._getInvalidInput(t)}if(this._getType(t)!==r.bigint)return this._getInvalidInput(t);let n;const s=new l;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?t.data<r.value:t.data<=r.value)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty())}else if("max"===r.kind){(r.inclusive?t.data>r.value:t.data>=r.value)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),s.dirty())}else"multipleOf"===r.kind?t.data%r.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),u(n,{code:a.not_multiple_of,multipleOf:r.value,message:r.message}),s.dirty()):e.assertNever(r);return{status:s.value,value:t.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.bigint,received:t.parsedType}),p}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,r,n){return new X({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:b.toString(n)}]})}_addCheck(e){return new X({...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,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}X.create=e=>{var t;return new X({checks:[],typeName:De.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...E(e)})};class Q extends O{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==r.boolean){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.boolean,received:t.parsedType}),p}return f(e.data)}}Q.create=e=>new Q({typeName:De.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...E(e)});class ee extends O{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==r.date){const e=this._getOrReturnCtx(t);return u(e,{code:a.invalid_type,expected:r.date,received:e.parsedType}),p}if(isNaN(t.data.getTime())){return u(this._getOrReturnCtx(t),{code:a.invalid_date}),p}const n=new l;let s;for(const r of this._def.checks)"min"===r.kind?t.data.getTime()<r.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),n.dirty()):"max"===r.kind?t.data.getTime()>r.value&&(s=this._getOrReturnCtx(t,s),u(s,{code:a.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),n.dirty()):e.assertNever(r);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(e){return new ee({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ee.create=e=>new ee({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:De.ZodDate,...E(e)});class te extends O{_parse(e){if(this._getType(e)!==r.symbol){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.symbol,received:t.parsedType}),p}return f(e.data)}}te.create=e=>new te({typeName:De.ZodSymbol,...E(e)});class re extends O{_parse(e){if(this._getType(e)!==r.undefined){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.undefined,received:t.parsedType}),p}return f(e.data)}}re.create=e=>new re({typeName:De.ZodUndefined,...E(e)});class ne extends O{_parse(e){if(this._getType(e)!==r.null){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.null,received:t.parsedType}),p}return f(e.data)}}ne.create=e=>new ne({typeName:De.ZodNull,...E(e)});class ae extends O{constructor(){super(...arguments),this._any=!0}_parse(e){return f(e.data)}}ae.create=e=>new ae({typeName:De.ZodAny,...E(e)});class se extends O{constructor(){super(...arguments),this._unknown=!0}_parse(e){return f(e.data)}}se.create=e=>new se({typeName:De.ZodUnknown,...E(e)});class ie extends O{_parse(e){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.never,received:t.parsedType}),p}}ie.create=e=>new ie({typeName:De.ZodNever,...E(e)});class oe extends O{_parse(e){if(this._getType(e)!==r.undefined){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.void,received:t.parsedType}),p}return f(e.data)}}oe.create=e=>new oe({typeName:De.ZodVoid,...E(e)});class de extends O{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),s=this._def;if(t.parsedType!==r.array)return u(t,{code:a.invalid_type,expected:r.array,received:t.parsedType}),p;if(null!==s.exactLength){const e=t.data.length>s.exactLength.value,r=t.data.length<s.exactLength.value;(e||r)&&(u(t,{code:e?a.too_big:a.too_small,minimum:r?s.exactLength.value:void 0,maximum:e?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(null!==s.minLength&&t.data.length<s.minLength.value&&(u(t,{code:a.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),null!==s.maxLength&&t.data.length>s.maxLength.value&&(u(t,{code:a.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>s.type._parseAsync(new S(t,e,t.path,r))))).then((e=>l.mergeArray(n,e)));const i=[...t.data].map(((e,r)=>s.type._parseSync(new S(t,e,t.path,r))));return l.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new de({...this._def,minLength:{value:e,message:b.toString(t)}})}max(e,t){return new de({...this._def,maxLength:{value:e,message:b.toString(t)}})}length(e,t){return new de({...this._def,exactLength:{value:e,message:b.toString(t)}})}nonempty(e){return this.min(1,e)}}function ce(e){if(e instanceof ue){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Ze.create(ce(n))}return new ue({...e._def,shape:()=>t})}return e instanceof de?new de({...e._def,type:ce(e.element)}):e instanceof Ze?Ze.create(ce(e.unwrap())):e instanceof Ne?Ne.create(ce(e.unwrap())):e instanceof ye?ye.create(e.items.map((e=>ce(e)))):e}de.create=(e,t)=>new de({type:e,minLength:null,maxLength:null,exactLength:null,typeName:De.ZodArray,...E(t)});class ue extends O{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),r=e.objectKeys(t);return this._cached={shape:t,keys:r}}_parse(e){if(this._getType(e)!==r.object){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.object,received:t.parsedType}),p}const{status:t,ctx:n}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ie&&"strip"===this._def.unknownKeys))for(const r in n.data)i.includes(r)||o.push(r);const d=[];for(const r of i){const e=s[r],t=n.data[r];d.push({key:{status:"valid",value:r},value:e._parse(new S(n,t,n.path,r)),alwaysSet:r in n.data})}if(this._def.catchall instanceof ie){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of o)d.push({key:{status:"valid",value:t},value:{status:"valid",value:n.data[t]}});else if("strict"===e)o.length>0&&(u(n,{code:a.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const r=n.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new S(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of d){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>l.mergeObjectSync(t,e))):l.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new ue({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,a,s,i;const o=null!==(s=null===(a=(n=this._def).errorMap)||void 0===a?void 0:a.call(n,t,r).message)&&void 0!==s?s:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=b.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new ue({...this._def,unknownKeys:"strip"})}passthrough(){return new ue({...this._def,unknownKeys:"passthrough"})}extend(e){return new ue({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ue({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:De.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ue({...this._def,catchall:e})}pick(t){const r={};return e.objectKeys(t).forEach((e=>{t[e]&&this.shape[e]&&(r[e]=this.shape[e])})),new ue({...this._def,shape:()=>r})}omit(t){const r={};return e.objectKeys(this.shape).forEach((e=>{t[e]||(r[e]=this.shape[e])})),new ue({...this._def,shape:()=>r})}deepPartial(){return ce(this)}partial(t){const r={};return e.objectKeys(this.shape).forEach((e=>{const n=this.shape[e];t&&!t[e]?r[e]=n:r[e]=n.optional()})),new ue({...this._def,shape:()=>r})}required(t){const r={};return e.objectKeys(this.shape).forEach((e=>{if(t&&!t[e])r[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Ze;)t=t._def.innerType;r[e]=t}})),new ue({...this._def,shape:()=>r})}keyof(){return xe(e.objectKeys(this.shape))}}ue.create=(e,t)=>new ue({shape:()=>e,unknownKeys:"strip",catchall:ie.create(),typeName:De.ZodObject,...E(t)}),ue.strictCreate=(e,t)=>new ue({shape:()=>e,unknownKeys:"strict",catchall:ie.create(),typeName:De.ZodObject,...E(t)}),ue.lazycreate=(e,t)=>new ue({shape:e,unknownKeys:"strip",catchall:ie.create(),typeName:De.ZodObject,...E(t)});class le extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const r=e.map((e=>new s(e.ctx.common.issues)));return u(t,{code:a.invalid_union,unionErrors:r}),p}));{let e;const n=[];for(const a of r){const r={...t,common:{...t.common,issues:[]},parent:null},s=a._parseSync({data:t.data,path:t.path,parent:r});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const i=n.map((e=>new s(e)));return u(t,{code:a.invalid_union,unionErrors:i}),p}}get options(){return this._def.options}}le.create=(e,t)=>new le({options:e,typeName:De.ZodUnion,...E(t)});const pe=t=>t instanceof be?pe(t.schema):t instanceof Oe?pe(t.innerType()):t instanceof ke?[t.value]:t instanceof Se?t.options:t instanceof Te?e.objectValues(t.enum):t instanceof je?pe(t._def.innerType):t instanceof re?[void 0]:t instanceof ne?[null]:t instanceof Ze?[void 0,...pe(t.unwrap())]:t instanceof Ne?[null,...pe(t.unwrap())]:t instanceof Ie||t instanceof Fe?pe(t.unwrap()):t instanceof Pe?pe(t._def.innerType):[];class he extends O{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==r.object)return u(t,{code:a.invalid_type,expected:r.object,received:t.parsedType}),p;const n=this.discriminator,s=t.data[n],i=this.optionsMap.get(s);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(u(t,{code:a.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),p)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const a of t){const t=pe(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const r of t){if(n.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);n.set(r,a)}}return new he({typeName:De.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...E(r)})}}function fe(t,a){const s=n(t),i=n(a);if(t===a)return{valid:!0,data:t};if(s===r.object&&i===r.object){const r=e.objectKeys(a),n=e.objectKeys(t).filter((e=>-1!==r.indexOf(e))),s={...t,...a};for(const e of n){const r=fe(t[e],a[e]);if(!r.valid)return{valid:!1};s[e]=r.data}return{valid:!0,data:s}}if(s===r.array&&i===r.array){if(t.length!==a.length)return{valid:!1};const e=[];for(let r=0;r<t.length;r++){const n=fe(t[r],a[r]);if(!n.valid)return{valid:!1};e.push(n.data)}return{valid:!0,data:e}}return s===r.date&&i===r.date&&+t===+a?{valid:!0,data:t}:{valid:!1}}class me extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(m(e)||m(n))return p;const s=fe(e.value,n.value);return s.valid?((y(e)||y(n))&&t.dirty(),{status:t.value,value:s.data}):(u(r,{code:a.invalid_intersection_types}),p)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}me.create=(e,t,r)=>new me({left:e,right:t,typeName:De.ZodIntersection,...E(r)});class ye extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.array)return u(n,{code:a.invalid_type,expected:r.array,received:n.parsedType}),p;if(n.data.length<this._def.items.length)return u(n,{code:a.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),p;!this._def.rest&&n.data.length>this._def.items.length&&(u(n,{code:a.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const s=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new S(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(s).then((e=>l.mergeArray(t,e))):l.mergeArray(t,s)}get items(){return this._def.items}rest(e){return new ye({...this._def,rest:e})}}ye.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ye({items:e,typeName:De.ZodTuple,rest:null,...E(t)})};class ge extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.object)return u(n,{code:a.invalid_type,expected:r.object,received:n.parsedType}),p;const s=[],i=this._def.keyType,o=this._def.valueType;for(const r in n.data)s.push({key:i._parse(new S(n,r,n.path,r)),value:o._parse(new S(n,n.data[r],n.path,r)),alwaysSet:r in n.data});return n.common.async?l.mergeObjectAsync(t,s):l.mergeObjectSync(t,s)}get element(){return this._def.valueType}static create(e,t,r){return new ge(t instanceof O?{keyType:e,valueType:t,typeName:De.ZodRecord,...E(r)}:{keyType:J.create(),valueType:e,typeName:De.ZodRecord,...E(t)})}}class ve extends O{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.map)return u(n,{code:a.invalid_type,expected:r.map,received:n.parsedType}),p;const s=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map((([e,t],r)=>({key:s._parse(new S(n,e,n.path,[r,"key"])),value:i._parse(new S(n,t,n.path,[r,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of o){const n=await r.key,a=await r.value;if("aborted"===n.status||"aborted"===a.status)return p;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of o){const n=r.key,a=r.value;if("aborted"===n.status||"aborted"===a.status)return p;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}}}ve.create=(e,t,r)=>new ve({valueType:t,keyType:e,typeName:De.ZodMap,...E(r)});class _e extends O{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==r.set)return u(n,{code:a.invalid_type,expected:r.set,received:n.parsedType}),p;const s=this._def;null!==s.minSize&&n.data.size<s.minSize.value&&(u(n,{code:a.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),t.dirty()),null!==s.maxSize&&n.data.size>s.maxSize.value&&(u(n,{code:a.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const r=new Set;for(const n of e){if("aborted"===n.status)return p;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const d=[...n.data.values()].map(((e,t)=>i._parse(new S(n,e,n.path,t))));return n.common.async?Promise.all(d).then((e=>o(e))):o(d)}min(e,t){return new _e({...this._def,minSize:{value:e,message:b.toString(t)}})}max(e,t){return new _e({...this._def,maxSize:{value:e,message:b.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}_e.create=(e,t)=>new _e({valueType:e,minSize:null,maxSize:null,typeName:De.ZodSet,...E(t)});class we extends O{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==r.function)return u(t,{code:a.invalid_type,expected:r.function,received:t.parsedType}),p;function n(e,r){return c({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),i].filter((e=>!!e)),issueData:{code:a.invalid_arguments,argumentsError:r}})}function o(e,r){return c({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,d(),i].filter((e=>!!e)),issueData:{code:a.invalid_return_type,returnTypeError:r}})}const l={errorMap:t.common.contextualErrorMap},h=t.data;if(this._def.returns instanceof Ee){const e=this;return f((async function(...t){const r=new s([]),a=await e._def.args.parseAsync(t,l).catch((e=>{throw r.addIssue(n(t,e)),r})),i=await Reflect.apply(h,this,a);return await e._def.returns._def.type.parseAsync(i,l).catch((e=>{throw r.addIssue(o(i,e)),r}))}))}{const e=this;return f((function(...t){const r=e._def.args.safeParse(t,l);if(!r.success)throw new s([n(t,r.error)]);const a=Reflect.apply(h,this,r.data),i=e._def.returns.safeParse(a,l);if(!i.success)throw new s([o(a,i.error)]);return i.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new we({...this._def,args:ye.create(e).rest(se.create())})}returns(e){return new we({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new we({args:e||ye.create([]).rest(se.create()),returns:t||se.create(),typeName:De.ZodFunction,...E(r)})}}class be extends O{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}be.create=(e,t)=>new be({getter:e,typeName:De.ZodLazy,...E(t)});class ke extends O{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:a.invalid_literal,expected:this._def.value}),p}return{status:"valid",value:e.data}}get value(){return this._def.value}}function xe(e,t){return new Se({values:e,typeName:De.ZodEnum,...E(t)})}ke.create=(e,t)=>new ke({value:e,typeName:De.ZodLiteral,...E(t)});class Se extends O{constructor(){super(...arguments),k.set(this,void 0)}_parse(t){if("string"!=typeof t.data){const r=this._getOrReturnCtx(t),n=this._def.values;return u(r,{expected:e.joinValues(n),received:r.parsedType,code:a.invalid_type}),p}if(_(this,k)||w(this,k,new Set(this._def.values)),!_(this,k).has(t.data)){const e=this._getOrReturnCtx(t),r=this._def.values;return u(e,{received:e.data,code:a.invalid_enum_value,options:r}),p}return f(t.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Se.create(e,{...this._def,...t})}exclude(e,t=this._def){return Se.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}k=new WeakMap,Se.create=xe;class Te extends O{constructor(){super(...arguments),x.set(this,void 0)}_parse(t){const n=e.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(t);if(s.parsedType!==r.string&&s.parsedType!==r.number){const t=e.objectValues(n);return u(s,{expected:e.joinValues(t),received:s.parsedType,code:a.invalid_type}),p}if(_(this,x)||w(this,x,new Set(e.getValidEnumValues(this._def.values))),!_(this,x).has(t.data)){const t=e.objectValues(n);return u(s,{received:s.data,code:a.invalid_enum_value,options:t}),p}return f(t.data)}get enum(){return this._def.values}}x=new WeakMap,Te.create=(e,t)=>new Te({values:e,typeName:De.ZodNativeEnum,...E(t)});class Ee extends O{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==r.promise&&!1===t.common.async)return u(t,{code:a.invalid_type,expected:r.promise,received:t.parsedType}),p;const n=t.parsedType===r.promise?t.data:Promise.resolve(t.data);return f(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}Ee.create=(e,t)=>new Ee({type:e,typeName:De.ZodPromise,...E(t)});class Oe extends O{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===De.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),a=this._def.effect||null,s={addIssue:e=>{u(n,e),e.fatal?r.abort():r.dirty()},get path(){return n.path}};if(s.addIssue=s.addIssue.bind(s),"preprocess"===a.type){const e=a.transform(n.data,s);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===r.value)return p;const t=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===t.status?p:"dirty"===t.status||"dirty"===r.value?h(t.value):t}));{if("aborted"===r.value)return p;const t=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===t.status?p:"dirty"===t.status||"dirty"===r.value?h(t.value):t}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,s);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const t=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===t.status?p:("dirty"===t.status&&r.dirty(),e(t.value),{status:r.value,value:t.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((t=>"aborted"===t.status?p:("dirty"===t.status&&r.dirty(),e(t.value).then((()=>({status:r.value,value:t.value}))))))}if("transform"===a.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!g(e))return e;const t=a.transform(e.value,s);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:t}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>g(e)?Promise.resolve(a.transform(e.value,s)).then((e=>({status:r.value,value:e}))):e))}e.assertNever(a)}}Oe.create=(e,t,r)=>new Oe({schema:e,typeName:De.ZodEffects,effect:t,...E(r)}),Oe.createWithPreprocess=(e,t,r)=>new Oe({schema:t,effect:{type:"preprocess",transform:e},typeName:De.ZodEffects,...E(r)});class Ze extends O{_parse(e){return this._getType(e)===r.undefined?f(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ze.create=(e,t)=>new Ze({innerType:e,typeName:De.ZodOptional,...E(t)});class Ne extends O{_parse(e){return this._getType(e)===r.null?f(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Ne.create=(e,t)=>new Ne({innerType:e,typeName:De.ZodNullable,...E(t)});class je extends O{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===r.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}je.create=(e,t)=>new je({innerType:e,typeName:De.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...E(t)});class Pe extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return v(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new s(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new s(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Pe.create=(e,t)=>new Pe({innerType:e,typeName:De.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...E(t)});class Ae extends O{_parse(e){if(this._getType(e)!==r.nan){const t=this._getOrReturnCtx(e);return u(t,{code:a.invalid_type,expected:r.nan,received:t.parsedType}),p}return{status:"valid",value:e.data}}}Ae.create=e=>new Ae({typeName:De.ZodNaN,...E(e)});const Ce=Symbol("zod_brand");class Ie extends O{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Re extends O{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),h(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?p:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Re({in:e,out:t,typeName:De.ZodPipeline})}}class Fe extends O{_parse(e){const t=this._def.innerType._parse(e),r=e=>(g(e)&&(e.value=Object.freeze(e.value)),e);return v(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function $e(e,t){const r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function Le(e,t={},r){return e?ae.create().superRefine(((n,a)=>{var s,i;const o=e(n);if(o instanceof Promise)return o.then((e=>{var s,i;if(!e){const e=$e(t,n),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:r)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}}));if(!o){const e=$e(t,n),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:r)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}})):ae.create()}Fe.create=(e,t)=>new Fe({innerType:e,typeName:De.ZodReadonly,...E(t)});const Me={object:ue.lazycreate};var De;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(De||(De={}));const Ue=J.create,ze=G.create,qe=Ae.create,Ve=X.create,He=Q.create,Be=ee.create,We=te.create,Ke=re.create,Je=ne.create,Ye=ae.create,Ge=se.create,Xe=ie.create,Qe=oe.create,et=de.create,tt=ue.create,rt=ue.strictCreate,nt=le.create,at=he.create,st=me.create,it=ye.create,ot=ge.create,dt=ve.create,ct=_e.create,ut=we.create,lt=be.create,pt=ke.create,ht=Se.create,ft=Te.create,mt=Ee.create,yt=Oe.create,gt=Ze.create,vt=Ne.create,_t=Oe.createWithPreprocess,wt=Re.create,bt={string:e=>J.create({...e,coerce:!0}),number:e=>G.create({...e,coerce:!0}),boolean:e=>Q.create({...e,coerce:!0}),bigint:e=>X.create({...e,coerce:!0}),date:e=>ee.create({...e,coerce:!0})},kt=p;var xt=Object.freeze({__proto__:null,defaultErrorMap:i,setErrorMap:function(e){o=e},getErrorMap:d,makeIssue:c,EMPTY_PATH:[],addIssueToContext:u,ParseStatus:l,INVALID:p,DIRTY:h,OK:f,isAborted:m,isDirty:y,isValid:g,isAsync:v,get util(){return e},get objectUtil(){return t},ZodParsedType:r,getParsedType:n,ZodType:O,datetimeRegex:B,ZodString:J,ZodNumber:G,ZodBigInt:X,ZodBoolean:Q,ZodDate:ee,ZodSymbol:te,ZodUndefined:re,ZodNull:ne,ZodAny:ae,ZodUnknown:se,ZodNever:ie,ZodVoid:oe,ZodArray:de,ZodObject:ue,ZodUnion:le,ZodDiscriminatedUnion:he,ZodIntersection:me,ZodTuple:ye,ZodRecord:ge,ZodMap:ve,ZodSet:_e,ZodFunction:we,ZodLazy:be,ZodLiteral:ke,ZodEnum:Se,ZodNativeEnum:Te,ZodPromise:Ee,ZodEffects:Oe,ZodTransformer:Oe,ZodOptional:Ze,ZodNullable:Ne,ZodDefault:je,ZodCatch:Pe,ZodNaN:Ae,BRAND:Ce,ZodBranded:Ie,ZodPipeline:Re,ZodReadonly:Fe,custom:Le,Schema:O,ZodSchema:O,late:Me,get ZodFirstPartyTypeKind(){return De},coerce:bt,any:Ye,array:et,bigint:Ve,boolean:He,date:Be,discriminatedUnion:at,effect:yt,enum:ht,function:ut,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Le((t=>t instanceof e),t),intersection:st,lazy:lt,literal:pt,map:dt,nan:qe,nativeEnum:ft,never:Xe,null:Je,nullable:vt,number:ze,object:tt,oboolean:()=>He().optional(),onumber:()=>ze().optional(),optional:gt,ostring:()=>Ue().optional(),pipeline:wt,preprocess:_t,promise:mt,record:ot,set:ct,strictObject:rt,string:Ue,symbol:We,transformer:yt,tuple:it,undefined:Ke,union:nt,unknown:Ge,void:Qe,NEVER:kt,ZodIssueCode:a,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:s});const St=xt.object({detail:xt.string()}),Tt=xt.object({error:xt.string()});function Et(e){if(!e)return"Unknown error";if(e instanceof Error){const t=St.safeParse(e.cause);return t.success?t.data.detail:function(e){const t=function(e){try{return JSON.parse(e)}catch{return e}}(e);if(!t)return e;const r=St.safeParse(t);if(r.success)return r.data.detail;const n=Tt.safeParse(t);if(n.success)return n.data.error;return e}(e.message)}if("object"==typeof e){const t=St.safeParse(e);if(t.success)return t.data.detail;const r=Tt.safeParse(e);if(r.success)return r.data.error}try{return JSON.stringify(e)}catch{return String(e)}}const Ot=1e3;function Zt(e,t){const r=e.map((e=>`"${e}"`)).join(", ");return new Error(`This RPC instance cannot ${t} because the transport did not provide one or more of these methods: ${r}`)}function Nt(e={}){let t={};function r(e){t=e}let n,a={};function s(e){a.unregisterHandler&&a.unregisterHandler(),a=e,a.registerHandler?.(_)}function i(e){n="function"!=typeof e?(t,r)=>{const n=e[t];if(n)return n(r);const a=e._;if(!a)throw new Error(`The requested method has no handler: ${t}`);return a(t,r)}:e}const{maxRequestTime:o=Ot}=e;e.transport&&s(e.transport),e.requestHandler&&i(e.requestHandler),e._debugHooks&&r(e._debugHooks);let d=0;const c=new Map,u=new Map;function l(e,...r){const n=r[0];return new Promise(((r,s)=>{if(!a.send)throw Zt(["send"],"make requests");const i=d<=1e10?++d:d=0,l={type:"request",id:i,method:e,params:n};c.set(i,{resolve:r,reject:s}),o!==1/0&&u.set(i,setTimeout((()=>{u.delete(i),s(new Error("RPC request timed out."))}),o)),t.onSend?.(l),a.send(l)}))}const p=new Proxy(l,{get:(e,t,r)=>t in e?Reflect.get(e,t,r):e=>l(t,e)}),h=p;function f(e,...r){const n=r[0];if(!a.send)throw Zt(["send"],"send messages");const s={type:"message",id:e,payload:n};t.onSend?.(s),a.send(s)}const m=new Proxy(f,{get:(e,t,r)=>t in e?Reflect.get(e,t,r):e=>f(t,e)}),y=m,g=new Map,v=new Set;async function _(e){if(t.onReceive?.(e),!("type"in e))throw new Error("Message does not contain a type.");if("request"===e.type){if(!a.send||!n)throw Zt(["send","requestHandler"],"handle requests");const{id:s,method:i,params:o}=e;let d;try{d={type:"response",id:s,success:!0,payload:await n(i,o)}}catch(r){if(!(r instanceof Error))throw r;d={type:"response",id:s,success:!1,error:r.message}}return t.onSend?.(d),void a.send(d)}if("response"!==e.type){if("message"!==e.type)throw new Error(`Unexpected RPC message type: ${e.type}`);{for(const r of v)r(e.id,e.payload);const t=g.get(e.id);if(!t)return;for(const r of t)r(e.payload)}}else{const t=u.get(e.id);null!=t&&clearTimeout(t);const{resolve:r,reject:n}=c.get(e.id)??{};e.success?r?.(e.payload):n?.(new Error(e.error))}}return{setTransport:s,setRequestHandler:i,request:p,requestProxy:h,send:m,sendProxy:y,addMessageListener:function(e,t){if(!a.registerHandler)throw Zt(["registerHandler"],"register message listeners");"*"!==e?(g.has(e)||g.set(e,new Set),g.get(e)?.add(t)):v.add(t)},removeMessageListener:function(e,t){"*"!==e?(g.get(e)?.delete(t),0===g.get(e)?.size&&g.delete(e)):v.delete(t)},proxy:{send:y,request:h},_setDebugHooks:r}}const jt="[transport-id]";function Pt(e,t={}){const{transportId:r,filter:n,remotePort:a}=t,s=e,i=a??e;let o;return{send(e){i.postMessage(function(e,t){const{transportId:r}=t;return null!=r?{[jt]:r,data:e}:e}(e,{transportId:r}))},registerHandler(e){o=t=>{const a=t.data,[s,i]=function(e,t){const{transportId:r,filter:n}=t,a=n?.();if(null!=r&&null!=a)throw new Error("Cannot use both `transportId` and `filter` at the same time");let s=e;if(r){if(e[jt]!==r)return[!0];s=e.data}return!1===a?[!0]:[!1,s]}(a,{transportId:r,filter:()=>n?.(t)});s||e(i)},s.addEventListener("message",o)},unregisterHandler(){o&&s.removeEventListener("message",o)}}}const At=()=>{},Ct=(e,t)=>{const r=`[${e}]`;return{debug:(...e)=>t.debug(r,...e),log:(...e)=>t.log(r,...e),warn:(...e)=>t.warn(r,...e),error:(...e)=>t.error(r,...e),trace:(...e)=>t.trace(r,...e),get:r=>Ct(`${e}.${r}`,t),disabled:(e=!0)=>e?Rt:t}},It={debug:(...e)=>{},log:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)},error:(...e)=>{console.error(...e)},trace:(...e)=>{console.trace(...e)},get:e=>Ct(e,It),disabled:(e=!0)=>e?Rt:It},Rt={debug:()=>At,log:()=>At,warn:()=>At,error:()=>At,trace:()=>At,get:()=>Rt,disabled:()=>Rt};const Ft="undefined"!=typeof window&&window.Logger||It;var $t,Lt=Object.defineProperty,Mt=(e,t)=>Lt(e,"name",{value:t,configurable:!0}),Dt=($t=function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')},typeof require<"u"?require:typeof Proxy<"u"?new Proxy($t,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):$t);function Ut(e){return!isNaN(parseFloat(e))&&isFinite(e)}function zt(e){return e.charAt(0).toUpperCase()+e.substring(1)}function qt(e){return function(){return this[e]}}Mt(Ut,"_isNumber"),Mt(zt,"_capitalize"),Mt(qt,"_getter");var Vt,Ht,Bt=["isConstructor","isEval","isNative","isToplevel"],Wt=["columnNumber","lineNumber"],Kt=["fileName","functionName","source"],Jt=Bt.concat(Wt,Kt,["args"],["evalOrigin"]);function Yt(e){if(e)for(var t=0;t<Jt.length;t++)void 0!==e[Jt[t]]&&this["set"+zt(Jt[t])](e[Jt[t]])}for(Mt(Yt,"StackFrame"),Yt.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof Yt)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new Yt(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",n=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:n?n+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r}},Yt.fromString=Mt((function(e){var t=e.indexOf("("),r=e.lastIndexOf(")"),n=e.substring(0,t),a=e.substring(t+1,r).split(","),s=e.substring(r+1);if(0===s.indexOf("@"))var i=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s,""),o=i[1],d=i[2],c=i[3];return new Yt({functionName:n,args:a||void 0,fileName:o,lineNumber:d||void 0,columnNumber:c||void 0})}),"StackFrame$$fromString"),Vt=0;Vt<Bt.length;Vt++)Yt.prototype["get"+zt(Bt[Vt])]=qt(Bt[Vt]),Yt.prototype["set"+zt(Bt[Vt])]=function(e){return function(t){this[e]=!!t}}(Bt[Vt]);for(Ht=0;Ht<Wt.length;Ht++)Yt.prototype["get"+zt(Wt[Ht])]=qt(Wt[Ht]),Yt.prototype["set"+zt(Wt[Ht])]=function(e){return function(t){if(!Ut(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(Wt[Ht]);for(Gt=0;Gt<Kt.length;Gt++)Yt.prototype["get"+zt(Kt[Gt])]=qt(Kt[Gt]),Yt.prototype["set"+zt(Kt[Gt])]=function(e){return function(t){this[e]=String(t)}}(Kt[Gt]);var Gt,Xt=Yt;function Qt(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:Mt((function(t){if(t.stack&&t.stack.match(e))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")}),"ErrorStackParser$$parse"),extractLocation:Mt((function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]}),"ErrorStackParser$$extractLocation"),parseV8OrIE:Mt((function(t){return t.stack.split("\n").filter((function(t){return!!t.match(e)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=t.match(/ (\(.+\)$)/);t=r?t.replace(r[0],""):t;var n=this.extractLocation(r?r[1]:t),a=r&&t||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new Xt({functionName:a,fileName:s,lineNumber:n[1],columnNumber:n[2],source:e})}),this)}),"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:Mt((function(e){return e.stack.split("\n").filter((function(e){return!e.match(t)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new Xt({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,a=this.extractLocation(e.replace(t,""));return new Xt({functionName:n,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:e})}),this)}),"ErrorStackParser$$parseFFOrSafari")}}Mt(Qt,"ErrorStackParser");var er,tr,rr,nr,ar,sr,ir,or,dr,cr=new Qt,ur="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&!process.browser,lr=ur&&typeof module<"u"&&typeof module.exports<"u"&&typeof Dt<"u"&&typeof __dirname<"u",pr=ur&&!lr,hr=typeof Deno<"u",fr=!ur&&!hr,mr=fr&&"object"==typeof window&&"object"==typeof document&&"function"==typeof document.createElement&&"sessionStorage"in window&&"function"!=typeof importScripts,yr=fr&&"function"==typeof importScripts&&"object"==typeof self;async function gr(){if(!ur||(er=(await import("./__vite-browser-external-CIEyP2s7.js")).default,nr=await import("./__vite-browser-external-CIEyP2s7.js"),ar=await import("./__vite-browser-external-CIEyP2s7.js"),rr=(await import("./__vite-browser-external-CIEyP2s7.js")).default,tr=await import("./__vite-browser-external-CIEyP2s7.js"),ir=tr.sep,typeof Dt<"u"))return;let e={fs:nr,crypto:await import("./__vite-browser-external-CIEyP2s7.js"),ws:await import("./__vite-browser-external-CIEyP2s7.js"),child_process:await import("./__vite-browser-external-CIEyP2s7.js")};globalThis.require=function(t){return e[t]}}function vr(e,t){return tr.resolve(t||".",e)}function _r(e,t){return void 0===t&&(t=location),new URL(e,t).toString()}function wr(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:ar.readFile(e).then((e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))}}function br(e,t){let r=new URL(e,location);return{response:fetch(r,t?{integrity:t}:{})}}async function kr(e,t){let{response:r,binary:n}=or(e,t);if(n)return n;let a=await r;if(!a.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await a.arrayBuffer())}if("object"==typeof navigator&&"string"==typeof navigator.userAgent&&-1==navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Safari"),Mt(gr,"initNodeModules"),Mt(vr,"node_resolvePath"),Mt(_r,"browser_resolvePath"),sr=ur?vr:_r,ur||(ir="/"),Mt(wr,"node_getBinaryResponse"),Mt(br,"browser_getBinaryResponse"),or=ur?wr:br,Mt(kr,"loadBinaryFile"),mr)dr=Mt((async e=>await import(e)),"loadScript");else if(yr)dr=Mt((async e=>{try{globalThis.importScripts(e)}catch(Jr){if(!(Jr instanceof TypeError))throw Jr;await import(e)}}),"loadScript");else{if(!ur)throw new Error("Cannot determine runtime environment");dr=xr}async function xr(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?rr.runInThisContext(await(await fetch(e)).text()):await import(er.pathToFileURL(e).href)}async function Sr(e){if(ur){await gr();let t=await ar.readFile(e,{encoding:"utf8"});return JSON.parse(t)}return await(await fetch(e)).json()}async function Tr(){if(lr)return __dirname;let e;try{throw new Error}catch(n){e=n}let t=cr.parse(e)[0].fileName;if(ur&&!t.startsWith("file://")&&(t=`file://${t}`),pr){let e=await import("./__vite-browser-external-CIEyP2s7.js");return(await import("./__vite-browser-external-CIEyP2s7.js")).fileURLToPath(e.dirname(t))}let r=t.lastIndexOf(ir);if(-1===r)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,r)}function Er(e){let t=e.FS,r=e.FS.filesystems.MEMFS,n=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:function(e){if(!e.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return r.mount.apply(null,arguments)},syncfs:async(e,t,r)=>{try{let n=a.getLocalSet(e),s=await a.getRemoteSet(e),i=t?s:n,o=t?n:s;await a.reconcile(e,i,o),r(null)}catch(n){r(n)}},getLocalSet:e=>{let r=Object.create(null);function a(e){return"."!==e&&".."!==e}function s(e){return t=>n.join2(e,t)}Mt(a,"isRealDir"),Mt(s,"toAbsolute");let i=t.readdir(e.mountpoint).filter(a).map(s(e.mountpoint));for(;i.length;){let e=i.pop(),n=t.stat(e);t.isDir(n.mode)&&i.push.apply(i,t.readdir(e).filter(a).map(s(e))),r[e]={timestamp:n.mtime,mode:n.mode}}return{type:"local",entries:r}},getRemoteSet:async e=>{let t=Object.create(null),r=await Or(e.opts.fileSystemHandle);for(let[s,i]of r)"."!==s&&(t[n.join2(e.mountpoint,s)]={timestamp:"file"===i.kind?new Date((await i.getFile()).lastModified):new Date,mode:"file"===i.kind?a.FILE_MODE:a.DIR_MODE});return{type:"remote",entries:t,handles:r}},loadLocalEntry:e=>{let n=t.lookupPath(e).node,a=t.stat(e);if(t.isDir(a.mode))return{timestamp:a.mtime,mode:a.mode};if(t.isFile(a.mode))return n.contents=r.getFileDataAsTypedArray(n),{timestamp:a.mtime,mode:a.mode,contents:n.contents};throw new Error("node type not supported")},storeLocalEntry:(e,r)=>{if(t.isDir(r.mode))t.mkdirTree(e,r.mode);else{if(!t.isFile(r.mode))throw new Error("node type not supported");t.writeFile(e,r.contents,{canOwn:!0})}t.chmod(e,r.mode),t.utime(e,r.timestamp,r.timestamp)},removeLocalEntry:e=>{var r=t.stat(e);t.isDir(r.mode)?t.rmdir(e):t.isFile(r.mode)&&t.unlink(e)},loadRemoteEntry:async e=>{if("file"===e.kind){let t=await e.getFile();return{contents:new Uint8Array(await t.arrayBuffer()),mode:a.FILE_MODE,timestamp:new Date(t.lastModified)}}if("directory"===e.kind)return{mode:a.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+e.kind)},storeRemoteEntry:async(e,r,a)=>{let s=e.get(n.dirname(r)),i=t.isFile(a.mode)?await s.getFileHandle(n.basename(r),{create:!0}):await s.getDirectoryHandle(n.basename(r),{create:!0});if("file"===i.kind){let e=await i.createWritable();await e.write(a.contents),await e.close()}e.set(r,i)},removeRemoteEntry:async(e,t)=>{await e.get(n.dirname(t)).removeEntry(n.basename(t)),e.delete(t)},reconcile:async(e,r,s)=>{let i=0,o=[];Object.keys(r.entries).forEach((function(e){let n=r.entries[e],a=s.entries[e];(!a||t.isFile(n.mode)&&n.timestamp.getTime()>a.timestamp.getTime())&&(o.push(e),i++)})),o.sort();let d=[];if(Object.keys(s.entries).forEach((function(e){r.entries[e]||(d.push(e),i++)})),d.sort().reverse(),!i)return;let c="remote"===r.type?r.handles:s.handles;for(let t of o){let r=n.normalize(t.replace(e.mountpoint,"/")).substring(1);if("local"===s.type){let e=c.get(r),n=await a.loadRemoteEntry(e);a.storeLocalEntry(t,n)}else{let e=a.loadLocalEntry(t);await a.storeRemoteEntry(c,r,e)}}for(let t of d)if("local"===s.type)a.removeLocalEntry(t);else{let r=n.normalize(t.replace(e.mountpoint,"/")).substring(1);await a.removeRemoteEntry(c,r)}}};e.FS.filesystems.NATIVEFS_ASYNC=a}Mt(xr,"nodeLoadScript"),Mt(Sr,"loadLockFile"),Mt(Tr,"calculateDirname"),Mt(Er,"initializeNativeFS");var Or=Mt((async e=>{let t=[];async function r(e){for await(let n of e.values())t.push(n),"directory"===n.kind&&await r(n)}Mt(r,"collect"),await r(e);let n=new Map;n.set(".",e);for(let a of t){let t=(await e.resolve(a)).join("/");n.set(t,a)}return n}),"getFsHandles");function Zr(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Cr(e),quit(e,r){throw t.exited={status:e,toThrow:r},r},print:e.stdout,printErr:e.stderr,thisProgram:e._sysExecutable,arguments:e.args,API:{config:e},locateFile:t=>e.indexURL+t,instantiateWasm:Ir(e.indexURL)};return t}function Nr(e){return function(t){try{t.FS.mkdirTree(e)}catch(r){console.error(`Error occurred while making a home directory '${e}':`),console.error(r),console.error("Using '/' for a home directory instead"),e="/"}t.FS.chdir(e)}}function jr(e){return function(t){Object.assign(t.ENV,e)}}function Pr(e){return e?[async t=>{t.addRunDependency("fsInitHook");try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency("fsInitHook")}}]:[]}function Ar(e){let t=kr(e);return async e=>{let r=e._py_version_major(),n=e._py_version_minor();e.FS.mkdirTree("/lib"),e.API.sitePackages=`/lib/python${r}.${n}/site-packages`,e.FS.mkdirTree(e.API.sitePackages),e.addRunDependency("install-stdlib");try{let a=await t;e.FS.writeFile(`/lib/python${r}${n}.zip`,a)}catch(a){console.error("Error occurred while installing the standard library:"),console.error(a)}finally{e.removeRunDependency("install-stdlib")}}}function Cr(e){let t;return t=null!=e.stdLibURL?e.stdLibURL:e.indexURL+"python_stdlib.zip",[...Pr(e.fsInit),Ar(t),Nr(e.env.HOME),jr(e.env),Er]}function Ir(e){if(typeof WasmOffsetConverter<"u")return;let{binary:t,response:r}=or(e+"pyodide.asm.wasm");return function(e,n){return async function(){try{let a;a=r?await WebAssembly.instantiateStreaming(r,e):await WebAssembly.instantiate(await t,e);let{instance:s,module:i}=a;n(s,i)}catch(a){console.warn("wasm instantiation failed!"),console.warn(a)}}(),{}}}Mt(Zr,"createSettings"),Mt(Nr,"createHomeDirectory"),Mt(jr,"setEnvironment"),Mt(Pr,"callFsInitHook"),Mt(Ar,"installStdlib"),Mt(Cr,"getFileSystemInitializationFuncs"),Mt(Ir,"getInstantiateWasmFunc");var Rr="0.27.5";async function Fr(e={}){var t,r;await gr();let n=e.indexURL||await Tr();n=sr(n),n.endsWith("/")||(n+="/"),e.indexURL=n;let a={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:n+"pyodide-lock.json",args:[],env:{},packageCacheDir:n,packages:[],enableRunUntilComplete:!1,checkAPIVersion:!0,BUILD_ID:"bd0388b62e760f8ba04185eb443fec955f25434f49c7b951efe5b1f792dbe5d4"},s=Object.assign(a,e);(t=s.env).HOME??(t.HOME="/home/pyodide"),(r=s.env).PYTHONINSPECT??(r.PYTHONINSPECT="1");let i,o=Zr(s),d=o.API;if(d.lockFilePromise=Sr(s.lockFileURL),"function"!=typeof _createPyodideModule){let e=`${s.indexURL}pyodide.asm.js`;await dr(e)}if(e._loadSnapshot){let t=await e._loadSnapshot;i=ArrayBuffer.isView(t)?t:new Uint8Array(t),o.noInitialRun=!0,o.INITIAL_MEMORY=i.length}let c,u=await _createPyodideModule(o);if(o.exited)throw o.exited.toThrow;if(e.pyproxyToStringRepr&&d.setPyProxyToStringMethod(!0),d.version!==Rr&&s.checkAPIVersion)throw new Error(`Pyodide version does not match: '${Rr}' <==> '${d.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);u.locateFile=e=>{throw new Error("Didn't expect to load any more file_packager files!")},i&&(c=d.restoreSnapshot(i));let l=d.finalizeBootstrap(c,e._snapshotDeserializer);return d.sys.path.insert(0,d.config.env.HOME),l.version.includes("dev")||d.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${l.version}/full/`),d._pyodide.set_excepthook(),await d.packageIndexReady,d.initializeStreams(s.stdin,s.stdout,s.stderr),l}Mt(Fr,"loadPyodide");function $r(e){return e.FS}const Lr=e=>(new TextDecoder).decode(e),Mr="notebook.py",Dr="/marimo",Ur=Mr,zr=e=>{const t=$r(e);try{t.mkdirTree(Dr)}catch{}t.chdir(Dr)},qr=e=>{$r(e).mount(e.FS.filesystems.IDBFS,{root:"."},Dr)},Vr=async e=>{await Kr(e,!0)},Hr=async e=>{await Kr(e,!1)},Br=e=>{const t=$r(e),r=`${Dr}/${Mr}`;return Lr(t.readFile(r))},Wr=e=>{const{pyodide:t,filename:r,code:n}=e,a=$r(t);if(r&&r!==Mr){const e=(e=>{try{return Lr(a.readFile(e))}catch{return null}})(r);if(e)return{code:e,filename:r}}return a.writeFile(Mr,n),{code:n,filename:Mr}};function Kr(e,t){return new Promise(((r,n)=>{$r(e).syncfs(t,(e=>{e instanceof Error?n(e):r()}))}))}const Jr=new class{constructor(){this.spans=[]}startSpan(e,t={}){const r={name:e,startTime:Date.now(),attributes:t,end:(e="ok")=>this.endSpan(r,e)};return this.spans.push(r),r}endSpan(e,t="ok"){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,r={}){const n=this.startSpan(t||e.name,r);try{const t=e();return this.endSpan(n),t}catch(a){throw this.endSpan(n,"error"),a}}wrapAsync(e,t,r={}){return async(...n)=>{const a=this.startSpan(t||e.name,r);try{const t=await e(...n);return this.endSpan(a),t}catch(s){throw this.endSpan(a,"error"),s}}}logSpans(){}};globalThis.t=Jr;class Yr{constructor(){this.pyodide=null}get requirePyodide(){return function(e,t){if(!e)throw new Error(t)}(this.pyodide,"Pyodide not loaded"),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!Fr)throw new Error("loadPyodide is not defined");const t=Jr.startSpan("loadPyodide");try{const r=await Fr({packages:["micropip","marimo-base","Markdown","pymdown-extensions","narwhals","packaging"],_makeSnapshot:false,lockFileURL:`https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,indexURL:`https://cdn.jsdelivr.net/pyodide/${e.pyodideVersion}/full/`});return this.pyodide=r,t.end("ok"),r}catch(r){throw Ft.error("Failed to load Pyodide",r),r}}async mountFilesystem(e){const t=Jr.startSpan("mountFilesystem");return zr(this.requirePyodide),qr(this.requirePyodide),await Vr(this.requirePyodide),t.end("ok"),Wr({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){const{code:t,filename:r,onMessage:n,queryParameters:a,userConfig:s}=e;self.messenger={callback:n},self.query_params=a,self.user_config=s;const i=Jr.startSpan("startSession.runPython"),o=r||Ur,[d,c,u]=this.requirePyodide.runPython(`\n print("[py] Starting marimo...")\n import asyncio\n import js\n from marimo._pyodide.bootstrap import create_session, instantiate\n\n assert js.messenger, "messenger is not defined"\n assert js.query_params, "query_params is not defined"\n\n session, bridge = create_session(\n filename="${o}",\n query_params=js.query_params.to_py(),\n message_callback=js.messenger.callback,\n user_config=js.user_config.to_py(),\n )\n\n def init(auto_instantiate=True):\n instantiate(session, auto_instantiate)\n asyncio.create_task(session.start())\n\n # Find the packages to install\n with open("${o}", "r") as f:\n packages = session.find_packages(f.read())\n\n bridge, init, packages`);i.end();const l=new Set(u.toJs());return this.loadNotebookDeps(t,l).then((()=>c(s.runtime.auto_instantiate))),d}async loadNotebookDeps(e,t){const r=this.requirePyodide;e.includes("mo.sql")&&(e=`import sqlglot\n${e=`import duckdb\n${e=`import pandas\n${e}`}`}`).includes("polars")&&(e=`import pyarrow\n${e}`),e=`import pyodide_http\n${e=`import jedi\n${e=`import pygments\n${e=`import docutils\n${e}`}`}`}`;const n=[...t];let a=Jr.startSpan("pyodide.loadPackage");await r.loadPackagesFromImports(e,{errorCallback:Ft.error,messageCallback:Ft.log}),a.end(),a=Jr.startSpan("micropip.install");const s=n.filter((e=>!r.loadedPackages[e]));s.length>0&&await r.runPythonAsync(`\n import micropip\n import sys\n # Filter out builtins\n missing = [p for p in ${JSON.stringify(s)} if p not in sys.modules]\n if len(missing) > 0:\n print("Loading from micropip:", missing)\n await micropip.install(missing)\n `).catch((e=>{Ft.error("Failed to load packages from micropip",e)})),a.end()}}const Gr=async function(){try{const e=self.name,t=function(e){return e.includes("dev"),`v${Rr}`}(e),r=await async function(e){try{return await import(`/wasm/controller.js?version=${e}`)}catch{return new Yr}}(e);self.controller=r,self.pyodide=await r.bootstrap({version:e,pyodideVersion:t}),await(r.mountFilesystem?.({code:"",filename:null})),Qr.send.initialized({})}catch(e){Ft.error("Error bootstrapping",e),Qr.send.initializedError({error:Et(e)})}}(),Xr={readFile:async e=>{await Gr;return Lr(self.pyodide.FS.readFile(e))},readNotebook:async()=>(await Gr,Br(self.pyodide)),saveNotebook:async e=>{await Gr;const t=self.pyodide.runPython("\n from marimo._pyodide.bootstrap import save_file\n\n save_file\n ");await t(JSON.stringify(e),Ur),await Hr(self.pyodide)}},Qr=function(e){return Nt(e)}({transport:(en={transportId:"marimo-transport"},Pt(self,en)),requestHandler:Xr});var en;Qr.send("ready",{});
@@ -1,4 +1,4 @@
1
- var yt;import{a as he,b as vt,g as It,d as pe,c as ge,e as ue}from"./chunk-D6G4REZN-SHP1AEu6.js";import{I as xe}from"./chunk-XZIHB7SX-CDHSRDvI.js";import{_ as g,n as ye,c as Z,l as j,i as zt,d as me,e as be,j as L,b as Ht,s as Te,p as Ee,a as fe,g as we,q as Ie,y as Le,h as Lt,u as $,M as nt,N as bt,O as jt,Z as Pe,P as Ut,F as Mt}from"./mermaid-Dj7jjx8c.js";import{s as Ot}from"./transform-Cyp0GDF-.js";import"./index-C5ey_n6K.js";import"./step-BwsUM5iJ.js";import"./timer-DFzT7np-.js";var St=function(){var e=g(function(w,A,_,T){for(_=_||{},T=w.length;T--;_[w[T]]=A);return _},"o"),t=[1,2],c=[1,3],a=[1,4],r=[2,4],i=[1,9],n=[1,11],d=[1,13],h=[1,14],s=[1,16],x=[1,17],E=[1,18],u=[1,24],m=[1,25],f=[1,26],I=[1,27],N=[1,28],C=[1,29],M=[1,30],B=[1,31],D=[1,32],F=[1,33],z=[1,34],U=[1,35],Q=[1,36],W=[1,37],q=[1,38],V=[1,39],O=[1,41],K=[1,42],H=[1,43],X=[1,44],tt=[1,45],v=[1,46],b=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],P=[4,5,16,50,52,53],G=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],rt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],k=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],Yt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],it=[68,69,70],ct=[1,122],At={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:g(function(w,A,_,T,S,l,mt){var p=l.length-1;switch(S){case 3:return T.apply(l[p]),l[p];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:l[p-1].push(l[p]),this.$=l[p-1];break;case 6:case 7:case 11:case 12:case 62:this.$=l[p];break;case 15:l[p].type="createParticipant",this.$=l[p];break;case 16:l[p-1].unshift({type:"boxStart",boxData:T.parseBoxData(l[p-2])}),l[p-1].push({type:"boxEnd",boxText:l[p-2]}),this.$=l[p-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-2]),sequenceIndexStep:Number(l[p-1]),sequenceVisible:!0,signalType:T.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:T.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:T.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:T.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:T.LINETYPE.ACTIVE_START,actor:l[p-1].actor};break;case 23:this.$={type:"activeEnd",signalType:T.LINETYPE.ACTIVE_END,actor:l[p-1].actor};break;case 29:T.setDiagramTitle(l[p].substring(6)),this.$=l[p].substring(6);break;case 30:T.setDiagramTitle(l[p].substring(7)),this.$=l[p].substring(7);break;case 31:this.$=l[p].trim(),T.setAccTitle(this.$);break;case 32:case 33:this.$=l[p].trim(),T.setAccDescription(this.$);break;case 34:l[p-1].unshift({type:"loopStart",loopText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.LOOP_START}),l[p-1].push({type:"loopEnd",loopText:l[p-2],signalType:T.LINETYPE.LOOP_END}),this.$=l[p-1];break;case 35:l[p-1].unshift({type:"rectStart",color:T.parseMessage(l[p-2]),signalType:T.LINETYPE.RECT_START}),l[p-1].push({type:"rectEnd",color:T.parseMessage(l[p-2]),signalType:T.LINETYPE.RECT_END}),this.$=l[p-1];break;case 36:l[p-1].unshift({type:"optStart",optText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.OPT_START}),l[p-1].push({type:"optEnd",optText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.OPT_END}),this.$=l[p-1];break;case 37:l[p-1].unshift({type:"altStart",altText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.ALT_START}),l[p-1].push({type:"altEnd",signalType:T.LINETYPE.ALT_END}),this.$=l[p-1];break;case 38:l[p-1].unshift({type:"parStart",parText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.PAR_START}),l[p-1].push({type:"parEnd",signalType:T.LINETYPE.PAR_END}),this.$=l[p-1];break;case 39:l[p-1].unshift({type:"parStart",parText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.PAR_OVER_START}),l[p-1].push({type:"parEnd",signalType:T.LINETYPE.PAR_END}),this.$=l[p-1];break;case 40:l[p-1].unshift({type:"criticalStart",criticalText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.CRITICAL_START}),l[p-1].push({type:"criticalEnd",signalType:T.LINETYPE.CRITICAL_END}),this.$=l[p-1];break;case 41:l[p-1].unshift({type:"breakStart",breakText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.BREAK_START}),l[p-1].push({type:"breakEnd",optText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.BREAK_END}),this.$=l[p-1];break;case 43:this.$=l[p-3].concat([{type:"option",optionText:T.parseMessage(l[p-1]),signalType:T.LINETYPE.CRITICAL_OPTION},l[p]]);break;case 45:this.$=l[p-3].concat([{type:"and",parText:T.parseMessage(l[p-1]),signalType:T.LINETYPE.PAR_AND},l[p]]);break;case 47:this.$=l[p-3].concat([{type:"else",altText:T.parseMessage(l[p-1]),signalType:T.LINETYPE.ALT_ELSE},l[p]]);break;case 48:l[p-3].draw="participant",l[p-3].type="addParticipant",l[p-3].description=T.parseMessage(l[p-1]),this.$=l[p-3];break;case 49:l[p-1].draw="participant",l[p-1].type="addParticipant",this.$=l[p-1];break;case 50:l[p-3].draw="actor",l[p-3].type="addParticipant",l[p-3].description=T.parseMessage(l[p-1]),this.$=l[p-3];break;case 51:l[p-1].draw="actor",l[p-1].type="addParticipant",this.$=l[p-1];break;case 52:l[p-1].type="destroyParticipant",this.$=l[p-1];break;case 53:this.$=[l[p-1],{type:"addNote",placement:l[p-2],actor:l[p-1].actor,text:l[p]}];break;case 54:l[p-2]=[].concat(l[p-1],l[p-1]).slice(0,2),l[p-2][0]=l[p-2][0].actor,l[p-2][1]=l[p-2][1].actor,this.$=[l[p-1],{type:"addNote",placement:T.PLACEMENT.OVER,actor:l[p-2].slice(0,2),text:l[p]}];break;case 55:this.$=[l[p-1],{type:"addLinks",actor:l[p-1].actor,text:l[p]}];break;case 56:this.$=[l[p-1],{type:"addALink",actor:l[p-1].actor,text:l[p]}];break;case 57:this.$=[l[p-1],{type:"addProperties",actor:l[p-1].actor,text:l[p]}];break;case 58:this.$=[l[p-1],{type:"addDetails",actor:l[p-1].actor,text:l[p]}];break;case 61:this.$=[l[p-2],l[p]];break;case 63:this.$=T.PLACEMENT.LEFTOF;break;case 64:this.$=T.PLACEMENT.RIGHTOF;break;case 65:this.$=[l[p-4],l[p-1],{type:"addMessage",from:l[p-4].actor,to:l[p-1].actor,signalType:l[p-3],msg:l[p],activate:!0},{type:"activeStart",signalType:T.LINETYPE.ACTIVE_START,actor:l[p-1].actor}];break;case 66:this.$=[l[p-4],l[p-1],{type:"addMessage",from:l[p-4].actor,to:l[p-1].actor,signalType:l[p-3],msg:l[p]},{type:"activeEnd",signalType:T.LINETYPE.ACTIVE_END,actor:l[p-4].actor}];break;case 67:this.$=[l[p-3],l[p-1],{type:"addMessage",from:l[p-3].actor,to:l[p-1].actor,signalType:l[p-2],msg:l[p]}];break;case 68:this.$={type:"addParticipant",actor:l[p]};break;case 69:this.$=T.LINETYPE.SOLID_OPEN;break;case 70:this.$=T.LINETYPE.DOTTED_OPEN;break;case 71:this.$=T.LINETYPE.SOLID;break;case 72:this.$=T.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=T.LINETYPE.DOTTED;break;case 74:this.$=T.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=T.LINETYPE.SOLID_CROSS;break;case 76:this.$=T.LINETYPE.DOTTED_CROSS;break;case 77:this.$=T.LINETYPE.SOLID_POINT;break;case 78:this.$=T.LINETYPE.DOTTED_POINT;break;case 79:this.$=T.parseMessage(l[p].trim().substring(1))}},"anonymous"),table:[{3:1,4:t,5:c,6:a},{1:[3]},{3:5,4:t,5:c,6:a},{3:6,4:t,5:c,6:a},e([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:n,8:8,9:10,12:12,13:d,14:h,17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},e(b,[2,5]),{9:47,12:12,13:d,14:h,17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},e(b,[2,7]),e(b,[2,8]),e(b,[2,14]),{12:48,50:W,52:q,53:V},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:v},{22:55,70:v},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},e(b,[2,29]),e(b,[2,30]),{32:[1,61]},{34:[1,62]},e(b,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:v},{22:72,70:v},{22:73,70:v},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:v},{22:90,70:v},{22:91,70:v},{22:92,70:v},e([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),e(b,[2,6]),e(b,[2,15]),e(P,[2,9],{10:93}),e(b,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},e(b,[2,21]),{5:[1,97]},{5:[1,98]},e(b,[2,24]),e(b,[2,25]),e(b,[2,26]),e(b,[2,27]),e(b,[2,28]),e(b,[2,31]),e(b,[2,32]),e(G,r,{7:99}),e(G,r,{7:100}),e(G,r,{7:101}),e(rt,r,{40:102,7:103}),e(k,r,{42:104,7:105}),e(k,r,{7:105,42:106}),e(Yt,r,{45:107,7:108}),e(G,r,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:v},e(it,[2,69]),e(it,[2,70]),e(it,[2,71]),e(it,[2,72]),e(it,[2,73]),e(it,[2,74]),e(it,[2,75]),e(it,[2,76]),e(it,[2,77]),e(it,[2,78]),{22:118,70:v},{22:120,58:119,70:v},{70:[2,63]},{70:[2,64]},{56:121,81:ct},{56:123,81:ct},{56:124,81:ct},{56:125,81:ct},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:W,52:q,53:V},{5:[1,131]},e(b,[2,19]),e(b,[2,20]),e(b,[2,22]),e(b,[2,23]),{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[1,132],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[1,133],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[1,134],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{16:[1,135]},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[2,46],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,49:[1,136],50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{16:[1,137]},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[2,44],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,48:[1,138],50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{16:[1,139]},{16:[1,140]},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[2,42],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,47:[1,141],50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[1,142],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{15:[1,143]},e(b,[2,49]),{15:[1,144]},e(b,[2,51]),e(b,[2,52]),{22:145,70:v},{22:146,70:v},{56:147,81:ct},{56:148,81:ct},{56:149,81:ct},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},e(b,[2,16]),e(P,[2,10]),{12:151,50:W,52:q,53:V},e(P,[2,12]),e(P,[2,13]),e(b,[2,18]),e(b,[2,34]),e(b,[2,35]),e(b,[2,36]),e(b,[2,37]),{15:[1,152]},e(b,[2,38]),{15:[1,153]},e(b,[2,39]),e(b,[2,40]),{15:[1,154]},e(b,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:ct},{56:158,81:ct},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:v},e(P,[2,11]),e(rt,r,{7:103,40:160}),e(k,r,{7:105,42:161}),e(Yt,r,{7:108,45:162}),e(b,[2,48]),e(b,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:g(function(w,A){if(!A.recoverable){var _=new Error(w);throw _.hash=A,_}this.trace(w)},"parseError"),parse:g(function(w){var A=this,_=[0],T=[],S=[null],l=[],mt=this.table,p="",Et=0,$t=0,le=l.slice.call(arguments,1),Y=Object.create(this.lexer),dt={yy:{}};for(var Nt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Nt)&&(dt.yy[Nt]=this.yy[Nt]);Y.setInput(w,dt.yy),dt.yy.lexer=Y,dt.yy.parser=this,Y.yylloc===void 0&&(Y.yylloc={});var kt=Y.yylloc;l.push(kt);var de=Y.options&&Y.options.ranges;function Vt(){var at;return typeof(at=T.pop()||Y.lex()||1)!="number"&&(at instanceof Array&&(at=(T=at).pop()),at=A.symbols_[at]||at),at}typeof dt.yy.parseError=="function"?this.parseError=dt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,g(function(at){_.length=_.length-2*at,S.length=S.length-at,l.length=l.length-at},"popStack"),g(Vt,"lex");for(var J,ht,et,Ft,ft,lt,Wt,wt,gt={};;){if(ht=_[_.length-1],this.defaultActions[ht]?et=this.defaultActions[ht]:(J==null&&(J=Vt()),et=mt[ht]&&mt[ht][J]),et===void 0||!et.length||!et[0]){var qt="";for(ft in wt=[],mt[ht])this.terminals_[ft]&&ft>2&&wt.push("'"+this.terminals_[ft]+"'");qt=Y.showPosition?"Parse error on line "+(Et+1)+`:
1
+ var yt;import{a as he,b as vt,g as It,d as pe,c as ge,e as ue}from"./chunk-D6G4REZN-7U1X8C4_.js";import{I as xe}from"./chunk-XZIHB7SX-rMWoJuKP.js";import{_ as g,n as ye,c as Z,l as j,i as zt,d as me,e as be,j as L,b as Ht,s as Te,p as Ee,a as fe,g as we,q as Ie,y as Le,h as Lt,u as $,M as nt,N as bt,O as jt,Z as Pe,P as Ut,F as Mt}from"./mermaid-DRaMHky5.js";import{s as Ot}from"./transform-C4Tsj3kK.js";import"./index-DW03ZSyb.js";import"./step-BwsUM5iJ.js";import"./timer-BI-lUAZ7.js";var St=function(){var e=g(function(w,A,_,T){for(_=_||{},T=w.length;T--;_[w[T]]=A);return _},"o"),t=[1,2],c=[1,3],a=[1,4],r=[2,4],i=[1,9],n=[1,11],d=[1,13],h=[1,14],s=[1,16],x=[1,17],E=[1,18],u=[1,24],m=[1,25],f=[1,26],I=[1,27],N=[1,28],C=[1,29],M=[1,30],B=[1,31],D=[1,32],F=[1,33],z=[1,34],U=[1,35],Q=[1,36],W=[1,37],q=[1,38],V=[1,39],O=[1,41],K=[1,42],H=[1,43],X=[1,44],tt=[1,45],v=[1,46],b=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],P=[4,5,16,50,52,53],G=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],rt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],k=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],Yt=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],it=[68,69,70],ct=[1,122],At={trace:g(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:g(function(w,A,_,T,S,l,mt){var p=l.length-1;switch(S){case 3:return T.apply(l[p]),l[p];case 4:case 9:case 8:case 13:this.$=[];break;case 5:case 10:l[p-1].push(l[p]),this.$=l[p-1];break;case 6:case 7:case 11:case 12:case 62:this.$=l[p];break;case 15:l[p].type="createParticipant",this.$=l[p];break;case 16:l[p-1].unshift({type:"boxStart",boxData:T.parseBoxData(l[p-2])}),l[p-1].push({type:"boxEnd",boxText:l[p-2]}),this.$=l[p-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-2]),sequenceIndexStep:Number(l[p-1]),sequenceVisible:!0,signalType:T.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(l[p-1]),sequenceIndexStep:1,sequenceVisible:!0,signalType:T.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:!1,signalType:T.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:!0,signalType:T.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:T.LINETYPE.ACTIVE_START,actor:l[p-1].actor};break;case 23:this.$={type:"activeEnd",signalType:T.LINETYPE.ACTIVE_END,actor:l[p-1].actor};break;case 29:T.setDiagramTitle(l[p].substring(6)),this.$=l[p].substring(6);break;case 30:T.setDiagramTitle(l[p].substring(7)),this.$=l[p].substring(7);break;case 31:this.$=l[p].trim(),T.setAccTitle(this.$);break;case 32:case 33:this.$=l[p].trim(),T.setAccDescription(this.$);break;case 34:l[p-1].unshift({type:"loopStart",loopText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.LOOP_START}),l[p-1].push({type:"loopEnd",loopText:l[p-2],signalType:T.LINETYPE.LOOP_END}),this.$=l[p-1];break;case 35:l[p-1].unshift({type:"rectStart",color:T.parseMessage(l[p-2]),signalType:T.LINETYPE.RECT_START}),l[p-1].push({type:"rectEnd",color:T.parseMessage(l[p-2]),signalType:T.LINETYPE.RECT_END}),this.$=l[p-1];break;case 36:l[p-1].unshift({type:"optStart",optText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.OPT_START}),l[p-1].push({type:"optEnd",optText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.OPT_END}),this.$=l[p-1];break;case 37:l[p-1].unshift({type:"altStart",altText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.ALT_START}),l[p-1].push({type:"altEnd",signalType:T.LINETYPE.ALT_END}),this.$=l[p-1];break;case 38:l[p-1].unshift({type:"parStart",parText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.PAR_START}),l[p-1].push({type:"parEnd",signalType:T.LINETYPE.PAR_END}),this.$=l[p-1];break;case 39:l[p-1].unshift({type:"parStart",parText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.PAR_OVER_START}),l[p-1].push({type:"parEnd",signalType:T.LINETYPE.PAR_END}),this.$=l[p-1];break;case 40:l[p-1].unshift({type:"criticalStart",criticalText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.CRITICAL_START}),l[p-1].push({type:"criticalEnd",signalType:T.LINETYPE.CRITICAL_END}),this.$=l[p-1];break;case 41:l[p-1].unshift({type:"breakStart",breakText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.BREAK_START}),l[p-1].push({type:"breakEnd",optText:T.parseMessage(l[p-2]),signalType:T.LINETYPE.BREAK_END}),this.$=l[p-1];break;case 43:this.$=l[p-3].concat([{type:"option",optionText:T.parseMessage(l[p-1]),signalType:T.LINETYPE.CRITICAL_OPTION},l[p]]);break;case 45:this.$=l[p-3].concat([{type:"and",parText:T.parseMessage(l[p-1]),signalType:T.LINETYPE.PAR_AND},l[p]]);break;case 47:this.$=l[p-3].concat([{type:"else",altText:T.parseMessage(l[p-1]),signalType:T.LINETYPE.ALT_ELSE},l[p]]);break;case 48:l[p-3].draw="participant",l[p-3].type="addParticipant",l[p-3].description=T.parseMessage(l[p-1]),this.$=l[p-3];break;case 49:l[p-1].draw="participant",l[p-1].type="addParticipant",this.$=l[p-1];break;case 50:l[p-3].draw="actor",l[p-3].type="addParticipant",l[p-3].description=T.parseMessage(l[p-1]),this.$=l[p-3];break;case 51:l[p-1].draw="actor",l[p-1].type="addParticipant",this.$=l[p-1];break;case 52:l[p-1].type="destroyParticipant",this.$=l[p-1];break;case 53:this.$=[l[p-1],{type:"addNote",placement:l[p-2],actor:l[p-1].actor,text:l[p]}];break;case 54:l[p-2]=[].concat(l[p-1],l[p-1]).slice(0,2),l[p-2][0]=l[p-2][0].actor,l[p-2][1]=l[p-2][1].actor,this.$=[l[p-1],{type:"addNote",placement:T.PLACEMENT.OVER,actor:l[p-2].slice(0,2),text:l[p]}];break;case 55:this.$=[l[p-1],{type:"addLinks",actor:l[p-1].actor,text:l[p]}];break;case 56:this.$=[l[p-1],{type:"addALink",actor:l[p-1].actor,text:l[p]}];break;case 57:this.$=[l[p-1],{type:"addProperties",actor:l[p-1].actor,text:l[p]}];break;case 58:this.$=[l[p-1],{type:"addDetails",actor:l[p-1].actor,text:l[p]}];break;case 61:this.$=[l[p-2],l[p]];break;case 63:this.$=T.PLACEMENT.LEFTOF;break;case 64:this.$=T.PLACEMENT.RIGHTOF;break;case 65:this.$=[l[p-4],l[p-1],{type:"addMessage",from:l[p-4].actor,to:l[p-1].actor,signalType:l[p-3],msg:l[p],activate:!0},{type:"activeStart",signalType:T.LINETYPE.ACTIVE_START,actor:l[p-1].actor}];break;case 66:this.$=[l[p-4],l[p-1],{type:"addMessage",from:l[p-4].actor,to:l[p-1].actor,signalType:l[p-3],msg:l[p]},{type:"activeEnd",signalType:T.LINETYPE.ACTIVE_END,actor:l[p-4].actor}];break;case 67:this.$=[l[p-3],l[p-1],{type:"addMessage",from:l[p-3].actor,to:l[p-1].actor,signalType:l[p-2],msg:l[p]}];break;case 68:this.$={type:"addParticipant",actor:l[p]};break;case 69:this.$=T.LINETYPE.SOLID_OPEN;break;case 70:this.$=T.LINETYPE.DOTTED_OPEN;break;case 71:this.$=T.LINETYPE.SOLID;break;case 72:this.$=T.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=T.LINETYPE.DOTTED;break;case 74:this.$=T.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=T.LINETYPE.SOLID_CROSS;break;case 76:this.$=T.LINETYPE.DOTTED_CROSS;break;case 77:this.$=T.LINETYPE.SOLID_POINT;break;case 78:this.$=T.LINETYPE.DOTTED_POINT;break;case 79:this.$=T.parseMessage(l[p].trim().substring(1))}},"anonymous"),table:[{3:1,4:t,5:c,6:a},{1:[3]},{3:5,4:t,5:c,6:a},{3:6,4:t,5:c,6:a},e([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:n,8:8,9:10,12:12,13:d,14:h,17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},e(b,[2,5]),{9:47,12:12,13:d,14:h,17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},e(b,[2,7]),e(b,[2,8]),e(b,[2,14]),{12:48,50:W,52:q,53:V},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:v},{22:55,70:v},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},e(b,[2,29]),e(b,[2,30]),{32:[1,61]},{34:[1,62]},e(b,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:v},{22:72,70:v},{22:73,70:v},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:v},{22:90,70:v},{22:91,70:v},{22:92,70:v},e([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),e(b,[2,6]),e(b,[2,15]),e(P,[2,9],{10:93}),e(b,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},e(b,[2,21]),{5:[1,97]},{5:[1,98]},e(b,[2,24]),e(b,[2,25]),e(b,[2,26]),e(b,[2,27]),e(b,[2,28]),e(b,[2,31]),e(b,[2,32]),e(G,r,{7:99}),e(G,r,{7:100}),e(G,r,{7:101}),e(rt,r,{40:102,7:103}),e(k,r,{42:104,7:105}),e(k,r,{7:105,42:106}),e(Yt,r,{45:107,7:108}),e(G,r,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:v},e(it,[2,69]),e(it,[2,70]),e(it,[2,71]),e(it,[2,72]),e(it,[2,73]),e(it,[2,74]),e(it,[2,75]),e(it,[2,76]),e(it,[2,77]),e(it,[2,78]),{22:118,70:v},{22:120,58:119,70:v},{70:[2,63]},{70:[2,64]},{56:121,81:ct},{56:123,81:ct},{56:124,81:ct},{56:125,81:ct},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:W,52:q,53:V},{5:[1,131]},e(b,[2,19]),e(b,[2,20]),e(b,[2,22]),e(b,[2,23]),{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[1,132],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[1,133],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[1,134],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{16:[1,135]},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[2,46],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,49:[1,136],50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{16:[1,137]},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[2,44],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,48:[1,138],50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{16:[1,139]},{16:[1,140]},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[2,42],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,47:[1,141],50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{4:i,5:n,8:8,9:10,12:12,13:d,14:h,16:[1,142],17:15,18:s,21:x,22:40,23:E,24:19,25:20,26:21,27:22,28:23,29:u,30:m,31:f,33:I,35:N,36:C,37:M,38:B,39:D,41:F,43:z,44:U,46:Q,50:W,52:q,53:V,54:O,59:K,60:H,61:X,62:tt,70:v},{15:[1,143]},e(b,[2,49]),{15:[1,144]},e(b,[2,51]),e(b,[2,52]),{22:145,70:v},{22:146,70:v},{56:147,81:ct},{56:148,81:ct},{56:149,81:ct},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},e(b,[2,16]),e(P,[2,10]),{12:151,50:W,52:q,53:V},e(P,[2,12]),e(P,[2,13]),e(b,[2,18]),e(b,[2,34]),e(b,[2,35]),e(b,[2,36]),e(b,[2,37]),{15:[1,152]},e(b,[2,38]),{15:[1,153]},e(b,[2,39]),e(b,[2,40]),{15:[1,154]},e(b,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:ct},{56:158,81:ct},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:v},e(P,[2,11]),e(rt,r,{7:103,40:160}),e(k,r,{7:105,42:161}),e(Yt,r,{7:108,45:162}),e(b,[2,48]),e(b,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:g(function(w,A){if(!A.recoverable){var _=new Error(w);throw _.hash=A,_}this.trace(w)},"parseError"),parse:g(function(w){var A=this,_=[0],T=[],S=[null],l=[],mt=this.table,p="",Et=0,$t=0,le=l.slice.call(arguments,1),Y=Object.create(this.lexer),dt={yy:{}};for(var Nt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Nt)&&(dt.yy[Nt]=this.yy[Nt]);Y.setInput(w,dt.yy),dt.yy.lexer=Y,dt.yy.parser=this,Y.yylloc===void 0&&(Y.yylloc={});var kt=Y.yylloc;l.push(kt);var de=Y.options&&Y.options.ranges;function Vt(){var at;return typeof(at=T.pop()||Y.lex()||1)!="number"&&(at instanceof Array&&(at=(T=at).pop()),at=A.symbols_[at]||at),at}typeof dt.yy.parseError=="function"?this.parseError=dt.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,g(function(at){_.length=_.length-2*at,S.length=S.length-at,l.length=l.length-at},"popStack"),g(Vt,"lex");for(var J,ht,et,Ft,ft,lt,Wt,wt,gt={};;){if(ht=_[_.length-1],this.defaultActions[ht]?et=this.defaultActions[ht]:(J==null&&(J=Vt()),et=mt[ht]&&mt[ht][J]),et===void 0||!et.length||!et[0]){var qt="";for(ft in wt=[],mt[ht])this.terminals_[ft]&&ft>2&&wt.push("'"+this.terminals_[ft]+"'");qt=Y.showPosition?"Parse error on line "+(Et+1)+`:
2
2
  `+Y.showPosition()+`
3
3
  Expecting `+wt.join(", ")+", got '"+(this.terminals_[J]||J)+"'":"Parse error on line "+(Et+1)+": Unexpected "+(J==1?"end of input":"'"+(this.terminals_[J]||J)+"'"),this.parseError(qt,{text:Y.match,token:this.terminals_[J]||J,line:Y.yylineno,loc:kt,expected:wt})}if(et[0]instanceof Array&&et.length>1)throw new Error("Parse Error: multiple actions possible at state: "+ht+", token: "+J);switch(et[0]){case 1:_.push(J),S.push(Y.yytext),l.push(Y.yylloc),_.push(et[1]),J=null,$t=Y.yyleng,p=Y.yytext,Et=Y.yylineno,kt=Y.yylloc;break;case 2:if(lt=this.productions_[et[1]][1],gt.$=S[S.length-lt],gt._$={first_line:l[l.length-(lt||1)].first_line,last_line:l[l.length-1].last_line,first_column:l[l.length-(lt||1)].first_column,last_column:l[l.length-1].last_column},de&&(gt._$.range=[l[l.length-(lt||1)].range[0],l[l.length-1].range[1]]),(Ft=this.performAction.apply(gt,[p,$t,Et,dt.yy,et[1],S,l].concat(le)))!==void 0)return Ft;lt&&(_=_.slice(0,-1*lt*2),S=S.slice(0,-1*lt),l=l.slice(0,-1*lt)),_.push(this.productions_[et[1]][0]),S.push(gt.$),l.push(gt._$),Wt=mt[_[_.length-2]][_[_.length-1]],_.push(Wt);break;case 3:return!0}}return!0},"parse")},ce=function(){return{EOF:1,parseError:g(function(w,A){if(!this.yy.parser)throw new Error(w);this.yy.parser.parseError(w,A)},"parseError"),setInput:g(function(w,A){return this.yy=A||this.yy||{},this._input=w,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:g(function(){var w=this._input[0];return this.yytext+=w,this.yyleng++,this.offset++,this.match+=w,this.matched+=w,w.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),w},"input"),unput:g(function(w){var A=w.length,_=w.split(/(?:\r\n?|\n)/g);this._input=w+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-A),this.offset-=A;var T=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),_.length-1&&(this.yylineno-=_.length-1);var S=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:_?(_.length===T.length?this.yylloc.first_column:0)+T[T.length-_.length].length-_[0].length:this.yylloc.first_column-A},this.options.ranges&&(this.yylloc.range=[S[0],S[0]+this.yyleng-A]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:g(function(w){this.unput(this.match.slice(w))},"less"),pastInput:g(function(){var w=this.matched.substr(0,this.matched.length-this.match.length);return(w.length>20?"...":"")+w.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:g(function(){var w=this.match;return w.length<20&&(w+=this._input.substr(0,20-w.length)),(w.substr(0,20)+(w.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:g(function(){var w=this.pastInput(),A=new Array(w.length+1).join("-");return w+this.upcomingInput()+`