twenty 2.60.0 → 2.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app-template/yarn.lock +28 -28
- package/dist/app-worker.cjs +1 -1
- package/dist/chunks/{build-source-manifest-CiNlHV98.cjs → build-source-manifest-DQ5YF5PV.cjs} +1 -1
- package/dist/chunks/{build-source-snapshot-Dchjr_ga.cjs → build-source-snapshot-DIjGWX_5.cjs} +20 -20
- package/dist/chunks/{cli-version.constant-B200rijQ.cjs → cli-version.constant-DNNCqpbE.cjs} +1 -1
- package/dist/chunks/collect-watch-inputs-Cj9epSJw.cjs +1 -0
- package/dist/chunks/compile-application-translations-CDykMbFf.cjs +58 -0
- package/dist/chunks/create-metadata-client-BTLenEIm.cjs +6 -0
- package/dist/chunks/{create-rest-client-HbzXSfhZ.cjs → create-rest-client-D3ZXtAxc.cjs} +1 -1
- package/dist/chunks/{extract-manifest-from-file-CaWVLmLU.cjs → extract-manifest-from-file-B3pazFD1.cjs} +1 -1
- package/dist/chunks/{extract-source-translations-CBveJ4xT.cjs → extract-source-translations-b9c2CH4w.cjs} +1 -1
- package/dist/chunks/{fetch-metadata-inspection-yvVdh4oY.cjs → fetch-metadata-inspection-D45BvG-t.cjs} +1 -1
- package/dist/chunks/{fetch-signed-in-identity-B6fnxBHj.cjs → fetch-signed-in-identity-CI1CRnos.cjs} +1 -1
- package/dist/chunks/fetch-workspace-or-throw-8afzHT9W.cjs +1 -0
- package/dist/chunks/fs-utils-BcNux7fF.cjs +2 -0
- package/dist/chunks/{get-client-generation-skip-reason-CFgiU52t.cjs → get-client-generation-skip-reason-C3VEtb-R.cjs} +1 -1
- package/dist/chunks/global-flags.constant-Bwz4LCEy.cjs +1 -0
- package/dist/chunks/is-exported-manifest-BHA_mGa6.cjs +1 -0
- package/dist/chunks/{is-valid-package-name-zAWZPNrj.cjs → is-valid-package-name-DCxejisa.cjs} +1 -1
- package/dist/chunks/parse-app-export-B9Ocghe1.cjs +1 -0
- package/dist/chunks/{pull-minimum-sdk-version.constant-BTfcyhwh.cjs → pull-minimum-sdk-version.constant-DOAFtDDD.cjs} +2 -2
- package/dist/chunks/pull-source-B5Hot5CI.cjs +1 -0
- package/dist/chunks/{read-app-identity-Cny6sAGs.cjs → read-app-identity-M47izSWp.cjs} +1 -1
- package/dist/chunks/{read-application-identifier-DcBW74TB.cjs → read-application-identifier-Ch3TuO_n.cjs} +1 -1
- package/dist/chunks/{read-application-identity-BrtopaMa.cjs → read-application-identity-CYKNL1g5.cjs} +1 -1
- package/dist/chunks/{read-infer-deletion-option-D1HMBsfw.cjs → read-infer-deletion-option-Cq68tV7k.cjs} +1 -1
- package/dist/chunks/{read-source-identity-CnPDqB6X.cjs → read-source-identity-bo4jC2Dh.cjs} +1 -1
- package/dist/chunks/read-watch-input-stamp-DKJ-Plk2.cjs +1 -0
- package/dist/chunks/{record-pull-base-Dz4BldQf.cjs → record-pull-base-DtY9aRif.cjs} +1 -1
- package/dist/chunks/{record-typecheck-config-inputs-U2RUjjp9.cjs → record-typecheck-config-inputs-BMV55iFx.cjs} +1 -1
- package/dist/chunks/{resolve-command-target-QjBwHpMj.cjs → resolve-command-target-BZJtWdPy.cjs} +1 -1
- package/dist/chunks/{resolve-project-typescript-DO4LrLr-.cjs → resolve-project-typescript-DjMUr6ks.cjs} +1 -1
- package/dist/chunks/{resolve-source-sdk-C4Hu045V.cjs → resolve-source-sdk-BDwffWHb.cjs} +1 -1
- package/dist/chunks/{run-app-add-command-b9sm20rn.cjs → run-app-add-command-De3cIhU0.cjs} +1 -1
- package/dist/chunks/{run-app-apply-command-CCsvdn3A.cjs → run-app-apply-command-Dh4lc8hj.cjs} +2 -2
- package/dist/chunks/{run-app-build-command-Daxe8O14.cjs → run-app-build-command-DDgaL02E.cjs} +1 -1
- package/dist/chunks/run-app-dev-command-B4KTmf_z.cjs +3 -0
- package/dist/chunks/{run-app-exec-command-BMhrv7YU.cjs → run-app-exec-command-kY1eL1r5.cjs} +1 -1
- package/dist/chunks/{run-app-generate-client-command-Z-2bRkaH.cjs → run-app-generate-client-command-QkxVxVx_.cjs} +1 -1
- package/dist/chunks/{run-app-init-command-B6npylwO.cjs → run-app-init-command-DSkO13d-.cjs} +1 -1
- package/dist/chunks/{run-app-install-command-DqPQXj09.cjs → run-app-install-command-Bi0zzk4A.cjs} +1 -1
- package/dist/chunks/{run-app-logs-command-CaLIVesh.cjs → run-app-logs-command-COAdNMuL.cjs} +1 -1
- package/dist/chunks/{run-app-operation-D_zIxvuw.cjs → run-app-operation-CDJvAttZ.cjs} +1 -1
- package/dist/chunks/{run-app-plan-command-pc6mp7th.cjs → run-app-plan-command-C6eyLLLO.cjs} +1 -1
- package/dist/chunks/{run-app-publish-command-CflX1x0o.cjs → run-app-publish-command-DQ6vzJgn.cjs} +1 -1
- package/dist/chunks/{run-app-pull-command-PCMBNH6R.cjs → run-app-pull-command-BXUC3k0e.cjs} +1 -1
- package/dist/chunks/{run-app-translations-extract-command-CGIFvpC1.cjs → run-app-translations-extract-command-DHIEEFXs.cjs} +1 -1
- package/dist/chunks/{run-app-typecheck-command-DnCMdagB.cjs → run-app-typecheck-command-4K_pP5i8.cjs} +1 -1
- package/dist/chunks/{run-app-uninstall-command-DWXEgVKe.cjs → run-app-uninstall-command-OmmIgnAn.cjs} +1 -1
- package/dist/chunks/{run-auth-login-command-DKCO9bot.cjs → run-auth-login-command-DZAiuNqZ.cjs} +1 -1
- package/dist/chunks/{run-auth-status-command-0vh-ENNj.cjs → run-auth-status-command-CqN2SXlq.cjs} +1 -1
- package/dist/chunks/{run-cli-BG3itvCe.cjs → run-cli-YPcCDqcg.cjs} +3 -3
- package/dist/chunks/{run-commands-command-CJ7qNty3.cjs → run-commands-command-DgnWg2rh.cjs} +1 -1
- package/dist/chunks/{run-data-export-command-DqyztEHe.cjs → run-data-export-command-B1rmhaKc.cjs} +1 -1
- package/dist/chunks/{run-data-get-command-D7_BdNBa.cjs → run-data-get-command-B4nBUwrU.cjs} +1 -1
- package/dist/chunks/{run-data-list-command-ZIpyFE04.cjs → run-data-list-command-D2HsR6ru.cjs} +1 -1
- package/dist/chunks/{run-doctor-command-CgWSXl7H.cjs → run-doctor-command-BkyTVduO.cjs} +2 -2
- package/dist/chunks/{run-metadata-field-describe-command-DZBqoC6c.cjs → run-metadata-field-describe-command-BjvbEGss.cjs} +1 -1
- package/dist/chunks/{run-metadata-field-list-command-3pXf6DzX.cjs → run-metadata-field-list-command-CjiAlmp4.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-describe-command-Dpmt4WVc.cjs → run-metadata-object-describe-command-BRKyHBUi.cjs} +1 -1
- package/dist/chunks/{run-metadata-object-list-command-B2PTelCt.cjs → run-metadata-object-list-command-CBzwm3R1.cjs} +1 -1
- package/dist/chunks/{run-open-command-B4YhDwqh.cjs → run-open-command-BNJTwnxV.cjs} +1 -1
- package/dist/chunks/{run-version-command-YPMJadrD.cjs → run-version-command-C2_qC5Qa.cjs} +1 -1
- package/dist/chunks/{sign-in-to-remote-again-D9amgIOZ.cjs → sign-in-to-remote-again-CpUKz_mi.cjs} +1 -1
- package/dist/chunks/standard-object-fields.constant-CA16BdJ2.cjs +1 -0
- package/dist/chunks/{typecheck-application-8A504oUF.cjs → typecheck-application-CiGxmS69.cjs} +1 -1
- package/dist/cli.cjs +1 -1
- package/docs/commands.md +45 -20
- package/package.json +2 -2
- package/src/app/bundles/README.md +4 -5
- package/src/app/dev/README.md +13 -1
- package/src/app/pull/README.md +43 -26
- package/dist/chunks/collect-watch-inputs-DfWAkX1r.cjs +0 -1
- package/dist/chunks/compile-application-translations-roDnPf1t.cjs +0 -58
- package/dist/chunks/create-metadata-client-DVQbIGNu.cjs +0 -6
- package/dist/chunks/fetch-workspace-or-throw-C6tCV0YH.cjs +0 -1
- package/dist/chunks/fs-utils-DoSmCBu8.cjs +0 -2
- package/dist/chunks/global-flags.constant-Celofkx1.cjs +0 -1
- package/dist/chunks/is-exported-manifest-C4lO285q.cjs +0 -1
- package/dist/chunks/parse-app-export-BsxpQED7.cjs +0 -1
- package/dist/chunks/pull-source-CIsoJ2eR.cjs +0 -1
- package/dist/chunks/read-watch-input-stamp-BxeOb0vI.cjs +0 -1
- package/dist/chunks/run-app-dev-command-BPwltUcL.cjs +0 -2
- package/dist/chunks/standard-object-fields.constant-jQV_KO0f.cjs +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const e=require("./rolldown-runtime-mLOUI7ql.cjs"),t=require("./build--4zYt4wd.cjs"),n=require("./isDefined-CJctgvfE.cjs"),r=require("./isNonEmptyArray-v52xg4Xj.cjs"),i=require("./isPlainObject-fJEJm71P.cjs"),a=require("./get-field-universal-identifier.util-d1401qKf.cjs"),o=require("./standard-object-fields.constant-CA16BdJ2.cjs"),s=require("./is-supported-locale-DUMI9QQ2.cjs"),c=require("./isValidUniversalIdentifier-DymFerYs.cjs"),l=require("./fs-utils-BcNux7fF.cjs"),u=require("./AssetDirectory-c_JEwMr2.cjs"),d=require("./TwentyStandardApplicationUniversalIdentifier-Cm4vo0D3.cjs"),f=require("./locale-catalog-format-BD4XDEnl.cjs"),p=require("./extract-manifest-from-file-B3pazFD1.cjs"),m=require("./get-engine-version-range-DZGIWoR6.cjs"),h=require("./constants-Cf5-CwMu.cjs");let ee=require("node:fs/promises"),g=require("node:path");g=e.r(g,1);let te=require("tinyglobby"),_=require("typescript");_=e.r(_);let v=require("path");v=e.r(v);var y=t.t(),ne=(e,t)=>{throw Error(t??`Didn't expect to get here.`)};function re(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function ie(e,t=`|`){return e.map(e=>Oe(e)).join(t)}function ae(e,t){return typeof t==`bigint`?t.toString():t}var oe=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function se(e){return new oe(e)}function ce(e){return e==null}function le(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function ue(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function de(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function fe(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function pe(e){return fe(e._zod.def)??e._zod.def.shape}function me(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return de(this,t,e),e},enumerable:!0,configurable:!0})}function he(e,t,n){t in e?de(e,t,n):e[t]=n}function ge(e,t,n,r){let i=pe(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?me(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):he(e,a,r?r(n.value,a):n.value))}}function _e(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?me(e,n,()=>t[n]):he(e,n,r.value))}}function b(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function ve(e){return JSON.stringify(e)}function ye(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var be=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function xe(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Se=se(()=>{if(gt.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ce(e){if(xe(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return!(xe(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function we(e){return Ce(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Te=new Set([`string`,`number`,`symbol`]);function Ee(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function De(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function x(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Oe(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ke(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Ae={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},je={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Me(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return ge(i,e,Ne(e,t)),De(e,b(n,{shape:i,checks:[]}))}function Ne(e,t){let n=pe(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Pe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Ne(e,t)),a={};return ge(a,e,Reflect.ownKeys(pe(e)).filter(e=>!i.has(e))),De(e,b(n,{shape:a,checks:[]}))}function Fe(e,t){if(!Ce(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=pe(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return De(e,b(e._zod.def,{shape:Ie(e,t)}))}function Ie(e,t){let n={};return ge(n,e,Reflect.ownKeys(pe(e))),_e(n,t),n}function Le(e,t){if(!Ce(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return De(e,b(e._zod.def,{shape:Ie(e,t)}))}function Re(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return ge(n,e,Reflect.ownKeys(pe(e))),ge(n,t,Reflect.ownKeys(pe(t))),De(e,b(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ze(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Ne(t,n)):void 0,o={};return ge(o,t,Reflect.ownKeys(pe(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),De(t,b(t._zod.def,{shape:o,checks:[]}))}function Be(e,t,n){let r=n?new Set(Ne(t,n)):void 0,i={};return ge(i,t,Reflect.ownKeys(pe(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),De(t,b(t._zod.def,{shape:i}))}function Ve(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function He(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Ue(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function We(e){return typeof e==`string`?e:e?.message}function Ge(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Ke(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function qe(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:We(e.inst?._zod.def?.error?.(e))??We(a?.(e))??We(t?.error?.(e))??We(n.customError?.(e))??We(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t===`inst`||t===`schema`||t===`continue`||t===`input`||t===`__proto__`||(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Je=/[\uD800-\uDBFF]/;function Ye(e){let t=e.length;if(!Je.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Xe(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ze(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Qe(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function $e(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):nt(e,n,r.value)}}function et(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function tt(e,t,n){return et(e,t,n,!1)}function S(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return et(this,n,r(this))},set(e){et(this,n,e)}})}return t}function nt(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:et(this,t,n.bind(this))},set(e){et(this,t,e)}})}function rt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var it,at=!1,ot={configurable:!0,get(){at=!0}};function C(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&it!==e._zod){it=void 0;return}it=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,ot);let e=at;at=!1;try{let r=n(this);return at?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),at||=e,r}catch(n){throw delete this[t],at||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function st(e,t,n,r){let i=rt(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var ct=`~constantCatch`;function lt(e){let t=()=>e;return t[ct]=!0,t}var ut,dt={value:void 0,enumerable:!1},ft=`captureStackTrace`in Error?Error:null;function pt(e){let t=ft;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return ft=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function w(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){dt.value=new a(r);try{Object.defineProperty(n,"_zod",dt)}finally{dt.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),$e(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?pt(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var mt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},ht=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ut=globalThis).__zod_globalConfig??(ut.__zod_globalConfig={});var gt=globalThis.__zod_globalConfig;function _t(e){return e&&Object.assign(gt,e),gt}function vt(){let e=this._zod;return e.message??=JSON.stringify(e.def,ae,2),e.message}function yt(e){this._zod.message=e}var bt={get:vt,set:yt,enumerable:!0,configurable:!0},xt={value:void 0,enumerable:!1},St=new WeakSet([Object.prototype,Error.prototype]),Ct=(e,t)=>{e.name=`$ZodError`,xt.value=t,Object.defineProperty(e,"issues",xt),xt.value=void 0,Object.defineProperty(e,"message",bt);let n=Object.getPrototypeOf(e);St.has(n)||(St.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},wt=w(`$ZodError`,Ct);w(`$ZodError`,Ct,void 0,{Parent:Error});function Tt(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Et(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Tt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Dt(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Ot(e,t){return{callee:t?.callee??e,Err:t?.Err}}var kt=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new mt;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>qe(e,o,_t())));throw be(n,a?.callee??t),n}return s.value};return t},At=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>qe(e,o,_t())));throw be(n,a?.callee??t),n}return s.value};return t},jt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new mt;return a.issues.length?Mt(e,a.issues,i):{success:!0,data:a.value}};function Mt(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>qe(e,n,_t()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Nt=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Mt(e,a.issues,i):{success:!0,data:a.value}},Pt=Symbol.for(`zod.compile.invalid`),Ft=Symbol.for(`zod.compile.fallback`),It=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Pt)return!0;if(r.definite===!0&&n===void 0)return!1}return Lt(e,t,n)});function Lt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Ft]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new mt;return a.issues.length===0}var Rt=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},zt=e=>{let t=kt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Ot(n,a))};return n},Bt=e=>{let t=kt(e),n=(e,r,i,a)=>t(e,r,i,Ot(n,a));return n},Vt=e=>{let t=At(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Ot(n,a))};return n},Ht=e=>{let t=At(e),n=async(e,r,i,a)=>await t(e,r,i,Ot(n,a));return n},Ut=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return jt(e)(t,n,i)},Wt=e=>(t,n,r)=>jt(e)(t,n,r),Gt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Nt(e)(t,n,i)},Kt=e=>async(t,n,r)=>Nt(e)(t,n,r),qt=/^[cC][0-9a-z]{6,}$/,Jt=/^[0-9a-z]+$/,Yt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Xt=/^[0-9a-vA-V]{20}$/,Zt=/^[A-Za-z0-9]{27}$/,Qt=/^[a-zA-Z0-9_-]{21}$/;function $t(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var en=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,tn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,nn=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,rn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,an=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function on(){return new RegExp(an,`u`)}var sn=/^(?:(?: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])$/,cn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ln=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,un=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,fn=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,pn=/^https?$/,mn=/^\+[1-9]\d{6,14}$/,hn=`(?:(?:\\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])))`;function gn(e){return RegExp(`^${e}$`)}var _n=gn(hn);function vn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function yn(e){return RegExp(`^${vn(e)}$`)}function bn(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${vn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${vn({precision:e.precision})}`:n;return RegExp(`^${hn}T(?:${r})$`)}var xn=/^[\s\S]{0,}$/,Sn=/^-?\d+(?:\.\d+)?$/,Cn=/^[^A-Z]*$/,wn=/^[^a-z]*$/,T=w(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Tn=e=>{let t=e.value;return!ce(t)&&t.length!==void 0},En={number:`number`,bigint:`bigint`,object:`date`},Dn=w(`$ZodCheckLessThan`,(e,t)=>{T.init(e,t);let n=En[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:En[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),On=w(`$ZodCheckGreaterThan`,(e,t)=>{T.init(e,t);let n=En[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:En[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),kn=w(`$ZodCheckMultipleOf`,(e,t)=>{T.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):ue(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),An=w(`$ZodCheckNumberFormat`,(e,t)=>{T.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ae[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),jn=w(`$ZodCheckMaxLength`,(e,t)=>{var n;T.init(e,t),(n=e._zod.def).when??(n.when=Tn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ye(r):i)<=t.maximum)return;let a=Xe(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Mn=w(`$ZodCheckMinLength`,(e,t)=>{var n;T.init(e,t),(n=e._zod.def).when??(n.when=Tn),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ye(r):i)>=t.minimum)return;let a=Xe(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Nn=w(`$ZodCheckLengthEquals`,(e,t)=>{var n;T.init(e,t),(n=e._zod.def).when??(n.when=Tn),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ye(r):i;if(a===t.length)return;let o=Xe(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Pn=w(`$ZodCheckStringFormat`,(e,t)=>{var n,r;T.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Fn=w(`$ZodCheckRegex`,(e,t)=>{Pn.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),In=w(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Cn,Pn.init(e,t)}),Ln=w(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=wn,Pn.init(e,t)}),Rn=w(`$ZodCheckIncludes`,(e,t)=>{T.init(e,t);let n=Ee(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),zn=w(`$ZodCheckStartsWith`,(e,t)=>{T.init(e,t);let n=RegExp(`^${Ee(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Bn=w(`$ZodCheckEndsWith`,(e,t)=>{T.init(e,t);let n=RegExp(`.*${Ee(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Vn=w(`$ZodCheckOverwrite`,(e,t)=>{T.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Hn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
3
|
+
`)}\n};`)(...Object.values(this.closed))}},Un={major:4,minor:6,patch:7},E=w(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Un;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=Ve(t),a;for(let o of n){if(o._zod.def.when){if(He(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new mt;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Ke(t.issues,n,e),i||=Ve(t,n))});else{if(t.issues.length===n)continue;Ke(t.issues,n,e),i||=Ve(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Ve(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new mt;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new mt;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return tt(this,`~standard`,Kn(this))},set"~standard"(e){et(this,`~standard`,e)}}),Wn=(e,t)=>e.issues.length?{issues:e.issues.map(e=>qe(e,t,_t()))}:{value:e.value};async function Gn(e,t){let n={async:!0};return Wn(await e._zod.run({value:t,issues:[]},n),n)}function Kn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Wn(r,n)}catch{}return Gn(e,t)},vendor:`zod`,version:1}}var qn=w(`$ZodString`,(e,t)=>{E.init(e,t),e._zod.pattern=t.pattern??xn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),D=w(`$ZodStringFormat`,(e,t)=>{Pn.init(e,t),qn.init(e,t)}),Jn=w(`$ZodGUID`,(e,t)=>{t.pattern??=tn,D.init(e,t)}),Yn=w(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=nn(e)}else t.pattern??=nn();D.init(e,t)}),Xn=w(`$ZodEmail`,(e,t)=>{t.pattern??=rn,D.init(e,t)});function Zn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Qn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Zn(e)||2:$n(e,t)}function $n(e,t){if(!t.normalize&&t.protocol?.source===pn.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var er=/[\t\n\r]/g;function tr(e){return e.replace(er,``)}function nr(e,t){return t.lastIndex=0,t.test(e.hostname)}function rr(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var ir=w(`$ZodURL`,(e,t)=>{D.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Qn(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=tr(r);return}t.hostname&&!nr(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!rr(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:tr(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),ar=w(`$ZodEmoji`,(e,t)=>{t.pattern??=on(),D.init(e,t)}),or=w(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Qt:$t(t.length),D.init(e,t)}),sr=w(`$ZodCUID`,(e,t)=>{t.pattern??=qt,D.init(e,t)}),cr=w(`$ZodCUID2`,(e,t)=>{t.pattern??=Jt,D.init(e,t)}),lr=w(`$ZodULID`,(e,t)=>{t.pattern??=Yt,D.init(e,t)}),ur=w(`$ZodXID`,(e,t)=>{t.pattern??=Xt,D.init(e,t)}),dr=w(`$ZodKSUID`,(e,t)=>{t.pattern??=Zt,D.init(e,t)}),fr=w(`$ZodISODateTime`,(e,t)=>{t.pattern??=bn(t),D.init(e,t)}),pr=w(`$ZodISODate`,(e,t)=>{t.pattern??=_n,D.init(e,t)}),mr=w(`$ZodISOTime`,(e,t)=>{t.pattern??=yn(t),D.init(e,t)}),hr=w(`$ZodISODuration`,(e,t)=>{t.pattern??=en,D.init(e,t)}),gr=w(`$ZodIPv4`,(e,t)=>{t.pattern??=sn,D.init(e,t)}),_r=/^[0-9a-fA-F:.]+$/;function vr(e){return _r.test(e)?Zn(`http://[${e}]`):!1}var yr=w(`$ZodIPv6`,(e,t)=>{t.pattern??=cn,D.init(e,t),e._zod.check=n=>{vr(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),br=w(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ln,D.init(e,t)});function xr(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:vr(n)}var Sr=w(`$ZodCIDRv6`,(e,t)=>{t.pattern??=un,D.init(e,t),e._zod.check=n=>{xr(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Cr(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var wr=/^[0-9a-zA-Z+/]*={0,2}$/,Tr=w(`$ZodBase64`,(e,t)=>{t.pattern??=wr,D.init(e,t),e._zod.check=n=>{Cr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),Er=/^[A-Za-z0-9_-]*$/;function Dr(e){if(!Er.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Cr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Or=w(`$ZodBase64URL`,(e,t)=>{t.pattern??=Er,D.init(e,t),e._zod.check=n=>{Dr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),kr=w(`$ZodE164`,(e,t)=>{t.pattern??=mn,D.init(e,t)});function Ar(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var jr=w(`$ZodJWT`,(e,t)=>{D.init(e,t),e._zod.check=n=>{Ar(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Mr=w(`$ZodNumber`,(e,t)=>{E.init(e,t),e._zod.pattern=Sn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Nr=w(`$ZodNumberFormat`,(e,t)=>{An.init(e,t),Mr.init(e,t)}),Pr=w(`$ZodUnknown`,(e,t)=>{E.init(e,t),e._zod.parse=e=>e}),Fr=w(`$ZodNever`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Ir(e,t){let n=Ge(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Ge(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Ke(n.issues,t,e),n}}return i(n,a)}}var Lr=e=>Array.isArray(e)?e.length:-1;function Rr(e,t,n){e.issues.length&&t.issues.push(...Ue(n,e.issues)),t.value[n]=e.value}var zr=w(`$ZodArray`,(e,t)=>{E.init(e,t);let n=gt.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Rr(t,r,e)));else if(Rr(c,r,e),s&&c.issues.length!==0&&Ve(c))break}return o.length?Promise.all(o).then(()=>r):r},Ir(e,Lr)});function Br(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(!(!o&&s&&i===`optional`)){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Ue(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Vr=[];function Hr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Vr,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ke(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Ur(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Ve(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Br(e,n,i,t,d,f))):Br(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Wr=w(`$ZodObject`,(e,t)=>{E.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=se(()=>Hr(t));C(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||de(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=xe,o=t.catchall,s,c=gt.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Ve(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Br(n,t,e,r,a,o))):Br(s,t,e,r,a,o)}return o?Ur(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Gr=w(`$ZodObjectJIT`,(e,t)=>{Wr.init(e,t);let n=e._zod.parse,r=se(()=>Hr(t)),i=gt.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Hn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
4
|
+
let ${e}_ab = false;
|
|
5
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
6
|
+
const iss = ${e}.issues[i];
|
|
7
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
8
|
+
payload.issues.push(iss);
|
|
9
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
10
|
+
}
|
|
11
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
12
|
+
payload.value = newResult;
|
|
13
|
+
return payload;
|
|
14
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:ve(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
15
|
+
const ${n}_present = ${i};
|
|
16
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
17
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (${e}) {
|
|
21
|
+
newResult[${r}] = ${n}.value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
`)}else f?(o.write(`
|
|
26
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
27
|
+
}
|
|
28
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
29
|
+
if (${n}.value !== undefined || ${i}) {
|
|
30
|
+
newResult[${r}] = ${n}.value;
|
|
31
|
+
}
|
|
32
|
+
`)):o.write(`
|
|
33
|
+
const ${n}_present = ${i};
|
|
34
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
35
|
+
}
|
|
36
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
37
|
+
payload.issues.push({
|
|
38
|
+
code: "invalid_type",
|
|
39
|
+
expected: "nonoptional",
|
|
40
|
+
input: undefined,
|
|
41
|
+
path: [${r}]
|
|
42
|
+
});
|
|
43
|
+
if (ctx && ctx.abortEarly) {
|
|
44
|
+
payload.value = newResult;
|
|
45
|
+
return payload;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (${n}_present) {
|
|
50
|
+
newResult[${r}] = ${n}.value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=xe,c=!gt.jitless,l=c&&Se.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Ur([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Kr(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!Ve(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>qe(e,r,_t())))}),t)}var qr=w(`$ZodUnion`,(e,t)=>{E.init(e,t),C(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),C(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),C(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),C(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>le(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Kr(t,r,e,i)):Kr(o,r,e,i)}}),Jr=w(`$ZodIntersection`,(e,t)=>{E.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Xr(e,t,n)):Xr(e,i,a)}});function Yr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ce(e)&&Ce(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Yr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Yr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Xr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Yr(t.value,n.value);if(!c.valid){if(Ve(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Zr=w(`$ZodEnum`,(e,t)=>{E.init(e,t);let n=re(t.entries),r=new Set(n);e._zod.values=r,C(e,`pattern`,e=>{let t=re(e.def.entries).filter(e=>Te.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Ee(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Qr=w(`$ZodLiteral`,(e,t)=>{E.init(e,t);let n=new Set(t.values);e._zod.values=n,C(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Ee(e):e?Ee(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),$r=w(`$ZodTransform`,(e,t)=>{E.init(e,t),e._zod.optin=`optional`,gt.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ht(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new mt;return n.value=i,n}});function ei(e,t){return e.value=t.issues.length?void 0:t.value,e}var ti=w(`$ZodOptional`,(e,t)=>{E.init(e,t),C(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,C(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),C(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${le(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>ei(e,t)):ei(e,r)}return t.innerType._zod.run(e,n)}}),ni=w(`$ZodExactOptional`,(e,t)=>{ti.init(e,t),C(e,`values`,e=>e.def.innerType._zod.values),C(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),ri=w(`$ZodNullable`,(e,t)=>{E.init(e,t),C(e,`optin`,e=>e.def.innerType._zod.optin),C(e,`optout`,e=>e.def.innerType._zod.optout),C(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${le(t.source)}|null)$`):void 0}),C(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),ii=w(`$ZodDefault`,(e,t)=>{E.init(e,t),e._zod.optin=`defaulted`,C(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>ai(e,t)):ai(r,t)}});function ai(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var oi=w(`$ZodPrefault`,(e,t)=>{E.init(e,t),e._zod.optin=`defaulted`,C(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),si=w(`$ZodNonOptional`,(e,t)=>{E.init(e,t),C(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>ci(t,e)):ci(i,e)}});function ci(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function li(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>qe(e,r,_t()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ui=w(`$ZodCatch`,(e,t)=>{E.init(e,t),C(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),C(e,`optout`,e=>e.def.innerType._zod.optout),C(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>li(e,r,t,n)):li(e,r,t,n)}}),di=w(`$ZodPipe`,(e,t)=>{E.init(e,t),C(e,`values`,e=>e.def.in._zod.values),C(e,`optin`,e=>e.def.in._zod.optin),C(e,`optout`,e=>e.def.out._zod.optout),C(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>fi(e,t.in,n)):fi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>fi(e,t.out,n)):fi(r,t.out,n)}});function fi(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var pi=w(`$ZodReadonly`,(e,t)=>{E.init(e,t),C(e,`propValues`,e=>e.def.innerType._zod.propValues),C(e,`values`,e=>e.def.innerType._zod.values),C(e,`optin`,e=>e.def.innerType?._zod?.optin),C(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(mi):mi(r)}});function mi(e){return e.memo||(e.value=Object.freeze(e.value)),e}var hi=w(`$ZodCustom`,(e,t)=>{T.init(e,t),E.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>gi(t,n,r,e));gi(i,n,r,e)}});function gi(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Qe(e))}}var _i=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},vi=`~memo`,yi=[];function bi(e){return typeof e==`object`&&!!e}function xi(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Si=new WeakMap,Ci=0,wi=1,Ti=2;function Ei(e,t,n){let r=Si.get(e);if(r!==void 0)return r?Ti:Ci;if(t.has(e))return Ti;t.add(e);let i=Ci,a=e=>{if(i!==Ti&&e?._zod){let r=Ei(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Ci;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?wi:o.value?._zod?Ei(o.value,t,n):Ci;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=fe(c);s(e?o(e,!0):wi),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Ei(r,t,!1):wi);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(!(!n||typeof n!=`object`)){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),Di(e,i)}function Di(e,t){return t!==wi&&Si.set(e,t===Ti),t}function Oi(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var ki,Ai=[],ji={alloc(e,t,n){let r=ki;if(!r)return n;ki=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ai.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Ni(n,e.value))throw new _i;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Ei(e,new Set,!1);if(i===Ci)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Ti||r?n=!0:r=!0}let l=s.value;if(!bi(l))return t(s,c);let u=c[vi];u||(u={buckets:new WeakMap,backEdges:void 0},c[vi]=u);let d;i===c?d=a:(d=Oi(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...xi(f.issues)):(s.memo=!0,u.backEdges??=new WeakSet,u.backEdges.add(f.value)),s;ki=d;let p=Ai.length,m=t(s,c);ki=void 0;let h=Ai.length>p?Ai.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?xi(e.issues):yi),e)):(h&&(h.issues=m.issues.length?xi(m.issues):yi),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Mi(){return ji}function Ni(e,t){let n=e[vi]?.backEdges;return n!==void 0&&bi(t)&&n.has(t)}var Pi=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Ze(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Oe(e.values[0])}`:`Invalid option: expected one of ${ie(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${ie(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function Fi(){return{localeError:Pi()}}var Ii,Li=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Ri(){return new Li}(Ii=globalThis).__zod_globalRegistry??(Ii.__zod_globalRegistry=Ri());var zi=globalThis.__zod_globalRegistry;function Bi(e){return e.checks&&=[...e.checks],e}function Vi(e,t){return new e(Bi({type:`string`,...x(t)}))}function Hi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...x(t)})}function Ui(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...x(t)})}function Wi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...x(t)})}function Gi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...x(t)})}function Ki(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...x(t)})}function qi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...x(t)})}function Ji(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...x(t)})}function Yi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...x(t)})}function Xi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...x(t)})}function Zi(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...x(t)})}function Qi(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...x(t)})}function $i(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...x(t)})}function ea(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...x(t)})}function ta(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...x(t)})}function na(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...x(t)})}function ra(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...x(t)})}function ia(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...x(t)})}function aa(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...x(t)})}function oa(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...x(t)})}function sa(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...x(t)})}function ca(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...x(t)})}function la(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...x(t)})}function ua(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...x(t)})}function da(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...x(t)})}function fa(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...x(t)})}function pa(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...x(t)})}function ma(e,t){return new e(Bi({type:`number`,coerce:!0,checks:[],...x(t)}))}function ha(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...x(t)})}function ga(e){return new e({type:`unknown`})}function _a(e,t){return new e({type:`never`,...x(t)})}function va(e,t){return new Dn({check:`less_than`,...x(t),value:e,inclusive:!1})}function ya(e,t){return new Dn({check:`less_than`,...x(t),value:e,inclusive:!0})}function ba(e,t){return new On({check:`greater_than`,...x(t),value:e,inclusive:!1})}function xa(e,t){return new On({check:`greater_than`,...x(t),value:e,inclusive:!0})}function Sa(e,t){return new kn({check:`multiple_of`,...x(t),value:e})}function Ca(e,t){return new jn({check:`max_length`,...x(t),maximum:e})}function wa(e,t){return new Mn({check:`min_length`,...x(t),minimum:e})}function Ta(e,t){return new Nn({check:`length_equals`,...x(t),length:e})}function Ea(e,t){return new Fn({check:`string_format`,format:`regex`,...x(t),pattern:e})}function Da(e){return new In({check:`string_format`,format:`lowercase`,...x(e)})}function Oa(e){return new Ln({check:`string_format`,format:`uppercase`,...x(e)})}function ka(e,t){return new Rn({check:`string_format`,format:`includes`,...x(t),includes:e})}function Aa(e,t){return new zn({check:`string_format`,format:`starts_with`,...x(t),prefix:e})}function ja(e,t){return new Bn({check:`string_format`,format:`ends_with`,...x(t),suffix:e})}function Ma(e){return new Vn({check:`overwrite`,tx:e})}function Na(e){return Ma(t=>t.normalize(e))}function Pa(){return Ma(e=>e.trim())}function Fa(){return Ma(e=>e.toLowerCase())}function Ia(){return Ma(e=>e.toUpperCase())}function La(){return Ma(e=>ye(e))}function Ra(e,t,n){return new e({type:`array`,element:t,...x(n)})}function za(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...x(n)})}function Ba(e,t){let n=Va(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Qe(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Qe(r))}},e(t.value,t)),t);return n}function Va(e,t){let n=new T({check:`custom`,...x(t)});return n._zod.check=e,n}function Ha(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&de(e,t,n[t]);return e}function Ua(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??zi,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Wa(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function O(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,O(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ha(o.schema,c),t.io===`input`&&k(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ga(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ka(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Ga(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Ga(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
54
|
+
|
|
55
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function qa(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;qa(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Ja=new Set([`type`,`properties`,`required`,`additionalProperties`]),Ya=[`oneOf`,`anyOf`];function Xa(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Za(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Ja.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Xa(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}de(n,r,e.length===1?e[0]:Za(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Xa(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Qa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Ja)if(t in e)return;let n=t.filter(e=>Ya.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Za(t);else{let e=n[0],i=Ya.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Za([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ha(e,r))}function $a(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ha(i,s),Ha(i,a),t._zod.parent===o)for(let e in i)e===`$ref`||e===`allOf`||e in a||delete i[e];if(s.$ref&&n.def)for(let e in i)e===`$ref`||e===`allOf`||e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e===`$ref`||e===`allOf`||e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())qa(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Qa(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ha(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,de(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:to(t,`input`,e.processors),output:to(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function k(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return k(r.element,n);if(r.type===`set`)return k(r.valueType,n);if(r.type===`lazy`)return k(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return k(r.innerType,n);if(r.type===`intersection`)return k(r.left,n)||k(r.right,n);if(r.type===`record`||r.type===`map`)return k(r.keyType,n)||k(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:k(r.in,n)||k(r.out,n);if(r.type===`object`){for(let e in r.shape)if(k(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(k(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(k(e,n))return!0;return!!(r.rest&&k(r.rest,n))}return!1}var eo=(e,t={})=>n=>{let r=Ua({...n,processors:t});return O(e,r),Ka(r,e),$a(r,e)},to=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ua({...i??{},target:a,io:t,processors:n});return O(e,o),Ka(o,e),$a(o,e)},no=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},ro=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},io=(e,t)=>{no(e,`minimum`,t),ro(e,`maximum`,t)},ao=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},oo=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},so=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},co=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},lo=(e,t)=>no(e,`minimum`,t.minimum),uo=(e,t)=>ro(e,`maximum`,t.maximum),fo=e=>(t,n)=>{co(t,n.format);let[r,i]=e[n.format];no(t,`minimum`,r),ro(t,`maximum`,i)},po={greater_than:(e,t)=>no(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>ro(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ao(e,t.value),number_format:fo(Ae),bigint_format:fo(je),min_length:lo,max_length:uo,length_equals:(e,t)=>io(e,t.length),min_size:lo,max_size:uo,size_equals:(e,t)=>io(e,t.size),string_format:(e,t)=>{co(e,t.format),t.pattern&&oo(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>so(e,t.mime)};function mo(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)po[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&no(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&no(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&ro(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&ro(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ao(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&so(t,i.mime);for(let e of i.patterns??[])oo(t,e);return t}var ho={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},go=new Map([[wr,dn],[Er,fn]]),_o=e=>go.get(e)??e,vo=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=mo(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ho[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(_o);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},yo=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=mo(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Wa(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},bo=(e,t,n,r)=>{n.not={}},xo=(e,t,n,r)=>{let i=e._zod.def,a=re(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},So=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Wa(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Wa(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Co=(e,t,n,r)=>{Wa(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},wo=(e,t,n,r)=>{Wa(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},To=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=mo(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=O(a.element,t,{...r,path:[...r.path,`items`]})};function Eo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Eo(t.out):t.type===`catch`?Eo(t.innerType):e._zod.optin}var Do=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Wa(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)de(i.properties,e,O(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Eo(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=O(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Oo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>O(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},ko=(e,t,n,r)=>{let i=e._zod.def,a=O(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=O(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Ao=(e,t,n,r)=>{let i=e._zod.def,a=O(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},jo=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mo=Symbol();function No(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Wa(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Mo):JSON.parse(o)}var Po=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=No(i.defaultValue,e,t,n,r);o!==Mo&&(n.default=o)},Fo=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=No(i.defaultValue,e,t,n,r);o!==Mo&&(n._prefault=o)},Io=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Wa(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Lo=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;O(o,t,r);let s=t.seen.get(e);s.ref=o},Ro=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},zo=(e,t,n,r)=>{let i=e._zod.def;O(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Bo=new WeakSet([Object.prototype,Error.prototype]);function Vo(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var Ho=w(`ZodError`,(e,t)=>{wt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Bo.has(n)||(Bo.add(n),Vo(n,`format`,e=>t=>Dt(e,t)),Vo(n,`flatten`,e=>t=>Et(e,t)),Vo(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,ae,2)}),Vo(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,ae,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Uo=kt(Ho),Wo=At(Ho),Go=jt(Ho),Ko=Nt(Ho),qo=zt(Ho),Jo=Bt(Ho),Yo=Vt(Ho),Xo=Ht(Ho),Zo=Ut(Ho),Qo=Wt(Ho),$o=Gt(Ho),es=Kt(Ho);function ts(){gt.localeError||_t(Fi())}function ns(){gt.memoizer||_t({memoizer:Mi()})}var A=w(`ZodType`,(e,t)=>(ts(),E.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(b(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return De(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(hc(e,t))},superRefine(e,t){return this.check(gc(e,t))},overwrite(e){return this.check(Ma(e))},optional(){return Zs(this)},exactOptional(){return $s(this)},nullable(){return tc(this)},nullish(){return Zs(tc(this))},nonoptional(e){return sc(this,e)},array(){return Ls(this)},or(e){return Vs([this,e])},and(e){return Us(this,e)},transform(e){return dc(this,Ys(e))},default(e){return rc(this,e)},prefault(e){return ac(this,e)},catch(e){return lc(this,e)},pipe(e){return dc(this,e)},readonly(){return pc(this)},describe(e){let t=this.clone();return zi.add(t,{description:e}),t},meta(...e){if(e.length===0)return zi.get(this);let t=this.clone();return zi.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return tt(this,`~standard`,{...Kn(this),jsonSchema:{input:to(this,`input`),output:to(this,`output`)}})},set"~standard"(e){et(this,`~standard`,e)},parse:function e(t,n){return Uo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Wo(this,t,n,{callee:e})},safeParse(e,t){return Go(this,e,t)},async safeParseAsync(e,t){return Ko(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){et(this,`spa`,e)},validate(e,t){return It(this,e,t)},validateAsync(e,t){return Rt(this,e,t)},encode:function e(t,n){return qo(this,t,n,{callee:e})},decode:function e(t,n){return Jo(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Yo(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Xo(this,t,n,{callee:e})},safeEncode(e,t){return Zo(this,e,t)},safeDecode(e,t){return Qo(this,e,t)},async safeEncodeAsync(e,t){return $o(this,e,t)},async safeDecodeAsync(e,t){return es(this,e,t)},toJSONSchema(e){return eo(this,{})(e)},get description(){return zi.get(this)?.description},get _def(){return this._zod.def}}),rs=w(`_ZodString`,(e,t)=>{qn.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vo(e,t,n,r)},S({format:e=>mo(e).format??null,minLength:e=>mo(e).minimum??null,maxLength:e=>mo(e).maximum??null},{regex(...e){return this.check(Ea(...e))},includes(...e){return this.check(ka(...e))},startsWith(...e){return this.check(Aa(...e))},endsWith(...e){return this.check(ja(...e))},min(...e){return this.check(wa(...e))},max(...e){return this.check(Ca(...e))},length(...e){return this.check(Ta(...e))},nonempty(...e){return this.check(wa(1,...e))},lowercase(e){return this.check(Da(e))},uppercase(e){return this.check(Oa(e))},trim(){return this.check(Pa())},normalize(...e){return this.check(Na(...e))},toLowerCase(){return this.check(Fa())},toUpperCase(){return this.check(Ia())},slugify(){return this.check(La())}})),is=w(`ZodString`,(e,t)=>{qn.init(e,t),rs.init(e,t)},{email(e){return this.check(Hi(us,e))},url(e){return this.check(Ji(ps,e))},jwt(e){return this.check(la(Os,e))},emoji(e){return this.check(Yi(ms,e))},guid(e){return this.check(Ui(ds,e))},uuid(e){return this.check(Wi(fs,e))},uuidv4(e){return this.check(Gi(fs,e))},uuidv6(e){return this.check(Ki(fs,e))},uuidv7(e){return this.check(qi(fs,e))},nanoid(e){return this.check(Xi(hs,e))},cuid(e){return this.check(Zi(gs,e))},cuid2(e){return this.check(Qi(_s,e))},ulid(e){return this.check($i(vs,e))},base64(e){return this.check(oa(Ts,e))},base64url(e){return this.check(sa(Es,e))},xid(e){return this.check(ea(ys,e))},ksuid(e){return this.check(ta(bs,e))},ipv4(e){return this.check(na(xs,e))},ipv6(e){return this.check(ra(Ss,e))},cidrv4(e){return this.check(ia(Cs,e))},cidrv6(e){return this.check(aa(ws,e))},e164(e){return this.check(ca(Ds,e))},datetime(e){return this.check(ua(os,e))},date(e){return this.check(da(ss,e))},time(e){return this.check(fa(cs,e))},duration(e){return this.check(pa(ls,e))}});function as(e){return Vi(is,e)}var j=w(`ZodStringFormat`,(e,t)=>{D.init(e,t),rs.init(e,t)}),os=w(`ZodISODateTime`,(e,t)=>{fr.init(e,t),j.init(e,t)}),ss=w(`ZodISODate`,(e,t)=>{pr.init(e,t),j.init(e,t)}),cs=w(`ZodISOTime`,(e,t)=>{mr.init(e,t),j.init(e,t)}),ls=w(`ZodISODuration`,(e,t)=>{hr.init(e,t),j.init(e,t)}),us=w(`ZodEmail`,(e,t)=>{Xn.init(e,t),j.init(e,t)}),ds=w(`ZodGUID`,(e,t)=>{Jn.init(e,t),j.init(e,t)}),fs=w(`ZodUUID`,(e,t)=>{Yn.init(e,t),j.init(e,t)}),ps=w(`ZodURL`,(e,t)=>{ir.init(e,t),j.init(e,t)}),ms=w(`ZodEmoji`,(e,t)=>{ar.init(e,t),j.init(e,t)}),hs=w(`ZodNanoID`,(e,t)=>{or.init(e,t),j.init(e,t)}),gs=w(`ZodCUID`,(e,t)=>{sr.init(e,t),j.init(e,t)}),_s=w(`ZodCUID2`,(e,t)=>{cr.init(e,t),j.init(e,t)}),vs=w(`ZodULID`,(e,t)=>{lr.init(e,t),j.init(e,t)}),ys=w(`ZodXID`,(e,t)=>{ur.init(e,t),j.init(e,t)}),bs=w(`ZodKSUID`,(e,t)=>{dr.init(e,t),j.init(e,t)}),xs=w(`ZodIPv4`,(e,t)=>{gr.init(e,t),j.init(e,t)}),Ss=w(`ZodIPv6`,(e,t)=>{yr.init(e,t),j.init(e,t)}),Cs=w(`ZodCIDRv4`,(e,t)=>{br.init(e,t),j.init(e,t)}),ws=w(`ZodCIDRv6`,(e,t)=>{Sr.init(e,t),j.init(e,t)}),Ts=w(`ZodBase64`,(e,t)=>{Tr.init(e,t),j.init(e,t)}),Es=w(`ZodBase64URL`,(e,t)=>{Or.init(e,t),j.init(e,t)}),Ds=w(`ZodE164`,(e,t)=>{kr.init(e,t),j.init(e,t)}),Os=w(`ZodJWT`,(e,t)=>{jr.init(e,t),j.init(e,t)}),ks=w(`ZodNumber`,(e,t)=>{Mr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yo(e,t,n,r),e.isFinite=!0},S({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=mo(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=mo(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=mo(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>mo(e).format??null},{gt(e,t){return this.check(ba(e,t))},gte(e,t){return this.check(xa(e,t))},min(e,t){return this.check(xa(e,t))},lt(e,t){return this.check(va(e,t))},lte(e,t){return this.check(ya(e,t))},max(e,t){return this.check(ya(e,t))},int(e){return this.check(js(e))},safe(e){return this.check(js(e))},positive(e){return this.check(ba(0,e))},nonnegative(e){return this.check(xa(0,e))},negative(e){return this.check(va(0,e))},nonpositive(e){return this.check(ya(0,e))},multipleOf(e,t){return this.check(Sa(e,t))},step(e,t){return this.check(Sa(e,t))},finite(){return this}})),As=w(`ZodNumberFormat`,(e,t)=>{Nr.init(e,t),ks.init(e,t)});function js(e){return ha(As,e)}var Ms=w(`ZodUnknown`,(e,t)=>{Pr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Ns(){return ga(Ms)}var Ps=w(`ZodNever`,(e,t)=>{Fr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bo(e,t,n,r)});function Fs(e){return _a(Ps,e)}var Is=w(`ZodArray`,(e,t)=>{ns(),zr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>To(e,t,n,r),e.element=t.element},{min(e,t){return this.check(wa(e,t))},nonempty(e){return this.check(wa(1,e))},max(e,t){return this.check(Ca(e,t))},length(e,t){return this.check(Ta(e,t))},unwrap(){return this.element}});function Ls(e,t){return Ra(Is,e,t)}var Rs=w(`ZodObject`,(e,t)=>{ns(),Gr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Do(e,t,n,r),st(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Gs(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(b(this._zod.def,{catchall:e}))},passthrough(){return this.clone(b(this._zod.def,{catchall:Ns()}))},loose(){return this.clone(b(this._zod.def,{catchall:Ns()}))},strict(){return this.clone(b(this._zod.def,{catchall:Fs()}))},strip(){return this.clone(b(this._zod.def,{catchall:void 0}))},extend(e){return Fe(this,e)},safeExtend(e){return Le(this,e)},merge(e){return Re(this,e)},pick(e){return Me(this,e)},omit(e){return Pe(this,e)},partial(...e){return ze(Xs,this,e[0])},exactPartial(...e){return ze(Qs,this,e[0],`exactPartial`)},required(...e){return Be(oc,this,e[0])}});function zs(e,t){return new Rs({type:`object`,shape:e??{},...x(t)})}var Bs=w(`ZodUnion`,(e,t)=>{qr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oo(e,t,n,r),e.options=t.options});function Vs(e,t){return new Bs({type:`union`,options:e,...x(t)})}var Hs=w(`ZodIntersection`,(e,t)=>{Jr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r)});function Us(e,t){return new Hs({type:`intersection`,left:e,right:t})}var Ws=w(`ZodEnum`,(e,t)=>{Zr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xo(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ws({...t,checks:[],...x(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ws({...t,checks:[],...x(r),entries:i})}});function Gs(e,t){return new Ws({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...x(t)})}var Ks=w(`ZodLiteral`,(e,t)=>{Qr.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>So(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function qs(e,t){return new Ks({type:`literal`,values:Array.isArray(e)?e:[e],...x(t)})}var Js=w(`ZodTransform`,(e,t)=>{ns(),$r.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ht(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Qe(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Qe(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ys(e){return new Js({type:`transform`,transform:e})}var Xs=w(`ZodOptional`,(e,t)=>{ti.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Zs(e){return new Xs({type:`optional`,innerType:e})}var Qs=w(`ZodExactOptional`,(e,t)=>{ni.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $s(e){return new Qs({type:`optional`,innerType:e})}var ec=w(`ZodNullable`,(e,t)=>{ri.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tc(e){return new ec({type:`nullable`,innerType:e})}var nc=w(`ZodDefault`,(e,t)=>{ii.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function rc(e,t){return new nc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():we(t)}})}var ic=w(`ZodPrefault`,(e,t)=>{oi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ac(e,t){return new ic({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():we(t)}})}var oc=w(`ZodNonOptional`,(e,t)=>{si.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sc(e,t){return new oc({type:`nonoptional`,innerType:e,...x(t)})}var cc=w(`ZodCatch`,(e,t)=>{ui.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lc(e,t){return new cc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:lt(t)})}var uc=w(`ZodPipe`,(e,t)=>{di.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lo(e,t,n,r),e.in=t.in,e.out=t.out});function dc(e,t){return new uc({type:`pipe`,in:e,out:t})}var fc=w(`ZodReadonly`,(e,t)=>{pi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pc(e){return new fc({type:`readonly`,innerType:e})}var mc=w(`ZodCustom`,(e,t)=>{hi.init(e,t),A.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Co(e,t,n,r)});function hc(e,t={}){return za(mc,e,t)}function gc(e,t){return Ba(e,t)}function _c(e){return ma(ks,e)}var vc=Gs([`SECOND`,`MINUTE`,`HOUR`,`DAY`,`WEEK`,`MONTH`,`QUARTER`,`YEAR`]),yc=class extends Error{constructor(e,t){super(e),this.code=t}},bc=e=>e,xc=({value:e,kind:t,allowedValues:n})=>{let r=n.map(e=>`'${e}'`);return bc(`${JSON.stringify(e)??String(e)} is not a date ${t}: use ${r.slice(0,-1).join(`, `)} or ${r[r.length-1]}`)},Sc=vc.options.filter(e=>e!==`SECOND`),Cc=e=>Sc.some(t=>t===e),wc=e=>{if(!Cc(e))throw new yc(xc({value:e,kind:`unit`,allowedValues:Sc}),`INVALID_DATE_UNIT`)},Tc=e=>e.isDateOnly?e.date.toString():e.dateTime.toInstant().toString({fractionalSecondDigits:3}),Ec=e=>e.isDateOnly?e.date.toZonedDateTime(`UTC`):e.dateTime,Dc=e=>{let{year:t}=Ec(e);return t>=1&&t<=9999},Oc=e=>/^\d{4}-\d{2}-\d{2}$/.test(e);function kc(e,t,n,r,i){return Ac(t,((e,t)=>{let n=e[t];if(n===void 0)throw TypeError(ah(t));return n})(e,t),n,r,i)}function Ac(e,t,n,r,i,a){let o=Jc(t,n,r);if(i&&t!==o)throw RangeError(rh(e,t,n,r,a));return o}function M(e){return e!==null&&/object|function/.test(typeof e)}function jc(e,t=Map){let n=new t;return(t,...r)=>{if(n.has(t))return n.get(t);let i=e(t,...r);return n.set(t,i),i}}function Mc(e){return Nc({name:e},1)}function Nc(e,t){return Lc((e=>({value:e,configurable:1,writable:!t})),e)}function Pc(e){return Lc((e=>({get:e,configurable:1})),e)}function Fc(e){return{[Symbol.toStringTag]:{value:e,configurable:1}}}function Ic(e,t){let n={},r=e.length;for(let i of t)n[e[--r]]=i;return n}function Lc(e,t,n){let r={};for(let i in t)r[i]=e(t[i],i,n);return r}function Rc(e,t,n){let r={};for(let i=0;i<t.length;i++){let a=t[i];r[a]=e(a,i,n)}return r}function zc(e,t,n){let r={};for(let i=0;i<e.length;i++)r[t[i]]=n[e[i]];return r}function Bc(e,t){let n=Object.create(null);for(let r of e)n[r]=t[r];return n}function Vc(e,t){for(let n of t)if(n in e)return 1;return 0}function Hc(e,t,n){for(let r of e)if(t[r]!==n[r])return 0;return 1}function Uc(e,t,n){let r={...n};for(let n=0;n<t;n++)r[e[n]]=0;return r}function N(e,...t){return(...n)=>e(...t,...n)}function Wc(e){return e[0].toUpperCase()+e.substring(1)}function Gc(e){return e.slice().sort()}function Kc(e,t){return String(t).padStart(e,`0`)}function qc(e,t){return Math.sign(e-t)}function Jc(e,t,n){return Math.min(Math.max(e,t),n)}function Yc(e,t){return[Math.floor(e/t),Xc(e,t)]}function Xc(e,t){return(e%t+t)%t}function Zc(e,t){return[Qc(e,t),$c(e,t)]}function Qc(e,t){return Math.trunc(e/t)||0}function $c(e,t){return e%t||0}function el(e){return Math.abs(e%1)===.5}function tl(e,t,n){let r=0,i=0;for(let a=0;a<=t;a++){let t=e[n[a]],o=ng[a],[s,c]=Zc(t,R/o);r+=c*o,i+=s}let[a,o]=Zc(r,R);return[i+a,o]}function nl(e,t,n){let r={};for(let i=t;i>=0;i--){let t=ng[i];r[n[i]]=Qc(e,t),e=$c(e,t)}return r}function rl(e){if(e!==void 0)return z(e)}function il(e){if(e!==void 0)return ol(e)}function al(e){if(e!==void 0)return sl(e)}function ol(e){return fl(sl(e))}function sl(e){return dl(Og(e))}function cl(e,t){if(t==null)throw RangeError(ah(e));return t}function ll(e){if(!M(e))throw TypeError(nh);return e}function ul(e,t,n=e){if(typeof t!==e)throw TypeError(ih(n,t));return t}function dl(e,t=`number`){if(!Number.isInteger(e))throw RangeError(Xm(t,e));return e||0}function fl(e,t=`number`){if(e<=0)throw RangeError(Zm(t,e));return e}function pl(e){if(typeof e==`symbol`)throw TypeError(th);return String(e)}function ml(e,t){return M(e)?String(e):z(e,t)}function hl(e){if(typeof e==`string`)return BigInt(e);if(typeof e!=`bigint`)throw TypeError(eh(e));return e}function gl(e,t=`number`){if(typeof e==`bigint`)throw TypeError($m(t));if(e=Number(e),!Number.isFinite(e))throw RangeError(Qm(t,e));return e}function _l(e,t){return Math.trunc(gl(e,t))||0}function vl(e,t){return dl(gl(e,t),t)}function yl(e,t){return fl(_l(e,t),t)}function bl(e,t){let[n,r]=Zc(t,R),i=e+n,a=Math.sign(i);return a&&a===-Math.sign(r)&&(i-=a,r+=a*R),[i,r]}function xl(e,t,n=1){return bl(e[0]+t[0]*n,e[1]+t[1]*n)}function Sl(e,t){return bl(e[0],e[1]+t)}function Cl(e,t){return xl(t,e,-1)}function wl(e,t){return qc(e[0],t[0])||qc(e[1],t[1])}function Tl(e,t,n){return wl(e,t)===-1||wl(e,n)===1}function El(e,t=1){let n=BigInt(R/t);return[Number(e/n),Number(e%n)*t]}function Dl(e,t=1){let[n,r]=Zc(e,R/t);return[n,r*t]}function Ol(e,t=1,n){let[r,i]=e,[a,o]=Zc(i,t);return R/t*r+(a+(n?o/t:0))}function kl(e,t,n=Yc){let[r,i]=e,[a,o]=n(i,t);return[R/t*r+a,o]}function Al(e){return kc(e,`isoYear`,Yg,Jg,1),e.isoYear===Yg?kc(e,`isoMonth`,4,12,1):e.isoYear===Jg&&kc(e,`isoMonth`,1,9,1),e}function jl(e){return Ml({...e,...Hg,isoHour:12}),e}function Ml(e){let t=kc(e,`isoYear`,Yg,Jg,1),n=t===Yg?1:t===Jg?-1:0;return n&&Nl(P({...e,isoDay:e.isoDay+n,isoNanosecond:e.isoNanosecond-n})),e}function Nl(e){if(!e||Tl(e,qg,Kg))throw RangeError(Mh);return e}function Pl(e){return tl(e,5,Ig)[1]}function Fl(e){let[t,n]=Yc(e,R);return[nl(n,5,Ig),t]}function Il(e){return kl(e,$h)}function Ll(e){return Bl(e.isoYear,e.isoMonth,e.isoDay,e.isoHour,e.isoMinute,e.isoSecond,e.isoMillisecond)}function P(e){let t=Ll(e);if(t!==void 0){let[n,r]=Zc(t,Yh);return[n,r*Qh+(e.isoMicrosecond||0)*Zh+(e.isoNanosecond||0)]}}function Rl(e,t){let[n,r]=Fl(Pl(e)-t);return Nl(P({...e,isoDay:e.isoDay+r,...n}))}function zl(...e){return Bl(...e)/Xh}function Bl(...e){let[t,n]=Vl(...e),r=t.valueOf();if(!isNaN(r))return r-n*Yh}function Vl(e,t=1,n=1,r=0,i=0,a=0,o=0){let s=e===Yg?1:e===Jg?-1:0,c=new Date;return c.setUTCHours(r,i,a,o),c.setUTCFullYear(e,t-1,n+s),[c,s]}function Hl(e,t){let[n,r]=Sl(e,t);r<0&&(r+=R,--n);let[i,a]=Yc(r,Qh),[o,s]=Yc(a,Zh);return Ul(n*Yh+i,o,s)}function Ul(e,t=0,n=0){let r=Math.ceil(Math.max(0,Math.abs(e)-Gg)/Yh)*Math.sign(e),i=new Date(e-r*Yh);return Ic(Rg,[i.getUTCFullYear(),i.getUTCMonth()+1,i.getUTCDate()+r,i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds(),t,n])}function Wl(e,t){if(t<-Gg)throw RangeError(Mh);let n=e.formatToParts(t),r={};for(let e of n)r[e.type]=e.value;return r}function Gl(e){return[e.isoYear,e.isoMonth,e.isoDay]}function Kl(e,t){return[t,0]}function ql(){return e_}function Jl(e,t){switch(t){case 2:return Xl(e)?29:28;case 4:case 6:case 9:case 11:return 30}return 31}function Yl(e){return Xl(e)?366:365}function Xl(e){return e%4==0&&(e%100!=0||e%400==0)}function Zl(e){let[t,n]=Vl(e.isoYear,e.isoMonth,e.isoDay);return Xc(t.getUTCDay()-n,7)||7}function Ql(e){return this.id===Sg?(({isoYear:e})=>e<1?[`gregory-inverse`,1-e]:[`gregory`,e])(e):this.id===Cg?n_(e):[]}function $l(e){let t=Ll(e);if(t<t_){let{isoYear:t}=e;return t<1?[`japanese-inverse`,1-t]:[`japanese`,t]}let{era:n,eraYear:r}=Mp(Wl(dv(Cg),t),Cg);return[n,r]}function eu(e){return tu(e),iu(e,1),e}function tu(e){return ru(e,1),e}function nu(e){return Hc(Lg,e,ru(e))}function ru(e,t){let{isoYear:n}=e,r=kc(e,`isoMonth`,1,ql(),t);return{isoYear:n,isoMonth:r,isoDay:kc(e,`isoDay`,1,Jl(n,r),t)}}function iu(e,t){return Ic(Ig,[kc(e,`isoHour`,0,23,t),kc(e,`isoMinute`,0,59,t),kc(e,`isoSecond`,0,59,t),kc(e,`isoMillisecond`,0,999,t),kc(e,`isoMicrosecond`,0,999,t),kc(e,`isoNanosecond`,0,999,t)])}function F(e){return e===void 0?0:x_(ll(e))}function au(e,t=0){e=gu(e);let n=S_(e),r=C_(e,t);return[x_(e),r,n]}function ou(e,t,n,r=9,i=0,a=4){t=gu(t);let o=y_(t,r,i),s=pu(t),c=D_(t,a),l=v_(t,r,i,1);return o==null?o=Math.max(n,l):xu(o,l),s=mu(s,l,1),e&&(c=(e=>e<4?(e+2)%4:e)(c)),[o,l,s,c]}function su(e,t=6,n){let r=pu(e=_u(e,r_)),i=D_(e,7),a=v_(e,t);return a=cl(r_,a),r=mu(r,a,void 0,n),[a,r,i]}function cu(e){return w_(gu(e))}function lu(e,t){return du(gu(e),t)}function uu(e){let t=bu(c_,__,_u(e,c_),0);if(!t)throw RangeError(ih(c_,t));return t}function du(e,t=4){let n=hu(e);return[D_(e,4),...fu(v_(e,t),n)]}function fu(e,t){return e==null?[t===void 0?1:10**(9-t),t]:[ng[e],e<4?9-3*e:-1]}function pu(e){let t=e[a_];return t===void 0?1:_l(t,a_)}function mu(e,t,n,r){let i=r?R:ng[t+1];if(i){let n=ng[t];if(i%((e=Ac(a_,e,1,i/n-+!r,1))*n))throw RangeError(ih(a_,e))}else e=Ac(a_,e,1,n?10**9:1,1);return e}function hu(e){let t=e[o_];if(t!==void 0){if(typeof t!=`number`){if(pl(t)===`auto`)return;throw RangeError(ih(o_,t))}t=Ac(o_,Math.floor(t),0,9,1)}return t}function gu(e){return e===void 0?{}:ll(e)}function _u(e,t){return typeof e==`string`?{[t]:e}:ll(e)}function vu(e){return{overflow:u_[e]}}function yu(e,t,n=9,r=0,i){let a=t[e];if(a===void 0)return i?r:void 0;if(a=pl(a),a===`auto`)return i?r:null;let o=qh[a];if(o===void 0&&(o=Ng[a]),o===void 0)throw RangeError(uh(e,a,qh));return Ac(e,o,r,n,1,Jh),o}function bu(e,t,n,r=0){let i=n[e];if(i===void 0)return r;let a=pl(i),o=t[a];if(o===void 0)throw RangeError(uh(e,a,t));return o}function xu(e,t){if(t>e)throw RangeError(Rh)}function Su(e){return{branding:P_,epochNanoseconds:e}}function Cu(e,t,n){return{branding:N_,calendar:n,timeZone:t,epochNanoseconds:e}}function wu(e,t=e.calendar){return{branding:j_,calendar:t,...Bc(Vg,e)}}function Tu(e,t=e.calendar){return{branding:A_,calendar:t,...Bc(zg,e)}}function Eu(e,t=e.calendar){return{branding:O_,calendar:t,...Bc(zg,e)}}function Du(e,t=e.calendar){return{branding:k_,calendar:t,...Bc(zg,e)}}function Ou(e){return{branding:M_,...Bc(Bg,e)}}function I(e){return{branding:F_,sign:$d(e),...Bc(kg,e)}}function ku(e){return kl(e.epochNanoseconds,Qh)[0]}function Au(e){return((e,t=1)=>{let[n,r]=e,i=Math.floor(r/t),a=R/t;return BigInt(n)*BigInt(a)+BigInt(i)})(e.epochNanoseconds)}function ju(e){return e.epochNanoseconds}function Mu(e,t,n,r,i){let a=of(r),[o,s]=((e,t)=>{let n=t((e=_u(e,i_))[s_]),r=b_(e);return r=cl(i_,r),[r,n]})(i,e);if(!s&&Kd(Math.max(o,a),s))return Nu(r,o);if(!s)throw RangeError(Fh);if(!r.sign)return 0;let[c,l,u]=Vd(t,n,s),d=Hd(u),f=Ud(u),p=Wd(u),m=f(l,c,r);Gd(s)||(Ml(c),Ml(m));let h=p(l,c,m,o);return Kd(o,s)?Nu(h,o):((e,t,n,r,i,a,o)=>{let s=$d(e),[c,l]=Pu(r,Fg(n,e),n,s,i,a,o),u=Fu(t,c,l);return e[B[n]]+u*s})(h,d(m),o,l,c,d,f)}function Nu(e,t){return Ol(L(e),ng[t],1)}function Pu(e,t,n,r,i,a,o){let s=B[n],c={...t,[s]:t[s]+r},l=o(e,i,t),u=o(e,i,c);return[a(l),a(u)]}function Fu(e,t,n){let r=Ol(Cl(t,n));if(!r)throw RangeError(Sh);return Ol(Cl(t,e))/r}function Iu(e,t){let[n,r,i]=su(t,5,1);return Su(Zu(e.epochNanoseconds,n,r,i,1))}function Lu(e,t,n){let{epochNanoseconds:r,timeZone:i,calendar:a}=t,[o,s,c]=su(n);if(o===0&&s===1)return t;let l=e(i);if(o===6)r=((e,t,n,r)=>{let[i,a]=e(H_(n,t)),o=n.epochNanoseconds,s=Od(t,i),c=Od(t,a);if(Tl(o,s,c))throw RangeError(Sh);return ed(Fu(o,s,c),r)?c:s})(qu,l,t,c);else{let e=l.R(r);r=Ed(l,Hu(Hl(r,e),o,s,c),e,2,0,1)}return Cu(r,i,a)}function Ru(e,t){return wu(Hu(e,...su(t)),e.calendar)}function zu(e,t){let[n,r,i]=su(t,5);var a;return Ou((a=i,Wu(e,Ku(n,r),a)[0]))}function Bu(e,t){let n=e(t.timeZone),[r,i]=qu(H_(t,n)),a=Ol(Cl(Od(n,r),Od(n,i)),tg,1);if(a<=0)throw RangeError(Sh);return a}function Vu(e,t){let{timeZone:n,calendar:r}=t;return Cu(((e,t,n)=>Od(t,e(H_(n,t))))(Ju,e(n),t),n,r)}function Hu(e,t,n,r){return Uu(e,Ku(t,n),r)}function Uu(e,t,n){let[r,i]=Wu(e,t,n);return Ml({...Bd(e,i),...r})}function Wu(e,t,n){return Fl($u(Pl(e),t,n))}function Gu(e){return $u(e,eg,7)}function Ku(e,t){return ng[e]*t}function qu(e){let t=Ju(e);return[t,Bd(t,1)]}function Ju(e){return Ug(6,e)}function Yu(e,t,n){let r=Math.min(of(e),6);return nf(Qu(L(e,r),t,n),r)}function Xu(e,t,n,r,i,a,o,s,c,l){if(r===0&&i===1)return e;let[u,d,f]=(Kd(r,s)?Gd(s)&&r<6&&n>=6?nd:td:rd)(e,t,n,r,i,a,o,s,c,l);return f&&r!==7&&(u=((e,t,n,r,i,a,o,s)=>{let c=$d(e);for(let l=r+1;l<=n;l++){if(l===7&&n!==7)continue;let r=Fg(l,e);r[B[l]]+=c;let u=Ol(Cl(o(s(i,a,r)),t));if(u&&Math.sign(u)!==c)break;e=r}return e})(u,d,n,Math.max(6,r),o,s,c,l)),u}function Zu(e,t,n,r,i){return t===6?[$u((e=>e[0]+e[1]/R)(e),n,r),0]:Qu(e,Ku(t,n),r,i)}function Qu(e,t,n,r){let[i,a]=e;r&&a<0&&(a+=R,--i);let[o,s]=Yc($u(a,t,n),R);return bl(i+o,s)}function $u(e,t,n){return ed(e/t,n)*t}function ed(e,t){return I_[t](e)}function td(e,t,n,r,i,a){let o=$d(e),s=L(e),c=Zu(s,r,i,a),l=Cl(s,c),u=Math.sign(c[0]-s[0])===o,d=nf(c,Math.min(n,6));return[{...e,...d},xl(t,l),u]}function nd(e,t,n,r,i,a,o,s,c,l){let u=$d(e)||1,d=Ol(L(e,5)),f=Ku(r,i),p=$u(d,f,a),[m,h]=Pu(o,{...e,...Pg},6,u,s,c,l),ee=p-Ol(Cl(m,h)),g=0;ee&&Math.sign(ee)!==u?t=Sl(m,p):(g+=u,p=$u(ee,f,a),t=Sl(h,p));let te=rf(p);return[{...e,...te,days:e.days+g},t,!!g]}function rd(e,t,n,r,i,a,o,s,c,l){let u=$d(e),d=B[r],f=Fg(r,e);r===7&&(e={...e,weeks:e.weeks+Math.trunc(e.days/7)});let p=Qc(e[d],i)*i;f[d]=p;let[m,h]=Pu(o,f,r,i*u,s,c,l),ee=p+Fu(t,m,h)*u*i,g=$u(ee,i,a),te=Math.sign(g-ee)===u;return f[d]=g,[f,te?h:m,te]}function id(e,t,n,r){let[i,a,o,s]=(e=>{let t=du(e=gu(e));return[e.timeZone,...t]})(r),c=i!==void 0;return((e,t,n,r,i,a)=>{n=Qu(n,i,r,1);let o=t.R(n);return md(Hl(n,o),a)+(e?yd(Gu(o)):`Z`)})(c,t(c?e(i):L_),n.epochNanoseconds,a,o,s)}function ad(e,t,n){let[r,i,a,o,s,c]=(e=>{e=gu(e);let t=w_(e),n=hu(e),r=E_(e),i=D_(e,4),a=v_(e,4);return[t,T_(e),r,i,...fu(a,n)]})(n);return((e,t,n,r,i,a,o,s,c,l)=>{r=Qu(r,c,s,1);let u=e(n).R(r);return md(Hl(r,u),l)+yd(Gu(u),o)+((e,t)=>t===1?``:`[`+(t===2?`!`:``)+e+`]`)(n,a)+bd(t,i)})(e,t.calendar,t.timeZone,t.epochNanoseconds,r,i,a,o,s,c)}function od(e,t){let[n,r,i,a]=(e=>(e=gu(e),[w_(e),...du(e)]))(t);return o=e.calendar,s=n,c=a,md(Uu(e,i,r),c)+bd(o,s);var o,s,c}function sd(e,t){return n=e.calendar,r=e,i=cu(t),hd(r)+bd(n,i);var n,r,i}function cd(e,t){return fd(e.calendar,gd,e,cu(t))}function ld(e,t){return fd(e.calendar,_d,e,cu(t))}function ud(e,t){let[n,r,i]=lu(t);return a=i,vd(Wu(e,r,n)[0],a);var a}function dd(e,t){let[n,r,i]=lu(t,3);return r>1&&ef(e={...e,...Yu(e,r,n)}),((e,t)=>{let{sign:n}=e,r=n===-1?Zd(e):e,{hours:i,minutes:a}=r,[o,s]=kl(L(r,3),$h,Zc);tf(o);let c=Sd(s,t),l=t>=0||!n||c;return(n<0?`-`:``)+`P`+pd({Y:wd(r.years),M:wd(r.months),W:wd(r.weeks),D:wd(r.days)})+(i||a||o||l?`T`+pd({H:wd(i),M:wd(a),S:wd(o,l)+c}):``)})(e,i)}function fd(e,t,n,r){return r===1?e===`iso8601`?t(n):hd(n):r>1||r===0&&e!==`iso8601`?hd(n)+xd(e,r===2):t(n)}function pd(e){let t=[];for(let n in e){let r=e[n];r&&t.push(r,n)}return t.join(``)}function md(e,t){return hd(e)+`T`+vd(e,t)}function hd(e){return gd(e)+`-`+Kh(e.isoDay)}function gd(e){let{isoYear:t}=e;return(t<0||t>9999?Cd(t)+Kc(6,Math.abs(t)):Kc(4,t))+`-`+Kh(e.isoMonth)}function _d(e){return Kh(e.isoMonth)+`-`+Kh(e.isoDay)}function vd(e,t){let n=[Kh(e.isoHour),Kh(e.isoMinute)];return t!==-1&&n.push(Kh(e.isoSecond)+((e,t,n,r)=>Sd(e*1e6+t*Zh+n,r))(e.isoMillisecond,e.isoMicrosecond,e.isoNanosecond,t)),n.join(`:`)}function yd(e,t=0){if(t===1)return``;let[n,r]=Yc(Math.abs(e),tg),[i,a]=Yc(r,eg),[o,s]=Yc(a,$h);return Cd(e)+Kh(n)+`:`+Kh(i)+(o||s?`:`+Kh(o)+Sd(s):``)}function bd(e,t){return t!==1&&(t>1||t===0&&e!==`iso8601`)?xd(e,t===2):``}function xd(e,t){return`[`+(t?`!`:``)+`u-ca=`+e+`]`}function Sd(e,t){let n=Kc(9,e);return n=t===void 0?n.replace(V_,``):n.slice(0,t),n?`.`+n:``}function Cd(e){return e<0?`-`:`+`}function wd(e,t){return e||t?e.toLocaleString(`fullwide`,{useGrouping:0}):``}function Td(e,t){let{epochNanoseconds:n}=e,r=(t.R?t:t(e.timeZone)).R(n),i=Hl(n,r);return{calendar:e.calendar,...i,offsetNanoseconds:r}}function Ed(e,t,n,r=0,i=0,a,o){if(n!==void 0&&r===1&&(r===1||o))return Rl(t,n);let s=e.I(t);if(n!==void 0&&r!==3){let e=((e,t,n,r)=>{let i=P(t);r&&(n=Gu(n));for(let t of e){let e=Ol(Cl(t,i));if(r&&(e=Gu(e)),e===n)return t}})(s,t,n,a);if(e!==void 0)return e;if(r===0)throw RangeError(Ah)}return o?P(t):Dd(e,t,i,s)}function Dd(e,t,n=0,r=e.I(t)){if(r.length===1)return r[0];if(n===1)throw RangeError(jh);if(r.length)return r[+(n===3)];let i=P(t),a=((e,t)=>{let n=e.R(Sl(t,-R));return(e=>{if(e>R)throw RangeError(kh);return e})(e.R(Sl(t,R))-n)})(e,i)*(n===2?-1:1);return(r=e.I(Hl(i,a)))[n===2?0:r.length-1]}function Od(e,t){let n=e.I(t);if(n.length)return n[0];let r=Sl(P(t),-R);return e.O(r,1)}function kd(e,t,n){return Su(Nl(xl(t.epochNanoseconds,(e=>{if(af(e))throw RangeError(Ih);return L(e,5)})(e?Zd(n):n))))}function Ad(e,t,n,r,i,a=Object.create(null)){let o=t(r.timeZone),s=e(r.calendar);return{...r,...Fd(o,s,r,n?Zd(i):i,a)}}function jd(e,t,n,r,i=Object.create(null)){let{calendar:a}=n;return wu(Id(e(a),n,t?Zd(r):r,i),a)}function Md(e,t,n,r,i){let{calendar:a}=n;return Tu(Ld(e(a),n,t?Zd(r):r,i),a)}function Nd(e,t,n,r,i){let a=n.calendar,o=e(a),s=jl(Rd(o,n));return t&&(r=Xd(r)),r.sign<0&&(s=o.P(s,{...V,months:1}),s=Bd(s,-1)),Eu(Rd(o,o.P(s,r,i)),a)}function Pd(e,t,n){return Ou(zd(t,e?Zd(n):n)[0])}function Fd(e,t,n,r,i){let a=L(r,5),o=n.epochNanoseconds;if(af(r)){let s=H_(n,e);o=xl(Dd(e,{...Ld(t,s,{...r,...Pg},i),...Bc(Ig,s)}),a)}else o=xl(o,a),F(i);return{epochNanoseconds:Nl(o)}}function Id(e,t,n,r){let[i,a]=zd(t,n);return Ml({...Ld(e,t,{...n,...Pg,days:n.days+a},r),...i})}function Ld(e,t,n,r){if(n.years||n.months||n.weeks)return e.P(t,n,r);F(r);let i=n.days+L(n,5)[0];return i?jl(Bd(t,i)):t}function Rd(e,t,n=1){return Bd(t,n-e.day(t))}function zd(e,t){let[n,r]=L(t,5),[i,a]=Fl(Pl(e)+r);return[i,n+a]}function Bd(e,t){return t?{...e,...Ul(Ll(e)+t*Yh)}:e}function Vd(e,t,n){let r=e(n.calendar);return Gd(n)?[n,r,t(n.timeZone)]:[{...n,...Hg},r]}function Hd(e){return e?ju:P}function Ud(e){return e?N(Fd,e):Id}function Wd(e){return e?N(cp,e):lp}function Gd(e){return e&&e.epochNanoseconds}function Kd(e,t){return e<=6-!!Gd(t)}function qd(e,t,n,r,i,a,o){let s=e(gu(o).relativeTo),c=Math.max(of(i),of(a));if(Kd(c,s))return I(ef(((e,t,n,r)=>{let i=xl(L(e),L(t),r?-1:1);if(!Number.isFinite(i[0]))throw RangeError(Mh);return{...V,...nf(i,n)}})(i,a,c,r)));if(!s)throw RangeError(Fh);r&&(a=Zd(a));let[l,u,d]=Vd(t,n,s),f=Ud(d);return I(Wd(d)(u,l,f(u,f(u,l,i),a),c))}function Jd(e,t,n,r,i){let a=of(r),[o,s,c,l,u]=((e,t,n)=>{e=_u(e,r_);let r=y_(e),i=n(e[s_]),a=pu(e),o=D_(e,7),s=v_(e);if(r===void 0&&s===void 0)throw RangeError(Lh);if(s??=0,r??=Math.max(s,t),xu(r,s),a=mu(a,s,1),a>1&&s>5&&r!==s)throw RangeError(`For calendar units with roundingIncrement > 1, use largestUnit = smallestUnit`);return[r,s,a,o,i]})(i,a,e);if(!u&&Math.max(a,o)<=6)return I(ef(((e,t,n,r,i)=>{let a=Zu(L(e),n,r,i);return{...V,...nf(a,t)}})(r,o,s,c,l)));if(!Gd(u)&&!r.sign)return r;if(!u)throw RangeError(Fh);let[d,f,p]=Vd(t,n,u),m=Hd(p),h=Ud(p),ee=Wd(p),g=h(f,d,r);Gd(u)||(Ml(d),Ml(g));let te=ee(f,d,g,o),_=r.sign,v=$d(te);if(_&&v&&_!==v)throw RangeError(Sh);return te=Xu(te,m(g),o,s,c,l,f,d,m,h),I(te)}function Yd(e){return e.sign===-1?Xd(e):e}function Xd(e){return I(Zd(e))}function Zd(e){let t={};for(let n of B)t[n]=-1*e[n]||0;return t}function Qd(e){return!e.sign}function $d(e,t=B){let n=0;for(let r of t){let t=Math.sign(e[r]);if(t){if(n&&n!==t)throw RangeError(Ph);n=t}}return n}function ef(e){for(let t of Mg)Ac(t,e[t],-U_,U_,1);return tf(Ol(L(e),$h)),e}function tf(e){if(!Number.isSafeInteger(e))throw RangeError(Nh)}function L(e,t=6){return tl(e,t,B)}function nf(e,t=6){let[n,r]=e,i=nl(r,t,B);if(i[B[t]]+=n*(R/ng[t]),!Number.isFinite(i[B[t]]))throw RangeError(Mh);return i}function rf(e,t=5){return nl(e,t,B)}function af(e){return!!$d(e,jg)}function of(e){let t=9;for(;t>0&&!e[B[t]];t--);return t}function sf(e,t){return[e,t]}function cf(e){let t=Math.floor(e/R_)*R_;return[t,t+R_]}function lf(e){let t=Ef(e=ml(e));if(!t)throw RangeError(zh(e));let n;if(t.j)n=0;else{if(!t.offset)throw RangeError(zh(e));n=ff(t.offset)}return t.timeZone&&kf(t.timeZone,1),Su(Rl(eu(t),n))}function uf(e){let t=Ef(z(e));if(!t)throw RangeError(zh(e));if(t.timeZone)return Sf(t,t.offset?ff(t.offset):void 0);if(t.j)throw RangeError(zh(e));return wf(t)}function df(e,t){let n=Ef(z(e));if(!n||!n.timeZone)throw RangeError(zh(e));let{offset:r}=n,i=r?ff(r):void 0,[,a,o]=au(t);return Sf(n,i,a,o)}function ff(e){let t=kf(e);if(t===void 0)throw RangeError(zh(e));return t}function pf(e){let t=Ef(z(e));if(!t||t.j)throw RangeError(zh(e));return wu(Cf(t))}function mf(e,t,n){let r=Ef(z(e));if(!r||r.j)throw RangeError(zh(e));return t?r.calendar===`iso8601`&&(r=r.isoYear===-271821&&r.isoMonth===4?{...r,isoDay:20,...Hg}:{...r,isoDay:1,...Hg}):n&&r.calendar===`iso8601`&&(r={...r,isoYear:$g}),Tu(r.C?Cf(r):wf(r))}function hf(e,t){let n=Df(z(t));if(n)return gf(n),Eu(Al(tu(n)));let r=mf(t,1);return Eu(Rd(e(r.calendar),r))}function gf(e){if(e.calendar!==`iso8601`)throw RangeError(Bh(e.calendar))}function _f(e,t){let n=Of(z(t));if(n)return gf(n),Du(tu(n));let r=mf(t,0,1),{calendar:i}=r,a=e(i),[o,s,c]=a.v(r),[l,u]=a.q(o,s),[d,f]=a.G(l,u,c);return Du(jl(a.V(d,f,c)),i)}function vf(e){let t,n=(e=>{let t=nv.exec(e);return t?(Mf(t[10]),jf(t)):void 0})(z(e));if(!n){if(n=Ef(e),!n||!n.C)throw RangeError(zh(e));if(n.j)throw RangeError(Bh(`Z`));gf(n)}if((t=Df(e))&&nu(t)||(t=Of(e))&&nu(t))throw RangeError(zh(e));return Ou(iu(n,1))}function yf(e){let t=(e=>{let t=av.exec(e);return t?(e=>{function t(e,t,a){let o=0,s=0;if(a&&([o,i]=Yc(i,ng[a])),e!==void 0){if(r)throw RangeError(Bh(e));s=(e=>{let t=parseInt(e);if(!Number.isFinite(t))throw RangeError(Bh(e));return t})(e),n=1,t&&(i=Nf(t)*(ng[a]/$h),r=1)}return o+s}let n=0,r=0,i=0,a={...Ic(B,[t(e[2]),t(e[3]),t(e[4]),t(e[5]),t(e[6],e[7],5),t(e[8],e[9],4),t(e[10],e[11],3)]),...nl(i,2,B)};if(!n)throw RangeError(ch(B));return Ff(e[1])<0&&(a=Zd(a)),a})(t):void 0})(z(e));if(!t)throw RangeError(zh(e));return I(ef(t))}function bf(e){let t=Ef(e)||Df(e)||Of(e);return t?t.calendar:e}function xf(e){let t=Ef(e);return t&&(t.timeZone||t.j&&L_||t.offset)||e}function Sf(e,t,n=0,r=0){let i=Rf(e.timeZone),a=H(i),o;return eu(e),o=e.C?Ed(a,e,t,n,r,!a.$,e.j):Od(a,e),Cu(o,i,Wp(e.calendar))}function Cf(e){return Tf(Ml(eu(e)))}function wf(e){return Tf(jl(tu(e)))}function Tf(e){return{...e,calendar:Wp(e.calendar)}}function Ef(e){let t=tv.exec(e);return t?(e=>{let t=e[10],n=(t||``).toUpperCase()===`Z`;return{isoYear:Af(e),isoMonth:parseInt(e[4]),isoDay:parseInt(e[5]),...jf(e.slice(5)),...Mf(e[16]),C:!!e[6],j:n,offset:n?void 0:t}})(t):void 0}function Df(e){let t=$_.exec(e);return t?(e=>({isoYear:Af(e),isoMonth:parseInt(e[4]),isoDay:1,...Mf(e[5])}))(t):void 0}function Of(e){let t=ev.exec(e);return t?(e=>({isoYear:$g,isoMonth:parseInt(e[1]),isoDay:parseInt(e[2]),...Mf(e[3])}))(t):void 0}function kf(e,t){let n=rv.exec(e);return n?((e,t)=>{let n=e[4]||e[5];if(t&&n)throw RangeError(Bh(n));return(e=>{if(Math.abs(e)>=R)throw RangeError(Oh);return e})((If(e[2])*tg+If(e[3])*eg+If(e[4])*$h+Nf(e[5]||``))*Ff(e[1]))})(n,t):void 0}function Af(e){let t=Ff(e[1]),n=parseInt(e[2]||e[3]);if(t<0&&!n)throw RangeError(Bh(-0));return t*n}function jf(e){let t=If(e[3]);return{...Fl(Nf(e[4]||``))[0],isoHour:If(e[1]),isoMinute:If(e[2]),isoSecond:t===60?59:t}}function Mf(e){let t,n,r=[];if(e.replace(iv,((e,i,a)=>{let o=!!i,[s,c]=a.split(`=`).reverse();if(c){if(c===`u-ca`)r.push(s),t||=o;else if(o||/[A-Z]/.test(c))throw RangeError(Bh(e))}else{if(n)throw RangeError(Bh(e));n=s}return``})),r.length>1&&t)throw RangeError(Bh(e));return{timeZone:n,calendar:r[0]||`iso8601`}}function Nf(e){return parseInt(e.padEnd(9,`0`))}function Pf(e){return RegExp(`^${e}$`,`i`)}function Ff(e){return e&&e!==`+`?-1:1}function If(e){return e===void 0?0:parseInt(e)}function Lf(e){return Rf(z(e))}function Rf(e){let t=Bf(e);return typeof t==`number`?yd(t):t?(e=>{if(cv.test(e))throw RangeError(Th(e));if(sv.test(e))throw RangeError(Dh);return e.toLowerCase().split(`/`).map(((e,t)=>(e.length<=3||/\d/.test(e))&&!/etc|yap/.test(e)?e.toUpperCase():e.replace(/baja|dumont|[a-z]+/g,((e,n)=>e.length<=2&&!t||e===`in`||e===`chat`?e.toUpperCase():e.length>2||!n?Wc(e).replace(/island|noronha|murdo|rivadavia|urville/,Wc):e)))).join(`/`)})(e):L_}function zf(e){let t=Bf(e);return typeof t==`number`?t:t?t.resolvedOptions().timeZone:L_}function Bf(e){let t=kf(e=e.toUpperCase(),1);return t===void 0?e===L_?void 0:ov(e):t}function Vf(e,t){return wl(e.epochNanoseconds,t.epochNanoseconds)}function Hf(e,t){return wl(e.epochNanoseconds,t.epochNanoseconds)}function Uf(e,t,n,r,i,a){let o=e(gu(a).relativeTo),s=Math.max(of(r),of(i));if(Hc(B,r,i))return 0;if(Kd(s,o))return wl(L(r),L(i));if(!o)throw RangeError(Fh);let[c,l,u]=Vd(t,n,o),d=Hd(u),f=Ud(u);return wl(d(f(l,c,r)),d(f(l,c,i)))}function Wf(e,t){return Gf(e,t)||Kf(e,t)}function Gf(e,t){return qc(Ll(e),Ll(t))}function Kf(e,t){return qc(Pl(e),Pl(t))}function qf(e,t){return!Vf(e,t)}function Jf(e,t){return!Hf(e,t)&&!!ep(e.timeZone,t.timeZone)&&e.calendar===t.calendar}function Yf(e,t){return!Wf(e,t)&&e.calendar===t.calendar}function Xf(e,t){return!Gf(e,t)&&e.calendar===t.calendar}function Zf(e,t){return!Gf(e,t)&&e.calendar===t.calendar}function Qf(e,t){return!Gf(e,t)&&e.calendar===t.calendar}function $f(e,t){return!Kf(e,t)}function ep(e,t){if(e===t)return 1;try{return zf(e)===zf(t)}catch{}}function tp(e,t,n,r){let i=ou(e,r,3,5),a=fp(t.epochNanoseconds,n.epochNanoseconds,...i);return I(e?Zd(a):a)}function np(e,t,n,r,i,a){let o=_p(r.calendar,i.calendar),[s,c,l,u]=ou(n,a,5),d=r.epochNanoseconds,f=i.epochNanoseconds,p=wl(f,d),m;if(p)if(s<6)m=fp(d,f,s,c,l,u);else{let n=t(((e,t)=>{if(!ep(e,t))throw RangeError(Eh);return e})(r.timeZone,i.timeZone)),d=e(o);m=up(d,n,r,i,p,s,a),m=Xu(m,f,s,c,l,u,d,r,ju,N(Fd,n))}else m=V;return I(n?Zd(m):m)}function rp(e,t,n,r,i){let a=_p(n.calendar,r.calendar),[o,s,c,l]=ou(t,i,6),u=P(n),d=P(r),f=wl(d,u),p;if(f)if(o<=6)p=fp(u,d,o,s,c,l);else{let t=e(a);p=dp(t,n,r,f,o,i),p=Xu(p,d,o,s,c,l,t,n,P,Id)}else p=V;return I(t?Zd(p):p)}function ip(e,t,n,r,i){let a=_p(n.calendar,r.calendar);return op(t,(()=>e(a)),n,r,...ou(t,i,6,9,6))}function ap(e,t,n,r,i){let a=_p(n.calendar,r.calendar),o=ou(t,i,9,9,8),s=e(a),c=Rd(s,n),l=Rd(s,r);return c.isoYear===l.isoYear&&c.isoMonth===l.isoMonth&&c.isoDay===l.isoDay?I(V):op(t,(()=>s),jl(c),jl(l),...o,8)}function op(e,t,n,r,i,a,o,s,c=6){let l=P(n),u=P(r);if(l===void 0||u===void 0)throw RangeError(Mh);let d;if(wl(u,l))if(i===6)d=fp(l,u,i,a,o,s);else{let e=t();d=e.N(n,r,i),a===c&&o===1||(d=Xu(d,u,i,a,o,s,e,n,P,Ld))}else d=V;return I(e?Zd(d):d)}function sp(e,t,n,r){let[i,a,o,s]=ou(e,r,5,5),c=$u(gp(t,n),Ku(a,o),s),l={...V,...rf(c,i)};return I(e?Zd(l):l)}function cp(e,t,n,r,i,a){let o=wl(r.epochNanoseconds,n.epochNanoseconds);return o?i<6?pp(n.epochNanoseconds,r.epochNanoseconds,i):up(t,e,n,r,o,i,a):V}function lp(e,t,n,r,i){let a=P(t),o=P(n),s=wl(o,a);return s?r<=6?pp(a,o,r):dp(e,t,n,s,r,i):V}function up(e,t,n,r,i,a,o){let[s,c,l]=((e,t,n,r)=>{function i(){return d={...Bd(s,l++*-r),...o},f=Dd(e,d),wl(c,f)===-r}let a=H_(t,e),o=Bc(Ig,a),s=H_(n,e),c=n.epochNanoseconds,l=0,u=gp(a,s),d,f;if(Math.sign(u)===-r&&l++,i()&&(r===-1||i()))throw RangeError(Sh);let p=Ol(Cl(f,c));return[a,d,p]})(t,n,r,i);var u,d;return{...a===6?(u=s,d=c,{...V,days:mp(u,d)}):e.N(s,c,a,o),...rf(l)}}function dp(e,t,n,r,i,a){let[o,s,c]=((e,t,n)=>{let r=t,i=gp(e,t);return Math.sign(i)===-n&&(r=Bd(t,-n),i+=R*n),[e,r,i]})(t,n,r);return{...e.N(o,s,i,a),...rf(c)}}function fp(e,t,n,r,i,a){return{...V,...nf(Zu(Cl(e,t),r,i,a),n)}}function pp(e,t,n){return{...V,...nf(Cl(e,t),n)}}function mp(e,t){return hp(Ll(e),Ll(t))}function hp(e,t){return Math.trunc((t-e)/Yh)}function gp(e,t){return Pl(t)-Pl(e)}function _p(e,t){if(e!==t)throw RangeError(wh);return e}function vp(e){return this.m(e)[0]}function yp(e){return this.m(e)[1]}function bp(e){let[t]=this.v(e);return hp(this.p(t),Ll(e))+1}function xp(e){let t=lv.exec(e);if(!t)throw RangeError(vh(e));return[parseInt(t[1]),!!t[2]]}function Sp(e,t){return`M`+Kh(e)+(t?`L`:``)}function Cp(e,t,n){return e+(t||n&&e>=n?1:0)}function wp(e,t){return e-(t&&e>=t?1:0)}function Tp(e,t){return(t+e)*(Math.sign(t)||1)||0}function Ep(e){return wg[Op(e)]}function Dp(e){return Eg[Op(e)]}function Op(e){return Gp(e.id||`iso8601`)}function kp(e){function t(e){return((e,t)=>({...Mp(e,t),o:e.month,day:parseInt(e.day)}))(Wl(n,e),r)}let n=dv(e),r=Gp(e);return{id:e,h:Ap(t),l:jp(t)}}function Ap(e){return jc((t=>e(Ll(t))),WeakMap)}function jp(e){let t=e(0).year-Qg;return jc((n=>{let r,i=Bl(n-t),a=0,o=[],s=[];do i+=400*Yh;while((r=e(i)).year<=n);do if(i+=(1-r.day)*Yh,r.year===n&&(o.push(i),s.push(r.o)),i-=Yh,++a>100||i<-Gg)throw RangeError(Sh);while((r=e(i)).year>=n);return{i:o.reverse(),u:Wh(s.reverse())}}))}function Mp(e,t){let n,r,i=Np(e);if(e.era){let a=wg[t],o=Tg[t]||{};a!==void 0&&(n=t===`islamic`?`ah`:e.era.normalize(`NFD`).toLowerCase().replace(/[^a-z0-9]/g,``),n===`bc`||n===`b`?n=`bce`:n===`ad`||n===`a`?n=`ce`:n===`beforeroc`&&(n=`broc`),n=o[n]||n,r=i,i=Tp(r,a[n]||0))}return{era:n,eraYear:r,year:i}}function Np(e){return parseInt(e.relatedYear||e.year)}function Pp(e){let{year:t,o:n,day:r}=this.h(e),{u:i}=this.l(t);return[t,i[n]+1,r]}function Fp(e,t=1,n=1){return this.l(e).i[t-1]+(n-1)*Yh}function Ip(e,t){let n=Lp.call(this,e);return[wp(t,n),n===t]}function Lp(e){let t=Hp(this,e),n=Hp(this,e-1),r=t.length;if(r>n.length){let e=Dp(this);if(e<0)return-e;for(let e=0;e<r;e++)if(t[e]!==n[e])return e+1}}function Rp(e){return hp(Fp.call(this,e),Fp.call(this,e+1))}function zp(e,t){let{i:n}=this.l(e),r=t+1,i=n;return r>n.length&&(r=1,i=this.l(e+1).i),hp(n[t-1],i[r-1])}function Bp(e){return this.l(e).i.length}function Vp(e){let t=this.h(e);return[t.era,t.eraYear]}function Hp(e,t){return Object.keys(e.l(t).u)}function Up(e){return Wp(z(e))}function Wp(e){if((e=e.toLowerCase())!==`iso8601`&&e!==Sg){let t=dv(e).resolvedOptions().calendar;if(Gp(e)!==Gp(t))throw RangeError(Ch(e));return t}return e}function Gp(e){return e===`islamicc`&&(e=`islamic`),e.split(`-`)[0]}function Kp(e,t){return n=>n===`iso8601`?e:n===Sg||n===Cg?Object.assign(Object.create(e),{id:n}):Object.assign(Object.create(t),uv(n))}function qp(e,t,n,r){let i=tm(n,r,_g,[],cg);if(i.timeZone!==void 0){let r=n.F(i),a=rm(i),o=e(i.timeZone);return{epochNanoseconds:Ed(t(o),{...r,...a},i.offset===void 0?void 0:ff(i.offset)),timeZone:o}}return{...n.F(i),...Hg}}function Jp(e,t,n,r,i,a){let o=tm(n,i,_g,og,cg),s=e(o.timeZone),[c,l,u]=au(a),d=n.F(o,vu(c)),f=rm(o,c);return Cu(Ed(t(s),{...d,...f},o.offset===void 0?void 0:ff(o.offset),l,u),s,r)}function Yp(e,t,n){let r=tm(e,t,_g,[],rg),i=F(n);return wu(Ml({...e.F(r,vu(i)),...rm(r,i)}))}function Xp(e,t,n,r=[]){let i=tm(e,t,_g,r);return e.F(i,n)}function Zp(e,t,n,r){let i=tm(e,t,hg,r);return e.K(i,n)}function Qp(e,t,n,r){let i=tm(e,n,_g,mg);return t&&i.month!==void 0&&i.monthCode===void 0&&i.year===void 0&&(i.year=$g),e._(i,r)}function $p(e,t){return Ou(rm(nm(e,ig,[],1),F(t)))}function em(e){let t=nm(e,kg);return I(ef({...V,...t}))}function tm(e,t,n,r=[],i=[]){return nm(t,[...e.fields(n),...i].sort(),r)}function nm(e,t,n,r=!n){let i={},a,o=0;for(let r of t){if(r===a)throw RangeError(sh(r));if(r===`constructor`||r===`__proto__`)throw RangeError(oh(r));let t=e[r];if(t!==void 0)o=1,vv[r]&&(t=vv[r](t,r)),i[r]=t;else if(n){if(n.includes(r))throw TypeError(ah(r));i[r]=bg[r]}a=r}if(r&&!o)throw TypeError(ch(t));return i}function rm(e,t){return iu(yv({...bg,...e}),t)}function im(e,t,n,r,i){let{calendar:a,timeZone:o}=n,s=e(a),c=t(o),l=[...s.fields(_g),...sg].sort(),u=(e=>{let t=H_(e,H),n=yd(t.offsetNanoseconds),r=_v(e.calendar),[i,a,o]=r.v(t),[s,c]=r.q(i,a),l=Sp(s,c);return{...bv(t),year:i,monthCode:l,day:o,offset:n}})(n),d=nm(r,l),f=s.k(u,d),p={...u,...d},[m,h,ee]=au(i,2);return Cu(Ed(c,{...s.F(f,vu(m)),...iu(yv(p),m)},ff(p.offset),h,ee),o,a)}function am(e,t,n,r){let i=e(t.calendar),a=[...i.fields(_g),...rg].sort(),o={...gm(s=t),hour:s.isoHour,minute:s.isoMinute,second:s.isoSecond,millisecond:s.isoMillisecond,microsecond:s.isoMicrosecond,nanosecond:s.isoNanosecond};var s;let c=nm(n,a),l=F(r),u=i.k(o,c),d={...o,...c};return wu(Ml({...i.F(u,vu(l)),...iu(yv(d),l)}))}function om(e,t,n,r){let i=e(t.calendar),a=i.fields(_g).sort(),o=gm(t),s=nm(n,a),c=i.k(o,s);return i.F(c,r)}function sm(e,t,n,r){let i=e(t.calendar),a=i.fields(hg).sort(),o=(e=>{let t=_v(e.calendar),[n,r]=t.v(e),[i,a]=t.q(n,r);return{year:n,monthCode:Sp(i,a)}})(t),s=nm(n,a),c=i.k(o,s);return i.K(c,r)}function cm(e,t,n,r){let i=e(t.calendar),a=i.fields(_g).sort(),o=(e=>{let t=_v(e.calendar),[n,r,i]=t.v(e),[a,o]=t.q(n,r);return{monthCode:Sp(a,o),day:i}})(t),s=nm(n,a),c=i.k(o,s);return i._(c,r)}function lm(e,t,n){return Ou(((e,t,n)=>rm({...Bc(ig,e),...nm(t,ig)},F(n)))(e,t,n))}function um(e,t){return I((n=e,r=t,ef({...n,...nm(r,kg)})));var n,r}function dm(e,t,n,r,i){t=Bc(n=e.fields(n),t),r=nm(r,i=e.fields(i),[]);let a=e.k(t,r);return a=nm(a,[...n,...i].sort(),[]),e.F(a)}function fm(e,t){let n=Ep(e),r=Tg[e.id||``]||{},{era:i,eraYear:a,year:o}=t;if(i!==void 0||a!==void 0){if(i===void 0||a===void 0)throw TypeError(mh);if(!n)throw RangeError(ph);let e=n[r[i]||i];if(e===void 0)throw RangeError(gh(i));let t=Tp(a,e);if(o!==void 0&&o!==t)throw RangeError(hh);o=t}else if(o===void 0)throw TypeError(_h(n));return o}function pm(e,t,n,r){let{month:i,monthCode:a}=t;if(a!==void 0){let t=((e,t,n,r)=>{let i=e.L(n),[a,o]=xp(t),s=Cp(a,o,i);if(o){let t=Dp(e);if(t===void 0)throw RangeError(xh);if(t>0){if(s>t)throw RangeError(xh);if(i===void 0){if(r===1)throw RangeError(xh);s--}}else if(s!==-t||i===void 0&&r===1)throw RangeError(xh)}return s})(e,a,n,r);if(i!==void 0&&i!==t)throw RangeError(yh);i=t,r=1}else if(i===void 0)throw TypeError(bh);return Ac(`month`,i,1,e.B(n),r)}function mm(e,t,n,r,i){return kc(t,`day`,1,e.U(r,n),i)}function hm(e,t,n,r){let i=0,a=[];for(let e of n)t[e]===void 0?a.push(e):i=1;if(Object.assign(e,t),i)for(let t of r||a)delete e[t]}function gm(e){let t=_v(e.calendar),[n,r,i]=t.v(e),[a,o]=t.q(n,r);return{year:n,monthCode:Sp(a,o),day:i}}function _m(e){return Su(Nl(El(hl(e))))}function vm(e,t,n,r,i=xg){return Cu(Nl(El(hl(n))),t(r),e(i))}function ym(e,t,n,r,i=0,a=0,o=0,s=0,c=0,l=0,u=xg){return wu(Ml(eu(Lc(_l,Ic(Rg,[t,n,r,i,a,o,s,c,l])))),e(u))}function bm(e,t,n,r,i=xg){return Tu(jl(tu(Lc(_l,{isoYear:t,isoMonth:n,isoDay:r}))),e(i))}function xm(e,t,n,r=xg,i=1){let a=_l(t),o=_l(n),s=e(r);return Eu(Al(tu({isoYear:a,isoMonth:o,isoDay:_l(i)})),s)}function Sm(e,t,n,r=xg,i=$g){let a=_l(t),o=_l(n),s=e(r);return Du(jl(tu({isoYear:_l(i),isoMonth:a,isoDay:o})),s)}function Cm(e=0,t=0,n=0,r=0,i=0,a=0){return Ou(iu(Lc(_l,Ic(Ig,[e,t,n,r,i,a])),1))}function wm(e=0,t=0,n=0,r=0,i=0,a=0,o=0,s=0,c=0,l=0){return I(ef(Lc(vl,Ic(B,[e,t,n,r,i,a,o,s,c,l]))))}function Tm(e,t,n=xg){return Cu(e.epochNanoseconds,t,n)}function Em(e){return Su(e.epochNanoseconds)}function Dm(e,t){return wu(H_(t,e))}function Om(e,t){return Tu(H_(t,e))}function km(e,t){return Ou(H_(t,e))}function Am(e,t,n,r){return Cu(Nl(((e,t,n,r)=>{let i=(e=>S_(gu(e)))(r);return Dd(e(t),n,i)})(e,n,t,r)),n,t.calendar)}function jm(e,t,n,r,i){let a=e(i.timeZone),o=i.plainTime,s=o===void 0?void 0:t(o),c=n(a),l;return l=s?Dd(c,{...r,...s}):Od(c,{...r,...Hg}),Cu(l,a,r.calendar)}function Mm(e,t=Hg){return wu(Ml({...e,...t}))}function Nm(e,t,n){return((e,t)=>{let n=tm(e,t,gg);return e.K(n,void 0)})(e(t.calendar),n)}function Pm(e,t,n){return((e,t)=>{let n=tm(e,t,yg);return e._(n)})(e(t.calendar),n)}function Fm(e,t,n,r){return((e,t,n)=>dm(e,t,gg,ll(n),mg))(e(t.calendar),n,r)}function Im(e,t,n,r){return((e,t,n)=>dm(e,t,yg,ll(n),dg))(e(t.calendar),n,r)}function Lm(e){return Su(Nl(Dl(vl(e),Qh)))}function Rm(e){return Su(Nl(El(hl(e))))}function zm(e,t,n){let r=new Set(n);return(i,a)=>{let o=n&&Vc(i,n);if(!Vc(i=((e,t)=>{let n={};for(let r in t)e.has(r)||(n[r]=t[r]);return n})(r,i),e)){if(a&&o)throw TypeError(`Invalid formatting options`);i={...t,...i}}return n&&(i.timeZone=L_,[`full`,`long`].includes(i.J)&&(i.J=`medium`)),i}}function Bm(e,t=Vm,n=0){let[r,,,i]=e;return(a,o=Xv,...s)=>{let c=t(i&&i(...s),a,o,r,n);return[c,...Hm(e,c.resolvedOptions(),s)]}}function Vm(e,t,n,r,i){if(n=r(n,i),e){if(n.timeZone!==void 0)throw TypeError(Uh);n.timeZone=e}return new Xg(t,n)}function Hm(e,t,n){let[,r,i]=e;return n.map((e=>(e.calendar&&((e,t,n)=>{if((n||e!==`iso8601`)&&e!==t)throw RangeError(wh)})(e.calendar,t.calendar,i),r(e,t))))}function Um(e,t,n){let r=t.timeZone,i=e(r),a={...H_(t,i),...n||Hg},o;return o=n?Ed(i,a,a.offsetNanoseconds,2):Od(i,a),Cu(o,r,t.calendar)}function Wm(e,t=Hg){return wu(Ml({...e,...t}))}function Gm(e,t){return{...e,calendar:t}}function Km(e,t){return{...e,timeZone:t}}function qm(e){let t=Jm();return Hl(t,e.R(t))}function Jm(){return Dl(Date.now(),Qh)}function Ym(){return ay||=new Xg().resolvedOptions().timeZone}var Xm=(e,t)=>`Non-integer ${e}: ${t}`,Zm=(e,t)=>`Non-positive ${e}: ${t}`,Qm=(e,t)=>`Non-finite ${e}: ${t}`,$m=e=>`Cannot convert bigint to ${e}`,eh=e=>`Invalid bigint: ${e}`,th=`Cannot convert Symbol to string`,nh=`Invalid object`,rh=(e,t,n,r,i)=>i?rh(e,i[t],i[n],i[r]):ih(e,t)+`; must be between ${n}-${r}`,ih=(e,t)=>`Invalid ${e}: ${t}`,ah=e=>`Missing ${e}`,oh=e=>`Invalid field ${e}`,sh=e=>`Duplicate field ${e}`,ch=e=>`No valid fields: `+e.join(),lh=`Invalid bag`,uh=(e,t,n)=>ih(e,t)+`; must be `+Object.keys(n).join(),dh=`Cannot use valueOf`,fh=`Invalid calling context`,ph=`Forbidden era/eraYear`,mh=`Mismatching era/eraYear`,hh=`Mismatching year/eraYear`,gh=e=>`Invalid era: ${e}`,_h=e=>`Missing year`+(e?`/era/eraYear`:``),vh=e=>`Invalid monthCode: ${e}`,yh=`Mismatching month/monthCode`,bh=`Missing month/monthCode`,xh=`Invalid leap month`,Sh=`Invalid protocol results`,Ch=e=>ih(`Calendar`,e),wh=`Mismatching Calendars`,Th=e=>ih(`TimeZone`,e),Eh=`Mismatching TimeZones`,Dh=`Forbidden ICU TimeZone`,Oh=`Out-of-bounds offset`,kh=`Out-of-bounds TimeZone gap`,Ah=`Invalid TimeZone offset`,jh=`Ambiguous offset`,Mh=`Out-of-bounds date`,Nh=`Out-of-bounds duration`,Ph=`Cannot mix duration signs`,Fh=`Missing relativeTo`,Ih=`Cannot use large units`,Lh=`Required smallestUnit or largestUnit`,Rh=`smallestUnit > largestUnit`,zh=e=>`Cannot parse: ${e}`,Bh=e=>`Invalid substring: ${e}`,Vh=e=>`Cannot format ${e}`,Hh=`Mismatching types for formatting`,Uh=`Cannot specify TimeZone`,Wh=N(Rc,((e,t)=>t)),Gh=N(Rc,((e,t,n)=>n)),Kh=N(Kc,2),qh={nanosecond:0,microsecond:1,millisecond:2,second:3,minute:4,hour:5,day:6,week:7,month:8,year:9},Jh=Object.keys(qh),Yh=864e5,Xh=1e3,Zh=1e3,Qh=1e6,$h=1e9,eg=6e10,tg=36e11,R=864e11,ng=[1,Zh,Qh,$h,eg,tg,R],rg=Jh.slice(0,6),ig=Gc(rg),ag=[`offset`],og=[`timeZone`],sg=rg.concat(ag),cg=sg.concat(og),lg=[`era`,`eraYear`],ug=lg.concat([`year`]),dg=[`year`],fg=[`monthCode`],pg=[`month`].concat(fg),mg=[`day`],hg=pg.concat(dg),gg=fg.concat(dg),_g=mg.concat(hg),vg=mg.concat(pg),yg=mg.concat(fg),bg=Gh(rg,0),xg=`iso8601`,Sg=`gregory`,Cg=`japanese`,wg={[Sg]:{"gregory-inverse":-1,gregory:0},[Cg]:{"japanese-inverse":-1,japanese:0,meiji:1867,taisho:1911,showa:1925,heisei:1988,reiwa:2018},ethiopic:{ethioaa:0,ethiopic:5500},coptic:{"coptic-inverse":-1,coptic:0},roc:{"roc-inverse":-1,roc:0},buddhist:{be:0},islamic:{ah:0},indian:{saka:0},persian:{ap:0}},Tg={[Sg]:{bce:`gregory-inverse`,ce:`gregory`},[Cg]:{bce:`japanese-inverse`,ce:`japanese`},ethiopic:{era0:`ethioaa`,era1:`ethiopic`},coptic:{era0:`coptic-inverse`,era1:`coptic`},roc:{broc:`roc-inverse`,minguo:`roc`}},Eg={chinese:13,dangi:13,hebrew:-6},z=N(ul,`string`),Dg=N(ul,`boolean`),Og=N(ul,`number`),B=Jh.map((e=>e+`s`)),kg=Gc(B),Ag=B.slice(0,6),jg=B.slice(6),Mg=jg.slice(1),Ng=Wh(B),V=Gh(B,0),Pg=Gh(Ag,0),Fg=N(Uc,B),Ig=[`isoNanosecond`,`isoMicrosecond`,`isoMillisecond`,`isoSecond`,`isoMinute`,`isoHour`],Lg=[`isoDay`,`isoMonth`,`isoYear`],Rg=Ig.concat(Lg),zg=Gc(Lg),Bg=Gc(Ig),Vg=Gc(Rg),Hg=Gh(Bg,0),Ug=N(Uc,Rg),Wg=1e8,Gg=Wg*Yh,Kg=[Wg,0],qg=[-1e8,0],Jg=275760,Yg=-271821,Xg=Intl.DateTimeFormat,Zg=`en-GB`,Qg=1970,$g=1972,e_=12,t_=Bl(1868,9,8),n_=jc($l,WeakMap),r_=`smallestUnit`,i_=`unit`,a_=`roundingIncrement`,o_=`fractionalSecondDigits`,s_=`relativeTo`,c_=`direction`,l_={constrain:0,reject:1},u_=Object.keys(l_),d_={compatible:0,reject:1,earlier:2,later:3},f_={reject:0,use:1,prefer:2,ignore:3},p_={auto:0,never:1,critical:2,always:3},m_={auto:0,never:1,critical:2},h_={auto:0,never:1},g_={floor:0,halfFloor:1,ceil:2,halfCeil:3,trunc:4,halfTrunc:5,expand:6,halfExpand:7,halfEven:8},__={previous:-1,next:1},v_=N(yu,r_),y_=N(yu,`largestUnit`),b_=N(yu,i_),x_=N(bu,`overflow`,l_),S_=N(bu,`disambiguation`,d_),C_=N(bu,`offset`,f_),w_=N(bu,`calendarName`,p_),T_=N(bu,`timeZoneName`,m_),E_=N(bu,`offset`,h_),D_=N(bu,`roundingMode`,g_),O_=`PlainYearMonth`,k_=`PlainMonthDay`,A_=`PlainDate`,j_=`PlainDateTime`,M_=`PlainTime`,N_=`ZonedDateTime`,P_=`Instant`,F_=`Duration`,I_=[Math.floor,e=>el(e)?Math.floor(e):Math.round(e),Math.ceil,e=>el(e)?Math.ceil(e):Math.round(e),Math.trunc,e=>el(e)?Math.trunc(e)||0:Math.round(e),e=>e<0?Math.floor(e):Math.ceil(e),e=>Math.sign(e)*Math.round(Math.abs(e))||0,e=>el(e)?(e=Math.trunc(e)||0)+e%2:Math.round(e)],L_=`UTC`,R_=5184e3,z_=zl(1847),B_=zl(new Date().getUTCFullYear()+10),V_=/0+$/,H_=jc(Td,WeakMap),U_=2**32-1,H=jc((e=>{let t=Bf(e);return typeof t==`object`?new G_(t):new W_(t||0)})),W_=class{constructor(e){this.$=e}R(){return this.$}I(e){return(e=>{let t=P({...e,...Hg});if(!t||Math.abs(t[0])>1e8)throw RangeError(Mh)})(e),[Rl(e,this.$)]}O(){}},G_=class{constructor(e){this.nn=(e=>{function t(e){let[t,s]=cf(Jc(e,a,o)),c=r(t),l=r(s);return c===l?c:n(i(t,s),c,l,e)}function n(t,n,r,i){let a,o;for(;(i===void 0||(a=i<t[0]?n:i>=t[1]?r:void 0)===void 0)&&(o=t[1]-t[0]);){let n=t[0]+Math.floor(o/2);e(n)===r?t[1]=n:t[0]=n+1}return a}let r=jc(e),i=jc(sf),a=z_,o=B_;return{tn(e){let n=t(e-86400),r=t(e+86400),i=e-n,a=e-r;if(n===r)return[i];let o=t(i);return o===t(a)?[e-o]:n>r?[i,a]:[]},rn:t,O(e,t){let s=Jc(e,a,o),[c,l]=cf(s),u=R_*t,d=t<0?()=>l>a||(a=s,0):()=>c<o||(o=s,0);for(;d();){let a=r(c),o=r(l);if(a!==o){let r=i(c,l);n(r,a,o);let s=r[0];if((qc(s,e)||1)===t)return s}c+=u,l+=u}}}})((e=>t=>{let n=Wl(e,t*Xh);return zl(Np(n),parseInt(n.month),parseInt(n.day),parseInt(n.hour),parseInt(n.minute),parseInt(n.second))-t})(e))}R(e){return this.nn.rn((e=>Il(e)[0])(e))*$h}I(e){let[t,n]=[zl((r=e).isoYear,r.isoMonth,r.isoDay,r.isoHour,r.isoMinute,r.isoSecond),r.isoMillisecond*Qh+r.isoMicrosecond*Zh+r.isoNanosecond];var r;return this.nn.tn(t).map((e=>Nl(Sl(Dl(e,$h),n))))}O(e,t){let[n,r]=Il(e),i=this.nn.O(n+(t>0||r?1:0),t);if(i!==void 0)return Dl(i,$h)}},K_=`([+-])`,q_=`(?:[.,](\\d{1,9}))?`,J_=`(?:(?:${K_}(\\d{6}))|(\\d{4}))-?(\\d{2})`,Y_=`([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?`,X_=J_+`-?(\\d{2})(?:[T ](\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?(Z|([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?)?)?`,Z_=`\\[(!?)([^\\]]*)\\]`,Q_=`((?:${Z_}){0,9})`,$_=Pf(J_+Q_),ev=Pf(`(?:--)?(\\d{2})-?(\\d{2})`+Q_),tv=Pf(X_+Q_),nv=Pf(`T?(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?(?:([+-])(\\d{2})(?::?(\\d{2})(?::?(\\d{2})(?:[.,](\\d{1,9}))?)?)?)?`+Q_),rv=Pf(Y_),iv=new RegExp(Z_,`g`),av=Pf(`${K_}?P(\\d+Y)?(\\d+M)?(\\d+W)?(\\d+D)?(?:T(?:(\\d+)${q_}H)?(?:(\\d+)${q_}M)?(?:(\\d+)${q_}S)?)?`),ov=jc((e=>new Xg(Zg,{timeZone:e,era:`short`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,second:`numeric`}))),sv=/^(AC|AE|AG|AR|AS|BE|BS|CA|CN|CS|CT|EA|EC|IE|IS|JS|MI|NE|NS|PL|PN|PR|PS|SS|VS)T$/,cv=/[^\w\/:+-]+/,lv=/^M(\d{2})(L?)$/,uv=jc(kp),dv=jc((e=>new Xg(Zg,{calendar:e,timeZone:L_,era:`short`,year:`numeric`,month:`short`,day:`numeric`}))),fv={P(e,t,n){let r=F(n),i,{years:a,months:o,weeks:s,days:c}=t;if(c+=L(t,5)[0],a||o)i=((e,t,n,r,i)=>{let[a,o,s]=e.v(t);if(n){let[t,r]=e.q(a,o);a+=n,o=Cp(t,r,e.L(a)),o=Ac(`month`,o,1,e.B(a),i)}return r&&([a,o]=e.un(a,o,r)),s=Ac(`day`,s,1,e.U(a,o),i),e.p(a,o,s)})(this,e,a,o,r);else{if(!s&&!c)return e;i=Ll(e)}if(i===void 0)throw RangeError(Mh);return i+=(7*s+c)*Yh,jl(Ul(i))},N(e,t,n){if(n<=7){let r=0,i=mp({...e,...Hg},{...t,...Hg});return n===7&&([r,i]=Zc(i,7)),{...V,weeks:r,days:i}}let r=this.v(e),i=this.v(t),[a,o,s]=((e,t,n,r,i,a,o)=>{let s=i-t,c=a-n,l=o-r;if(s||c){let u=Math.sign(s||c),d=e.U(i,a),f=0;if(Math.sign(l)===-u){let r=d;[i,a]=e.un(i,a,-u),s=i-t,c=a-n,d=e.U(i,a),f=u<0?-r:d}if(l=o-Math.min(r,d)+f,s){let[r,o]=e.q(t,n),[l,d]=e.q(i,a);if(c=l-r||Number(d)-Number(o),Math.sign(c)===-u){let n=u<0&&-e.B(i);s=(i-=u)-t,c=a-Cp(r,o,e.L(i))+(n||e.B(i))}}}return[s,c,l]})(this,...r,...i);return n===8&&(o+=this.cn(a,r[0]),a=0),{...V,years:a,months:o,days:s}},F(e,t){let n=F(t),r=fm(this,e),i=pm(this,e,r,n),a=mm(this,e,i,r,n);return Tu(jl(this.V(r,i,a)),this.id||`iso8601`)},K(e,t){let n=F(t),r=fm(this,e),i=pm(this,e,r,n);return Eu(Al(this.V(r,i,1)),this.id||`iso8601`)},_(e,t){let n=F(t),r,i,a,o=e.eraYear!==void 0||e.year!==void 0?fm(this,e):void 0,s=!this.id;if(o===void 0&&s&&(o=$g),o!==void 0){let t=pm(this,e,o,n);r=mm(this,e,t,o,n);let s=this.L(o);i=wp(t,s),a=t===s}else{if(e.monthCode===void 0)throw TypeError(bh);if([i,a]=xp(e.monthCode),this.id&&this.id!==Sg&&this.id!==Cg)if(this.id&&Gp(this.id)===`coptic`&&n===0){let t=a||i!==13?30:6;r=e.day,r=Jc(r,1,t)}else if(this.id&&Gp(this.id)===`chinese`&&n===0){let t=!a||i!==1&&i!==9&&i!==10&&i!==11&&i!==12?30:29;r=e.day,r=Jc(r,1,t)}else r=e.day;else r=mm(this,e,pm(this,e,$g,n),$g,n)}let c=this.G(i,a,r);if(!c)throw RangeError(`Cannot guess year`);let[l,u]=c;return Du(jl(this.V(l,u,r)),this.id||`iso8601`)},fields(e){return Ep(this)&&e.includes(`year`)?[...e,...lg]:e},k(e,t){let n=Object.assign(Object.create(null),e);return hm(n,t,pg),Ep(this)&&(hm(n,t,ug),this.id===Cg&&hm(n,t,vg,lg)),n},inLeapYear(e){let[t]=this.v(e);return this.sn(t)},monthsInYear(e){let[t]=this.v(e);return this.B(t)},daysInMonth(e){let[t,n]=this.v(e);return this.U(t,n)},daysInYear(e){let[t]=this.v(e);return this.fn(t)},dayOfYear:bp,era(e){return this.hn(e)[0]},eraYear(e){return this.hn(e)[1]},monthCode(e){let[t,n]=this.v(e),[r,i]=this.q(t,n);return Sp(r,i)},dayOfWeek:Zl,daysInWeek(){return 7}},pv={v:Gl,hn:Ql,q:Kl},mv=Object.assign({},fv,Object.assign({},{dayOfYear:bp,v:Gl,p:Bl},{weekOfYear:vp,yearOfWeek:yp,m(e){function t(e){return(7-e<r?7:0)-e}function n(e){let n=Yl(f+e),r=e||1;return u=(n+(t(Xc(c+n*r,7))-l)*r)/7}let r=this.id?1:4,i=Zl(e),a=this.dayOfYear(e),o=Xc(i-1,7),s=a-1,c=Xc(o-s,7),l=t(c),u,d=Math.floor((s-l)/7)+1,f=e.isoYear;return d?d>n(0)&&(d=1,f++):(d=n(-1),f--),[d,f,u]}}),{v:Gl,hn:Ql,q:Kl,G(e,t){if(!t)return[$g,e]},sn:Xl,L(){},B:ql,cn:e=>e*e_,U:Jl,fn:Yl,V:(e,t,n)=>({isoYear:e,isoMonth:t,isoDay:n}),p:Bl,un:(e,t,n)=>(e+=Qc(n,e_),(t+=$c(n,e_))<1?(e--,t+=e_):t>e_&&(e++,t-=e_),[e,t]),year(e){return e.isoYear},month(e){return e.isoMonth},day:e=>e.isoDay}),hv={v:Pp,hn:Vp,q:Ip},gv=Object.assign({},fv,{dayOfYear:bp,v:Pp,p:Fp,weekOfYear:vp,yearOfWeek:yp,m(){return[]}},{v:Pp,hn:Vp,q:Ip,G(e,t,n){let r=this.id&&Gp(this.id)===`chinese`?((e,t,n)=>{if(t)switch(e){case 1:return 1651;case 2:return n<30?1947:1765;case 3:return n<30?1966:1955;case 4:return n<30?1963:1944;case 5:return n<30?1971:1952;case 6:return n<30?1960:1941;case 7:return n<30?1968:1938;case 8:return n<30?1957:1718;case 9:return 1832;case 10:return 1870;case 11:return 1814;case 12:return 1890}return 1972})(e,t,n):$g,[i,a,o]=Pp.call(this,{isoYear:r,isoMonth:e_,isoDay:31}),s=Lp.call(this,i),c=a===s;(qc(e,wp(a,s))||qc(Number(t),Number(c))||qc(n,o))===1&&i--;for(let r=0;r<100;r++){let a=i-r,o=Lp.call(this,a),s=Cp(e,t,o);if(t===(s===o)&&n<=zp.call(this,a,s))return[a,s]}},sn(e){let t=Rp.call(this,e);return t>Rp.call(this,e-1)&&t>Rp.call(this,e+1)},L:Lp,B:Bp,cn(e,t){let n=t+e,r=Math.sign(e),i=r<0?-1:0,a=0;for(let e=t;e!==n;e+=r)a+=Bp.call(this,e+i);return a},U:zp,fn:Rp,V(e,t,n){return Ul(Fp.call(this,e,t,n))},p:Fp,un(e,t,n){if(n){if(t+=n,!Number.isSafeInteger(t))throw RangeError(Mh);if(n<0)for(;t<1;)t+=Bp.call(this,--e);else{let n;for(;t>(n=Bp.call(this,e));)t-=n,e++}}return[e,t]},year(e){return this.h(e).year},month(e){let{year:t,o:n}=this.h(e),{u:r}=this.l(t);return r[n]+1},day(e){return this.h(e).day}}),_v=Kp(pv,hv),U=Kp(mv,gv),vv={era:ml,eraYear:_l,year:_l,month:yl,monthCode(e){let t=ml(e);return xp(t),t},day:yl,...Gh(rg,_l),...Gh(B,vl),offset(e){let t=ml(e);return ff(t),t}},yv=N(zc,rg,Ig),bv=N(zc,Ig,rg),xv=`numeric`,Sv=[`timeZoneName`],Cv={month:xv,day:xv},wv={year:xv,month:xv},Tv=Object.assign({},wv,{day:xv}),Ev={hour:xv,minute:xv,second:xv},Dv=Object.assign({},Tv,Ev),Ov=Object.assign({},Dv,{timeZoneName:`short`}),kv=Object.keys(wv),Av=Object.keys(Cv),jv=Object.keys(Tv),Mv=Object.keys(Ev),Nv=[`dateStyle`],Pv=kv.concat(Nv),Fv=Av.concat(Nv),Iv=jv.concat(Nv,[`weekday`]),Lv=Mv.concat([`dayPeriod`,`timeStyle`,`fractionalSecondDigits`]),Rv=Iv.concat(Lv),zv=Sv.concat(Lv),Bv=Sv.concat(Iv),Vv=Sv.concat([`day`,`weekday`],Lv),Hv=Sv.concat([`year`,`weekday`],Lv),Uv=zm(Rv,Dv),Wv=zm(Rv,Ov),Gv=zm(Rv,Dv,Sv),Kv=zm(Iv,Tv,zv),qv=zm(Lv,Ev,Bv),Jv=zm(Pv,wv,Vv),Yv=zm(Fv,Cv,Hv),Xv={},Zv=new Xg(void 0,{calendar:xg}).resolvedOptions().calendar===xg,Qv=[Uv,ku],$v=[Wv,ku,0,(e,t)=>{let n=e.timeZone;if(t&&t.timeZone!==n)throw RangeError(Eh);return n}],ey=[Gv,Ll],ty=[Kv,Ll],ny=[qv,e=>Pl(e)/Qh],ry=[Jv,Ll,Zv],iy=[Yv,Ll,Zv],ay;function oy(e,t,n,r,i){function a(...e){if(!(this instanceof a))throw TypeError(fh);jy(this,t(...e))}function o(e,t){return Object.defineProperties((function(...t){return e.call(this,s(this),...t)}),Mc(t))}function s(t){let n=Ay(t);if(!n||n.branding!==e)throw TypeError(fh);return n}return Object.defineProperties(a.prototype,{...Pc(Lc(o,n)),...Nc(Lc(o,r)),...Fc(`Temporal.`+e)}),Object.defineProperties(a,{...Nc(i),...Mc(e)}),[a,e=>{let t=Object.create(a.prototype);return jy(t,e),t},s]}function sy(e){if(Ay(e)||e.calendar!==void 0||e.timeZone!==void 0)throw TypeError(lh);return e}function cy(e){return ly(e)||`iso8601`}function ly(e){let{calendar:t}=e;if(t!==void 0)return uy(t)}function uy(e){if(M(e)){let{calendar:t}=Ay(e)||{};if(!t)throw TypeError(Ch(e));return t}return(e=>Wp(bf(z(e))))(e)}function dy(e){let t={};for(let n in e)t[n]=e=>{let{calendar:t}=e;return U(t)[n](e)};return t}function fy(){throw TypeError(dh)}function py(e){if(M(e)){let{timeZone:t}=Ay(e)||{};if(!t)throw TypeError(Th(e));return t}return(e=>Rf(xf(z(e))))(e)}function W(e){if(M(e)){let t=Ay(e);return t&&t.branding===`Duration`?t:em(e)}return yf(e)}function my(e){if(e!==void 0){if(M(e)){let t=Ay(e)||{};switch(t.branding){case N_:case A_:return t;case j_:return Tu(t)}let n=cy(e);return{...qp(py,H,U(n),e),calendar:n}}return uf(e)}}function hy(e,t){if(M(e)){let n=Ay(e)||{};switch(n.branding){case M_:return F(t),n;case j_:return F(t),Ou(n);case N_:return F(t),km(H,n)}return $p(e,t)}let n=vf(e);return F(t),n}function gy(e){return e===void 0?void 0:hy(e)}function _y(e,t){if(M(e)){let n=Ay(e)||{};switch(n.branding){case j_:return F(t),n;case A_:return F(t),wu({...n,...Hg});case N_:return F(t),Dm(H,n)}return Yp(U(cy(e)),e,t)}let n=pf(e);return F(t),n}function vy(e,t){if(M(e)){let n=Ay(e);if(n&&n.branding===`PlainMonthDay`)return F(t),n;let r=ly(e);return Qp(U(r||`iso8601`),!r,e,t)}let n=_f(U,e);return F(t),n}function yy(e,t){if(M(e)){let n=Ay(e);return n&&n.branding===`PlainYearMonth`?(F(t),n):Zp(U(cy(e)),e,t)}let n=hf(U,e);return F(t),n}function by(e,t){if(M(e)){let n=Ay(e)||{};switch(n.branding){case A_:return F(t),n;case j_:return F(t),Tu(n);case N_:return F(t),Om(H,n)}return Xp(U(cy(e)),e,t)}let n=mf(e);return F(t),n}function xy(e,t){if(M(e)){let n=Ay(e);if(n&&n.branding===`ZonedDateTime`)return au(t),n;let r=cy(e);return Jp(py,H,U(r),r,e,t)}return df(e,t)}function Sy(e){return Lc((e=>t=>e(Cy(t))),e)}function Cy(e){return H_(e,H)}function wy(e){if(M(e)){let t=Ay(e);if(t)switch(t.branding){case P_:return t;case N_:return Su(t.epochNanoseconds)}}return lf(e)}function Ty(){function e(e,n){return new t(e,n)}function t(e,t=Object.create(null)){yb.set(this,((e,t)=>{let n=new Xg(e,t),r=n.resolvedOptions(),i=r.locale,a=Bc(Object.keys(t),r),o=jc(Oy),s=(e,...t)=>{if(e){if(t.length!==2)throw TypeError(Hh);for(let e of t)if(e===void 0)throw TypeError(Hh)}e||t[0]!==void 0||(t=[]);let r=t.map((e=>Ay(e)||Number(e))),s,c=0;for(let e of r){let t=typeof e==`object`?e.branding:void 0;if(c++&&t!==s)throw TypeError(Hh);s=t}return s?o(s)(i,a,...r):[n,...r]};return s.X=n,s})(e,t))}let n=Xg.prototype,r=Object.getOwnPropertyDescriptors(n),i=Object.getOwnPropertyDescriptors(Xg);for(let t in r){let n=r[t],i=t.startsWith(`format`)&&Ey(t);typeof n.value==`function`?n.value=t===`constructor`?e:i||Dy(t):i&&(n.get=function(){if(!yb.has(this))throw TypeError(`Invalid calling context`);return(...e)=>i.apply(this,e)},Object.defineProperties(n.get,Mc(`get ${t}`)))}return i.prototype.value=t.prototype=Object.create({},r),Object.defineProperties(e,i),e}function Ey(e){return Object.defineProperties((function(...t){let[n,...r]=yb.get(this)(e.includes(`Range`),...t);return n[e](...r)}),Mc(e))}function Dy(e){return Object.defineProperties((function(...t){return yb.get(this).X[e](...t)}),Mc(e))}function Oy(e){let t=Wy[e];if(!t)throw TypeError(Vh(e));return Bm(t,jc(Vm),1)}var ky=new WeakMap,Ay=ky.get.bind(ky),jy=ky.set.bind(ky),My={era:rl,eraYear:al,year:sl,month:ol,daysInMonth:ol,daysInYear:ol,inLeapYear:Dg,monthsInYear:ol},Ny={monthCode:z},Py={day:ol},Fy=dy(Object.assign({},My,Ny,Py,{dayOfWeek:ol,dayOfYear:ol,weekOfYear:il,yearOfWeek:al,daysInWeek:ol})),Iy=dy({...My,...Ny}),Ly=dy({...Ny,...Py}),Ry={calendarId:e=>e.calendar},zy=Rc((e=>t=>t[e]),B.concat(`sign`)),By=Rc(((e,t)=>e=>e[Ig[t]]),rg),Vy={epochMilliseconds:ku,epochNanoseconds:Au},[Hy,G,Uy]=oy(F_,wm,{...zy,blank:Qd},{with:(e,t)=>G(um(e,t)),negated:e=>G(Xd(e)),abs:e=>G(Yd(e)),add:(e,t,n)=>G(qd(my,U,H,0,e,W(t),n)),subtract:(e,t,n)=>G(qd(my,U,H,1,e,W(t),n)),round:(e,t)=>G(Jd(my,U,H,e,t)),total:(e,t)=>Mu(my,U,H,e,t),toLocaleString(e,t,n){return Intl.DurationFormat?new Intl.DurationFormat(t,n).format(this):dd(e)},toString:dd,toJSON:e=>dd(e),valueOf:fy},{from:e=>G(W(e)),compare:(e,t,n)=>Uf(my,U,H,W(e),W(t),n)}),Wy={Instant:Qv,PlainDateTime:ey,PlainDate:ty,PlainTime:ny,PlainYearMonth:ry,PlainMonthDay:iy},Gy=Bm(Qv),Ky=Bm($v),qy=Bm(ey),Jy=Bm(ty),Yy=Bm(ny),Xy=Bm(ry),Zy=Bm(iy),[Qy,$y]=oy(M_,Cm,By,{with(e,t,n){return $y(lm(this,sy(t),n))},add:(e,t)=>$y(Pd(0,e,W(t))),subtract:(e,t)=>$y(Pd(1,e,W(t))),until:(e,t,n)=>G(sp(0,e,hy(t),n)),since:(e,t,n)=>G(sp(1,e,hy(t),n)),round:(e,t)=>$y(zu(e,t)),equals:(e,t)=>$f(e,hy(t)),toLocaleString(e,t,n){let[r,i]=Yy(t,n,e);return r.format(i)},toString:ud,toJSON:e=>ud(e),valueOf:fy},{from:(e,t)=>$y(hy(e,t)),compare:(e,t)=>Kf(hy(e),hy(t))}),[eb,tb]=oy(j_,N(ym,Up),{...Ry,...Fy,...By},{with:(e,t,n)=>tb(am(U,e,sy(t),n)),withCalendar:(e,t)=>tb(Gm(e,uy(t))),withPlainTime:(e,t)=>tb(Wm(e,gy(t))),add:(e,t,n)=>tb(jd(U,0,e,W(t),n)),subtract:(e,t,n)=>tb(jd(U,1,e,W(t),n)),until:(e,t,n)=>G(rp(U,0,e,_y(t),n)),since:(e,t,n)=>G(rp(U,1,e,_y(t),n)),round:(e,t)=>tb(Ru(e,t)),equals:(e,t)=>Yf(e,_y(t)),toZonedDateTime:(e,t,n)=>fb(Am(H,e,py(t),n)),toPlainDate:e=>lb(Tu(e)),toPlainTime:e=>$y(Ou(e)),toLocaleString(e,t,n){let[r,i]=qy(t,n,e);return r.format(i)},toString:od,toJSON:e=>od(e),valueOf:fy},{from:(e,t)=>tb(_y(e,t)),compare:(e,t)=>Wf(_y(e),_y(t))}),[nb,rb,ib]=oy(k_,N(Sm,Up),{...Ry,...Ly},{with:(e,t,n)=>rb(cm(U,e,sy(t),n)),equals:(e,t)=>Qf(e,vy(t)),toPlainDate(e,t){return lb(Im(U,e,this,t))},toLocaleString(e,t,n){let[r,i]=Zy(t,n,e);return r.format(i)},toString:ld,toJSON:e=>ld(e),valueOf:fy},{from:(e,t)=>rb(vy(e,t))}),[ab,ob,sb]=oy(O_,N(xm,Up),{...Ry,...Iy},{with:(e,t,n)=>ob(sm(U,e,sy(t),n)),add:(e,t,n)=>ob(Nd(U,0,e,W(t),n)),subtract:(e,t,n)=>ob(Nd(U,1,e,W(t),n)),until:(e,t,n)=>G(ap(U,0,e,yy(t),n)),since:(e,t,n)=>G(ap(U,1,e,yy(t),n)),equals:(e,t)=>Zf(e,yy(t)),toPlainDate(e,t){return lb(Fm(U,e,this,t))},toLocaleString(e,t,n){let[r,i]=Xy(t,n,e);return r.format(i)},toString:cd,toJSON:e=>cd(e),valueOf:fy},{from:(e,t)=>ob(yy(e,t)),compare:(e,t)=>Gf(yy(e),yy(t))}),[cb,lb,ub]=oy(A_,N(bm,Up),{...Ry,...Fy},{with:(e,t,n)=>lb(om(U,e,sy(t),n)),withCalendar:(e,t)=>lb(Gm(e,uy(t))),add:(e,t,n)=>lb(Md(U,0,e,W(t),n)),subtract:(e,t,n)=>lb(Md(U,1,e,W(t),n)),until:(e,t,n)=>G(ip(U,0,e,by(t),n)),since:(e,t,n)=>G(ip(U,1,e,by(t),n)),equals:(e,t)=>Xf(e,by(t)),toZonedDateTime(e,t){return fb(jm(py,hy,H,e,M(t)?t:{timeZone:t}))},toPlainDateTime:(e,t)=>tb(Mm(e,gy(t))),toPlainYearMonth(e){return ob(Nm(U,e,this))},toPlainMonthDay(e){return rb(Pm(U,e,this))},toLocaleString(e,t,n){let[r,i]=Jy(t,n,e);return r.format(i)},toString:sd,toJSON:e=>sd(e),valueOf:fy},{from:(e,t)=>lb(by(e,t)),compare:(e,t)=>Gf(by(e),by(t))}),[db,fb]=oy(N_,N(vm,Up,Lf),{...Vy,...Ry,...Sy(Fy),...Sy(By),offset:e=>yd(Cy(e).offsetNanoseconds),offsetNanoseconds:e=>Cy(e).offsetNanoseconds,timeZoneId:e=>e.timeZone,hoursInDay:e=>Bu(H,e)},{with:(e,t,n)=>fb(im(U,H,e,sy(t),n)),withCalendar:(e,t)=>fb(Gm(e,uy(t))),withTimeZone:(e,t)=>fb(Km(e,py(t))),withPlainTime:(e,t)=>fb(Um(H,e,gy(t))),add:(e,t,n)=>fb(Ad(U,H,0,e,W(t),n)),subtract:(e,t,n)=>fb(Ad(U,H,1,e,W(t),n)),until:(e,t,n)=>G(I(np(U,H,0,e,xy(t),n))),since:(e,t,n)=>G(I(np(U,H,1,e,xy(t),n))),round:(e,t)=>fb(Lu(H,e,t)),startOfDay:e=>fb(Vu(H,e)),equals:(e,t)=>Jf(e,xy(t)),toInstant:e=>mb(Em(e)),toPlainDateTime:e=>tb(Dm(H,e)),toPlainDate:e=>lb(Om(H,e)),toPlainTime:e=>$y(km(H,e)),toLocaleString(e,t,n={}){let[r,i]=Ky(t,n,e);return r.format(i)},toString:(e,t)=>ad(H,e,t),toJSON:e=>ad(H,e),valueOf:fy,getTimeZoneTransition(e,t){let{timeZone:n,epochNanoseconds:r}=e,i=uu(t),a=H(n).O(r,i);return a?fb({...e,epochNanoseconds:a}):null}},{from:(e,t)=>fb(xy(e,t)),compare:(e,t)=>Hf(xy(e),xy(t))}),[pb,mb,hb]=oy(P_,_m,Vy,{add:(e,t)=>mb(kd(0,e,W(t))),subtract:(e,t)=>mb(kd(1,e,W(t))),until:(e,t,n)=>G(tp(0,e,wy(t),n)),since:(e,t,n)=>G(tp(1,e,wy(t),n)),round:(e,t)=>mb(Iu(e,t)),equals:(e,t)=>qf(e,wy(t)),toZonedDateTimeISO:(e,t)=>fb(Tm(e,py(t))),toLocaleString(e,t,n){let[r,i]=Gy(t,n,e);return r.format(i)},toString:(e,t)=>id(py,H,e,t),toJSON:e=>id(py,H,e),valueOf:fy},{from:e=>mb(wy(e)),fromEpochMilliseconds:e=>mb(Lm(e)),fromEpochNanoseconds:e=>mb(Rm(e)),compare:(e,t)=>Vf(wy(e),wy(t))}),gb=Object.defineProperties({},{...Fc(`Temporal.Now`),...Nc({timeZoneId:()=>Ym(),instant:()=>mb(Su(Jm())),zonedDateTimeISO:(e=Ym())=>fb(Cu(Jm(),py(e),xg)),plainDateTimeISO:(e=Ym())=>tb(wu(qm(H(py(e))),xg)),plainDateISO:(e=Ym())=>lb(Tu(qm(H(py(e))),xg)),plainTimeISO:(e=Ym())=>$y(Ou(qm(H(py(e)))))})}),_b=Object.defineProperties({},{...Fc(`Temporal`),...Nc({PlainYearMonth:ab,PlainMonthDay:nb,PlainDate:cb,PlainTime:Qy,PlainDateTime:eb,ZonedDateTime:db,Instant:pb,Duration:Hy,Now:gb})}),vb=Ty(),yb=new WeakMap;Object.create(Intl),Nc({DateTimeFormat:vb});var bb=e=>{if(!(0,y.isString)(e))return null;try{return Oc(e)?{isDateOnly:!0,date:_b.PlainDate.from(e)}:{isDateOnly:!1,dateTime:_b.Instant.from(e).toZonedDateTimeISO(`UTC`)}}catch{return null}},xb=e=>Math.trunc(e)+0,Sb=(e,t,n)=>{switch(t){case`DAY`:return e.add({days:n});case`WEEK`:return e.add({weeks:n});case`QUARTER`:return e.add({months:n*3});case`MONTH`:return e.add({months:n});case`YEAR`:return e.add({years:n});case`SECOND`:return e.add({seconds:n});case`MINUTE`:return e.add({minutes:n});case`HOUR`:return e.add({hours:n});default:return ne(t)}},Cb=({expressionDate:e,amount:t,unit:n})=>{try{let r=Sb(Ec(e),n,t);return e.isDateOnly&&n!==`MINUTE`&&n!==`HOUR`?{isDateOnly:!0,date:r.toPlainDate()}:{isDateOnly:!1,dateTime:r}}catch(e){if(e instanceof RangeError)return null;throw e}},wb=(e,t,r)=>{wc(r);let i=bb(e);if(!n.t(i)||!Dc(i)||!(0,y.isNumber)(t)||!Number.isFinite(t))return null;let a=Cb({expressionDate:i,amount:xb(t),unit:r});return n.t(a)&&Dc(a)?Tc(a):null},Tb=({from:e,to:t})=>{let n=(t.year-e.year)*12+(t.month-e.month);return n>0&&t.day<e.day?n-1:n<0&&t.day>e.day?n+1:n},Eb={MINUTE:6e4,HOUR:36e5},Db=(e,t,r)=>{wc(r);let i=bb(e),a=bb(t);if(!n.t(i)||!n.t(a))return null;let o=Ec(i),s=Ec(a);switch(r){case`MINUTE`:case`HOUR`:return xb((s.epochMilliseconds-o.epochMilliseconds)/Eb[r]);case`DAY`:case`WEEK`:{let e=o.toPlainDate().until(s.toPlainDate(),{largestUnit:`days`}).days;return r===`DAY`?e:xb(e/7)}case`MONTH`:case`QUARTER`:case`YEAR`:return xb(Tb({from:o.toPlainDate(),to:s.toPlainDate()})/{MONTH:1,QUARTER:3,YEAR:12}[r])}},Ob=[`YEAR`,`QUARTER`,`MONTH`,`WEEK`,`DAY`,`DAY_OF_WEEK`,`HOUR`,`MINUTE`],kb=e=>Ob.some(t=>t===e),Ab=e=>{if(!kb(e))throw new yc(xc({value:e,kind:`part`,allowedValues:Ob}),`INVALID_DATE_PART`)},jb=(e,t)=>{Ab(t);let r=bb(e);if(!n.t(r))return null;let i=Ec(r);switch(t){case`YEAR`:return i.year;case`QUARTER`:return Math.floor((i.month-1)/3)+1;case`MONTH`:return i.month;case`WEEK`:return i.weekOfYear??null;case`DAY`:return i.day;case`DAY_OF_WEEK`:return i.dayOfWeek;case`HOUR`:return i.hour;case`MINUTE`:return i.minute}},Mb=function(e){return e.MONDAY=`MONDAY`,e.SUNDAY=`SUNDAY`,e.SATURDAY=`SATURDAY`,e}({}),Nb=e=>{switch(e){case Mb.MONDAY:return 1;case Mb.SATURDAY:return 6;case Mb.SUNDAY:return 7;default:return ne(e)}},Pb=(e,t,r)=>{switch(t){case`DAY`:return e.startOfDay();case`WEEK`:{let t=n.t(r)?Nb(r):1,i=(e.dayOfWeek-t+7)%7;return e.startOfDay().subtract({days:i})}case`QUARTER`:{let t=Math.floor((e.month-1)/3);return e.startOfDay().with({day:1,month:t*3+1})}case`MONTH`:return e.startOfDay().with({day:1});case`YEAR`:return e.startOfDay().with({day:1,month:1});case`SECOND`:return e.with({nanosecond:0,microsecond:0,millisecond:0});case`MINUTE`:return e.with({second:0,nanosecond:0,microsecond:0,millisecond:0});case`HOUR`:return e.with({minute:0,second:0,nanosecond:0,microsecond:0,millisecond:0});default:return ne(t)}},Fb=(e,t,n)=>{switch(t){case`DAY`:return Pb(e,`DAY`).add({days:1});case`WEEK`:return Pb(e,`WEEK`,n).add({weeks:1});case`MONTH`:return Pb(e,`MONTH`,n).add({months:1});case`QUARTER`:return Pb(e,`QUARTER`,n).add({months:3});case`YEAR`:return Pb(e,`YEAR`,n).add({years:1});case`SECOND`:return Pb(e,`SECOND`).add({seconds:1});case`MINUTE`:return Pb(e,`MINUTE`).add({minutes:1});case`HOUR`:return Pb(e,`HOUR`).add({hours:1});default:return ne(t)}},Ib=(e,t)=>{wc(t);let r=bb(e);if(!n.t(r))return null;let i=Pb(Ec(r),t);return Tc(r.isDateOnly?{isDateOnly:!0,date:i.toPlainDate()}:{isDateOnly:!1,dateTime:i})},Lb=Gs([Mb.MONDAY,Mb.SATURDAY,Mb.SUNDAY]),Rb=Vs([_c().int().positive(),qs(`undefined`)]).transform(e=>e===`undefined`?void 0:e),zb=zs({direction:Gs([`NEXT`,`THIS`,`PAST`]),amount:Rb.nullish(),unit:vc,timezone:as().nullish(),firstDayOfTheWeek:Lb.nullish()}).refine(e=>!(e.amount===void 0&&e.direction!==`THIS`),{error:`Amount cannot be 'undefined' unless direction is 'THIS'`}),Bb=(e,t,n)=>{switch(t){case`DAY`:return e.subtract({days:n});case`WEEK`:return e.subtract({weeks:n});case`QUARTER`:return e.subtract({months:n*3});case`MONTH`:return e.subtract({months:n});case`YEAR`:return e.subtract({years:n});case`SECOND`:return e.subtract({seconds:n});case`MINUTE`:return e.subtract({minutes:n});case`HOUR`:return e.subtract({hours:n});default:return ne(t)}},Vb=(e,t)=>{let{direction:r,amount:i,unit:a,firstDayOfTheWeek:o}=e;switch(r){case`NEXT`:{if(!n.t(i))throw Error(`Amount is required`);let r=Fb(t,a,o);return{...e,start:r,end:Sb(r,a,i)}}case`PAST`:{if(!n.t(i))throw Error(`Amount is required`);let r=Pb(t,a,o);return{...e,start:Bb(r,a,i),end:r}}case`THIS`:return{...e,start:Pb(t,a,o),end:Fb(t,a,o)}}},Hb={},Ub=()=>n.t(Hb.current)?_b.Instant.from(Hb.current).toZonedDateTimeISO(`UTC`):_b.Now.zonedDateTimeISO(`UTC`),Wb=e=>{try{return _b.Instant.from(e)}catch{}try{return _b.PlainDate.from(e).toZonedDateTime({timeZone:`UTC`}).toInstant()}catch{return null}},Gb=(e,t,r,i)=>{if(!(0,y.isString)(e)||t!==`THIS`&&!n.t(r))return!1;let a=Wb(e),o=zb.safeParse({direction:t,amount:t===`THIS`?void 0:r,unit:i});if(!n.t(a)||!o.success)return!1;let{start:s,end:c}=Vb(o.data,Ub());return _b.Instant.compare(a,s.toInstant())>=0&&_b.Instant.compare(a,c.toInstant())<0},Kb=new WeakSet,qb=new WeakMap,Jb=e=>n.t(e)&&!(typeof e==`object`&&Kb.has(e)),Yb={[a.a.CURRENCY]:[`amountMicros`],[a.a.FULL_NAME]:[`firstName`,`lastName`],[a.a.LINKS]:[`primaryLinkUrl`],[a.a.EMAILS]:[`primaryEmail`],[a.a.PHONES]:[`primaryPhoneNumber`]},Xb=e=>{if(!n.t(e)||e===``)return!0;if(Array.isArray(e))return e.length===0;if(!i.t(e)||e instanceof Date)return!1;if(Kb.has(e))return!0;let t=qb.get(e);if(t===a.a.RICH_TEXT)return!(0,y.isNonEmptyString)(e.markdown)||e.markdown.trim().length===0;let r=n.t(t)?Yb[t]:void 0;return(n.t(r)?r.map(t=>e[t]):Object.values(e)).every(Xb)},Zb=function(e){return e.FIT_CONTENT=`FIT_CONTENT`,e.TAB_VIEWPORT=`TAB_VIEWPORT`,e}({}),Qb=({widgetType:e,heightBehavior:t})=>{if(n.t(t))return t;switch(e){case o.d.CALENDAR:case o.d.CALL_RECORDING_SUMMARY:case o.d.CALL_RECORDING_TRANSCRIPT:case o.d.CHAT:case o.d.CHAT_THREADS:case o.d.EMAILS:case o.d.EMAIL_THREAD:case o.d.FILES:case o.d.MESSAGE_CAMPAIGN_BODY:case o.d.NOTES:case o.d.TASKS:case o.d.TIMELINE:case o.d.WORKFLOW:case o.d.WORKFLOW_RUN:case o.d.WORKFLOW_VERSION:return Zb.TAB_VIEWPORT;case o.d.IFRAME:case o.d.RECORD_TABLE:case o.d.MESSAGE_CAMPAIGN_DETAILS:case o.d.FIELD:case o.d.FIELDS:case o.d.FORM_FIELD:case o.d.FIELD_RICH_TEXT:case o.d.FRONT_COMPONENT:case o.d.GRAPH:case o.d.STANDALONE_RICH_TEXT:case o.d.VIEW:return Zb.FIT_CONTENT}},$b=({map:e,maxEntries:t,minEvict:r=0,recencyOf:i,matches:a})=>{if(!n.t(a)){if(e.size<=t)return 0;if(!n.t(i)){let n=Math.min(e.size,Math.max(r,e.size-t)),i=e.keys();for(let t=0;t<n;t+=1){let t=i.next();if(t.done)break;e.delete(t.value)}return n}}let o=[];for(let t of e)(!n.t(a)||a(t[0]))&&o.push(t);if(o.length<=t)return 0;n.t(i)&&o.sort((e,t)=>i(e[1])-i(t[1]));let s=Math.min(o.length,Math.max(r,o.length-t));for(let[t]of o.slice(0,s))e.delete(t);return s},ex=({map:e,key:t})=>{let n=e.get(t);if(!(0,y.isUndefined)(n))return e.delete(t),e.set(t,n),n},tx=({map:e,key:t,value:n,maxEntries:r})=>{e.delete(t),e.set(t,n),$b({map:e,maxEntries:r})},nx=({compute:e,maxEntries:t})=>{let r=new Map;return i=>{let a=ex({map:r,key:i});if(n.t(a))return a;let o=e(i);return tx({map:r,key:i,value:o,maxEntries:t}),o}},rx=e=>{try{return _b.Instant.from(e).toZonedDateTimeISO(`UTC`).toPlainDate()}catch{}try{return _b.PlainDate.from(e)}catch{}throw Error(`Cannot parse date string as PlainDate : "${e}"`)},ix=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*/,ax=/^\d+(?:\.\d+)?/,ox=/^\s+/,sx=[`"`,`'`],cx=(e,t)=>{let n=e[t];for(let r=t+1;r<e.length;r++){if(e[r]===`\\`){r++;continue}if(e[r]===n)return{type:`string`,end:r+1}}return{type:`unclosedString`,end:e.length}},lx=(e,t)=>{let r=e[t]??``;if(sx.includes(r))return cx(e,t);let i=e.slice(t),a=[[`whitespace`,ox],[`number`,ax],[`path`,ix]];for(let[e,r]of a){let a=i.match(r);if(n.t(a))return{type:e,end:t+a[0].length}}return{type:`symbol`,end:t+1}},ux=e=>{let t=[],n=0;for(;n<e.length;){let{type:r,end:i}=lx(e,n);t.push({type:r,text:e.slice(n,i),start:n,end:i}),n=i}return t},dx=/Unknown character "(.+)"/,fx=/^unexpected T[A-Z]+: (.+)$/,px=`Expected )`,mx=`TEOF`,hx=({expression:e,error:t})=>{let r=t instanceof Error?t.message:String(t);if(ux(e).some(e=>e.type===`unclosedString`))return{errorMessage:`A text value is missing its closing quote`,errorCode:`UNCLOSED_TEXT`};if(r.includes(mx)||r.endsWith(px))return{errorMessage:`Expression is incomplete`,errorCode:`INCOMPLETE_EXPRESSION`};let i=r.match(dx)?.[1]??r.match(fx)?.[1];return n.t(i)?{errorMessage:`Unexpected "${i}"`,errorCode:`INVALID_SYNTAX`,errorParams:{token:i}}:{errorMessage:`Expression is not valid`,errorCode:`INVALID_SYNTAX`}},gx,_x=new Uint8Array(16);function vx(){if(!gx){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);gx=crypto.getRandomValues.bind(crypto)}return gx(_x)}var yx={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function bx(e,t,n){if(yx.randomUUID&&!t&&!e)return yx.randomUUID();e||={};let r=e.random??e.rng?.()??vx();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return a.r(r)}var xx=function(e){return e.EMAIL=`EMAIL`,e.CALENDAR=`CALENDAR`,e.WORKFLOW=`WORKFLOW`,e.AGENT=`AGENT`,e.API=`API`,e.IMPORT=`IMPORT`,e.MANUAL=`MANUAL`,e.SYSTEM=`SYSTEM`,e.WEBHOOK=`WEBHOOK`,e.APPLICATION=`APPLICATION`,e}({}),Sx={type:a.a.ACTOR,properties:[{name:`source`,type:a.a.SELECT,hidden:!1,isRequired:!0,options:Object.keys(xx).map((e,t)=>({id:bx(),label:`${xx[e].toLowerCase()}`,value:e,position:t}))},{name:`workspaceMemberId`,type:a.a.UUID,hidden:`input`,isRequired:!1},{name:`name`,type:a.a.TEXT,hidden:`input`,isRequired:!0},{name:`context`,type:a.a.RAW_JSON,hidden:!1,isRequired:!1}]},Cx=[o.u.IS_EMPTY,o.u.IS_NOT_EMPTY],wx={CURRENCY:{currencyCode:[o.u.IS,o.u.IS_NOT,...Cx],amountMicros:[o.u.GREATER_THAN_OR_EQUAL,o.u.LESS_THAN_OR_EQUAL,o.u.IS,o.u.IS_NOT,...Cx]}},K=[o.u.IS_EMPTY,o.u.IS_NOT_EMPTY],Tx=[o.u.IS,o.u.IS_NOT],Ex={TEXT:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,o.u.IS,o.u.IS_NOT,...K],EMAILS:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...K],FULL_NAME:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...K],ADDRESS:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...K],LINKS:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...K],PHONES:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...K],CURRENCY:[o.u.GREATER_THAN_OR_EQUAL,o.u.LESS_THAN_OR_EQUAL,...K],NUMBER:[o.u.IS,o.u.IS_NOT,o.u.GREATER_THAN_OR_EQUAL,o.u.LESS_THAN_OR_EQUAL,...K],RAW_JSON:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...K],FILES:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...K],DATE_TIME:[o.u.IS,o.u.IS_RELATIVE,o.u.IS_IN_PAST,o.u.IS_IN_FUTURE,o.u.IS_TODAY,o.u.IS_BEFORE,o.u.IS_AFTER,...K],DATE:[o.u.IS,o.u.IS_RELATIVE,o.u.IS_IN_PAST,o.u.IS_IN_FUTURE,o.u.IS_TODAY,o.u.IS_BEFORE,o.u.IS_AFTER,...K],RATING:[o.u.IS,o.u.IS_NOT,o.u.GREATER_THAN_OR_EQUAL,o.u.LESS_THAN_OR_EQUAL,...K],RELATION:[...Tx,...K],MULTI_SELECT:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...K],SELECT:[o.u.IS,o.u.IS_NOT,...K],ACTOR:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...K],ARRAY:[o.u.CONTAINS,o.u.DOES_NOT_CONTAIN,...K],BOOLEAN:[o.u.IS],TS_VECTOR:[o.u.VECTOR_SEARCH],UUID:[o.u.IS,o.u.IS_NOT,...K]},Dx=[o.u.IS,o.u.IS_NOT,o.u.IS_EMPTY,o.u.IS_NOT_EMPTY],Ox=({filterType:e,subFieldName:t})=>e===`CURRENCY`?t===`currencyCode`?wx.CURRENCY.currencyCode:wx.CURRENCY.amountMicros:e===`ACTOR`&&(t===`source`||t===`workspaceMemberId`)?Dx:Ex[e],kx={type:a.a.ADDRESS,properties:[{name:`addressStreet1`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressStreet2`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressCity`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressPostcode`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressState`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressCountry`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`addressLat`,type:a.a.NUMERIC,hidden:!1,isRequired:!1},{name:`addressLng`,type:a.a.NUMERIC,hidden:!1,isRequired:!1}]},Ax={type:a.a.CURRENCY,properties:[{name:`amountMicros`,type:a.a.NUMERIC,hidden:!1,isRequired:!1},{name:`currencyCode`,type:a.a.TEXT,hidden:!1,isRequired:!1}]},jx={type:a.a.EMAILS,properties:[{name:`primaryEmail`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`additionalEmails`,type:a.a.RAW_JSON,hidden:!1,isRequired:!1}]},Mx={type:a.a.FULL_NAME,properties:[{name:`firstName`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!1},{name:`lastName`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!1}]},Nx={type:a.a.LINKS,properties:[{name:`primaryLinkLabel`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`primaryLinkUrl`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`secondaryLinks`,type:a.a.RAW_JSON,hidden:!1,isRequired:!1}]},Px={type:a.a.PHONES,properties:[{name:`primaryPhoneNumber`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`primaryPhoneCountryCode`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`primaryPhoneCallingCode`,type:a.a.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`additionalPhones`,type:a.a.RAW_JSON,hidden:!1,isRequired:!1}]},Fx={type:a.a.RICH_TEXT,properties:[{name:`blocknote`,deprecationReason:`Use markdown or tiptap instead. This value is cleared whenever the field is written in another format.`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`markdown`,type:a.a.TEXT,hidden:!1,isRequired:!1},{name:`tiptap`,type:a.a.TEXT,hidden:!1,isRequired:!1}]};zs({tiptap:as().nullable().optional(),markdown:as().nullable().optional(),blocknote:as().nullable().optional()});var Ix=new Map([[a.a.LINKS,Nx],[a.a.CURRENCY,Ax],[a.a.FULL_NAME,Mx],[a.a.ADDRESS,kx],[a.a.ACTOR,Sx],[a.a.EMAILS,jx],[a.a.PHONES,Px],[a.a.RICH_TEXT,Fx]]),Lx=`previous`,Rx=e=>e.startsWith(`${Lx}.`),zx=e=>Rx(e)?e.slice(Lx.length+1):null,Bx=(e,t)=>n.t(e)?e instanceof Date?e.toISOString():e:t?.type!==a.a.BOOLEAN&&null,Vx=e=>i.t(e)&&!(e instanceof Date),Hx=(e,t)=>{n.t(t)&&Vx(e)&&Ix.has(t.type)&&qb.set(e,t.type)},Ux=(e,t,r)=>{let i=e[t];if(!n.t(i)){let n={};return Kb.add(n),r.add(n),e[t]=n,n}if(!Vx(i))return null;if(r.has(i))return i;let a={...i},o=qb.get(i);return n.t(o)&&qb.set(a,o),r.add(a),e[t]=a,a},Wx=({record:e,previousRecord:t,fieldByName:r,identifierPaths:i,now:a,isPreviousRecordContext:o=!1})=>{let s={},c=new WeakSet,l=o?[]:i.map(zx).filter(n.t);l.length>0&&(s.previous=Wx({record:t??{},fieldByName:n.t(t)?r:new Map,identifierPaths:l,now:a,isPreviousRecordContext:!0}));for(let t of i){let i=t.split(`.`),[l]=i;if(!n.t(l))continue;if(!o){if(l===`previous`)continue;if(l===`now`){s.now=a;continue}}let u=r.get(l);if(!(l in s)){let t=Bx(e[l],u);Hx(t,u),s[l]=t}let d=s;for(let[e,t]of i.entries()){if(!n.t(d))break;if(e===i.length-1){d[t]=Bx(d[t],e===0?u:u?.relationTargetFields?.find(e=>e.name===t));break}d=Ux(d,t,c);let r=i[e+1];if(e===0&&n.t(d)&&n.t(r)){let e=u?.relationTargetFields?.find(e=>e.name===r);Hx(d[r],e)}}}return s},Gx=e=>e.some(e=>e.type===`IOP2`?e.value===`[`:e.type===`IEXPR`&&Array.isArray(e.value)&&Gx(e.value)),Kx={isDefined:{signature:`isDefined(value)`,evaluate:Jb},isEmpty:{signature:`isEmpty(value)`,evaluate:Xb},isNonEmptyString:{signature:`isNonEmptyString(value)`,evaluate:e=>(0,y.isNonEmptyString)(e)},includes:{signature:`includes(listOrText, value)`,evaluate:(e,t)=>(Array.isArray(e)||(0,y.isString)(e)&&(0,y.isString)(t))&&e.includes(t)},arrayLength:{signature:`arrayLength(list)`,evaluate:e=>Array.isArray(e)?e.length:0},dateDiff:{signature:`dateDiff(from, to, unit)`,evaluate:Db},dateAdd:{signature:`dateAdd(date, amount, unit)`,evaluate:wb},dateTrunc:{signature:`dateTrunc(date, unit)`,evaluate:Ib},datePart:{signature:`datePart(date, part)`,evaluate:jb},isInRelativeDateRange:{signature:`isInRelativeDateRange(date, direction, amount, unit)`,evaluate:Gb}},qx=`INUMBER`,Jx=`IOP1`,Yx=`IOP2`,Xx=`IOP3`,Zx=`IVAR`,Qx=`IVARNAME`,$x=`IFUNCALL`,eS=`IFUNDEF`,tS=`IEXPR`,nS=`IEXPREVAL`,rS=`IMEMBER`,iS=`IENDSTATEMENT`,aS=`IARRAY`;function q(e,t){this.type=e,this.value=t??0}q.prototype.toString=function(){switch(this.type){case qx:case Jx:case Yx:case Xx:case Zx:case Qx:case iS:return this.value;case $x:return`CALL `+this.value;case eS:return`DEF `+this.value;case aS:return`ARRAY `+this.value;case rS:return`.`+this.value;default:return`Invalid Instruction`}};function oS(e){return new q(Jx,e)}function sS(e){return new q(Yx,e)}function cS(e){return new q(Xx,e)}function lS(e,t,n,r,i){for(var a=[],o=[],s,c,l,u,d=0;d<e.length;d++){var f=e[d],p=f.type;if(p===qx||p===Qx)Array.isArray(f.value)?a.push.apply(a,lS(f.value.map(function(e){return new q(qx,e)}).concat(new q(aS,f.value.length)),t,n,r,i)):a.push(f);else if(p===Zx&&Object.hasOwn(i,f.value))f=new q(qx,i[f.value]),a.push(f);else if(p===Yx&&a.length>1)c=a.pop(),s=a.pop(),u=n[f.value],f=new q(qx,u(s.value,c.value)),a.push(f);else if(p===Xx&&a.length>2)l=a.pop(),c=a.pop(),s=a.pop(),f.value===`?`?a.push(s.value?c.value:l.value):(u=r[f.value],f=new q(qx,u(s.value,c.value,l.value)),a.push(f));else if(p===Jx&&a.length>0)s=a.pop(),u=t[f.value],f=new q(qx,u(s.value)),a.push(f);else if(p===tS){for(;a.length>0;)o.push(a.shift());o.push(new q(tS,lS(f.value,t,n,r,i)))}else if(p===rS&&a.length>0)s=a.pop(),a.push(new q(qx,s.value[f.value]));else{for(;a.length>0;)o.push(a.shift());o.push(f)}}for(;a.length>0;)o.push(a.shift());return o}function uS(e,t,n){for(var r=[],i=0;i<e.length;i++){var a=e[i],o=a.type;if(o===Zx&&a.value===t)for(var s=0;s<n.tokens.length;s++){var c=n.tokens[s],l=c.type===Jx?oS(c.value):c.type===Yx?sS(c.value):c.type===Xx?cS(c.value):new q(c.type,c.value);r.push(l)}else o===tS?r.push(new q(tS,uS(a.value,t,n))):r.push(a)}return r}function dS(e,t,n){if(Object.values(t.functions).includes(e))return!0;for(let i of Object.values(n))if(typeof i==`object`&&i){for(let n of Object.values(i))if(n===e){let e=Object.freeze({abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,clz32:Math.clz32,cos:Math.cos,exp:Math.exp,floor:Math.floor,imul:Math.imul,fround:Math.fround,f16round:Math.f16round,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,log10:Math.log10,log2:Math.log2,log1p:Math.log1p,expm1:Math.expm1,cosh:Math.cosh,sinh:Math.sinh,tanh:Math.tanh,acosh:Math.acosh,asinh:Math.asinh,atanh:Math.atanh,hypot:Math.hypot,trunc:Math.trunc,sign:Math.sign,cbrt:Math.cbrt});for(var r of Object.getOwnPropertyNames(e))if(e[r]===n)return!0;return Object.values(t.functions).includes(n)}}return!1}function fS(e,t,n){var r=[],i,a,o,s,c,l;if(mS(e))return hS(e,n);for(var u=e.length,d=0;d<u;d++){var f=e[d],p=f.type;if(p===qx||p===Qx)r.push(f.value);else if(p===Yx)a=r.pop(),i=r.pop(),f.value===`and`?r.push(i?!!fS(a,t,n):!1):f.value===`or`?r.push(i?!0:!!fS(a,t,n)):f.value===`=`?(s=t.binaryOps[f.value],r.push(s(i,fS(a,t,n),n))):(s=t.binaryOps[f.value],r.push(s(hS(i,n),hS(a,n))));else if(p===Xx)o=r.pop(),a=r.pop(),i=r.pop(),f.value===`?`?r.push(fS(i?a:o,t,n)):(s=t.ternaryOps[f.value],r.push(s(hS(i,n),hS(a,n),hS(o,n))));else if(p===Zx){if(/^__proto__|prototype|constructor$/.test(f.value))throw Error(`prototype access detected`);if(f.value in t.functions)r.push(t.functions[f.value]);else if(f.value in t.unaryOps&&t.parser.isOperatorEnabled(f.value))r.push(t.unaryOps[f.value]);else{var m=n[f.value];if(m!==void 0){if(typeof m==`function`&&!dS(m,t,n))throw Error(`Variable references an unallowed function: `+f.value);r.push(m)}else throw Error(`undefined variable: `+f.value)}}else if(p===Jx)i=r.pop(),s=t.unaryOps[f.value],r.push(s(hS(i,n)));else if(p===$x){for(l=f.value,c=[];l-->0;)c.unshift(hS(r.pop(),n));if(s=r.pop(),!dS(s,t,n))throw Error(`Is not an allowed function.`);if(s.apply&&s.call)r.push(s.apply(void 0,c));else throw Error(s+` is not a function`)}else if(p===eS)r.push((function(){for(var e=r.pop(),i=[],a=f.value;a-->0;)i.unshift(r.pop());var o=r.pop(),s=function(){for(var r=Object.assign({},n),a=0,o=i.length;a<o;a++)r[i[a]]=arguments[a];return fS(e,t,r)};return t.functions[`lambda_`+t.functions.__counter++]=s,n[o]=s,s})());else if(p===tS)r.push(pS(f,t));else if(p===nS)r.push(f);else if(p===rS){if(i=r.pop(),/^__proto__|prototype|constructor$/.test(f.value))throw Error(`prototype access detected in MEMBER`);if(typeof i==`object`&&typeof i[f.value]==`function`&&!dS(i[f.value],t,n))throw Error(`Is not an allowed function in MEMBER.`);r.push(i[f.value])}else if(p===iS)r.pop();else if(p===aS){for(l=f.value,c=[];l-->0;)c.unshift(r.pop());r.push(c)}else throw Error(`invalid Expression`)}if(r.length>1)throw Error(`invalid Expression (parity)`);return r[0]===0?0:hS(r[0],n)}function pS(e,t,n){return mS(e)?e:{type:nS,value:function(n){return fS(e.value,t,n)}}}function mS(e){return e&&e.type===nS}function hS(e,t){return mS(e)?e.value(t):e}function gS(e,t){for(var n=[],r,i,a,o,s,c,l=0;l<e.length;l++){var u=e[l],d=u.type;if(d===qx)typeof u.value==`number`&&u.value<0?n.push(`(`+u.value+`)`):Array.isArray(u.value)?n.push(`[`+u.value.map(_S).join(`, `)+`]`):n.push(_S(u.value));else if(d===Yx)i=n.pop(),r=n.pop(),o=u.value,t?o===`^`?n.push(`Math.pow(`+r+`, `+i+`)`):o===`and`?n.push(`(!!`+r+` && !!`+i+`)`):o===`or`?n.push(`(!!`+r+` || !!`+i+`)`):o===`||`?n.push(`(function(a,b){ return Array.isArray(a) && Array.isArray(b) ? a.concat(b) : String(a) + String(b); }((`+r+`),(`+i+`)))`):o===`==`?n.push(`(`+r+` === `+i+`)`):o===`!=`?n.push(`(`+r+` !== `+i+`)`):o===`[`?n.push(r+`[(`+i+`) | 0]`):n.push(`(`+r+` `+o+` `+i+`)`):o===`[`?n.push(r+`[`+i+`]`):n.push(`(`+r+` `+o+` `+i+`)`);else if(d===Xx)if(a=n.pop(),i=n.pop(),r=n.pop(),o=u.value,o===`?`)n.push(`(`+r+` ? `+i+` : `+a+`)`);else throw Error(`invalid Expression`);else if(d===Zx||d===Qx)n.push(u.value);else if(d===Jx)r=n.pop(),o=u.value,o===`-`||o===`+`?n.push(`(`+o+r+`)`):t?o===`not`?n.push(`(!`+r+`)`):o===`!`?n.push(`fac(`+r+`)`):n.push(o+`(`+r+`)`):o===`!`?n.push(`(`+r+`!)`):n.push(`(`+o+` `+r+`)`);else if(d===$x){for(c=u.value,s=[];c-->0;)s.unshift(n.pop());o=n.pop(),n.push(o+`(`+s.join(`, `)+`)`)}else if(d===eS){for(i=n.pop(),c=u.value,s=[];c-->0;)s.unshift(n.pop());r=n.pop(),t?n.push(`(`+r+` = function(`+s.join(`, `)+`) { return `+i+` })`):n.push(`(`+r+`(`+s.join(`, `)+`) = `+i+`)`)}else if(d===rS)r=n.pop(),n.push(r+`.`+u.value);else if(d===aS){for(c=u.value,s=[];c-->0;)s.unshift(n.pop());n.push(`[`+s.join(`, `)+`]`)}else if(d===tS)n.push(`(`+gS(u.value,t)+`)`);else if(d!==iS)throw Error(`invalid Expression`)}return n.length>1&&(n=t?[n.join(`,`)]:[n.join(`;`)]),String(n[0])}function _S(e){return typeof e==`string`?JSON.stringify(e).replace(/\u2028/g,`\\u2028`).replace(/\u2029/g,`\\u2029`):e}function vS(e,t){for(var n=0;n<e.length;n++)if(e[n]===t)return!0;return!1}function yS(e,t,n){n||={};for(var r=!!n.withMembers,i=null,a=0;a<e.length;a++){var o=e[a];o.type===Zx||o.type===Qx?!r&&!vS(t,o.value)?t.push(o.value):(i===null||vS(t,i)||t.push(i),i=o.value):o.type===rS&&r&&i!==null?i+=`.`+o.value:o.type===tS?yS(o.value,t,n):i!==null&&(vS(t,i)||t.push(i),i=null)}i!==null&&!vS(t,i)&&t.push(i)}function bS(e,t){this.tokens=e,this.parser=t,this.unaryOps=t.unaryOps,this.binaryOps=t.binaryOps,this.ternaryOps=t.ternaryOps,this.functions=t.functions}bS.prototype.simplify=function(e){return e||={},new bS(lS(this.tokens,this.unaryOps,this.binaryOps,this.ternaryOps,e),this.parser)},bS.prototype.substitute=function(e,t){return t instanceof bS||(t=this.parser.parse(String(t))),new bS(uS(this.tokens,e,t),this.parser)},bS.prototype.evaluate=function(e){return e||={},fS(this.tokens,this,e)},bS.prototype.toString=function(){return gS(this.tokens,!1)},bS.prototype.symbols=function(e){e||={};var t=[];return yS(this.tokens,t,e),t},bS.prototype.variables=function(e){e||={};var t=[];yS(this.tokens,t,e);var n=this.functions;return t.filter(function(e){return!(e in n)})},bS.prototype.toJSFunction=function(e,t){var n=this,r=Function(e,`with(this.functions) with (this.ternaryOps) with (this.binaryOps) with (this.unaryOps) { return `+gS(this.simplify(t).tokens,!0)+`; }`);return function(){return r.apply(n,arguments)}};var xS=`TEOF`,J=`TOP`,SS=`TNUMBER`,CS=`TSTRING`,wS=`TPAREN`,TS=`TBRACKET`,ES=`TCOMMA`,DS=`TNAME`,OS=`TSEMICOLON`;function kS(e,t,n){this.type=e,this.value=t,this.index=n}kS.prototype.toString=function(){return this.type+`: `+this.value};function Y(e,t){this.pos=0,this.current=null,this.unaryOps=e.unaryOps,this.binaryOps=e.binaryOps,this.ternaryOps=e.ternaryOps,this.consts=e.consts,this.expression=t,this.savedPosition=0,this.savedCurrent=null,this.options=e.options,this.parser=e}Y.prototype.newToken=function(e,t,n){return new kS(e,t,n??this.pos)},Y.prototype.save=function(){this.savedPosition=this.pos,this.savedCurrent=this.current},Y.prototype.restore=function(){this.pos=this.savedPosition,this.current=this.savedCurrent},Y.prototype.next=function(){if(this.pos>=this.expression.length)return this.newToken(xS,`EOF`);if(this.isWhitespace()||this.isComment())return this.next();if(this.isRadixInteger()||this.isNumber()||this.isOperator()||this.isString()||this.isParen()||this.isBracket()||this.isComma()||this.isSemicolon()||this.isNamedOp()||this.isConst()||this.isName())return this.current;this.parseError(`Unknown character "`+this.expression.charAt(this.pos)+`"`)},Y.prototype.isString=function(){var e=!1,t=this.pos,n=this.expression.charAt(t);if(n===`'`||n===`"`)for(var r=this.expression.indexOf(n,t+1);r>=0&&this.pos<this.expression.length;){if(this.pos=r+1,this.expression.charAt(r-1)!==`\\`){var i=this.expression.substring(t+1,r);this.current=this.newToken(CS,this.unescape(i),t),e=!0;break}r=this.expression.indexOf(n,r+1)}return e},Y.prototype.isParen=function(){var e=this.expression.charAt(this.pos);return e===`(`||e===`)`?(this.current=this.newToken(wS,e),this.pos++,!0):!1},Y.prototype.isBracket=function(){var e=this.expression.charAt(this.pos);return(e===`[`||e===`]`)&&this.isOperatorEnabled(`[`)?(this.current=this.newToken(TS,e),this.pos++,!0):!1},Y.prototype.isComma=function(){return this.expression.charAt(this.pos)===`,`?(this.current=this.newToken(ES,`,`),this.pos++,!0):!1},Y.prototype.isSemicolon=function(){return this.expression.charAt(this.pos)===`;`?(this.current=this.newToken(OS,`;`),this.pos++,!0):!1},Y.prototype.isConst=function(){for(var e=this.pos,t=e;t<this.expression.length;t++){var n=this.expression.charAt(t);if(n.toUpperCase()===n.toLowerCase()&&(t===this.pos||n!==`_`&&n!==`.`&&(n<`0`||n>`9`)))break}if(t>e){var r=this.expression.substring(e,t);if(r in this.consts)return this.current=this.newToken(SS,this.consts[r]),this.pos+=r.length,!0}return!1},Y.prototype.isNamedOp=function(){for(var e=this.pos,t=e;t<this.expression.length;t++){var n=this.expression.charAt(t);if(n.toUpperCase()===n.toLowerCase()&&(t===this.pos||n!==`_`&&(n<`0`||n>`9`)))break}if(t>e){var r=this.expression.substring(e,t);if(this.isOperatorEnabled(r)&&(r in this.binaryOps||r in this.unaryOps||r in this.ternaryOps))return this.current=this.newToken(J,r),this.pos+=r.length,!0}return!1},Y.prototype.isName=function(){for(var e=this.pos,t=e,n=!1;t<this.expression.length;t++){var r=this.expression.charAt(t);if(r.toUpperCase()===r.toLowerCase()){if(t===this.pos&&(r===`$`||r===`_`)){r===`_`&&(n=!0);continue}else if(t===this.pos||!n||r!==`_`&&(r<`0`||r>`9`))break}else n=!0}if(n){var i=this.expression.substring(e,t);return this.current=this.newToken(DS,i),this.pos+=i.length,!0}return!1},Y.prototype.isWhitespace=function(){for(var e=!1,t=this.expression.charAt(this.pos);(t===` `||t===` `||t===`
|
|
56
|
+
`||t===`\r`)&&(e=!0,this.pos++,!(this.pos>=this.expression.length));)t=this.expression.charAt(this.pos);return e};var AS=/^[0-9a-f]{4}$/i;Y.prototype.unescape=function(e){var t=e.indexOf(`\\`);if(t<0)return e;for(var n=e.substring(0,t);t>=0;){var r=e.charAt(++t);switch(r){case`'`:n+=`'`;break;case`"`:n+=`"`;break;case`\\`:n+=`\\`;break;case`/`:n+=`/`;break;case`b`:n+=`\b`;break;case`f`:n+=`\f`;break;case`n`:n+=`
|
|
57
|
+
`;break;case`r`:n+=`\r`;break;case`t`:n+=` `;break;case`u`:var i=e.substring(t+1,t+5);AS.test(i)||this.parseError(`Illegal escape sequence: \\u`+i),n+=String.fromCharCode(parseInt(i,16)),t+=4;break;default:throw this.parseError(`Illegal escape sequence: "\\`+r+`"`)}++t;var a=e.indexOf(`\\`,t);n+=e.substring(t,a<0?e.length:a),t=a}return n},Y.prototype.isComment=function(){return this.expression.charAt(this.pos)===`/`&&this.expression.charAt(this.pos+1)===`*`?(this.pos=this.expression.indexOf(`*/`,this.pos)+2,this.pos===1&&(this.pos=this.expression.length),!0):!1},Y.prototype.isRadixInteger=function(){var e=this.pos;if(e>=this.expression.length-2||this.expression.charAt(e)!==`0`)return!1;++e;var t,n;if(this.expression.charAt(e)===`x`)t=16,n=/^[0-9a-f]$/i,++e;else if(this.expression.charAt(e)===`b`)t=2,n=/^[01]$/i,++e;else return!1;for(var r=!1,i=e;e<this.expression.length;){var a=this.expression.charAt(e);if(n.test(a))e++,r=!0;else break}return r&&(this.current=this.newToken(SS,parseInt(this.expression.substring(i,e),t)),this.pos=e),r},Y.prototype.isNumber=function(){for(var e=!1,t=this.pos,n=t,r=t,i=!1,a=!1,o;t<this.expression.length&&(o=this.expression.charAt(t),o>=`0`&&o<=`9`||!i&&o===`.`);)o===`.`?i=!0:a=!0,t++,e=a;if(e&&(r=t),o===`e`||o===`E`){t++;for(var s=!0,c=!1;t<this.expression.length;){if(o=this.expression.charAt(t),s&&(o===`+`||o===`-`))s=!1;else if(o>=`0`&&o<=`9`)c=!0,s=!1;else break;t++}c||(t=r)}return e?(this.current=this.newToken(SS,parseFloat(this.expression.substring(n,t))),this.pos=t):this.pos=r,e},Y.prototype.isOperator=function(){var e=this.pos,t=this.expression.charAt(this.pos);if(t===`+`||t===`-`||t===`*`||t===`/`||t===`%`||t===`^`||t===`?`||t===`:`||t===`.`)this.current=this.newToken(J,t);else if(t===`∙`||t===`•`)this.current=this.newToken(J,`*`);else if(t===`>`)this.expression.charAt(this.pos+1)===`=`?(this.current=this.newToken(J,`>=`),this.pos++):this.current=this.newToken(J,`>`);else if(t===`<`)this.expression.charAt(this.pos+1)===`=`?(this.current=this.newToken(J,`<=`),this.pos++):this.current=this.newToken(J,`<`);else if(t===`|`)if(this.expression.charAt(this.pos+1)===`|`)this.current=this.newToken(J,`||`),this.pos++;else return!1;else if(t===`=`)this.expression.charAt(this.pos+1)===`=`?(this.current=this.newToken(J,`==`),this.pos++):this.current=this.newToken(J,t);else if(t===`!`)this.expression.charAt(this.pos+1)===`=`?(this.current=this.newToken(J,`!=`),this.pos++):this.current=this.newToken(J,t);else return!1;return this.pos++,this.isOperatorEnabled(this.current.value)?!0:(this.pos=e,!1)},Y.prototype.isOperatorEnabled=function(e){return this.parser.isOperatorEnabled(e)},Y.prototype.getCoordinates=function(){var e=0,t,n=-1;do e++,t=this.pos-n,n=this.expression.indexOf(`
|
|
58
|
+
`,n+1);while(n>=0&&n<this.pos);return{line:e,column:t}},Y.prototype.parseError=function(e){var t=this.getCoordinates();throw Error(`parse error [`+t.line+`:`+t.column+`]: `+e)};function X(e,t,n){this.parser=e,this.tokens=t,this.current=null,this.nextToken=null,this.next(),this.savedCurrent=null,this.savedNextToken=null,this.allowMemberAccess=n.allowMemberAccess!==!1}X.prototype.next=function(){return this.current=this.nextToken,this.nextToken=this.tokens.next()},X.prototype.tokenMatches=function(e,t){return t===void 0?!0:Array.isArray(t)?vS(t,e.value):typeof t==`function`?t(e):e.value===t},X.prototype.save=function(){this.savedCurrent=this.current,this.savedNextToken=this.nextToken,this.tokens.save()},X.prototype.restore=function(){this.tokens.restore(),this.current=this.savedCurrent,this.nextToken=this.savedNextToken},X.prototype.accept=function(e,t){return this.nextToken.type===e&&this.tokenMatches(this.nextToken,t)?(this.next(),!0):!1},X.prototype.expect=function(e,t){if(!this.accept(e,t)){var n=this.tokens.getCoordinates();throw Error(`parse error [`+n.line+`:`+n.column+`]: Expected `+(t||e))}},X.prototype.parseAtom=function(e){var t=this.tokens.unaryOps;function n(e){return e.value in t}if(this.accept(DS)||this.accept(J,n))e.push(new q(Zx,this.current.value));else if(this.accept(SS))e.push(new q(qx,this.current.value));else if(this.accept(CS))e.push(new q(qx,this.current.value));else if(this.accept(wS,`(`))this.parseExpression(e),this.expect(wS,`)`);else if(this.accept(TS,`[`))if(this.accept(TS,`]`))e.push(new q(aS,0));else{var r=this.parseArrayList(e);e.push(new q(aS,r))}else throw Error(`unexpected `+this.nextToken)},X.prototype.parseExpression=function(e){var t=[];this.parseUntilEndStatement(e,t)||(this.parseVariableAssignmentExpression(t),!this.parseUntilEndStatement(e,t)&&this.pushExpression(e,t))},X.prototype.pushExpression=function(e,t){for(var n=0,r=t.length;n<r;n++)e.push(t[n])},X.prototype.parseUntilEndStatement=function(e,t){return this.accept(OS)?(this.nextToken&&this.nextToken.type!==xS&&!(this.nextToken.type===wS&&this.nextToken.value===`)`)&&t.push(new q(iS)),this.nextToken.type!==xS&&this.parseExpression(t),e.push(new q(tS,t)),!0):!1},X.prototype.parseArrayList=function(e){for(var t=0;!this.accept(TS,`]`);)for(this.parseExpression(e),++t;this.accept(ES);)this.parseExpression(e),++t;return t},X.prototype.parseVariableAssignmentExpression=function(e){for(this.parseConditionalExpression(e);this.accept(J,`=`);){var t=e.pop(),n=[],r=e.length-1;if(t.type===$x){if(!this.tokens.isOperatorEnabled(`()=`))throw Error(`function definition is not permitted`);for(var i=0,a=t.value+1;i<a;i++){var o=r-i;e[o].type===Zx&&(e[o]=new q(Qx,e[o].value))}this.parseVariableAssignmentExpression(n),e.push(new q(tS,n)),e.push(new q(eS,t.value));continue}if(t.type!==Zx&&t.type!==rS)throw Error(`expected variable for assignment`);this.parseVariableAssignmentExpression(n),e.push(new q(Qx,t.value)),e.push(new q(tS,n)),e.push(sS(`=`))}},X.prototype.parseConditionalExpression=function(e){for(this.parseOrExpression(e);this.accept(J,`?`);){var t=[],n=[];this.parseConditionalExpression(t),this.expect(J,`:`),this.parseConditionalExpression(n),e.push(new q(tS,t)),e.push(new q(tS,n)),e.push(cS(`?`))}},X.prototype.parseOrExpression=function(e){for(this.parseAndExpression(e);this.accept(J,`or`);){var t=[];this.parseAndExpression(t),e.push(new q(tS,t)),e.push(sS(`or`))}},X.prototype.parseAndExpression=function(e){for(this.parseComparison(e);this.accept(J,`and`);){var t=[];this.parseComparison(t),e.push(new q(tS,t)),e.push(sS(`and`))}};var jS=[`==`,`!=`,`<`,`<=`,`>=`,`>`,`in`];X.prototype.parseComparison=function(e){for(this.parseAddSub(e);this.accept(J,jS);){var t=this.current;this.parseAddSub(e),e.push(sS(t.value))}};var MS=[`+`,`-`,`||`];X.prototype.parseAddSub=function(e){for(this.parseTerm(e);this.accept(J,MS);){var t=this.current;this.parseTerm(e),e.push(sS(t.value))}};var NS=[`*`,`/`,`%`];X.prototype.parseTerm=function(e){for(this.parseFactor(e);this.accept(J,NS);){var t=this.current;this.parseFactor(e),e.push(sS(t.value))}},X.prototype.parseFactor=function(e){var t=this.tokens.unaryOps;function n(e){return e.value in t}if(this.save(),this.accept(J,n)){if(this.current.value!==`-`&&this.current.value!==`+`){if(this.nextToken.type===wS&&this.nextToken.value===`(`){this.restore(),this.parseExponential(e);return}else if(this.nextToken.type===OS||this.nextToken.type===ES||this.nextToken.type===xS||this.nextToken.type===wS&&this.nextToken.value===`)`){this.restore(),this.parseAtom(e);return}}var r=this.current;this.parseFactor(e),e.push(oS(r.value))}else this.parseExponential(e)},X.prototype.parseExponential=function(e){for(this.parsePostfixExpression(e);this.accept(J,`^`);)this.parseFactor(e),e.push(sS(`^`))},X.prototype.parsePostfixExpression=function(e){for(this.parseFunctionCall(e);this.accept(J,`!`);)e.push(oS(`!`))},X.prototype.parseFunctionCall=function(e){var t=this.tokens.unaryOps;function n(e){return e.value in t}if(this.accept(J,n)){var r=this.current;this.parseAtom(e),e.push(oS(r.value))}else for(this.parseMemberExpression(e);this.accept(wS,`(`);)if(this.accept(wS,`)`))e.push(new q($x,0));else{var i=this.parseArgumentList(e);e.push(new q($x,i))}},X.prototype.parseArgumentList=function(e){for(var t=0;!this.accept(wS,`)`);)for(this.parseExpression(e),++t;this.accept(ES);)this.parseExpression(e),++t;return t},X.prototype.parseMemberExpression=function(e){for(this.parseAtom(e);this.accept(J,`.`)||this.accept(TS,`[`);){var t=this.current;if(t.value===`.`){if(!this.allowMemberAccess)throw Error(`unexpected ".", member access is not permitted`);this.expect(DS),e.push(new q(rS,this.current.value))}else if(t.value===`[`){if(!this.tokens.isOperatorEnabled(`[`))throw Error(`unexpected "[]", arrays are disabled`);this.parseExpression(e),this.expect(TS,`]`),e.push(sS(`[`))}else throw Error(`unexpected symbol: `+t.value)}};function PS(e,t){return Number(e)+Number(t)}function FS(e,t){return e-t}function IS(e,t){return e*t}function LS(e,t){return e/t}function RS(e,t){return e%t}function zS(e,t){return Array.isArray(e)&&Array.isArray(t)?e.concat(t):``+e+t}function BS(e,t){return e===t}function VS(e,t){return e!==t}function HS(e,t){return e>t}function US(e,t){return e<t}function WS(e,t){return e>=t}function GS(e,t){return e<=t}function KS(e,t){return!!(e&&t)}function qS(e,t){return!!(e||t)}function JS(e,t){return vS(t,e)}function YS(e){return(Math.exp(e)-Math.exp(-e))/2}function XS(e){return(Math.exp(e)+Math.exp(-e))/2}function ZS(e){return e===1/0?1:e===-1/0?-1:(Math.exp(e)-Math.exp(-e))/(Math.exp(e)+Math.exp(-e))}function QS(e){return e===-1/0?e:Math.log(e+Math.sqrt(e*e+1))}function $S(e){return Math.log(e+Math.sqrt(e*e-1))}function eC(e){return Math.log((1+e)/(1-e))/2}function tC(e){return Math.log(e)*Math.LOG10E}function nC(e){return-e}function rC(e){return!e}function iC(e){return e<0?Math.ceil(e):Math.floor(e)}function aC(e){return Math.random()*(e||1)}function oC(e){return uC(e+1)}function sC(e){return isFinite(e)&&e===Math.round(e)}var cC=4.7421875,lC=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];function uC(e){var t,n;if(sC(e)){if(e<=0)return isFinite(e)?1/0:NaN;if(e>171)return 1/0;for(var r=e-2,i=e-1;r>1;)i*=r,r--;return i===0&&(i=1),i}if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*uC(1-e));if(e>=171.35)return 1/0;if(e>85){var a=e*e,o=a*e,s=o*e,c=s*e;return Math.sqrt(2*Math.PI/e)*(e/Math.E)**+e*(1+1/(12*e)+1/(288*a)-139/(51840*o)-571/(2488320*s)+163879/(209018880*c)+5246819/(75246796800*c*e))}--e,n=lC[0];for(var l=1;l<lC.length;++l)n+=lC[l]/(e+l);return t=e+cC+.5,Math.sqrt(2*Math.PI)*t**+(e+.5)*Math.exp(-t)*n}function dC(e){return Array.isArray(e)?e.length:String(e).length}function fC(){for(var e=0,t=0,n=0;n<arguments.length;n++){var r=Math.abs(arguments[n]),i;t<r?(i=t/r,e=e*i*i+1,t=r):r>0?(i=r/t,e+=i*i):e+=r}return t===1/0?1/0:t*Math.sqrt(e)}function pC(e,t,n){return e?t:n}function mC(e,t){return t===void 0||+t==0?Math.round(e):(e=+e,t=-+t,isNaN(e)||!(typeof t==`number`&&t%1==0)?NaN:(e=e.toString().split(`e`),e=Math.round(+(e[0]+`e`+(e[1]?+e[1]-t:-t))),e=e.toString().split(`e`),+(e[0]+`e`+(e[1]?+e[1]+t:t))))}function hC(e,t,n){return n&&(n[e]=t),t}function gC(e,t){return e[t|0]}function _C(e){return arguments.length===1&&Array.isArray(e)?Math.max.apply(Math,e):Math.max.apply(Math,arguments)}function vC(e){return arguments.length===1&&Array.isArray(e)?Math.min.apply(Math,e):Math.min.apply(Math,arguments)}function yC(e,t){if(typeof e!=`function`)throw Error(`First argument to map is not a function`);if(!Array.isArray(t))throw Error(`Second argument to map is not an array`);return t.map(function(t,n){return e(t,n)})}function bC(e,t,n){if(typeof e!=`function`)throw Error(`First argument to fold is not a function`);if(!Array.isArray(n))throw Error(`Second argument to fold is not an array`);return n.reduce(function(t,n,r){return e(t,n,r)},t)}function xC(e,t){if(typeof e!=`function`)throw Error(`First argument to filter is not a function`);if(!Array.isArray(t))throw Error(`Second argument to filter is not an array`);return t.filter(function(t,n){return e(t,n)})}function SC(e,t){if(!(Array.isArray(t)||typeof t==`string`))throw Error(`Second argument to indexOf is not a string or array`);return t.indexOf(e)}function CC(e,t){if(!Array.isArray(t))throw Error(`Second argument to join is not an array`);return t.join(e)}function wC(e){return(e>0)-(e<0)||+e}var TC=1/3;function EC(e){return e<0?-((-e)**+TC):e**+TC}function DC(e){return Math.exp(e)-1}function OC(e){return Math.log(1+e)}function kC(e){return Math.log(e)/Math.LN2}function AC(e){if(!Array.isArray(e))throw Error(`Sum argument is not an array`);return e.reduce(function(e,t){return e+Number(t)},0)}function jC(e){this.options=e||{},this.unaryOps={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,sinh:Math.sinh||YS,cosh:Math.cosh||XS,tanh:Math.tanh||ZS,asinh:Math.asinh||QS,acosh:Math.acosh||$S,atanh:Math.atanh||eC,sqrt:Math.sqrt,cbrt:Math.cbrt||EC,log:Math.log,log2:Math.log2||kC,ln:Math.log,lg:Math.log10||tC,log10:Math.log10||tC,expm1:Math.expm1||DC,log1p:Math.log1p||OC,abs:Math.abs,ceil:Math.ceil,floor:Math.floor,round:Math.round,trunc:Math.trunc||iC,"-":nC,"+":Number,exp:Math.exp,not:rC,length:dC,"!":oC,sign:Math.sign||wC},this.binaryOps={"+":PS,"-":FS,"*":IS,"/":LS,"%":RS,"^":Math.pow,"||":zS,"==":BS,"!=":VS,">":HS,"<":US,">=":WS,"<=":GS,and:KS,or:qS,in:JS,"=":hC,"[":gC},this.ternaryOps={"?":pC},this.functions={random:aC,fac:oC,min:vC,max:_C,hypot:Math.hypot||fC,pyt:Math.hypot||fC,pow:Math.pow,atan2:Math.atan2,if:pC,gamma:uC,roundTo:mC,map:yC,fold:bC,filter:xC,indexOf:SC,join:CC,sum:AC},this.consts={E:Math.E,PI:Math.PI,true:!0,false:!1}}jC.prototype.parse=function(e){var t=[],n=new X(this,new Y(this,e),{allowMemberAccess:this.options.allowMemberAccess});return n.parseExpression(t),n.expect(xS,`EOF`),new bS(t,this)},jC.prototype.evaluate=function(e,t){return this.parse(e).evaluate(t)};var MC=new jC;jC.parse=function(e){return MC.parse(e)},jC.evaluate=function(e,t){return MC.parse(e).evaluate(t)};var NC={"+":`add`,"-":`subtract`,"*":`multiply`,"/":`divide`,"%":`remainder`,"^":`power`,"!":`factorial`,"<":`comparison`,">":`comparison`,"<=":`comparison`,">=":`comparison`,"==":`comparison`,"!=":`comparison`,"||":`concatenate`,and:`logical`,or:`logical`,not:`logical`,"?":`conditional`,":":`conditional`,"=":`assignment`,"[":`array`,"()=":`fndef`};function PC(e){return Object.hasOwn(NC,e)?NC[e]:e}jC.prototype.isOperatorEnabled=function(e){var t=PC(e),n=this.options.operators||{};return!(t in n)||!!n[t]};var FC=new jC({allowMemberAccess:!0,operators:{add:!0,subtract:!0,multiply:!0,divide:!0,remainder:!0,comparison:!0,concatenate:!0,conditional:!1,logical:!0,in:!0,length:!0,abs:!0,ceil:!0,floor:!0,round:!0,trunc:!0,power:!1,factorial:!1,assignment:!1,fndef:!1,random:!1,min:!1,max:!1,sin:!1,cos:!1,tan:!1,asin:!1,acos:!1,atan:!1,sinh:!1,cosh:!1,tanh:!1,asinh:!1,acosh:!1,atanh:!1,sqrt:!1,cbrt:!1,log:!1,log2:!1,ln:!1,lg:!1,log10:!1,expm1:!1,log1p:!1,exp:!1,sign:!1}});FC.consts={true:!0,false:!1};var IC=e=>{try{return rx(e).toString()}catch{return e}},LC=({value:e,otherValue:t})=>{if((0,y.isString)(e)&&(0,y.isString)(t)&&Oc(t))return IC(e);if((0,y.isString)(e)&&(0,y.isString)(t)){let r=bb(e),i=bb(t);if(n.t(r)&&n.t(i)&&!r.isDateOnly&&!i.isDateOnly)return r.dateTime.epochNanoseconds}return e},RC=e=>(t,n)=>Jb(t)&&Jb(n)&&e(LC({value:t,otherValue:n}),LC({value:n,otherValue:t})),zC=({left:e,right:t})=>(0,y.isString)(e)&&(0,y.isString)(t)?LC({value:e,otherValue:t})===LC({value:t,otherValue:e}):e===t;FC.binaryOps[`==`]=(e,t)=>zC({left:e,right:t}),FC.binaryOps[`!=`]=(e,t)=>!zC({left:e,right:t}),FC.binaryOps[`<`]=RC((e,t)=>e<t),FC.binaryOps[`<=`]=RC((e,t)=>e<=t),FC.binaryOps[`>`]=RC((e,t)=>e>t),FC.binaryOps[`>=`]=RC((e,t)=>e>=t),FC.binaryOps.in=(e,t)=>Array.isArray(t)&&t.includes(e),FC.functions=Object.fromEntries(Object.entries(Kx).map(([e,{evaluate:t}])=>[e,t]));var BC=nx({compute:e=>FC.parse(e),maxEntries:500}),VC=({now:e,run:t})=>{let n=Hb.current;Hb.current=e;try{return t()}finally{Hb.current=n}},HC=e=>e instanceof Error?e.message:String(e),UC=({expression:e,fields:t})=>{let n;try{n=BC(e)}catch(e){let t=HC(e);return()=>({status:`errored`,errorMessage:t})}let r=n.variables({withMembers:!0}),i=new Map(t.map(e=>[e.name,e]));return({record:e,previousRecord:t,now:a})=>{try{let o=VC({now:a,run:()=>n.evaluate(Wx({record:e,previousRecord:t,fieldByName:i,identifierPaths:r,now:a}))});return typeof o==`boolean`?o?{status:`passed`}:{status:`failed`}:{status:`errored`,errorMessage:`Expression did not return true or false`,errorCode:`NON_BOOLEAN_RESULT`}}catch(e){return e instanceof yc&&(e.code===`INVALID_DATE_UNIT`||e.code===`INVALID_DATE_PART`)?{status:`errored`,errorMessage:e.message,errorCode:e.code}:{status:`errored`,errorMessage:HC(e)}}}},WC=({expression:e,record:t,previousRecord:n,fields:r,now:i})=>UC({expression:e,fields:r})({record:t,previousRecord:n,now:i}),GC=({field:e,subfieldSegments:t,path:r})=>{if(t.length===0)return null;let i=Ix.get(e.type);if(!n.t(i)||t.length>1)return{errorMessage:`"${r}" goes deeper than the field "${e.name}" allows`,errorCode:`SUBFIELD_TOO_DEEP`,errorParams:{path:r,fieldName:e.name}};let a=t[0];return i.properties.some(e=>e.name===a)?null:{errorMessage:`"${a}" is not a subfield of "${e.name}"`,errorCode:`UNKNOWN_SUBFIELD`,errorParams:{subfieldName:a,fieldName:e.name}}},KC=e=>({errorMessage:`"${e}" is not a value`,errorCode:`NOT_A_VALUE`,errorParams:{path:e}}),qC=({path:e,memberSegments:t,fields:r})=>{let[i,...o]=t;if(!n.t(i))return{isResolved:!1,...KC(e)};let s=r.find(e=>e.name===i);if(!n.t(s))return{isResolved:!1,errorMessage:`Unknown field "${i}"`,errorCode:`UNKNOWN_FIELD`,errorParams:{fieldName:i}};if(s.type===a.a.RELATION||s.type===a.a.MORPH_RELATION)return{isResolved:!1,errorMessage:`"${e}" reads a relation, but previous values only cover this record's own fields`,errorCode:`PREVIOUS_VALUE_OF_RELATION`,errorParams:{path:e}};let c=GC({field:s,subfieldSegments:o,path:e});return n.t(c)?{isResolved:!1,...c}:{isResolved:!0,bindings:{[`${Lx}.${i}`]:s.universalIdentifier}}},JC=({path:e,fields:t})=>{let[r,...i]=e.split(`.`);if(!n.t(r))return{isResolved:!1,...KC(e)};if(r===`now`)return i.length===0?{isResolved:!0,bindings:{}}:{isResolved:!1,...KC(e)};if(r===`previous`)return qC({path:e,memberSegments:i,fields:t});let o=t.find(e=>e.name===r);if(!n.t(o))return{isResolved:!1,errorMessage:`Unknown field "${r}"`,errorCode:`UNKNOWN_FIELD`,errorParams:{fieldName:r}};if(!(o.type===a.a.RELATION||o.type===a.a.MORPH_RELATION)){let t=GC({field:o,subfieldSegments:i,path:e});return n.t(t)?{isResolved:!1,...t}:{isResolved:!0,bindings:{[r]:o.universalIdentifier}}}if(o.type===a.a.MORPH_RELATION||o.relationType!==a.i.MANY_TO_ONE||!n.t(o.relationTargetFields))return{isResolved:!1,errorMessage:`"${r}" is not a to-one relation`,errorCode:`NOT_A_TO_ONE_RELATION`,errorParams:{fieldName:r}};let[s,...c]=i;if(!n.t(s))return{isResolved:!0,bindings:{[r]:o.universalIdentifier}};let l=o.relationTargetFields.find(e=>e.name===s);if(!n.t(l))return{isResolved:!1,errorMessage:`Unknown field "${s}" on "${r}"`,errorCode:`UNKNOWN_RELATION_TARGET_FIELD`,errorParams:{fieldName:s,relationFieldName:r}};if(l.type===a.a.RELATION||l.type===a.a.MORPH_RELATION)return{isResolved:!1,errorMessage:`"${e}" goes more than one relation deep`,errorCode:`RELATION_TOO_DEEP`,errorParams:{path:e}};let u=GC({field:l,subfieldSegments:c,path:e});return n.t(u)?{isResolved:!1,...u}:{isResolved:!0,bindings:{[r]:o.universalIdentifier,[`${r}.${s}`]:l.universalIdentifier}}},YC=2e3,XC=({expression:e,fields:t})=>{if(e.trim().length===0)return{isValid:!1,errorMessage:`Expression is empty`,errorCode:`EMPTY_EXPRESSION`};if(e.length>2e3)return{isValid:!1,errorMessage:`Expression is longer than ${YC} characters`,errorCode:`EXPRESSION_TOO_LONG`,errorParams:{maxLength:YC}};let n;try{n=BC(e)}catch(t){return{isValid:!1,...hx({expression:e,error:t})}}if(Gx(n.tokens))return{isValid:!1,errorMessage:`Bracket access is not supported, use dot access instead`,errorCode:`BRACKET_ACCESS`};let r=ux(e).filter(e=>e.type!==`whitespace`),i=r.findIndex((e,t)=>e.type===`symbol`&&e.text===`.`&&r[t-1]?.type===`path`&&r[t+1]?.type===`path`);if(i!==-1){let e=`${r[i-1]?.text}.${r[i+1]?.text}`;return{isValid:!1,errorMessage:`Write ${e} without spaces around the dot`,errorCode:`SPACED_MEMBER_DOT`,errorParams:{path:e}}}let a=n.variables({withMembers:!0}),o={};for(let e of a){let n=JC({path:e,fields:t});if(!n.isResolved)return{isValid:!1,errorMessage:n.errorMessage,errorCode:n.errorCode,errorParams:n.errorParams};o={...o,...n.bindings}}let s=WC({expression:e,record:{},fields:t,now:new Date().toISOString()});return s.status===`errored`?{isValid:!1,errorMessage:s.errorMessage,errorCode:s.errorCode}:{isValid:!0,bindings:o}},ZC=[`AGGREGATE_CHART`,`PIE_CHART`,`BAR_CHART`,`LINE_CHART`],QC=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;function $C(e){return typeof e==`string`&&QC.test(e)}function ew(e){if(!$C(e))throw TypeError(`Invalid UUID`);let t;return Uint8Array.of((t=parseInt(e.slice(0,8),16))>>>24,t>>>16&255,t>>>8&255,t&255,(t=parseInt(e.slice(9,13),16))>>>8,t&255,(t=parseInt(e.slice(14,18),16))>>>8,t&255,(t=parseInt(e.slice(19,23),16))>>>8,t&255,(t=parseInt(e.slice(24,36),16))/1099511627776&255,t/4294967296&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255)}var Z=[];for(let e=0;e<256;++e)Z.push((e+256).toString(16).slice(1));function tw(e,t=0){return(Z[e[t+0]]+Z[e[t+1]]+Z[e[t+2]]+Z[e[t+3]]+`-`+Z[e[t+4]]+Z[e[t+5]]+`-`+Z[e[t+6]]+Z[e[t+7]]+`-`+Z[e[t+8]]+Z[e[t+9]]+`-`+Z[e[t+10]]+Z[e[t+11]]+Z[e[t+12]]+Z[e[t+13]]+Z[e[t+14]]+Z[e[t+15]]).toLowerCase()}function nw(e){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n)t[n]=e.charCodeAt(n);return t}var rw=`6ba7b810-9dad-11d1-80b4-00c04fd430c8`,iw=`6ba7b811-9dad-11d1-80b4-00c04fd430c8`;function aw(e,t,n,r,i,a){let o=typeof n==`string`?nw(n):n,s=typeof r==`string`?ew(r):r;if(typeof r==`string`&&(r=ew(r)),r?.length!==16)throw TypeError(`Namespace must be array-like (16 iterable integer values, 0-255)`);let c=new Uint8Array(16+o.length);if(c.set(s),c.set(o,s.length),c=t(c),c[6]=c[6]&15|e,c[8]=c[8]&63|128,i){if(a||=0,a<0||a+16>i.length)throw RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;++e)i[a+e]=c[e];return i}return tw(c)}function ow(e,t,n,r){switch(e){case 0:return t&n^~t&r;case 1:return t^n^r;case 2:return t&n^t&r^n&r;case 3:return t^n^r}}function sw(e,t){return e<<t|e>>>32-t}function cw(e){let t=[1518500249,1859775393,2400959708,3395469782],n=[1732584193,4023233417,2562383102,271733878,3285377520],r=new Uint8Array(e.length+1);r.set(e),r[e.length]=128,e=r;let i=e.length/4+2,a=Math.ceil(i/16),o=Array(a);for(let t=0;t<a;++t){let n=new Uint32Array(16);for(let r=0;r<16;++r)n[r]=e[t*64+r*4]<<24|e[t*64+r*4+1]<<16|e[t*64+r*4+2]<<8|e[t*64+r*4+3];o[t]=n}o[a-1][14]=(e.length-1)*8/2**32,o[a-1][14]=Math.floor(o[a-1][14]),o[a-1][15]=(e.length-1)*8&4294967295;for(let e=0;e<a;++e){let r=new Uint32Array(80);for(let t=0;t<16;++t)r[t]=o[e][t];for(let e=16;e<80;++e)r[e]=sw(r[e-3]^r[e-8]^r[e-14]^r[e-16],1);let i=n[0],a=n[1],s=n[2],c=n[3],l=n[4];for(let e=0;e<80;++e){let n=Math.floor(e/20),o=sw(i,5)+ow(n,a,s,c)+l+t[n]+r[e]>>>0;l=c,c=s,s=sw(a,30)>>>0,a=i,i=o}n[0]=n[0]+i>>>0,n[1]=n[1]+a>>>0,n[2]=n[2]+s>>>0,n[3]=n[3]+c>>>0,n[4]=n[4]+l>>>0}return Uint8Array.of(n[0]>>24,n[0]>>16,n[0]>>8,n[0],n[1]>>24,n[1]>>16,n[1]>>8,n[1],n[2]>>24,n[2]>>16,n[2]>>8,n[2],n[3]>>24,n[3]>>16,n[3]>>8,n[3],n[4]>>24,n[4]>>16,n[4]>>8,n[4])}function lw(e,t,n,r){return aw(80,cw,e,t,n,r)}lw.DNS=rw,lw.URL=iw;function uw(e){if(!$C(e))throw TypeError(`Invalid UUID`);return parseInt(e.slice(14,15),16)}var dw=`a80ff791-b940-4c47-a522-2bb478515415`,fw=e=>e.type!==a.a.SELECT&&e.type!==a.a.MULTI_SELECT||e.options===void 0||e.options===null?e:{...e,options:e.options.map(t=>({...t,id:t.id??lw(`${t.label}-${e.universalIdentifier}`,dw)}))},pw=({fields:e,labelIdentifierFieldMetadataUniversalIdentifier:t})=>n.t(t)&&!e.some(e=>e.universalIdentifier===t),mw=`front-component-shared-dependencies.mjs`,hw=({objectMetadataApplicationUniversalIdentifier:e,viewUniversalIdentifier:t,name:n})=>a.n({entityNamespace:`viewFieldGroup`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),gw=({fieldMetadataApplicationUniversalIdentifier:e,viewUniversalIdentifier:t,fieldMetadataUniversalIdentifier:n})=>a.n({entityNamespace:`viewField`,value:`${t}:${n}`,applicationUniversalIdentifier:e}),_w={default:{w:4,h:4},minimum:{w:2,h:2}},vw=({pageLayoutTabManifest:e,pageLayoutType:t})=>{let r=e.layoutMode??(t===o.c.STANDALONE_PAGE?o.l.VERTICAL_LIST:o.l.GRID),a=e.widgets??[],s=[];if(!Object.values(o.l).some(e=>e===r))return{status:`fail`,errors:[`Page layout tab "${e.title}" defines unsupported layoutMode "${r}". Expected GRID, VERTICAL_LIST or CANVAS.`]};for(let t of a){let a=[t.heightBehavior,i.t(t.position)&&`heightBehavior`in t.position?t.position.heightBehavior:void 0].filter(n.t);a.length>0&&r!==o.l.VERTICAL_LIST&&s.push(`Page layout widget "${t.title}" defines heightBehavior, but its parent tab "${e.title}" uses ${r}. heightBehavior is only supported for VERTICAL_LIST tabs.`);for(let e of a)Object.values(Zb).some(t=>t===e)||s.push(`Page layout widget "${t.title}" defines unsupported heightBehavior "${e}". Expected FIT_CONTENT or TAB_VIEWPORT.`)}if(s.length>0)return{status:`fail`,errors:s};let c={...e,layoutMode:r,widgets:a.map(({heightBehavior:e,position:t,gridPosition:i,...a},s)=>{if(n.t(t))return{...a,position:t.layoutMode===o.l.VERTICAL_LIST&&n.t(e)?{...t,heightBehavior:e}:t};if(n.t(i))return{...a,position:{layoutMode:o.l.GRID,...i}};switch(r){case o.l.GRID:return{...a,position:{layoutMode:r,row:0,column:0,rowSpan:_w.default.h,columnSpan:_w.default.w}};case o.l.VERTICAL_LIST:return{...a,position:{layoutMode:r,index:s,...n.t(e)?{heightBehavior:e}:{}}};case o.l.CANVAS:return{...a,position:{layoutMode:r}};default:return ne(r)}})};for(let e of c.widgets)e.position.layoutMode!==r&&s.push(`Page layout widget "${e.title}" uses a ${e.position.layoutMode} position, but its parent tab "${c.title}" uses ${r}.`);if(r===o.l.VERTICAL_LIST){let e=c.widgets.filter(({type:e,position:t})=>t.layoutMode===o.l.VERTICAL_LIST&&Qb({widgetType:e,heightBehavior:t.heightBehavior})===Zb.TAB_VIEWPORT);e.length>1&&s.push(`Page layout tab "${c.title}" can contain only one TAB_VIEWPORT widget.`);let t=e.length===1?e[0]:void 0;n.t(t)&&c.widgets.some(e=>e!==t&&e.position.layoutMode===o.l.VERTICAL_LIST&&t.position.layoutMode===o.l.VERTICAL_LIST&&e.position.index>=t.position.index)&&s.push(`Page layout tab "${c.title}" must place its TAB_VIEWPORT widget last.`)}return s.length>0?{status:`fail`,errors:s}:{status:`success`,pageLayoutTab:c}},yw=[`canReadObjectRecords`,`canUpdateObjectRecords`,`canSoftDeleteObjectRecords`,`canDestroyObjectRecords`];[...yw];var bw={canReadObjectRecords:`canReadAllObjectRecords`,canUpdateObjectRecords:`canUpdateAllObjectRecords`,canSoftDeleteObjectRecords:`canSoftDeleteAllObjectRecords`,canDestroyObjectRecords:`canDestroyAllObjectRecords`},xw=({role:e,objectUniversalIdentifier:t})=>{let n=e.objectPermissions?.find(e=>e.objectUniversalIdentifier===t);return{canReadObjectRecords:n?.canReadObjectRecords??e[bw.canReadObjectRecords]??!1,canUpdateObjectRecords:n?.canUpdateObjectRecords??e[bw.canUpdateObjectRecords]??!1,canSoftDeleteObjectRecords:n?.canSoftDeleteObjectRecords??e[bw.canSoftDeleteObjectRecords]??!1,canDestroyObjectRecords:n?.canDestroyObjectRecords??e[bw.canDestroyObjectRecords]??!1}},Sw=e=>JSON.stringify(e,(e,t)=>i.t(t)?Object.fromEntries(Object.entries(t).sort(([e],[t])=>e.localeCompare(t))):t),Cw=({groupsByUniversalIdentifier:e,predicateGroupUniversalIdentifier:t})=>{let r=[],i=new Set,a=t;for(;n.t(a)&&!i.has(a);){i.add(a);let t=e.get(a);if(!n.t(t))break;r.push(t.logicalOperator),a=t.parentPredicateGroupUniversalIdentifier}return r},ww=({role:e,objectUniversalIdentifier:t})=>{let n=new Map((e.rowLevelPermissionPredicateGroups??[]).map(e=>[e.universalIdentifier,e]));return(e.rowLevelPermissionPredicates??[]).filter(e=>e.objectUniversalIdentifier===t).map(e=>Sw({fieldUniversalIdentifier:e.fieldUniversalIdentifier,subFieldName:e.subFieldName??null,operand:e.operand,value:e.value??null,workspaceMemberFieldUniversalIdentifier:e.workspaceMemberFieldUniversalIdentifier??null,workspaceMemberSubFieldName:e.workspaceMemberSubFieldName??null,groupOperatorPath:Cw({groupsByUniversalIdentifier:n,predicateGroupUniversalIdentifier:e.predicateGroupUniversalIdentifier})})).sort()},Tw=function(e){return e.API_KEYS_AND_WEBHOOKS=`API_KEYS_AND_WEBHOOKS`,e.WORKSPACE=`WORKSPACE`,e.WORKSPACE_MEMBERS=`WORKSPACE_MEMBERS`,e.ROLES=`ROLES`,e.DATA_MODEL=`DATA_MODEL`,e.SECURITY=`SECURITY`,e.WORKFLOWS=`WORKFLOWS`,e.IMPERSONATE=`IMPERSONATE`,e.SSO_BYPASS=`SSO_BYPASS`,e.APPLICATIONS=`APPLICATIONS`,e.MARKETPLACE_APPS=`MARKETPLACE_APPS`,e.LAYOUTS=`LAYOUTS`,e.BILLING=`BILLING`,e.AI_SETTINGS=`AI_SETTINGS`,e.AI=`AI`,e.VIEWS=`VIEWS`,e.UPLOAD_FILE=`UPLOAD_FILE`,e.DOWNLOAD_FILE=`DOWNLOAD_FILE`,e.SEND_EMAIL_TOOL=`SEND_EMAIL_TOOL`,e.CREATE_CALENDAR_EVENT_TOOL=`CREATE_CALENDAR_EVENT_TOOL`,e.HTTP_REQUEST_TOOL=`HTTP_REQUEST_TOOL`,e.CODE_INTERPRETER_TOOL=`CODE_INTERPRETER_TOOL`,e.IMPORT_CSV=`IMPORT_CSV`,e.EXPORT_CSV=`EXPORT_CSV`,e.CONNECTED_ACCOUNTS=`CONNECTED_ACCOUNTS`,e.PROFILE_INFORMATION=`PROFILE_INFORMATION`,e.READ_PRIVATE_CHANNELS=`READ_PRIVATE_CHANNELS`,e}({}),Ew=[Tw.AI,Tw.VIEWS,Tw.UPLOAD_FILE,Tw.DOWNLOAD_FILE,Tw.SEND_EMAIL_TOOL,Tw.CREATE_CALENDAR_EVENT_TOOL,Tw.HTTP_REQUEST_TOOL,Tw.IMPORT_CSV,Tw.EXPORT_CSV,Tw.CONNECTED_ACCOUNTS,Tw.PROFILE_INFORMATION,Tw.CODE_INTERPRETER_TOOL].map(e=>o.r[e]),Dw=({roleSignature:e,supersetSignature:t})=>e.length===t.length&&e.every((e,n)=>e===t[n]),Ow=({role:e,superset:t})=>[...yw.filter(n=>{let r=bw[n];return e[r]&&!t[r]}).map(e=>({type:`ALL_OBJECT_RECORDS`,action:e})),...e.canUpdateAllSettings&&!t.canUpdateAllSettings?[{type:`ALL_SETTINGS`}]:[],...e.canAccessAllTools&&!t.canAccessAllTools?[{type:`ALL_TOOLS`}]:[]],kw=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>{let r=new Set([...Ew,...n]),i=new Set(t.permissionFlagUniversalIdentifiers??[]);return[...new Set(e.permissionFlagUniversalIdentifiers??[])].filter(e=>!(r.has(e)?t.canAccessAllTools:t.canUpdateAllSettings)&&!i.has(e)).map(e=>({type:`PERMISSION_FLAG`,permissionFlagUniversalIdentifier:e}))},Aw=({role:e,superset:t})=>[...new Set([...[...e.objectPermissions??[],...t.objectPermissions??[]].map(e=>e.objectUniversalIdentifier),...(t.rowLevelPermissionPredicates??[]).map(e=>e.objectUniversalIdentifier)])].flatMap(n=>{let r=xw({role:e,objectUniversalIdentifier:n}),i=xw({role:t,objectUniversalIdentifier:n}),a=yw.filter(e=>r[e]&&!i[e]).map(e=>({type:`OBJECT_RECORDS`,objectUniversalIdentifier:n,action:e})),o=yw.some(e=>r[e]),s=ww({role:t,objectUniversalIdentifier:n}),c=ww({role:e,objectUniversalIdentifier:n});return o&&s.length>0&&!Dw({roleSignature:c,supersetSignature:s})?[...a,{type:`ROW_LEVEL_RESTRICTION`,objectUniversalIdentifier:n}]:a}),jw=({role:e,superset:t})=>(t.fieldPermissions??[]).flatMap(t=>{let{objectUniversalIdentifier:n,fieldUniversalIdentifier:r}=t,i=xw({role:e,objectUniversalIdentifier:n}),a=e.fieldPermissions?.find(e=>e.objectUniversalIdentifier===n&&e.fieldUniversalIdentifier===r),o=t.canReadFieldValue===!1&&i.canReadObjectRecords&&a?.canReadFieldValue!==!1,s=t.canUpdateFieldValue===!1&&i.canUpdateObjectRecords&&a?.canUpdateFieldValue!==!1;return[...o?[{type:`FIELD_VALUE`,objectUniversalIdentifier:n,fieldUniversalIdentifier:r,action:`canReadFieldValue`}]:[],...s?[{type:`FIELD_VALUE`,objectUniversalIdentifier:n,fieldUniversalIdentifier:r,action:`canUpdateFieldValue`}]:[]]}),Mw=({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n})=>[...Ow({role:e,superset:t}),...kw({role:e,superset:t,toolPermissionFlagUniversalIdentifiers:n}),...Aw({role:e,superset:t}),...jw({role:e,superset:t})],Nw=({objectConfig:e,applicationUniversalIdentifier:t})=>({name:`name`,label:`Name`,description:`Name`,icon:`IconAbc`,isNullable:!0,defaultValue:null,type:a.a.TEXT,universalIdentifier:a.t({applicationUniversalIdentifier:t,objectUniversalIdentifier:e.universalIdentifier,name:`name`})}),Pw=({objectConfig:e,applicationUniversalIdentifier:t})=>{let n=(e.fields??[]).map(e=>e.name),r=[...e.fields??[]],i=Nw({objectConfig:e,applicationUniversalIdentifier:t}),a=pw({fields:e.fields??[],labelIdentifierFieldMetadataUniversalIdentifier:e.labelIdentifierFieldMetadataUniversalIdentifier});return!n.includes(i.name)&&!a&&r.push(i),{objectFields:r}},Fw=({objectConfig:e,applicationUniversalIdentifier:t})=>{let{objectFields:n}=Pw({objectConfig:e,applicationUniversalIdentifier:t}),r=e.labelIdentifierFieldMetadataUniversalIdentifier??n.find(e=>e.name===`name`)?.universalIdentifier;return r?{objectManifest:{...e,fields:n.map(fw),labelIdentifierFieldMetadataUniversalIdentifier:r},errors:[]}:{objectManifest:null,errors:[`No label identifier field found for object ${e.nameSingular}. Please add a field with name "name" to your object.`]}},Iw={type:`object`,properties:{}},Lw=e=>{let t={type:`unknown`};switch(e.type){case`string`:t.type=`string`;break;case`number`:case`integer`:t.type=`number`;break;case`boolean`:t.type=`boolean`;break;case`array`:t.type=`array`,e.items&&(t.items=Lw(e.items));break;case`object`:t.type=`object`,e.properties&&(t.properties=Object.fromEntries(Object.entries(e.properties).map(([e,t])=>[e,Lw(t)])));break;case`record`:t.type=`record`;break;case`records`:t.type=`records`;break;default:t.type=`unknown`}return Array.isArray(e.enum)&&(t.enum=e.enum.filter(e=>typeof e==`string`)),e.multiline===!0&&(t.multiline=!0),(0,y.isNonEmptyString)(e.label)&&(t.label=e.label),(0,y.isNonEmptyString)(e.objectUniversalIdentifier)&&(t.objectUniversalIdentifier=e.objectUniversalIdentifier),t},Rw=e=>[Lw(e)],zw=async e=>{let{getFunctionInputSchema:t}=await Promise.resolve().then(()=>require("./get-function-input-schema-ClPQURr8.cjs")),r=t(e)[0];return r?.type===`object`&&n.t(r.properties)?{type:`object`,properties:r.properties}:Iw},Bw=async({logicFunctionConfig:e,sourceCode:t,sourcePath:n})=>{let{handler:r,...i}=e,a=i.toolTriggerSettings&&!i.toolTriggerSettings.inputSchema||i.workflowActionTriggerSettings&&!i.workflowActionTriggerSettings.inputSchema?await zw(t):null,o=i.toolTriggerSettings?{...i.toolTriggerSettings,inputSchema:i.toolTriggerSettings.inputSchema??a??void 0}:void 0,s=i.workflowActionTriggerSettings?{...i.workflowActionTriggerSettings,inputSchema:i.workflowActionTriggerSettings.inputSchema??(a?Rw(a):void 0)}:void 0;return{...i,...o?{toolTriggerSettings:o}:{},...s?{workflowActionTriggerSettings:s}:{},handlerName:`default.config.handler`,sourceHandlerPath:n,builtHandlerPath:n.replace(/\.tsx?$/,`.mjs`),builtHandlerChecksum:`[default-checksum]`}},Vw=({frontComponentConfig:e,sourcePath:t})=>{let{component:n,...r}=e;return{...r,componentName:n.name,sourceComponentPath:t,builtComponentPath:t.replace(/\.tsx?$/,`.mjs`),builtComponentChecksum:``,isHeadless:r.isHeadless??!1}},Hw=({roleConfig:e,applicationUniversalIdentifier:t})=>{let{recordsPermissions:r}=e;return n.t(r)?{...e,recordsPermissions:{...r,...n.t(r.objects)?{objects:r.objects.map(n=>({...n,universalIdentifier:n.universalIdentifier??o.o({applicationUniversalIdentifier:t,roleUniversalIdentifier:e.universalIdentifier,objectUniversalIdentifier:n.objectUniversalIdentifier})}))}:{}},permissionFlagUniversalIdentifiers:e.permissionFlagUniversalIdentifiers??[]}:{...e,objectPermissions:(e.objectPermissions??[]).map(n=>({...n,universalIdentifier:n.universalIdentifier??o.o({applicationUniversalIdentifier:t,roleUniversalIdentifier:e.universalIdentifier,objectUniversalIdentifier:n.objectUniversalIdentifier})})),fieldPermissions:(e.fieldPermissions??[]).map(n=>({...n,universalIdentifier:n.universalIdentifier??o.s({applicationUniversalIdentifier:t,roleUniversalIdentifier:e.universalIdentifier,fieldUniversalIdentifier:n.fieldUniversalIdentifier})})),rowLevelPermissionPredicateGroups:e.rowLevelPermissionPredicateGroups??[],rowLevelPermissionPredicates:e.rowLevelPermissionPredicates??[],permissionFlagUniversalIdentifiers:e.permissionFlagUniversalIdentifiers??[]}},Uw=[`react`,`react-dom`,`react-dom/client`,`react/jsx-runtime`],Ww=[`twenty-ui/primitives/input`,`twenty-ui/primitives/data-display`,`twenty-ui/primitives/feedback`,`twenty-ui/primitives/layout`,`twenty-ui/primitives/navigation`,`twenty-ui/primitives/surfaces`,`twenty-ui/primitives/typography`,`twenty-ui/components/input`,`twenty-ui/icon`,`twenty-ui/theme`,`twenty-ui/style.css`,`twenty-ui/theme-light.css`],Gw=[...Uw,...Ww],Kw=({dependencies:e,packageNames:t=[]})=>{let n=new Set([...e,...Gw.filter(e=>t.some(t=>e===t||e.startsWith(`${t}/`)))]);return n.has(`react`)&&n.add(`react/jsx-runtime`),[...n].sort()},qw=[`twenty-client-sdk`,`twenty-sdk`],Jw=e=>{if(e===void 0)return{errors:[]};if(!Array.isArray(e))return{errors:[`"frontComponentSharedDependencies" in package.json must be an array of package specifiers`]};if(!(0,y.isNonEmptyArray)(e))return{errors:[]};let t=[],n=new Set;for(let r of e){if(!(0,y.isNonEmptyString)(r)){t.push(`"frontComponentSharedDependencies" entries in package.json must be non-empty strings`);continue}if(r.startsWith(`.`)||g.default.posix.isAbsolute(r)||g.default.win32.isAbsolute(r)){t.push(`Shared dependency "${r}" must be a package specifier, not a relative or absolute path`);continue}if(r===`twenty:front-component-shared-dependencies`){t.push(`Shared dependency "${r}" is reserved and cannot be shared`);continue}if(qw.some(e=>r===e||r.startsWith(`${e}/`))){t.push(`Shared dependency "${r}" is already served separately and cannot be shared`);continue}if(n.has(r)){t.push(`Shared dependency "${r}" is declared twice`);continue}n.add(r)}return(0,y.isNonEmptyArray)(t)?{errors:t}:{dependencies:Kw({dependencies:[...n]}),errors:[]}},Yw=async e=>{let t=v.default.join(e,`package.json`);if(!await l.i(t))return{errors:[]};let{dependencies:r,errors:i}=Jw((await l.a(t)).frontComponentSharedDependencies);return n.t(r)?{sharedDependencies:{dependencies:r,builtPath:mw,builtChecksum:null},errors:[]}:{errors:i}},Xw=`pageType.isInSidePanel.isDashboardPageLayoutInEditMode.isLayoutCustomizationModeEnabled.favoriteRecordIds.isSelectAll.hasAnySoftDeleteFilterOnView.numberOfSelectedRecords.objectPermissions.selectedRecords.featureFlags.targetObjectReadPermissions.targetObjectWritePermissions.canImpersonate.canAccessFullAdminPanel.objectMetadataItem.objectMetadataLabel.currentView.isDefined.isNonEmptyString.includes.every.everyDefined.everyEquals.some.someDefined.someEquals.none.noneDefined.noneEquals.someNonEmptyString.includesEvery`.split(`.`),Zw=`conditionalAvailabilityExpression`,Qw=[`twenty-sdk/define`,`twenty-sdk`],$w=new Set(Xw),eT=(e,t)=>{let r=[];for(let i of e.statements){if(!_.default.isImportDeclaration(i)||!_.default.isStringLiteral(i.moduleSpecifier)||!Qw.includes(i.moduleSpecifier.text))continue;let a=i.importClause;if(!n.t(a)||a.phaseModifier===_.default.SyntaxKind.TypeKeyword)continue;let o=a.namedBindings;if(n.t(o)){if(_.default.isNamespaceImport(o)){let n=t.getSymbolAtLocation(o.name),i=e=>{_.default.isImportDeclaration(e)||_.default.isTypeNode(e)||(_.default.isPropertyAccessExpression(e)&&_.default.isIdentifier(e.expression)&&t.getSymbolAtLocation(e.expression)===n&&$w.has(e.name.text)&&r.push({importedName:e.name.text,node:e}),_.default.forEachChild(e,i))};i(e);continue}if(_.default.isNamedImports(o))for(let i of o.elements){if(i.isTypeOnly)continue;let a=(i.propertyName??i.name).text;if($w.has(a)){let o=t.getSymbolAtLocation(i.name),s,c=e=>{if(!(n.t(s)||_.default.isImportDeclaration(e)||_.default.isTypeNode(e))){if(_.default.isIdentifier(e)){let r=_.default.isShorthandPropertyAssignment(e.parent)?t.getShorthandAssignmentValueSymbol(e.parent):t.getSymbolAtLocation(e);n.t(o)&&r===o&&(s=e)}_.default.forEachChild(e,c)}};c(e),n.t(s)&&r.push({importedName:a,node:s})}}}}return r},tT=e=>{let t=!1,n=e=>{if(!t){if((_.default.isPropertyAssignment(e)||_.default.isShorthandPropertyAssignment(e))&&(_.default.isIdentifier(e.name)||_.default.isStringLiteral(e.name))&&e.name.text===Zw){t=!0;return}_.default.forEachChild(e,n)}};return n(e),t},nT=(e,t)=>{if(!Xw.some(t=>e.includes(t)))return[];let n=_.default.createSourceFile(t,e,_.default.ScriptTarget.Latest,!0,t.endsWith(`.tsx`)?_.default.ScriptKind.TSX:_.default.ScriptKind.TS);if(tT(n))return[];let r={noLib:!0,noResolve:!0},i=_.default.createCompilerHost(r);return i.getSourceFile=e=>e===n.fileName?n:void 0,eT(n,_.default.createProgram([n.fileName],r,i).getTypeChecker()).map(({importedName:e,node:r})=>{let{line:i,character:a}=n.getLineAndCharacterOfPosition(r.getStart(n));return`${t}:${i+1}:${a+1} - "${e}" is a conditional-availability expression variable from twenty-sdk but this file has no ${Zw}. These variables can only be used inside a command's ${Zw}, not at runtime.`})},rT={id:a.a.UUID,createdAt:a.a.DATE_TIME,updatedAt:a.a.DATE_TIME,deletedAt:a.a.DATE_TIME,createdBy:a.a.ACTOR,updatedBy:a.a.ACTOR,position:a.a.POSITION},Q=({objectUniversalIdentifier:e,fields:t,viewFieldNames:n})=>{let r=o.i({objectMetadataApplicationUniversalIdentifier:d.t,objectUniversalIdentifier:e,viewKey:o.a.INDEX});return{universalIdentifier:r,viewFields:Object.fromEntries(n.map(n=>{let i=t[n];if(i===void 0)throw Error(`Missing field "${n}" for the INDEX view of object ${e}`);return[n,{universalIdentifier:gw({fieldMetadataApplicationUniversalIdentifier:d.t,viewUniversalIdentifier:r,fieldMetadataUniversalIdentifier:i.universalIdentifier})}]}))}},$=({objectUniversalIdentifier:e,fields:t,viewFieldNames:n,viewFieldGroupNames:r})=>{let i=o.i({objectMetadataApplicationUniversalIdentifier:d.t,objectUniversalIdentifier:e,viewKey:o.a.FIELDS_WIDGET});return{universalIdentifier:i,viewFields:Object.fromEntries(n.map(n=>{let r=t[n];if(r===void 0)throw Error(`Missing field "${n}" for the record-page view of object ${e}`);return[n,{universalIdentifier:gw({fieldMetadataApplicationUniversalIdentifier:d.t,viewUniversalIdentifier:i,fieldMetadataUniversalIdentifier:r.universalIdentifier})}]})),viewFieldGroups:Object.fromEntries(Object.entries(r).map(([e,t])=>[e,{universalIdentifier:hw({objectMetadataApplicationUniversalIdentifier:d.t,viewUniversalIdentifier:i,name:t})}]))}},iT={attachment:{universalIdentifier:o.n.attachment,fields:o.t.attachment,morphIds:{targetMorphId:{morphId:o.t.attachment.target.universalIdentifier}},indexes:{taskIdIndex:{universalIdentifier:`b8d4f9a3-0c25-4e7b-9f6a-2d3e4c5b6f70`},noteIdIndex:{universalIdentifier:`9d31ea73-13b6-4e06-84ee-c66c72bf7787`},personIdIndex:{universalIdentifier:`55637a5a-1edc-4351-8d76-d40020bf8944`},companyIdIndex:{universalIdentifier:`4137ba06-184d-438f-b484-080f02a97659`},opportunityIdIndex:{universalIdentifier:`8cc162d1-c127-4981-878d-f78622f8f12d`},dashboardIdIndex:{universalIdentifier:`c10eba2d-ff1a-4eab-9285-50481c12a003`},agentChatThreadIdIndex:{universalIdentifier:`69857371-6ff9-48fa-a9de-db4f71593431`},messageIdIndex:{universalIdentifier:`83c77988-2dc4-4575-bac5-f0f50c05568e`}},views:{allAttachments:Q({objectUniversalIdentifier:o.n.attachment,fields:o.t.attachment,viewFieldNames:[`name`,`file`,`createdBy`,`createdAt`,`targetPerson`,`targetCompany`,`targetOpportunity`,`targetTask`,`targetNote`,`targetDashboard`]}),attachmentRecordPageFields:$({objectUniversalIdentifier:o.n.attachment,fields:o.t.attachment,viewFieldNames:[`createdBy`,`createdAt`],viewFieldGroupNames:{}})}},blocklist:{universalIdentifier:o.n.blocklist,fields:o.t.blocklist,indexes:{workspaceMemberIdIndex:{universalIdentifier:`4daf320e-74d0-4f24-a45a-af3a09d741cb`}},views:{allBlocklists:Q({objectUniversalIdentifier:o.n.blocklist,fields:o.t.blocklist,viewFieldNames:[`handle`,`workspaceMember`,`createdAt`]}),blocklistRecordPageFields:$({objectUniversalIdentifier:o.n.blocklist,fields:o.t.blocklist,viewFieldNames:[`workspaceMember`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},calendarChannelEventAssociation:{universalIdentifier:o.n.calendarChannelEventAssociation,fields:o.t.calendarChannelEventAssociation,indexes:{calendarChannelIdIndex:{universalIdentifier:`ff6b86c1-3112-4dfa-b734-c4789111a716`},calendarEventIdIndex:{universalIdentifier:`47a3c8d2-9f14-4b6e-8c5d-1a2b3f4e5c69`},eventExternalIdIndex:{universalIdentifier:`b14d63d0-c1ab-470f-927d-9c0c05277caa`}},views:{allCalendarChannelEventAssociations:Q({objectUniversalIdentifier:o.n.calendarChannelEventAssociation,fields:o.t.calendarChannelEventAssociation,viewFieldNames:[`calendarChannelId`,`calendarEvent`,`eventExternalId`,`createdAt`]}),calendarChannelEventAssociationRecordPageFields:$({objectUniversalIdentifier:o.n.calendarChannelEventAssociation,fields:o.t.calendarChannelEventAssociation,viewFieldNames:[`calendarChannelId`,`calendarEvent`,`eventExternalId`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},calendarEventParticipant:{universalIdentifier:o.n.calendarEventParticipant,fields:o.t.calendarEventParticipant,indexes:{calendarEventIdIndex:{universalIdentifier:`c458ad97-8b95-43de-9003-88eb68576049`},personIdIndex:{universalIdentifier:`30e9b75a-881f-4a85-aaf1-f2d2464be1cf`},workspaceMemberIdIndex:{universalIdentifier:`898aa202-428f-4a7a-a3b3-8f0a17a6658e`}},views:{allCalendarEventParticipants:Q({objectUniversalIdentifier:o.n.calendarEventParticipant,fields:o.t.calendarEventParticipant,viewFieldNames:[`calendarEvent`,`handle`,`displayName`,`isOrganizer`,`responseStatus`,`person`,`workspaceMember`,`createdAt`]}),calendarEventParticipantRecordPageFields:$({objectUniversalIdentifier:o.n.calendarEventParticipant,fields:o.t.calendarEventParticipant,viewFieldNames:[`calendarEvent`,`handle`,`displayName`,`isOrganizer`,`responseStatus`,`person`,`workspaceMember`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},calendarEvent:{universalIdentifier:o.n.calendarEvent,fields:o.t.calendarEvent,indexes:{iCalUidIndex:{universalIdentifier:`e38d1418-f994-4f0d-b0cd-41d4da240ea0`}},views:{allCalendarEvents:Q({objectUniversalIdentifier:o.n.calendarEvent,fields:o.t.calendarEvent,viewFieldNames:[`title`,`startsAt`,`endsAt`,`isFullDay`,`location`,`conferenceLink`,`isCanceled`,`createdAt`]}),calendarEventRecordPageFields:$({objectUniversalIdentifier:o.n.calendarEvent,fields:o.t.calendarEvent,viewFieldNames:[`title`,`startsAt`,`endsAt`,`isFullDay`,`isCanceled`,`conferenceLink`,`location`,`description`,`calendarEventTargets`,`externalCreatedAt`,`externalUpdatedAt`,`iCalUid`,`conferenceSolution`],viewFieldGroupNames:{general:`General`,system:`System`}})}},calendarEventTarget:{universalIdentifier:o.n.calendarEventTarget,fields:o.t.calendarEventTarget,morphIds:{targetMorphId:{morphId:o.t.calendarEventTarget.target.universalIdentifier}},indexes:{calendarEventIdIndex:{universalIdentifier:`ce1c180c-0236-4673-ad1d-359dddf59f93`},personIdIndex:{universalIdentifier:`f151bc84-ba45-40cb-b064-02ef359ac17b`},companyIdIndex:{universalIdentifier:`30413277-505d-4f08-be38-a56257460f9f`},opportunityIdIndex:{universalIdentifier:`7920092d-281f-473a-8ea4-53c209b36a37`},calendarEventPersonUniqueIndex:{universalIdentifier:`15b9e394-d451-4186-aaf0-612f6be1ea91`},calendarEventCompanyUniqueIndex:{universalIdentifier:`3fa22398-6e7d-47a5-95eb-4971f9d62135`},calendarEventOpportunityUniqueIndex:{universalIdentifier:`c8183b17-5dfe-4e02-8d9d-aef8e54ef07d`}},views:{}},callRecording:{universalIdentifier:o.n.callRecording,fields:o.t.callRecording,indexes:{calendarEventIdIndex:{universalIdentifier:`8be3cc47-9352-4a1b-ad19-bb186bc0865d`}},views:{allCallRecordings:Q({objectUniversalIdentifier:o.n.callRecording,fields:o.t.callRecording,viewFieldNames:[`status`,`recordingRequestStatus`,`title`,`startedAt`]}),callRecordingRecordPageFields:$({objectUniversalIdentifier:o.n.callRecording,fields:o.t.callRecording,viewFieldNames:[`title`,`status`,`recordingRequestStatus`,`startedAt`,`endedAt`,`video`,`audio`,`transcript`,`summary`],viewFieldGroupNames:{general:`General`}})}},company:{universalIdentifier:o.n.company,fields:o.t.company,indexes:{accountOwnerIdIndex:{universalIdentifier:`ec2ebfc9-0c9b-4597-a87d-aa295e2d8bfe`},domainNameUniqueIndex:{universalIdentifier:`dd300c61-f422-467a-91f4-de4f83c4175b`},searchVectorGinIndex:{universalIdentifier:`c3eb62df-2cc1-4cc3-b7aa-e96a4d65c633`}},views:{allCompanies:Q({objectUniversalIdentifier:o.n.company,fields:o.t.company,viewFieldNames:[`name`,`domainName`,`createdBy`,`accountOwner`,`createdAt`,`linkedinLink`,`address`]}),companyRecordPageFields:$({objectUniversalIdentifier:o.n.company,fields:o.t.company,viewFieldNames:[`domainName`,`accountOwner`,`annualRevenue`,`linkedinLink`,`address`,`createdAt`,`createdBy`,`updatedAt`,`updatedBy`,`people`,`taskTargets`,`noteTargets`,`opportunities`,`attachments`,`timelineActivities`],viewFieldGroupNames:{general:`General`,business:`Business`,contact:`Contact`,system:`System`}})}},dashboard:{universalIdentifier:o.n.dashboard,fields:o.t.dashboard,indexes:{searchVectorGinIndex:{universalIdentifier:`e69f71aa-de0f-4b70-845f-7a8369c47928`}},views:{allDashboards:Q({objectUniversalIdentifier:o.n.dashboard,fields:o.t.dashboard,viewFieldNames:[`title`,`createdBy`,`createdAt`,`updatedAt`]})}},messageCampaign:{universalIdentifier:o.n.messageCampaign,fields:o.t.messageCampaign,indexes:{unsubscribeTopicIdIndex:{universalIdentifier:`efe8c20e-d12b-4475-969e-e86e0bbfe444`},listIdIndex:{universalIdentifier:`17bffd6a-714a-458d-a547-f9e2183d9520`},searchVectorGinIndex:{universalIdentifier:`975823ad-9b97-4f39-b2c7-fbd7d77f4bd1`}},views:{allMessageCampaigns:Q({objectUniversalIdentifier:o.n.messageCampaign,fields:o.t.messageCampaign,viewFieldNames:[`name`,`subject`,`status`,`list`,`fromAddress`,`scheduledAt`,`sentAt`,`recipients`,`createdAt`]}),messageCampaignList:{universalIdentifier:`99ca5417-e5e0-4fd4-8e64-67acd7b21e25`,viewFields:{name:{universalIdentifier:`fcda0c3b-7ee3-40dd-b280-da3ff4da5452`},subject:{universalIdentifier:`700087d2-bd10-4ab9-b8a9-b0710146927c`},status:{universalIdentifier:`ff29b192-5a52-42a1-8a1e-1a03d26f5464`},list:{universalIdentifier:`8e28bc70-eaa0-4768-bb13-606571e65ac8`},fromAddress:{universalIdentifier:`b9798ecc-de06-4717-8b42-057181437dbc`},scheduledAt:{universalIdentifier:`caba5417-964d-416c-a5a9-b64ef71e5964`},sentAt:{universalIdentifier:`9d546249-b029-4b01-8389-65a88ae583c8`},recipients:{universalIdentifier:`e065a2d1-1352-4869-b527-58e3c37557c0`},createdAt:{universalIdentifier:`27548f0a-5ed4-4412-b23a-718b99eb697e`}}},messageCampaignRecordPageFields:$({objectUniversalIdentifier:o.n.messageCampaign,fields:o.t.messageCampaign,viewFieldNames:[`status`,`scheduledAt`,`sentAt`,`sentCount`,`deliveredCount`,`failedCount`,`skippedCount`,`bouncedCount`,`complainedCount`,`uniqueClickCount`,`clickRate`,`uniqueOpenCount`,`openRate`],viewFieldGroupNames:{stats:`Stats`}})}},messageList:{universalIdentifier:o.n.messageList,fields:o.t.messageList,indexes:{searchVectorGinIndex:{universalIdentifier:`8e205171-ed74-4620-b7d2-674aab85033a`}},views:{allMessageLists:Q({objectUniversalIdentifier:o.n.messageList,fields:o.t.messageList,viewFieldNames:[`name`,`description`,`members`,`campaigns`,`createdAt`]})}},messageListMember:{universalIdentifier:o.n.messageListMember,fields:o.t.messageListMember,indexes:{listIdIndex:{universalIdentifier:`61188470-6dcb-4b2a-b1a9-baeb688bccae`},personListUniqueIndex:{universalIdentifier:`e5497dc2-1d72-418c-a389-a0645ca0195a`}},views:{allMessageListMembers:Q({objectUniversalIdentifier:o.n.messageListMember,fields:o.t.messageListMember,viewFieldNames:[`id`,`person`,`list`,`createdAt`]})}},messageChannelMessageAssociation:{universalIdentifier:o.n.messageChannelMessageAssociation,fields:o.t.messageChannelMessageAssociation,indexes:{messageChannelIdIndex:{universalIdentifier:`9894f9a3-0225-4e7b-9f6a-23d4e2576784`},messageIdIndex:{universalIdentifier:`9bb24d40-60dd-4beb-8c64-a74e8c67f9ee`},messageChannelIdMessageIdUniqueIndex:{universalIdentifier:`1b86ece8-7ce3-4df3-8771-fd4b5d45b2f2`}},views:{allMessageChannelMessageAssociations:Q({objectUniversalIdentifier:o.n.messageChannelMessageAssociation,fields:o.t.messageChannelMessageAssociation,viewFieldNames:[`messageChannelId`,`message`,`messageExternalId`,`direction`,`createdAt`]}),messageChannelMessageAssociationRecordPageFields:$({objectUniversalIdentifier:o.n.messageChannelMessageAssociation,fields:o.t.messageChannelMessageAssociation,viewFieldNames:[`messageChannelId`,`message`,`messageExternalId`,`direction`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},messageChannelMessageAssociationMessageFolder:{universalIdentifier:o.n.messageChannelMessageAssociationMessageFolder,fields:o.t.messageChannelMessageAssociationMessageFolder,indexes:{messageChannelMessageAssociationIdIndex:{universalIdentifier:`8e6038aa-1f79-4a84-87b5-f33caa172e98`},messageFolderIdIndex:{universalIdentifier:`905299c3-ca81-435d-901c-f68b87562516`},messageChannelMessageAssociationIdMessageFolderIdUniqueIndex:{universalIdentifier:`a3de1788-5dff-4849-ac5a-0dabe5fab216`}},views:{allMessageChannelMessageAssociationMessageFolders:Q({objectUniversalIdentifier:o.n.messageChannelMessageAssociationMessageFolder,fields:o.t.messageChannelMessageAssociationMessageFolder,viewFieldNames:[`messageChannelMessageAssociation`,`messageFolderId`,`createdAt`]}),messageChannelMessageAssociationMessageFolderRecordPageFields:$({objectUniversalIdentifier:o.n.messageChannelMessageAssociationMessageFolder,fields:o.t.messageChannelMessageAssociationMessageFolder,viewFieldNames:[`messageChannelMessageAssociation`,`messageFolderId`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},messageParticipant:{universalIdentifier:o.n.messageParticipant,fields:o.t.messageParticipant,indexes:{messageIdIndex:{universalIdentifier:`ab0863ba-f95e-493c-b86c-56e1bc7e5bc2`},personIdIndex:{universalIdentifier:`df805c2e-3bfe-4d51-8309-75e5eb4052fe`},workspaceMemberIdIndex:{universalIdentifier:`ce1e3a9e-afe9-439d-abb7-6cc98a6fa405`},messageCampaignIdIndex:{universalIdentifier:`e9bcdd77-cc8b-4532-833c-124dfdc8e5ff`}},views:{allMessageParticipants:Q({objectUniversalIdentifier:o.n.messageParticipant,fields:o.t.messageParticipant,viewFieldNames:[`message`,`role`,`handle`,`displayName`,`person`,`workspaceMember`,`createdAt`]}),messageParticipantRecordPageFields:$({objectUniversalIdentifier:o.n.messageParticipant,fields:o.t.messageParticipant,viewFieldNames:[`message`,`role`,`displayName`,`person`,`workspaceMember`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},messageThread:{universalIdentifier:o.n.messageThread,fields:o.t.messageThread,indexes:{},views:{allMessageThreads:Q({objectUniversalIdentifier:o.n.messageThread,fields:o.t.messageThread,viewFieldNames:[`subject`,`messages`,`updatedAt`,`createdAt`]})}},messageThreadTarget:{universalIdentifier:o.n.messageThreadTarget,fields:o.t.messageThreadTarget,morphIds:{targetMorphId:{morphId:o.t.messageThreadTarget.target.universalIdentifier}},indexes:{messageThreadIdIndex:{universalIdentifier:`222fdd8b-0863-4f2a-816a-29745537b6b6`},personIdIndex:{universalIdentifier:`280ee419-ac3c-4599-bd62-3e5cb268342c`},companyIdIndex:{universalIdentifier:`b98005e4-3811-41b6-82d0-3ccd27757eba`},opportunityIdIndex:{universalIdentifier:`7679ee05-cf6c-40a7-9ee6-c3e8053caca5`},messageThreadPersonUniqueIndex:{universalIdentifier:`087f97cb-8c3c-4ea1-9556-933acde6c83b`},messageThreadCompanyUniqueIndex:{universalIdentifier:`30d4f1af-8b6f-4685-802f-8a7cf29f318b`},messageThreadOpportunityUniqueIndex:{universalIdentifier:`1dc0e37e-afb1-4e90-90b4-052374126a6a`}},views:{}},message:{universalIdentifier:o.n.message,fields:o.t.message,indexes:{messageThreadIdIndex:{universalIdentifier:`7a05b45e-7aa6-4a7e-9bbc-299cbed53c96`},messageCampaignIdIndex:{universalIdentifier:`79e777ca-7008-46c5-b3a6-3108b7c7dfb6`},headerMessageIdIndex:{universalIdentifier:`0904b3e4-6052-4a8d-bf41-f12a27c7e34a`}},views:{allMessages:Q({objectUniversalIdentifier:o.n.message,fields:o.t.message,viewFieldNames:[`subject`,`messageThread`,`messageParticipants`,`receivedAt`,`headerMessageId`,`text`,`createdAt`]}),messageRecordPageFields:$({objectUniversalIdentifier:o.n.message,fields:o.t.message,viewFieldNames:[`messageThread`,`messageParticipants`,`receivedAt`,`text`,`headerMessageId`,`createdAt`,`createdBy`],viewFieldGroupNames:{general:`General`,system:`System`}})}},note:{universalIdentifier:o.n.note,fields:o.t.note,indexes:{searchVectorGinIndex:{universalIdentifier:`8183c8d2-9114-4b6e-8c5d-12a3b14a5a13`}},views:{allNotes:Q({objectUniversalIdentifier:o.n.note,fields:o.t.note,viewFieldNames:[`title`,`noteTargets`,`bodyV2`,`createdBy`,`createdAt`]}),noteRecordPageFields:$({objectUniversalIdentifier:o.n.note,fields:o.t.note,viewFieldNames:[`noteTargets`,`attachments`,`timelineActivities`],viewFieldGroupNames:{general:`General`}})}},noteTarget:{universalIdentifier:o.n.noteTarget,fields:o.t.noteTarget,morphIds:{targetMorphId:{morphId:o.t.noteTarget.target.universalIdentifier}},indexes:{noteIdIndex:{universalIdentifier:`9294d9e3-0225-4c7f-9d6e-23b4c25b6b24`},personIdIndex:{universalIdentifier:`7c069dc0-e83b-4cd5-aaa2-cac7f3e00d80`},companyIdIndex:{universalIdentifier:`2d83909a-a383-4e82-b00a-8b7739f3f906`},opportunityIdIndex:{universalIdentifier:`0d1a59b4-cc87-4b7d-804a-656e8504f371`},notePersonUniqueIndex:{universalIdentifier:`29be76d1-ff4f-4f0f-b05c-f679a234e90a`},noteCompanyUniqueIndex:{universalIdentifier:`e3b92659-04cf-4496-8fd4-4f32c747c26a`},noteOpportunityUniqueIndex:{universalIdentifier:`58002741-8aa7-4812-b7af-f4cf98dd2433`}},views:{allNoteTargets:Q({objectUniversalIdentifier:o.n.noteTarget,fields:o.t.noteTarget,viewFieldNames:[`id`,`note`,`targetPerson`,`targetCompany`,`targetOpportunity`]})}},opportunity:{universalIdentifier:o.n.opportunity,fields:o.t.opportunity,indexes:{pointOfContactIdIndex:{universalIdentifier:`b8c2a673-a981-4357-a43d-313a358e4daa`},companyIdIndex:{universalIdentifier:`e161072d-37b1-477a-b944-ef0d65289574`},stageIndex:{universalIdentifier:`ae60d580-b562-44f2-a24d-7b8040063f83`},searchVectorGinIndex:{universalIdentifier:`f53fdd28-a26b-47ba-81b5-6813ad622720`}},views:{allOpportunities:Q({objectUniversalIdentifier:o.n.opportunity,fields:o.t.opportunity,viewFieldNames:[`name`,`amount`,`createdBy`,`closeDate`,`company`,`pointOfContact`]}),byStage:{universalIdentifier:`20202020-a004-4a04-8a04-0aa0b1ca1ba0`,viewFields:{name:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2baf`},amount:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2bb0`},createdBy:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2bb1`},closeDate:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2bb2`},company:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2bb3`},pointOfContact:{universalIdentifier:`20202020-af04-4a04-8a04-0aa0b2ca2bb4`}},viewGroups:{new:{universalIdentifier:`20202020-af14-4a04-8a04-0aa0b2ca2bf1`},screening:{universalIdentifier:`20202020-af14-4a04-8a04-0aa0b2ca2bf2`},meeting:{universalIdentifier:`20202020-af14-4a04-8a04-0aa0b2ca2bf3`},proposal:{universalIdentifier:`20202020-af14-4a04-8a04-0aa0b2ca2bf4`},customer:{universalIdentifier:`20202020-af14-4a04-8a04-0aa0b2ca2bf5`}}},opportunityRecordPageFields:$({objectUniversalIdentifier:o.n.opportunity,fields:o.t.opportunity,viewFieldNames:[`amount`,`closeDate`,`stage`,`company`,`pointOfContact`,`owner`,`createdAt`,`createdBy`,`updatedAt`,`updatedBy`,`taskTargets`,`noteTargets`,`attachments`,`timelineActivities`],viewFieldGroupNames:{deal:`Deal`,relations:`Relations`,system:`System`}})}},person:{universalIdentifier:o.n.person,fields:o.t.person,indexes:{companyIdIndex:{universalIdentifier:`8a265a5c-d3ae-47dc-bdf9-b42cfa2ba639`},emailsUniqueIndex:{universalIdentifier:`8183a8b2-9114-4f6c-8a5b-12e3f14e5e13`},searchVectorGinIndex:{universalIdentifier:`9294b9c3-0225-4a7d-9b6c-23f4a25f6f24`}},views:{allPeople:Q({objectUniversalIdentifier:o.n.person,fields:o.t.person,viewFieldNames:[`name`,`emails`,`createdBy`,`company`,`phones`,`createdAt`,`jobTitle`,`linkedinLink`]}),personRecordPageFields:$({objectUniversalIdentifier:o.n.person,fields:o.t.person,viewFieldNames:[`emails`,`phones`,`company`,`jobTitle`,`linkedinLink`,`avatarUrl`,`createdAt`,`createdBy`,`updatedAt`,`updatedBy`,`avatarFile`,`pointOfContactForOpportunities`,`taskTargets`,`noteTargets`,`attachments`,`messageParticipants`,`calendarEventParticipants`,`timelineActivities`],viewFieldGroupNames:{general:`General`,work:`Work`,social:`Social`,system:`System`}}),messageListRecordPageMembers:{universalIdentifier:`bef79e8e-9ef3-4458-81ed-78a299e2566f`,viewFields:{name:{universalIdentifier:`a4f0d7b4-3956-44a6-8bb2-df45a699609b`},emails:{universalIdentifier:`180e9cbb-34c2-4e27-8648-2915be88a50e`},company:{universalIdentifier:`3db54119-df4d-449b-91c9-22fca1e5d599`}},viewFilters:{listMembershipsListIsCurrentRecord:{universalIdentifier:`256dceea-a9b5-42b7-8461-a6ce62e7fa6c`}}}}},accessGroup:{universalIdentifier:o.n.accessGroup,fields:o.t.accessGroup,indexes:{roleIdIndex:{universalIdentifier:`933f2eee-0856-46fd-b144-ffd4bad7e9c8`},groupHashUniqueIndex:{universalIdentifier:`dcb0d254-43ae-442e-9223-8ac052eddb28`},objectMetadataIdIndex:{universalIdentifier:`60e48c2a-a3db-4f11-b25b-49c7e8a385bc`}},views:{}},recordShare:{universalIdentifier:o.n.recordShare,fields:o.t.recordShare,indexes:{recordPrincipalCauseSourceUniqueIndex:{universalIdentifier:`4580f104-47a7-4110-87a8-26cb6f63ce7b`},principalIdIndex:{universalIdentifier:`66fbc3d2-6126-4e29-a306-dbe9995bf062`},sourceIdIndex:{universalIdentifier:`21b84593-c647-40ce-bdf4-a8b4ac658f57`}},views:{}},shortLink:{universalIdentifier:o.n.shortLink,fields:o.t.shortLink,indexes:{templateAndResolvedUrlHashUniqueIndex:{universalIdentifier:`b1330e3c-bd74-4bd1-a9dc-1ecefe41f199`}},views:{}},task:{universalIdentifier:o.n.task,fields:o.t.task,indexes:{assigneeIdIndex:{universalIdentifier:`f48fa3b1-0cec-44da-a9e5-f8a5e766637e`},searchVectorGinIndex:{universalIdentifier:`a86b32b3-01d3-4302-a152-8b7f247db7b4`}},views:{allTasks:Q({objectUniversalIdentifier:o.n.task,fields:o.t.task,viewFieldNames:[`title`,`status`,`taskTargets`,`createdBy`,`dueAt`,`assignee`,`bodyV2`,`createdAt`]}),assignedToMe:{universalIdentifier:`20202020-a007-4a07-8a07-ba5ca551aaed`,viewFields:{title:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaed`},taskTargets:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaee`},createdBy:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaef`},dueAt:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaf0`},assignee:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaf1`},bodyV2:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaf2`},createdAt:{universalIdentifier:`20202020-af07-4a07-8a07-ba5ca551aaf3`}},viewFilters:{assigneeIsMe:{universalIdentifier:`20202020-af17-4a07-8a07-ba5ca551abf1`}},viewGroups:{todo:{universalIdentifier:`20202020-af17-4a07-8a07-ba5ca551abf2`},inProgress:{universalIdentifier:`20202020-af17-4a07-8a07-ba5ca551abf3`},done:{universalIdentifier:`20202020-af17-4a07-8a07-ba5ca551abf4`},empty:{universalIdentifier:`20202020-af17-4a07-8a07-ba5ca551abf5`}}},byStatus:{universalIdentifier:`20202020-a008-4a08-8a08-ba5cba51aba5`,viewFields:{title:{universalIdentifier:`20202020-af08-4a08-8a08-ba5cba5babf0`},status:{universalIdentifier:`20202020-af08-4a08-8a08-ba5cba5babf1`},dueAt:{universalIdentifier:`20202020-af08-4a08-8a08-ba5cba5babf2`},assignee:{universalIdentifier:`20202020-af08-4a08-8a08-ba5cba5babf3`},createdAt:{universalIdentifier:`20202020-af08-4a08-8a08-ba5cba5babf4`}},viewGroups:{todo:{universalIdentifier:`20202020-af18-4a08-8a08-ba5cba5bbf01`},inProgress:{universalIdentifier:`20202020-af18-4a08-8a08-ba5cba5bbf02`},done:{universalIdentifier:`20202020-af18-4a08-8a08-ba5cba5bbf03`}}},taskRecordPageFields:$({objectUniversalIdentifier:o.n.task,fields:o.t.task,viewFieldNames:[`dueAt`,`status`,`assignee`,`taskTargets`,`attachments`,`timelineActivities`],viewFieldGroupNames:{general:`General`}})}},taskTarget:{universalIdentifier:o.n.taskTarget,fields:o.t.taskTarget,morphIds:{targetMorphId:{morphId:o.t.taskTarget.target.universalIdentifier}},indexes:{taskIdIndex:{universalIdentifier:`c882f7a4-b025-4d32-aa26-5ef2595bdbf9`},personIdIndex:{universalIdentifier:`b7d305d1-6fae-4ed6-9bdc-354fe9032c0e`},companyIdIndex:{universalIdentifier:`c0af54c7-751b-4bb2-b102-677cc4e47402`},opportunityIdIndex:{universalIdentifier:`6942e0ba-90f6-4c33-bf40-7f00b1ec35ab`},taskPersonUniqueIndex:{universalIdentifier:`4adf4d5a-ad69-4c5c-bc62-2807816b3aa8`},taskCompanyUniqueIndex:{universalIdentifier:`637dce5e-f609-49f4-89e3-c0ef9e330d3a`},taskOpportunityUniqueIndex:{universalIdentifier:`eb5422ff-7a41-48d2-a2df-3de1cbf7bced`}},views:{allTaskTargets:Q({objectUniversalIdentifier:o.n.taskTarget,fields:o.t.taskTarget,viewFieldNames:[`id`,`task`,`targetPerson`,`targetCompany`,`targetOpportunity`]})}},timelineActivity:{universalIdentifier:o.n.timelineActivity,fields:o.t.timelineActivity,morphIds:{targetMorphId:{morphId:o.t.timelineActivity.target.universalIdentifier}},indexes:{workspaceMemberIdIndex:{universalIdentifier:`5e0b2391-85ca-4a66-aef4-52d74245bec2`},personIdIndex:{universalIdentifier:`3e89a914-7bec-47bd-9cf9-743c6b83d001`},companyIdIndex:{universalIdentifier:`8183e8f2-9114-4d6a-8e5f-12c3d14c5c13`},opportunityIdIndex:{universalIdentifier:`9294f9a3-0225-4e7b-9f6a-23d4e25d6d24`},noteIdIndex:{universalIdentifier:`995db1d8-0d3e-40f7-b0eb-5e6897bc9966`},taskIdIndex:{universalIdentifier:`609cf622-86ef-48d1-812b-e1cab610a46c`},workflowRunIdIndex:{universalIdentifier:`1a2bd046-7c23-4e0a-9f8a-c3ca3a16d3b9`},dashboardIdIndex:{universalIdentifier:`e8821da9-728d-470a-bf5b-5a981fff7880`},messageListIdIndex:{universalIdentifier:`a251f71a-c698-4526-8817-0e7c803c158e`},messageCampaignIdIndex:{universalIdentifier:`e808e721-91cc-4b9b-b24b-806d64b4d5e2`},linkedRecordIdIndex:{universalIdentifier:`00e9bf50-0e98-4105-8cb7-31c94995ff55`}},views:{allTimelineActivities:Q({objectUniversalIdentifier:o.n.timelineActivity,fields:o.t.timelineActivity,viewFieldNames:[`linkedRecordCachedName`,`happensAt`,`workspaceMember`,`targetPerson`,`targetCompany`,`targetOpportunity`,`targetTask`,`targetNote`,`targetWorkflowRun`,`targetDashboard`]})}},workflowRun:{universalIdentifier:o.n.workflowRun,fields:o.t.workflowRun,indexes:{coreWorkflowIdCreatedAtIndex:{universalIdentifier:`5f16fa40-7dd4-4a30-8331-9ad4a106f6be`},searchVectorGinIndex:{universalIdentifier:`e0ac5ad2-d0c8-4f72-b710-8e53b9dc18d9`}},views:{allWorkflowRuns:Q({objectUniversalIdentifier:o.n.workflowRun,fields:o.t.workflowRun,viewFieldNames:[`name`,`coreWorkflowId`,`status`]}),workflowRunRecordPageFields:$({objectUniversalIdentifier:o.n.workflowRun,fields:o.t.workflowRun,viewFieldNames:[`status`,`coreWorkflowId`,`startedAt`,`endedAt`,`createdAt`,`createdBy`,`enqueuedAt`,`state`,`updatedAt`,`updatedBy`,`timelineActivities`],viewFieldGroupNames:{general:`General`,system:`System`}})}},workspaceMember:{universalIdentifier:o.n.workspaceMember,fields:o.t.workspaceMember,indexes:{userEmailUniqueIndex:{universalIdentifier:`76da5f27-523c-44b6-ad06-12954f6b949f`},searchVectorGinIndex:{universalIdentifier:`8678dde9-a804-4a9e-80e3-9af35e471ec5`}},views:{workspaceMemberRecordPageFields:$({objectUniversalIdentifier:o.n.workspaceMember,fields:o.t.workspaceMember,viewFieldNames:[`userEmail`,`jobTitle`,`createdAt`,`updatedAt`,`assignedTasks`,`accountOwnerForCompanies`,`ownedOpportunities`],viewFieldGroupNames:{general:`General`,system:`System`,relations:`Relations`}}),allWorkspaceMembers:Q({objectUniversalIdentifier:o.n.workspaceMember,fields:o.t.workspaceMember,viewFieldNames:[`name`,`createdAt`,`ownedOpportunities`,`assignedTasks`]})}},agentChatThread:{universalIdentifier:o.n.agentChatThread,fields:o.t.agentChatThread,indexes:{directMessagePairUniqueIndex:{universalIdentifier:`365c5b24-cd52-4ebc-98d2-23c5684216d5`},workspaceMemberIndex:{universalIdentifier:`079f2dd7-6c11-4eae-be8a-cce2d1bee0fb`},assigneeIndex:{universalIdentifier:`a65524f8-c999-448b-b9f4-c9ecce15fd13`},channelLastActivityIndex:{universalIdentifier:`bd129bd1-db66-4c74-a64e-819d2edd3062`}}},agentChatThreadParticipant:{universalIdentifier:o.n.agentChatThreadParticipant,fields:o.t.agentChatThreadParticipant,indexes:{threadWorkspaceMemberUniqueIndex:{universalIdentifier:`e5bbe244-cf74-49a3-938a-e6fff7a8710b`},workspaceMemberIndex:{universalIdentifier:`73d8bb5d-18eb-47bb-89e6-12d8f89aecf6`}}},agentChatThreadTarget:{universalIdentifier:o.n.agentChatThreadTarget,fields:o.t.agentChatThreadTarget,morphIds:{targetMorphId:{morphId:o.t.agentChatThreadTarget.target.universalIdentifier}},indexes:{threadIdIndex:{universalIdentifier:`19291d2c-15ab-43a0-91f7-1694b34813dd`},personIdIndex:{universalIdentifier:`fe9c48d0-5b2a-4a51-bd47-f9205ea0c09d`},companyIdIndex:{universalIdentifier:`ab45593a-3614-41c8-aab1-20aa91f1095c`},opportunityIdIndex:{universalIdentifier:`b68e2031-73c6-4bc4-b062-5f795539e452`},threadPersonUniqueIndex:{universalIdentifier:`5a12050f-4de2-4076-aecc-959b863e14b2`},threadCompanyUniqueIndex:{universalIdentifier:`d9067628-fd16-4843-955b-5fd47fea52a9`},threadOpportunityUniqueIndex:{universalIdentifier:`1b9bec10-2788-40be-9435-44937b9f7018`}},views:{}},agentTurn:{universalIdentifier:o.n.agentTurn,fields:o.t.agentTurn,indexes:{agentIndex:{universalIdentifier:`606e8ba3-f322-426b-bef8-2208f67a541a`},agentIdCreatedAtIndex:{universalIdentifier:`39fbc85e-22ec-4279-8c67-f3f0850b68c9`},threadIndex:{universalIdentifier:`7d351559-4546-4307-ba28-de9fc4c40ef4`}}},agentMessage:{universalIdentifier:o.n.agentMessage,fields:o.t.agentMessage,indexes:{agentIndex:{universalIdentifier:`465b20e1-d4cd-4d80-a85b-78bd1f0e70ad`},threadIndex:{universalIdentifier:`2054f1a5-554f-42ac-a41a-b8ccd6ba72ec`},turnIndex:{universalIdentifier:`dc46f804-a55f-4283-884e-9cb938741da3`},senderWorkspaceMemberIndex:{universalIdentifier:`8ecdac01-7bbe-411e-8461-6ff265c90759`}}},agentMessageReaction:{universalIdentifier:o.n.agentMessageReaction,fields:o.t.agentMessageReaction,indexes:{messageWorkspaceMemberEmojiUniqueIndex:{universalIdentifier:`4089a239-e2d0-4e3e-83e8-e9b555a8a31d`},workspaceMemberIndex:{universalIdentifier:`565d89ab-2c11-4ebe-aaaf-8dbc4d79a9e5`}}},agentMessagePart:{universalIdentifier:o.n.agentMessagePart,fields:o.t.agentMessagePart,indexes:{messageOrderIndex:{universalIdentifier:`f5a08f6f-cf91-4996-9c21-2af64a17ca83`}}},campaignDelivery:{universalIdentifier:o.n.campaignDelivery,fields:o.t.campaignDelivery,indexes:{campaignPersonUniqueIndex:{universalIdentifier:`8d719548-d34f-4891-bbc9-e0e09f0e363b`},expiredClaimIndex:{universalIdentifier:`a4d7e8ed-0008-4f6a-a20c-a2b821487481`},countsIndex:{universalIdentifier:`1ea1ae7a-158f-436a-95a0-e9c998ad94f7`},claimTokenIndex:{universalIdentifier:`91640dcd-3f6b-4378-b284-bb02cc8b81ec`},providerMessageIdUniqueIndex:{universalIdentifier:`4de6f73d-ef3a-4c80-b71a-88739213f1c0`}}},messageSuppression:{universalIdentifier:o.n.messageSuppression,fields:o.t.messageSuppression,indexes:{emailAddressTopicUniqueIndex:{universalIdentifier:`a6c1f4dc-d925-49f9-8205-3e7f95545966`}}}},aT={canReadObjectRecords:`read`,canUpdateObjectRecords:`update`,canSoftDeleteObjectRecords:`soft-delete`,canDestroyObjectRecords:`destroy`},oT=e=>{let t=new Map;for(let[n,r]of Object.entries(e))t.has(r)||t.set(r,n);return t},sT=Object.fromEntries(Object.entries(iT).map(([e,{universalIdentifier:t}])=>[t,e])),cT=({grant:e,objects:t,permissionFlags:n,systemPermissionFlagNameByUniversalIdentifier:r})=>{let i=e=>t.find(t=>t.universalIdentifier===e)?.nameSingular??sT[e]??e;switch(e.type){case`ALL_OBJECT_RECORDS`:return`${aT[e.action]} all object records`;case`ALL_SETTINGS`:return`update all settings`;case`ALL_TOOLS`:return`access all tools`;case`PERMISSION_FLAG`:return`permission flag ${n.find(t=>t.universalIdentifier===e.permissionFlagUniversalIdentifier)?.key??r.get(e.permissionFlagUniversalIdentifier)??e.permissionFlagUniversalIdentifier}`;case`OBJECT_RECORDS`:return`${aT[e.action]} ${i(e.objectUniversalIdentifier)} records`;case`FIELD_VALUE`:return`${e.action===`canReadFieldValue`?`read`:`update`} field ${e.fieldUniversalIdentifier} of ${i(e.objectUniversalIdentifier)}`;case`ROW_LEVEL_RESTRICTION`:return`${i(e.objectUniversalIdentifier)} records without the row-level restriction`}},lT=e=>e.map(e=>`"${e}"`).join(`, `),uT=({agents:e,defaultRoleUniversalIdentifier:t})=>{let r=new Map;for(let i of e)!n.t(i.roleUniversalIdentifier)||i.roleUniversalIdentifier===t||r.set(i.roleUniversalIdentifier,[...r.get(i.roleUniversalIdentifier)??[],i.name]);return r},dT=({agentNamesByRoleUniversalIdentifier:e,roles:t})=>[...e].filter(([e])=>!t.some(t=>t.universalIdentifier===e)).map(([e,t])=>`Agent ${lT(t)} references role "${e}", which is not defined by this application.`),fT=({agentNamesByRoleUniversalIdentifier:e,applicationRole:t,roles:r,objects:i,permissionFlags:a,systemPermissionFlagNameByUniversalIdentifier:o})=>{let s=a.filter(e=>(e.permissionType??`tool`)===`tool`).map(e=>e.universalIdentifier);return[...e].flatMap(([e,c])=>{let l=r.find(t=>t.universalIdentifier===e);if(!n.t(l))return[];let u=Mw({role:l,superset:t,toolPermissionFlagUniversalIdentifiers:s});if(u.length===0)return[];let d=u.map(e=>cT({grant:e,objects:i,permissionFlags:a,systemPermissionFlagNameByUniversalIdentifier:o})).join(`, `);return[`Role "${l.label}" used by agent ${lT(c)} grants more than the application role "${t.label}": ${d}. The application role must cover every permission an agent role grants.`]})},pT=({agents:e,roles:t,objects:r,permissionFlags:i,defaultRoleUniversalIdentifier:a,systemPermissionFlag:s=o.r})=>{let c=t.find(e=>e.universalIdentifier===a),l=uT({agents:e,defaultRoleUniversalIdentifier:a});return[...dT({agentNamesByRoleUniversalIdentifier:l,roles:t}),...n.t(c)?fT({agentNamesByRoleUniversalIdentifier:l,applicationRole:c,roles:t,objects:r,permissionFlags:i,systemPermissionFlagNameByUniversalIdentifier:oT(s)}):[]]},mT=({views:e,objects:t,fields:r})=>{let i=[],o=new Map;for(let e of r)o.set(e.universalIdentifier,e);for(let e of t)for(let t of e.fields)o.set(t.universalIdentifier,t);for(let t of e)for(let e of t.filters??[]){let t=o.get(e.fieldMetadataUniversalIdentifier);if(!n.t(t))continue;let r=(t.type===a.a.RELATION||t.type===a.a.MORPH_RELATION)&&n.t(e.relationTargetFieldMetadataUniversalIdentifier)?o.get(e.relationTargetFieldMetadataUniversalIdentifier)?.type??t.type:t.type;if(!(r in Ex))continue;let s=Ox({filterType:r,subFieldName:e.subFieldName});s.includes(e.operand)||i.push(`Operand "${e.operand}" is not supported on field "${t.name}" (type "${r}"). Supported operands: ${s.join(`, `)}.`)}return i},hT=e=>p.i(e),gT=async e=>(await(0,te.glob)([`${u.t}/**/*`],{cwd:e,absolute:!0,onlyFiles:!0})).sort(),_T=async e=>{try{let t=await(0,ee.readFile)((0,v.join)(e,`README.md`),`utf-8`);return t.trim().length>0?t:void 0}catch{return}},vT=async e=>{let t=await hT(e),r=await _T(e),i=[],a=[],o,s=[],c=[],l=[],u=[],d=[],h=[],g=[],te=[],_=[],y=[],re=[],ie=[],ae=[],oe=[],se=[],ce=[],le=[],ue=[],de=[],fe=[],pe=[],me=[],he=[],ge=[],_e=[],b=[],ve=[],ye=[],be=[],xe=[],Se=[],Ce=[],we=[],Te=[],Ee=[],De=[],x=[],Oe=[],ke=[],Ae=[],je=[],Me=[],Ne=[],Pe=[],Fe=[],Ie=[],Le=[],Re=[],ze=[],Be=[],Ve=[],He=[],Ue=[],We=[],Ge=[],Ke=[],qe=[],Je=[],Ye=[];for(let r of t){let t=await(0,ee.readFile)(r,`utf-8`),l=(0,v.relative)(e,r);i.push(...nT(t,l));let f=p.r({fileContent:t,filePath:r});if(!f)continue;let m=p.n[f];switch(m){case`application`:{let t=await p.t({appPath:e,filePath:r});o=t.config,i.push(...t.errors),a.push(...t.warnings??[]),Te.push(l);break}case`objects`:{let t=await p.t({appPath:e,filePath:r});s.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ee.push(l);break}case`fields`:{let t=await p.t({appPath:e,filePath:r}),n=fw(t.config);u.push(n),i.push(...t.errors),a.push(...t.warnings??[]),De.push(l);break}case`permissionFlags`:{let t=await p.t({appPath:e,filePath:r});g.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),ke.push(l);break}case`roles`:{let t=await p.t({appPath:e,filePath:r});c.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ae.push(l),f===`defineApplicationRole`&&we.push(t.config.universalIdentifier);break}case`skills`:{let t=await p.t({appPath:e,filePath:r});_.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),je.push(l);break}case`agents`:{let t=await p.t({appPath:e,filePath:r});y.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Me.push(l);break}case`workflows`:{let t=await p.t({appPath:e,filePath:r});re.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ne.push(l);break}case`connectionProviders`:{let t=await p.t({appPath:e,filePath:r});ie.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Pe.push(l);break}case`messagingProviders`:{let t=await p.t({appPath:e,filePath:r});ae.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Fe.push(l);break}case`mcpServers`:{let t=await p.t({appPath:e,filePath:r});oe.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ie.push(l);break}case`relatedRecordPaths`:{let t=await p.t({appPath:e,filePath:r});se.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Le.push(l);break}case`logicFunctions`:{let o=await p.t({appPath:e,filePath:r});i.push(...o.errors),a.push(...o.warnings??[]),f===`definePreInstallLogicFunction`&&n.t(o.config.serverRouteTriggerSettings)&&i.push(`${l}: pre-install logic functions cannot define serverRouteTriggerSettings.`);let{runOnUserPreferences:s,...c}=o.config,u=await Bw({logicFunctionConfig:c,sourceCode:t,sourcePath:l});if(ce.push(u),Re.push(l),f===`definePostInstallLogicFunction`){let e=o.config;ye.push({universalIdentifier:o.config.universalIdentifier,shouldRunOnVersionUpgrade:e.shouldRunOnVersionUpgrade??!1,shouldRunSynchronously:e.shouldRunSynchronously??!1})}if(f===`definePreInstallLogicFunction`){let e=o.config;be.push({universalIdentifier:o.config.universalIdentifier,shouldRunOnVersionUpgrade:e.shouldRunOnVersionUpgrade??!1})}f===`defineUninstallLogicFunction`&&xe.push({universalIdentifier:o.config.universalIdentifier}),f===`defineHealthCheck`&&Se.push({universalIdentifier:o.config.universalIdentifier,...n.t(s)?{runOnUserPreferences:s}:{}});break}case`frontComponents`:{let t=await p.t({appPath:e,filePath:r});i.push(...t.errors),a.push(...t.warnings??[]);let n=Vw({frontComponentConfig:t.config,sourcePath:l});le.push(n),ze.push(l),f===`defineSettingsFrontComponent`&&Ce.push(t.config.universalIdentifier);break}case`views`:{let t=await p.t({appPath:e,filePath:r}),n={...t.config};de.push(n),i.push(...t.errors),a.push(...t.warnings??[]),Ve.push(l);break}case`viewFields`:{let t=await p.t({appPath:e,filePath:r});fe.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),He.push(l);break}case`navigationMenuItems`:{let t=await p.t({appPath:e,filePath:r});pe.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ue.push(l);break}case`pageLayouts`:{let t=await p.t({appPath:e,filePath:r}),n={...t.config};me.push(n),i.push(...t.errors),a.push(...t.warnings??[]),We.push(l);break}case`indexes`:{let t=await p.t({appPath:e,filePath:r}),n={...t.config};d.push(n),i.push(...t.errors),a.push(...t.warnings??[]),x.push(l);break}case`validationRules`:{let t=await p.t({appPath:e,filePath:r});h.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Oe.push(l);break}case`pageLayoutTabs`:{let t=await p.t({appPath:e,filePath:r}),n={...t.config};he.push(n),i.push(...t.errors),a.push(...t.warnings??[]),Ge.push(l);break}case`pageLayoutWidgets`:{let t=await p.t({appPath:e,filePath:r});ge.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ke.push(l);break}case`commandMenuItems`:{let t=await p.t({appPath:e,filePath:r});_e.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),qe.push(l);break}case`timelineActivityTypes`:{let t=await p.t({appPath:e,filePath:r});b.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Je.push(l);break}case`settingsMenuItems`:{let t=await p.t({appPath:e,filePath:r});ve.push(t.config),i.push(...t.errors),a.push(...t.warnings??[]),Ye.push(l);break}default:ne(m)}}let Xe=await gT(e);for(let t of Xe){let n=(0,v.relative)(e,t);ue.push({filePath:n,fileName:(0,v.basename)(t),fileType:(0,v.extname)(t).replace(/^\./,``),checksum:null}),Be.push(n)}if(o||i.push(`Cannot build application, please export default defineApplication() to define an application`),o){for(let e of s){let{objectManifest:t,errors:n}=Fw({objectConfig:e,applicationUniversalIdentifier:o.universalIdentifier});i.push(...n),t&&l.push(t)}for(let e of c)te.push(Hw({roleConfig:e,applicationUniversalIdentifier:o.universalIdentifier}))}ye.length>1&&i.push(`Only one post install logic function is allowed per application`),be.length>1&&i.push(`Only one pre install logic function is allowed per application`),xe.length>1&&i.push(`Only one uninstall logic function is allowed per application`),Se.length>1&&i.push(`Only one health check is allowed per application`);let[Ze]=Se;Ce.length>1&&i.push(`Only one settings front component is allowed per application`),we.length>1&&i.push(`Only one defineApplicationRole is allowed per application`);let{sharedDependencies:Qe,errors:$e}=await Yw(e);i.push(...$e);let et=o?.defaultRoleUniversalIdentifier??(we.length===1?we[0]:void 0);o&&!et&&i.push("Application must declare a default role: either pass `defaultRoleUniversalIdentifier` to defineApplication() or mark a role file with defineApplicationRole()"),i.push(...mT({views:de,objects:l,fields:u})),n.t(o)&&n.t(et)&&i.push(...pT({agents:y,roles:te,objects:l,permissionFlags:g,defaultRoleUniversalIdentifier:et,systemPermissionFlag:f.i(e)}));let tt=o&&et?(()=>{let{logoUrl:t,screenshots:i,...a}=o;return{...a,logo:o.logo,galleryImages:o.galleryImages??[],defaultRoleUniversalIdentifier:et,aboutDescription:r,yarnLockChecksum:null,packageJsonChecksum:``,requiredServerVersionRange:m.t(e),...ye.length>=1?{postInstallLogicFunction:ye[0]}:{},...be.length>=1?{preInstallLogicFunction:be[0]}:{},...xe.length>=1?{uninstallLogicFunction:xe[0]}:{},...n.t(Ze)?{healthCheckLogicFunction:Ze}:{},...Ce.length>=1?{settingsFrontComponent:{universalIdentifier:Ce[0]}}:{},...n.t(Qe)?{frontComponentSharedDependencies:Qe}:{}}})():void 0,S=(e,t)=>e.universalIdentifier.localeCompare(t.universalIdentifier);return{manifest:tt?{application:tt,objects:l.sort(S),fields:u.sort(S),indexes:d.sort(S),permissionFlags:g.sort(S),roles:te.sort(S),skills:_.sort(S),agents:y.sort(S),workflows:re.sort(S),connectionProviders:ie.sort(S),messagingProviders:ae.sort(S),mcpServers:oe.sort(S),logicFunctions:ce.sort(S),frontComponents:le.sort(S),publicAssets:ue.sort((e,t)=>e.filePath.localeCompare(t.filePath)),views:de.sort(S),viewFields:fe.sort(S),navigationMenuItems:pe.sort(S),pageLayouts:me.sort(S),pageLayoutTabs:he.sort(S),pageLayoutWidgets:ge.sort(S),commandMenuItems:_e.sort(S),timelineActivityTypes:b.sort(S),settingsMenuItems:ve.sort(S),validationRules:h.sort(S),relatedRecordPaths:se.sort(S)}:null,filePaths:{application:Te,objects:Ee,fields:De,indexes:x,validationRules:Oe,permissionFlags:ke,roles:Ae,skills:je,agents:Me,workflows:Ne,connectionProviders:Pe,messagingProviders:Fe,mcpServers:Ie,relatedRecordPaths:Le,logicFunctions:Re,frontComponents:ze,publicAssets:Be,views:Ve,viewFields:He,navigationMenuItems:Ue,pageLayouts:We,pageLayoutTabs:Ge,pageLayoutWidgets:Ke,commandMenuItems:qe,timelineActivityTypes:Je,settingsMenuItems:Ye},errors:i,warnings:a}},yT=[a.a.RELATION,a.a.MORPH_RELATION],bT=e=>yT.includes(e.type),xT=e=>{let t=new Set,n=new Set;for(let r of e)t.has(r)?n.add(r):t.add(r);return Array.from(n)},ST=({manifest:e,pageLayoutWidgets:t})=>{let r=new Set([e.application.settingsFrontComponent?.universalIdentifier,...e.settingsMenuItems.map(e=>e.frontComponentUniversalIdentifier),...e.commandMenuItems.map(e=>e.frontComponentUniversalIdentifier),...e.timelineActivityTypes.map(e=>e.frontComponentUniversalIdentifier),...t.map(({configuration:e})=>n.t(e)&&`frontComponentUniversalIdentifier`in e?e.frontComponentUniversalIdentifier:void 0)].filter(n.t));return e.frontComponents.filter(e=>!e.isHeadless&&!n.t(e.widgetAvailability)&&!r.has(e.universalIdentifier)).map(e=>`Front component "${e.name??e.componentName}" declares no widgetAvailability, so it is not offered in any widget picker. Set widgetAvailability to let users add it to record pages or dashboards.`)},CT=e=>{let t=[],r=[...e.pageLayouts.flatMap(({tabs:e})=>e??[]),...e.pageLayoutTabs];for(let e of r){e.layoutMode===o.l.CANVAS&&t.push(`Page layout tab "${e.title}" uses deprecated CANVAS. For a full-height widget, use VERTICAL_LIST and set the widget's heightBehavior to 'TAB_VIEWPORT'. Existing Canvas layouts remain supported and are not converted.`);for(let r of e.widgets??[])r.position?.layoutMode===o.l.VERTICAL_LIST&&t.push(`Page layout widget "${r.title}" uses a deprecated vertical-list position. Order the widgets array by position.index, remove position, and move any position.heightBehavior to heightBehavior. Existing positions remain supported and keep their indices.`),`gridPosition`in r&&n.t(r.gridPosition)&&t.push(`Page layout widget "${r.title}" uses deprecated gridPosition. If position is already set, it takes precedence; remove the ignored gridPosition. Use position with layoutMode: 'GRID' and the same row, column, rowSpan and columnSpan only when position is absent. Existing gridPosition remains supported as a fallback.`)}return t},wT=[`id`,`createdAt`,`createdBy`,`updatedAt`,`updatedBy`,`deletedAt`,`position`,`searchVector`],TT=e=>e.objects.flatMap(t=>{let r=t.labelIdentifierFieldMetadataUniversalIdentifier?.toLowerCase();return n.t(r)?[...(t.fields??[]).map(e=>e.universalIdentifier.toLowerCase()),...e.fields.filter(e=>e.objectUniversalIdentifier.toLowerCase()===t.universalIdentifier.toLowerCase()).map(e=>e.universalIdentifier.toLowerCase()),...wT.map(n=>a.t({applicationUniversalIdentifier:e.application.universalIdentifier,objectUniversalIdentifier:t.universalIdentifier,name:n}))].includes(r)?[]:[`Object "${t.nameSingular}" references label field ${r}, which is not declared in this app or a recognized generated field. Check the identifier; the server must resolve this reference before applying.`]:[]}),ET=e=>xT(e.settingsMenuItems.map(e=>e.slug).filter(n.t)).map(e=>`Settings menu item slug "${e}" is used more than once. Slugs must be unique within an application.`),DT=e=>{let t=[],i=xT(e.timelineActivityTypes.map(e=>e.name)),o=new Set(e.frontComponents.map(e=>e.universalIdentifier));for(let e of i)t.push(`Timeline activity type name "${e}" is used more than once. Names must be unique within an application.`);for(let i of e.timelineActivityTypes){n.t(i.frontComponentUniversalIdentifier)&&!o.has(i.frontComponentUniversalIdentifier)&&t.push(`Timeline activity type "${i.name}" references front component "${i.frontComponentUniversalIdentifier}", which is not defined by this application.`);let s=i.emit,l=i.replacesTimelineActivityTypeUniversalIdentifier;if(!n.t(s)){n.t(l)&&t.push(`Timeline activity type "${i.name}" declares replacesTimelineActivityTypeUniversalIdentifier without an automatic emit contract.`);continue}let u=s.through,d=u?.triggerFieldUniversalIdentifiers,f=c.t(s.objectUniversalIdentifier);f||t.push(`Timeline activity type "${i.name}" references an invalid object universal identifier "${s.objectUniversalIdentifier}".`),(s.on===`linked`||s.on===`unlinked`)&&!n.t(u)&&t.push(`Timeline activity type "${i.name}" must declare emit.through for a ${s.on} event.`),n.t(d)&&(s.on!==`updated`||!r.t(d)||new Set(d).size!==d.length)&&t.push(`Timeline activity type "${i.name}" trigger fields must be a non-empty list of unique fields on an updated through event.`);let p=f?e.objects.find(e=>e.universalIdentifier===s.objectUniversalIdentifier):void 0;if(!n.t(p)){f&&!n.t(l)&&t.push(`Timeline activity type "${i.name}" targets object "${s.objectUniversalIdentifier}", which is not defined by this application. Types targeting another application's object must declare replacesTimelineActivityTypeUniversalIdentifier.`),n.t(l)&&!c.t(l)&&t.push(`Timeline activity type "${i.name}" references an invalid replacement universal identifier "${l}".`),n.t(u)&&!c.t(u.relationFieldUniversalIdentifier)&&t.push(`Timeline activity type "${i.name}" references an invalid through relation field universal identifier "${u.relationFieldUniversalIdentifier}".`);let e=d?.filter(e=>!c.t(e))??[];e.length>0&&t.push(`Timeline activity type "${i.name}" references invalid trigger field universal identifiers: ${e.join(`, `)}.`);continue}n.t(l)&&t.push(`Timeline activity type "${i.name}" targets an object defined by this application and must not replace another application's type.`);let m=[...p.fields,...e.fields.filter(e=>e.objectUniversalIdentifier===p.universalIdentifier)];if(!n.t(u))continue;let h=m.find(e=>e.universalIdentifier===u.relationFieldUniversalIdentifier);if(n.t(h)?bT(h)&&n.t(h.universalSettings)&&(h.universalSettings.relationType===a.i.MANY_TO_ONE||h.universalSettings.relationType===a.i.ONE_TO_MANY&&(0,y.isNonEmptyString)(h.universalSettings.junctionTargetFieldUniversalIdentifier))||t.push(`Timeline activity type "${i.name}" must route through a MANY_TO_ONE relation or a junction-backed ONE_TO_MANY relation.`):t.push(`Timeline activity type "${i.name}" references relation field "${u.relationFieldUniversalIdentifier}", which is not defined on object "${p.nameSingular}".`),n.t(d)){let e=new Set(m.map(e=>e.universalIdentifier)),n=d.filter(t=>!e.has(t));n.length>0&&t.push(`Timeline activity type "${i.name}" references trigger fields that are not defined on object "${p.nameSingular}": ${n.join(`, `)}.`)}}return t},OT=({name:e,errorMessage:t})=>`Validation rule "${e}" has an invalid expression: ${t}`,kT=e=>({name:e.name,type:e.type,universalIdentifier:e.universalIdentifier}),AT=e=>new Map(e.objects.map(t=>[t.universalIdentifier,[...t.fields,...e.fields.filter(e=>e.objectUniversalIdentifier===t.universalIdentifier)]])),jT=({manifest:{application:e},objectUniversalIdentifier:t})=>Object.entries(rT).map(([n,r])=>({name:n,type:r,universalIdentifier:a.t({applicationUniversalIdentifier:e.universalIdentifier,objectUniversalIdentifier:t,name:n})})),MT=({manifest:e,declaredFieldsByObject:t,objectUniversalIdentifier:n})=>[...t.get(n)??[],...jT({manifest:e,objectUniversalIdentifier:n})].map(kT),NT=({manifest:e,declaredFieldsByObject:t,objectUniversalIdentifier:n})=>[...(t.get(n)??[]).map(n=>{if(!bT(n))return kT(n);let r=n.universalSettings?.relationType;return r===a.i.MANY_TO_ONE?{...kT(n),relationType:r,relationTargetFields:MT({manifest:e,declaredFieldsByObject:t,objectUniversalIdentifier:n.relationTargetObjectMetadataUniversalIdentifier})}:{...kT(n),relationType:r}}),...jT({manifest:e,objectUniversalIdentifier:n}).map(kT)],PT=({name:e,expression:t})=>{let n=XC({expression:t,fields:[]});return!n.isValid&&n.errorCode!==`UNKNOWN_FIELD`?[OT({name:e,errorMessage:n.errorMessage})]:[]},FT=({validationRule:{name:e,errorFieldUniversalIdentifier:t},objectFields:r})=>n.t(t)&&!r.some(e=>e.universalIdentifier===t)?[`Validation rule "${e}" shows its error on field "${t}", which does not belong to the rule's object.`]:[],IT=({compilationResult:e,declaredFields:t,declaredFieldsByObject:r})=>{if(e.isValid||e.errorCode!==`UNKNOWN_RELATION_TARGET_FIELD`)return!1;let i=t.find(t=>t.name===e.errorParams?.relationFieldName);return n.t(i)&&bT(i)&&!r.has(i.relationTargetObjectMetadataUniversalIdentifier)},LT=({validationRule:e,manifest:t,declaredFields:n,declaredFieldsByObject:r})=>{let{name:i,expression:a,objectUniversalIdentifier:o}=e,s=FT({validationRule:e,objectFields:MT({manifest:t,declaredFieldsByObject:r,objectUniversalIdentifier:o})}),c=XC({expression:a,fields:NT({manifest:t,declaredFieldsByObject:r,objectUniversalIdentifier:o})});return c.isValid||IT({compilationResult:c,declaredFields:n,declaredFieldsByObject:r})?s:[...s,OT({name:i,errorMessage:c.errorMessage})]},RT=e=>{let t=AT(e);return(e.validationRules??[]).flatMap(r=>{let i=t.get(r.objectUniversalIdentifier);return n.t(i)?LT({validationRule:r,manifest:e,declaredFields:i,declaredFieldsByObject:t}):PT(r)})},zT=[a.i.MANY_TO_ONE,a.i.ONE_TO_MANY],BT=`aggregateFieldMetadataId`,VT=e=>n.t(e)&&ZC.some(t=>t===e.configurationType),HT=e=>{let t=[];if(!e)return[];for(let[n,r]of Object.entries(e))n===`universalIdentifier`&&typeof r==`string`&&t.push(r),!(n===`postInstallLogicFunction`||n===`preInstallLogicFunction`||n===`uninstallLogicFunction`||n===`healthCheckLogicFunction`||n===`identifyAccountLogicFunction`||n===`authorizeLogicFunction`||n===`callbackLogicFunction`||n===`onConnectLogicFunction`||n===`onDisconnectLogicFunction`||n===`sendMessageLogicFunction`||n===`markThreadAsReadLogicFunction`||n===`connectionProvider`||n===`settingsFrontComponent`||n===`input`||n===`expectedBody`||n===`outputSchema`||n===`expectedOutputSchema`)&&typeof r==`object`&&t.push(...HT(r));return t},UT=e=>{let t=[];for(let n of e){if(!bT(n))continue;let e=n.universalSettings;if(!e?.relationType){t.push(`Relation field "${n.name}" is missing relationType. ${n.type} fields must declare a relationType (${zT.join(` or `)}) in universalSettings.`);continue}if(!zT.includes(e.relationType)){t.push(`Relation field "${n.name}" has invalid relationType "${e.relationType}". Expected ${zT.join(` or `)}.`);continue}e.relationType===a.i.MANY_TO_ONE&&!e.joinColumnName&&t.push(`MANY_TO_ONE relation field "${n.name}" is missing joinColumnName. MANY_TO_ONE relations must declare a joinColumnName in universalSettings.`)}return t},WT=e=>{let t=e.pageLayouts.flatMap(e=>e.tabs?.flatMap(e=>e.widgets??[])??[]),n=e.pageLayoutTabs.flatMap(e=>e.widgets??[]);return[...t,...n,...e.pageLayoutWidgets??[]]},GT=e=>{let t=[];for(let n of e){let e=n.configuration;if(VT(e)&&!(0,y.isNonEmptyString)(e.aggregateFieldMetadataUniversalIdentifier)){let r=BT in e?` Reference the aggregate field with "aggregateFieldMetadataUniversalIdentifier" (not "${BT}").`:``;t.push(`Graph widget "${n.title}" is missing aggregateFieldMetadataUniversalIdentifier.${r}`)}}return t},KT=({pageLayoutTab:e,pageLayoutType:t})=>{let n=vw({pageLayoutTabManifest:e,pageLayoutType:t});return n.status===`fail`?n.errors:[]},qT=e=>{let t=new Map(e.pageLayouts.map(e=>[e.universalIdentifier,e.type])),r=e.pageLayouts.flatMap(e=>(e.tabs??[]).flatMap(t=>KT({pageLayoutTab:t,pageLayoutType:e.type}))),i=e.pageLayoutTabs.flatMap(e=>KT({pageLayoutTab:e,pageLayoutType:n.t(e.pageLayoutUniversalIdentifier)?t.get(e.pageLayoutUniversalIdentifier):void 0}));return[...r,...i]},JT=e=>{let t=[],n=new Set;for(let r of e){if(n.has(r))continue;if(n.add(r),!$C(r)){t.push(`Universal identifier "${r}" is not a valid UUID.`);continue}let e=uw(r);c.t(r)||t.push(`Universal identifier "${r}" is UUID version ${e}. Only UUID version 4 or higher is allowed.`)}return t},YT=e=>{let t=[],i=WT(e),o=[...CT(e),...TT(e),...ST({manifest:e,pageLayoutWidgets:i})],s=HT(e),c=xT(s.map(e=>e.toLowerCase()));c.length>0&&t.push(`Duplicate universal identifiers: ${c.join(`, `)}`);let l=JT(s);l.length>0&&t.push(`Invalid universal identifiers: ${l.join(`, `)}`),(e.application.billing?.prices??[]).some(({per:e})=>e===`CONNECTED_ACCOUNT`)&&!r.t(e.connectionProviders)&&t.push(`A billing price per CONNECTED_ACCOUNT needs a connection provider: without one no account is ever connected and the price is never billed.`);let u=[...e.fields,...e.objects.flatMap(e=>e.fields)];for(let e of u)if((e.type===a.a.SELECT||e.type===a.a.MULTI_SELECT||e.type===a.a.RATING)&&n.t(e.options)){e.options.some(({id:e})=>n.t(e)&&!(0,y.isNonEmptyString)(e))&&t.push(`Field "${e.name}" has empty option IDs. Set distinct non-empty IDs on these options.`);let r=xT(e.options.map(e=>e.id).filter(n.t).map(e=>e.toLowerCase()));r.length>0&&t.push(`Field "${e.name}" has duplicate option IDs: ${r.join(`, `)}. Set distinct explicit IDs on these options.`)}return t.push(...UT(u)),t.push(...qT(e)),t.push(...GT(i)),t.push(...DT(e)),t.push(...RT(e)),t.push(...ET(e)),{errors:t,warnings:o,isValid:t.length===0}},XT={"twenty-sdk":`"twenty-sdk" is listed under "dependencies" in package.json. It is a build-time only tool and should be moved to "devDependencies".`,"twenty-client-sdk":`"twenty-client-sdk" is listed under "dependencies" in package.json. It is provided at runtime by Twenty's injected SDK and should be moved to "devDependencies".`},ZT=async e=>{let t=v.default.join(e,`package.json`);if(!await l.i(t))return[];let r=await l.a(t);return[`dependencies`,`optionalDependencies`].flatMap(e=>Object.entries(XT).filter(([t])=>n.t(r[e]?.[t])).map(([,t])=>t.replace(`"dependencies"`,`"${e}"`)))},QT=async e=>await l.i(e)?(await(0,ee.stat)(e)).size===0?[`yarn.lock is empty. Run "yarn install" to regenerate it before building.`]:[]:[`yarn.lock not found. Run "yarn install" to generate it before building.`],$T=e=>QT(v.default.join(e,`yarn.lock`)),eE=async e=>{let t=await vT(e);if(t.errors.length>0||!t.manifest)return{success:!1,errors:t.errors.length>0?t.errors:[`Failed to build manifest.`]};let n=YT(t.manifest);if(!n.isValid)return{success:!1,errors:n.errors};let r=await $T(e);if(r.length>0)return{success:!1,errors:r};let i=await ZT(e);return{success:!0,manifest:t.manifest,filePaths:t.filePaths,warnings:[...t.warnings,...n.warnings,...i]}},tE=({catalog:e,onCollision:t})=>{let r={},i=new Map;for(let{message:a,context:o,translation:s}of f.n(e)){if(s.length===0)continue;let e=n.t(o)?`${o} ${a}`:a,c=f.r(a,o),l=i.get(c);n.t(l)&&l!==e&&t?.({messageId:c,keptKey:e,droppedKey:l}),i.set(c,e),r[c]=s}return r},nE=async({filePath:e,onWarning:t})=>{let r;try{r=await l.a(e)}catch{return t(`Skipping translation file "${v.default.basename(e)}": it is not valid JSON.`),null}return!n.t(r)||typeof r!=`object`||Array.isArray(r)?(t(`Skipping translation file "${v.default.basename(e)}": expected a JSON object.`),null):r},rE=async({appPath:e,onWarning:t})=>{let n=v.default.join(e,h.t);if(!await l.i(n))return{};let r={};for(let e of(await(0,ee.readdir)(n)).filter(e=>e.endsWith(`.json`))){let i=v.default.basename(e,`.json`);if(i===`en`)continue;if(!s.t(i)){t(`Skipping compiled translation file "${e}": "${i}" is not a supported locale.`);continue}let a=await nE({filePath:v.default.join(n,e),onWarning:t});if(a===null)continue;let o=Object.fromEntries(Object.entries(a).filter(e=>typeof e[1]==`string`&&e[1].length>0));Object.keys(o).length>0&&(r[i]=o)}return r},iE=async({appPath:e,onWarning:t=e=>console.warn(e)})=>{let n=v.default.join(e,h.n);if(!await l.i(n))return;let r=(await(0,ee.readdir)(n)).filter(e=>e.endsWith(`.json`)),i={};for(let e of r){let r=v.default.basename(e,`.json`);if(r===`en`)continue;if(!s.t(r)){t(`Skipping translation file "${e}": "${r}" is not a supported locale.`);continue}let a=await nE({filePath:v.default.join(n,e),onWarning:t});if(a===null)continue;let o=tE({catalog:a,onCollision:({messageId:n,keptKey:r,droppedKey:i})=>t(`Message id collision in "${e}": "${r}" and "${i}" share id "${n}". Keeping "${r}".`)});Object.keys(o).length>0&&(i[r]=o)}for(let[n,r]of Object.entries(await rE({appPath:e,onWarning:t})))i[n]={...r,...i[n]??{}};return i};Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return yc}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Kw}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return tE}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return eE}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return iE}});
|