twenty-sdk 2.30.0 → 2.31.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/billing/index.cjs +20 -1
- package/dist/billing/index.cjs.map +1 -1
- package/dist/billing/index.mjs +2380 -18
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{catalog-sync-WmgvkRw7.mjs → catalog-sync-Ch6nB5uf.mjs} +1 -1
- package/dist/catalog-sync-yH3B_al1.js +1 -0
- package/dist/cli/utilities/build/common/esbuild-watcher.d.ts +1 -1
- package/dist/cli/utilities/build/common/front-component-build/front-components-watcher.d.ts +40 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/build-shared-dependencies-bundle.d.ts +8 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/create-shared-dependencies-shim-plugin.d.ts +3 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/types/shared-dependencies-build-context.type.d.ts +4 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/types/shared-dependencies-export-names.type.d.ts +4 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/enumerate-shared-dependencies-export-names.d.ts +5 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/get-shared-dependencies-entry-source.d.ts +1 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/get-shared-dependencies-namespace-collisions.d.ts +1 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/get-shared-dependencies-shim-source.d.ts +5 -0
- package/dist/cli/utilities/build/common/front-component-build/shared-dependencies-build/utils/to-shared-dependencies-namespace-identifier.d.ts +1 -0
- package/dist/cli/utilities/build/common/front-component-build/utils/get-front-component-build-plugins.d.ts +2 -0
- package/dist/cli/utilities/build/manifest/utils/extract-front-component-shared-dependencies.d.ts +5 -0
- package/dist/cli/utilities/build/manifest/utils/normalize-front-component-shared-dependencies.d.ts +1 -0
- package/dist/cli.cjs +36 -36
- package/dist/cli.mjs +2147 -2051
- package/dist/define/index.cjs +24 -24
- package/dist/define/index.cjs.map +1 -1
- package/dist/define/index.d.ts +328 -844
- package/dist/define/index.mjs +6645 -6513
- package/dist/define/index.mjs.map +1 -1
- package/dist/front-component/index.cjs +3 -3
- package/dist/front-component/index.cjs.map +1 -1
- package/dist/front-component/index.mjs +460 -460
- package/dist/front-component/index.mjs.map +1 -1
- package/dist/front-component-renderer/build.cjs +1 -1
- package/dist/front-component-renderer/build.mjs +1 -1
- package/dist/get-front-component-build-plugins-C-Webbfn.js +196 -0
- package/dist/get-front-component-build-plugins-DA62IZes.mjs +9849 -0
- package/dist/{get-function-input-schema-GNk3NRLJ-DkTcUzrb.mjs → get-function-input-schema-GNk3NRLJ-C5HXalke.mjs} +1 -1
- package/dist/get-function-input-schema-GNk3NRLJ-DwfXUGPz.js +1 -0
- package/dist/logic-function/index.cjs +26 -7
- package/dist/logic-function/index.cjs.map +1 -1
- package/dist/logic-function/index.mjs +2420 -56
- package/dist/logic-function/index.mjs.map +1 -1
- package/dist/{login-BnGCnmge.mjs → login-BHgUJK94.mjs} +5750 -15164
- package/dist/login-BzHQgxeV.js +343 -0
- package/dist/operations.cjs +1 -1
- package/dist/operations.mjs +1 -1
- package/dist/utils/index.cjs +20 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs +2375 -13
- package/dist/utils/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/catalog-sync-61JsVcDP.js +0 -1
- package/dist/get-front-component-build-plugins-B5IvUvSS.mjs +0 -133
- package/dist/get-front-component-build-plugins-TJrFS3_p.js +0 -172
- package/dist/get-function-input-schema-GNk3NRLJ-D8x7FINz.js +0 -1
- package/dist/isDefined-Dtu5EYqP-Dp026Ry1.js +0 -1
- package/dist/login-CM2Aug-k.js +0 -365
package/dist/operations.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./login-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./login-BzHQgxeV.js");var t=async t=>(t?.remote&&e.U.setActiveRemote(t.remote),await new e.U().clearConfig(),{success:!0,data:void 0}),n=n=>e.X(()=>t(n),e.q.AUTH_FAILED),r=`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyMDIwMjAyMC0xYzI1LTRkMDItYmYyNS02YWVjY2Y3ZWE0MTkiLCJ0eXBlIjoiQVBJX0tFWSIsIndvcmtzcGFjZUlkIjoiMjAyMDIwMjAtMWMyNS00ZDAyLWJmMjUtNmFlY2NmN2VhNDE5IiwiaWF0IjoxNzM1Njg5NjAwLCJleHAiOjQ4OTE0NDk2MDAsImp0aSI6IjIwMjAyMDIwLWY0MDEtNGQ4YS1hNzMxLTY0ZDAwN2MyN2JhZCJ9.bfQjfyN0NEtTCLE_xPyNcwonDzlSXFoP8kdCQTdnuDc`,i=`http://localhost:2020`;exports.APP_ERROR_CODES=e.K,exports.AUTH_ERROR_CODES=e.q,exports.ConfigService=e.U,exports.DEV_API_KEY=r,exports.DEV_API_URL=i,exports.FUNCTION_ERROR_CODES=e.J,exports.SERVER_ERROR_CODES=e.Y,exports.appBuild=e.G,exports.appDeploy=e.R,exports.appDevOnce=e.a,exports.appInstall=e.N,exports.appPublish=e.L,exports.appUninstall=e.v,exports.authLogin=e.t,exports.authLoginOAuth=e.H,exports.authLogout=n,exports.checkDockerRunning=e.T,exports.containerExists=e.E,exports.detectLocalServer=e.m,exports.functionExecute=e._,exports.getContainerDigest=e.D,exports.getEngineVersionRange=e.et,exports.getImageDigest=e.A,exports.getImageForVersion=e.j,exports.resolveHighestEngineVersion=e.r,exports.serverStart=e.n,exports.serverUpgrade=e.i;
|
package/dist/operations.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { createRequire as e } from "node:module";
|
|
|
2
2
|
import { fileURLToPath as t } from "node:url";
|
|
3
3
|
import { dirname as n } from "node:path";
|
|
4
4
|
e(import.meta.url), n(t(import.meta.url));
|
|
5
|
-
import { A as r, D as i, E as a, G as o, H as s, J as c, K as l, L as u, N as d, R as f, T as p, U as m, X as h, Y as g, _, a as v, et as y, i as b, j as x, m as S, n as C, q as w, r as T, t as E, v as D } from "./login-
|
|
5
|
+
import { A as r, D as i, E as a, G as o, H as s, J as c, K as l, L as u, N as d, R as f, T as p, U as m, X as h, Y as g, _, a as v, et as y, i as b, j as x, m as S, n as C, q as w, r as T, t as E, v as D } from "./login-BHgUJK94.mjs";
|
|
6
6
|
//#region src/cli/operations/logout.ts
|
|
7
7
|
var O = async (e) => (e?.remote && m.setActiveRemote(e.remote), await new m().clearConfig(), {
|
|
8
8
|
success: !0,
|
package/dist/utils/index.cjs
CHANGED
|
@@ -1,2 +1,21 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("uuid");let e=require("@sniptt/guards");var t=function(e){return e.ACTOR=`ACTOR`,e.ADDRESS=`ADDRESS`,e.ARRAY=`ARRAY`,e.BOOLEAN=`BOOLEAN`,e.CURRENCY=`CURRENCY`,e.DATE=`DATE`,e.DATE_TIME=`DATE_TIME`,e.EMAILS=`EMAILS`,e.FILES=`FILES`,e.FULL_NAME=`FULL_NAME`,e.LINKS=`LINKS`,e.MORPH_RELATION=`MORPH_RELATION`,e.MULTI_SELECT=`MULTI_SELECT`,e.NUMBER=`NUMBER`,e.NUMERIC=`NUMERIC`,e.PHONES=`PHONES`,e.POSITION=`POSITION`,e.RATING=`RATING`,e.RAW_JSON=`RAW_JSON`,e.RELATION=`RELATION`,e.RICH_TEXT=`RICH_TEXT`,e.SELECT=`SELECT`,e.TEXT=`TEXT`,e.TS_VECTOR=`TS_VECTOR`,e.UUID=`UUID`,e}({});t.TEXT,t.ARRAY,t.BOOLEAN,t.DATE,t.DATE_TIME,t.NUMBER,t.NUMERIC,t.RAW_JSON,t.RICH_TEXT,t.SELECT,t.MULTI_SELECT;var n=`TWENTY_API_URL`,r=`TWENTY_APP_ACCESS_TOKEN`,i=e=>{let t=JSON.parse(atob(e.split(`.`)[1]));return{workspaceId:t.workspaceId,applicationId:t.applicationId}},a=e=>{let t=process.env[n],a=process.env[r];if(!t||!a)throw Error(`getPublicAssetUrl can only be called from within a logic function or front component`);let{workspaceId:o,applicationId:s}=i(a),c=e.startsWith(`/`)?e.slice(1):e;return`${t}/public-assets/${o}/${s}/${(c.startsWith(`public/`)?c:`public/${c}`).split(`/`).map(encodeURIComponent).join(`/`)}`},o=t=>!(0,e.isUndefined)(t)&&!(0,e.isNull)(t);exports.getPublicAssetUrl=a,exports.isDefined=o;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("uuid"),t=require("@sniptt/guards");Object.freeze({status:`aborted`});function n(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var r=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},i=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}},a={};function o(e){return e&&Object.assign(a,e),a}function s(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 c(e,t){return typeof t==`bigint`?t.toString():t}function l(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error(`cached value already set`)}}}function u(e){return e==null}function d(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var f=Symbol(`evaluating`);function p(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==f)return r===void 0&&(r=f,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function m(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function h(...e){let t={};for(let n of e)Object.assign(t,Object.getOwnPropertyDescriptors(n));return Object.defineProperties({},t)}function g(e){return JSON.stringify(e)}var ee=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function _(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var te=l(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function v(e){if(_(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(_(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ne(e){return v(e)?{...e}:Array.isArray(e)?[...e]:e}var re=new Set([`string`,`number`,`symbol`]);function y(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function b(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 ie(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function ae(e,t){let n=e._zod.def;return b(e,h(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return m(this,`shape`,e),e},checks:[]}))}function oe(e,t){let n=e._zod.def;return b(e,h(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return m(this,`shape`,r),r},checks:[]}))}function se(e,t){if(!v(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0)throw Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");return b(e,h(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return m(this,`shape`,n),n},checks:[]}))}function ce(e,t){if(!v(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return b(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return m(this,`shape`,n),n},checks:e._zod.def.checks})}function le(e,t){return b(e,h(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return m(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:[]}))}function ue(e,t,n){return b(t,h(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return m(this,`shape`,i),i},checks:[]}))}function de(e,t,n){return b(t,h(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return m(this,`shape`,i),i},checks:[]}))}function S(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 fe(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function C(e){return typeof e==`string`?e:e?.message}function w(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=C(e.inst?._zod.def?.error?.(e))??C(t?.error?.(e))??C(n.customError?.(e))??C(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function T(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function E(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var pe=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,c,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},me=n(`$ZodError`,pe),he=n(`$ZodError`,pe,{Parent:Error});function ge(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function _e(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i<t.path.length;){let r=t.path[i];i===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],i++}}};return i(e),r}var D=e=>(t,n,i,a)=>{let s=i?Object.assign(i,{async:!1}):{async:!1},c=t._zod.run({value:n,issues:[]},s);if(c instanceof Promise)throw new r;if(c.issues.length){let t=new(a?.Err??e)(c.issues.map(e=>w(e,s,o())));throw ee(t,a?.callee),t}return c.value},O=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>w(e,a,o())));throw ee(t,i?.callee),t}return s.value},k=e=>(t,n,i)=>{let a=i?{...i,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},a);if(s instanceof Promise)throw new r;return s.issues.length?{success:!1,error:new(e??me)(s.issues.map(e=>w(e,a,o())))}:{success:!0,data:s.value}},ve=k(he),A=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>w(e,i,o())))}:{success:!0,data:a.value}},ye=A(he),be=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return D(e)(t,n,i)},xe=e=>(t,n,r)=>D(e)(t,n,r),Se=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return O(e)(t,n,i)},Ce=e=>async(t,n,r)=>O(e)(t,n,r),we=e=>(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return k(e)(t,n,i)},Te=e=>(t,n,r)=>k(e)(t,n,r),Ee=e=>async(t,n,r)=>{let i=r?Object.assign(r,{direction:`backward`}):{direction:`backward`};return A(e)(t,n,i)},De=e=>async(t,n,r)=>A(e)(t,n,r),Oe=/^[cC][^\s-]{8,}$/,ke=/^[0-9a-z]+$/,Ae=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,je=/^[0-9a-vA-V]{20}$/,Me=/^[A-Za-z0-9]{27}$/,Ne=/^[a-zA-Z0-9_-]{21}$/,Pe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Fe=/^([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})$/,j=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)$/,Ie=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Le=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Re(){return new RegExp(Le,`u`)}var ze=/^(?:(?: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])$/,Be=/^(([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}|:))$/,Ve=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,He=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ue=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,M=/^[A-Za-z0-9_-]*$/,We=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Ge=/^\+(?:[0-9]){6,14}[0-9]$/,N=`(?:(?:\\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])))`,Ke=RegExp(`^${N}$`);function P(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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function qe(e){return RegExp(`^${P(e)}$`)}function Je(e){let t=P({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${N}T(?:${r})$`)}var Ye=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Xe=/^[^A-Z]*$/,Ze=/^[^a-z]*$/,F=n(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Qe=n(`$ZodCheckMaxLength`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!u(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=T(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$e=n(`$ZodCheckMinLength`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!u(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=T(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),et=n(`$ZodCheckLengthEquals`,(e,t)=>{var n;F.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!u(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=T(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),I=n(`$ZodCheckStringFormat`,(e,t)=>{var n,r;F.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),tt=n(`$ZodCheckRegex`,(e,t)=>{I.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})}}),nt=n(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Xe,I.init(e,t)}),rt=n(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Ze,I.init(e,t)}),it=n(`$ZodCheckIncludes`,(e,t)=>{F.init(e,t);let n=y(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),at=n(`$ZodCheckStartsWith`,(e,t)=>{F.init(e,t);let n=RegExp(`^${y(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ot=n(`$ZodCheckEndsWith`,(e,t)=>{F.init(e,t);let n=RegExp(`.*${y(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),st=n(`$ZodCheckOverwrite`,(e,t)=>{F.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),ct=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--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?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
3
|
+
`))}},lt={major:4,minor:1,patch:11},L=n(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=lt;let i=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&i.unshift(e);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=(e,t,n)=>{let i=S(e),a;for(let o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&n?.async===!1)throw new r;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,e.issues.length!==t&&(i||=S(e,t))});else{if(e.issues.length===t)continue;i||=S(e,t)}}return a?a.then(()=>e):e},n=(n,a,o)=>{if(S(n))return n.aborted=!0,n;let s=t(a,i,o);if(s instanceof Promise){if(o.async===!1)throw new r;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(a,o)=>{if(o.skipChecks)return e._zod.parse(a,o);if(o.direction===`backward`){let t=e._zod.parse({value:a.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,a,o)):n(t,a,o)}let s=e._zod.parse(a,o);if(s instanceof Promise){if(o.async===!1)throw new r;return s.then(e=>t(e,i,o))}return t(s,i,o)}}e[`~standard`]={validate:t=>{try{let n=ve(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return ye(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),R=n(`$ZodString`,(e,t)=>{L.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ye(e._zod.bag),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}}),z=n(`$ZodStringFormat`,(e,t)=>{I.init(e,t),R.init(e,t)}),ut=n(`$ZodGUID`,(e,t)=>{t.pattern??=Fe,z.init(e,t)}),dt=n(`$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??=j(e)}else t.pattern??=j();z.init(e,t)}),ft=n(`$ZodEmail`,(e,t)=>{t.pattern??=Ie,z.init(e,t)}),pt=n(`$ZodURL`,(e,t)=>{z.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:We.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),mt=n(`$ZodEmoji`,(e,t)=>{t.pattern??=Re(),z.init(e,t)}),ht=n(`$ZodNanoID`,(e,t)=>{t.pattern??=Ne,z.init(e,t)}),gt=n(`$ZodCUID`,(e,t)=>{t.pattern??=Oe,z.init(e,t)}),_t=n(`$ZodCUID2`,(e,t)=>{t.pattern??=ke,z.init(e,t)}),vt=n(`$ZodULID`,(e,t)=>{t.pattern??=Ae,z.init(e,t)}),yt=n(`$ZodXID`,(e,t)=>{t.pattern??=je,z.init(e,t)}),bt=n(`$ZodKSUID`,(e,t)=>{t.pattern??=Me,z.init(e,t)}),xt=n(`$ZodISODateTime`,(e,t)=>{t.pattern??=Je(t),z.init(e,t)}),St=n(`$ZodISODate`,(e,t)=>{t.pattern??=Ke,z.init(e,t)}),Ct=n(`$ZodISOTime`,(e,t)=>{t.pattern??=qe(t),z.init(e,t)}),wt=n(`$ZodISODuration`,(e,t)=>{t.pattern??=Pe,z.init(e,t)}),Tt=n(`$ZodIPv4`,(e,t)=>{t.pattern??=ze,z.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),Et=n(`$ZodIPv6`,(e,t)=>{t.pattern??=Be,z.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Dt=n(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Ve,z.init(e,t)}),Ot=n(`$ZodCIDRv6`,(e,t)=>{t.pattern??=He,z.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function kt(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var At=n(`$ZodBase64`,(e,t)=>{t.pattern??=Ue,z.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{kt(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function jt(e){if(!M.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return kt(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Mt=n(`$ZodBase64URL`,(e,t)=>{t.pattern??=M,z.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{jt(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Nt=n(`$ZodE164`,(e,t)=>{t.pattern??=Ge,z.init(e,t)});function Pt(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 Ft=n(`$ZodJWT`,(e,t)=>{z.init(e,t),e._zod.check=n=>{Pt(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),It=n(`$ZodUnknown`,(e,t)=>{L.init(e,t),e._zod.parse=e=>e}),Lt=n(`$ZodNever`,(e,t)=>{L.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Rt(e,t,n){e.issues.length&&t.issues.push(...fe(n,e.issues)),t.value[n]=e.value}var zt=n(`$ZodArray`,(e,t)=>{L.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Rt(t,n,e))):Rt(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function B(e,t,n,r){e.issues.length&&t.issues.push(...fe(n,e.issues)),e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Bt(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=ie(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Vt(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type;for(let i of Object.keys(t)){if(s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>B(e,n,i,t))):B(a,n,i,t)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var Ht=n(`$ZodObject`,(e,t)=>{if(L.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=l(()=>Bt(t));p(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=_,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e]._zod.run({value:s[e],issues:[]},o);n instanceof Promise?c.push(n.then(n=>B(n,t,e,s))):B(n,t,e,s)}return i?Vt(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Ut=n(`$ZodObjectJIT`,(e,t)=>{Ht.init(e,t);let n=e._zod.parse,r=l(()=>Bt(t)),i=e=>{let t=new ct([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=g(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let e of n.keys){let n=a[e],r=g(e);t.write(`const ${n} = ${i(e)};`),t.write(`
|
|
4
|
+
if (${n}.issues.length) {
|
|
5
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
6
|
+
...iss,
|
|
7
|
+
path: iss.path ? [${r}, ...iss.path] : [${r}]
|
|
8
|
+
})));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
if (${n}.value === undefined) {
|
|
13
|
+
if (${r} in input) {
|
|
14
|
+
newResult[${r}] = undefined;
|
|
15
|
+
}
|
|
16
|
+
} else {
|
|
17
|
+
newResult[${r}] = ${n}.value;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},o,s=_,c=!a.jitless,u=c&&te.value,d=t.catchall,f;e._zod.parse=(a,l)=>{f??=r.value;let p=a.value;return s(p)?c&&u&&l?.async===!1&&l.jitless!==!0?(o||=i(t.shape),a=o(a,l),d?Vt([],p,a,l,f,e):a):n(a,l):(a.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),a)}});function Wt(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=>!S(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=>w(e,r,o())))}),t)}var Gt=n(`$ZodUnion`,(e,t)=>{L.init(e,t),p(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),p(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),p(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),p(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>d(e.source)).join(`|`)})$`)}});let n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(i,a)=>{if(n)return r(i,a);let o=!1,s=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},a);if(t instanceof Promise)s.push(t),o=!0;else{if(t.issues.length===0)return t;s.push(t)}}return o?Promise.all(s).then(t=>Wt(t,i,e,a)):Wt(s,i,e,a)}}),Kt=n(`$ZodIntersection`,(e,t)=>{L.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])=>qt(e,t,n)):qt(e,i,a)}});function V(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(v(e)&&v(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=V(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=V(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 qt(e,t,n){if(t.issues.length&&e.issues.push(...t.issues),n.issues.length&&e.issues.push(...n.issues),S(e))return e;let r=V(t.value,n.value);if(!r.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);return e.value=r.data,e}var Jt=n(`$ZodEnum`,(e,t)=>{L.init(e,t);let n=s(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>re.has(typeof e)).map(e=>typeof e==`string`?y(e):e.toString()).join(`|`)})$`),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}}),Yt=n(`$ZodTransform`,(e,t)=>{L.init(e,t),e._zod.parse=(n,a)=>{if(a.direction===`backward`)throw new i(e.constructor.name);let o=t.transform(n.value,n);if(a.async)return(o instanceof Promise?o:Promise.resolve(o)).then(e=>(n.value=e,n));if(o instanceof Promise)throw new r;return n.value=o,n}});function Xt(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}var Zt=n(`$ZodOptional`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${d(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(t=>Xt(t,e.value)):Xt(r,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Qt=n(`$ZodNullable`,(e,t)=>{L.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${d(e.source)}|null)$`):void 0}),p(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),$t=n(`$ZodDefault`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.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=>en(e,t)):en(r,t)}});function en(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var tn=n(`$ZodPrefault`,(e,t)=>{L.init(e,t),e._zod.optin=`optional`,p(e._zod,`values`,()=>t.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))}),nn=n(`$ZodNonOptional`,(e,t)=>{L.init(e,t),p(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].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=>rn(t,e)):rn(i,e)}});function rn(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var an=n(`$ZodCatch`,(e,t)=>{L.init(e,t),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.innerType._zod.optout),p(e._zod,`values`,()=>t.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(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>w(e,n,o()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>w(e,n,o()))},input:e.value}),e.issues=[]),e)}}),on=n(`$ZodPipe`,(e,t)=>{L.init(e,t),p(e._zod,`values`,()=>t.in._zod.values),p(e._zod,`optin`,()=>t.in._zod.optin),p(e._zod,`optout`,()=>t.out._zod.optout),p(e._zod,`propValues`,()=>t.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=>H(e,t.in,n)):H(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>H(e,t.out,n)):H(r,t.out,n)}});function H(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var sn=n(`$ZodReadonly`,(e,t)=>{L.init(e,t),p(e._zod,`propValues`,()=>t.innerType._zod.propValues),p(e._zod,`values`,()=>t.innerType._zod.values),p(e._zod,`optin`,()=>t.innerType._zod.optin),p(e._zod,`optout`,()=>t.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(cn):cn(r)}});function cn(e){return e.value=Object.freeze(e.value),e}var ln=n(`$ZodCustom`,(e,t)=>{F.init(e,t),L.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=>un(t,n,r,e));un(i,n,r,e)}});function un(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(E(e))}}var dn=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return 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 fn(){return new dn}var U=fn();function pn(e,t){return new e({type:`string`,...x(t)})}function mn(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...x(t)})}function hn(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...x(t)})}function gn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...x(t)})}function _n(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...x(t)})}function vn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...x(t)})}function yn(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...x(t)})}function bn(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...x(t)})}function xn(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...x(t)})}function Sn(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...x(t)})}function Cn(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...x(t)})}function wn(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...x(t)})}function Tn(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...x(t)})}function En(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...x(t)})}function Dn(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...x(t)})}function On(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...x(t)})}function kn(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...x(t)})}function An(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...x(t)})}function jn(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...x(t)})}function Mn(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...x(t)})}function Nn(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...x(t)})}function Pn(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...x(t)})}function Fn(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...x(t)})}function In(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...x(t)})}function Ln(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...x(t)})}function Rn(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...x(t)})}function zn(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...x(t)})}function Bn(e){return new e({type:`unknown`})}function Vn(e,t){return new e({type:`never`,...x(t)})}function Hn(e,t){return new Qe({check:`max_length`,...x(t),maximum:e})}function W(e,t){return new $e({check:`min_length`,...x(t),minimum:e})}function Un(e,t){return new et({check:`length_equals`,...x(t),length:e})}function Wn(e,t){return new tt({check:`string_format`,format:`regex`,...x(t),pattern:e})}function Gn(e){return new nt({check:`string_format`,format:`lowercase`,...x(e)})}function Kn(e){return new rt({check:`string_format`,format:`uppercase`,...x(e)})}function qn(e,t){return new it({check:`string_format`,format:`includes`,...x(t),includes:e})}function Jn(e,t){return new at({check:`string_format`,format:`starts_with`,...x(t),prefix:e})}function Yn(e,t){return new ot({check:`string_format`,format:`ends_with`,...x(t),suffix:e})}function G(e){return new st({check:`overwrite`,tx:e})}function Xn(e){return G(t=>t.normalize(e))}function Zn(){return G(e=>e.trim())}function Qn(){return G(e=>e.toLowerCase())}function $n(){return G(e=>e.toUpperCase())}function er(e,t,n){return new e({type:`array`,element:t,...x(n)})}function tr(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...x(n)})}function nr(e){let t=rr(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(E(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(E(r))}},e(n.value,n)));return t}function rr(e,t){let n=new F({check:`custom`,...x(t)});return n._zod.check=e,n}var ir=n(`ZodISODateTime`,(e,t)=>{xt.init(e,t),J.init(e,t)});function ar(e){return In(ir,e)}var or=n(`ZodISODate`,(e,t)=>{St.init(e,t),J.init(e,t)});function sr(e){return Ln(or,e)}var cr=n(`ZodISOTime`,(e,t)=>{Ct.init(e,t),J.init(e,t)});function lr(e){return Rn(cr,e)}var ur=n(`ZodISODuration`,(e,t)=>{wt.init(e,t),J.init(e,t)});function dr(e){return zn(ur,e)}var fr=(e,t)=>{me.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>_e(e,t)},flatten:{value:t=>ge(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,c,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,c,2)}},isEmpty:{get(){return e.issues.length===0}}})};n(`ZodError`,fr);var K=n(`ZodError`,fr,{Parent:Error}),pr=D(K),mr=O(K),hr=k(K),gr=A(K),_r=be(K),vr=xe(K),yr=Se(K),br=Ce(K),xr=we(K),Sr=Te(K),Cr=Ee(K),wr=De(K),q=n(`ZodType`,(e,t)=>(L.init(e,t),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(h(t,{checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]})),e.clone=(t,n)=>b(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>pr(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>hr(e,t,n),e.parseAsync=async(t,n)=>mr(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>gr(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>_r(e,t,n),e.decode=(t,n)=>vr(e,t,n),e.encodeAsync=async(t,n)=>yr(e,t,n),e.decodeAsync=async(t,n)=>br(e,t,n),e.safeEncode=(t,n)=>xr(e,t,n),e.safeDecode=(t,n)=>Sr(e,t,n),e.safeEncodeAsync=async(t,n)=>Cr(e,t,n),e.safeDecodeAsync=async(t,n)=>wr(e,t,n),e.refine=(t,n)=>e.check(Ci(t,n)),e.superRefine=t=>e.check(wi(t)),e.overwrite=t=>e.check(G(t)),e.optional=()=>si(e),e.nullable=()=>li(e),e.nullish=()=>si(li(e)),e.nonoptional=t=>hi(e,t),e.array=()=>Zr(e),e.or=t=>ti([e,t]),e.and=t=>ri(e,t),e.transform=t=>yi(e,oi(t)),e.default=t=>di(e,t),e.prefault=t=>pi(e,t),e.catch=t=>_i(e,t),e.pipe=t=>yi(e,t),e.readonly=()=>xi(e),e.describe=t=>{let n=e.clone();return U.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return U.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return U.get(e);let n=e.clone();return U.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Tr=n(`_ZodString`,(e,t)=>{R.init(e,t),q.init(e,t);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...t)=>e.check(Wn(...t)),e.includes=(...t)=>e.check(qn(...t)),e.startsWith=(...t)=>e.check(Jn(...t)),e.endsWith=(...t)=>e.check(Yn(...t)),e.min=(...t)=>e.check(W(...t)),e.max=(...t)=>e.check(Hn(...t)),e.length=(...t)=>e.check(Un(...t)),e.nonempty=(...t)=>e.check(W(1,...t)),e.lowercase=t=>e.check(Gn(t)),e.uppercase=t=>e.check(Kn(t)),e.trim=()=>e.check(Zn()),e.normalize=(...t)=>e.check(Xn(...t)),e.toLowerCase=()=>e.check(Qn()),e.toUpperCase=()=>e.check($n())}),Er=n(`ZodString`,(e,t)=>{R.init(e,t),Tr.init(e,t),e.email=t=>e.check(mn(Or,t)),e.url=t=>e.check(bn(Ar,t)),e.jwt=t=>e.check(Fn(Gr,t)),e.emoji=t=>e.check(xn(jr,t)),e.guid=t=>e.check(hn(kr,t)),e.uuid=t=>e.check(gn(Y,t)),e.uuidv4=t=>e.check(_n(Y,t)),e.uuidv6=t=>e.check(vn(Y,t)),e.uuidv7=t=>e.check(yn(Y,t)),e.nanoid=t=>e.check(Sn(Mr,t)),e.guid=t=>e.check(hn(kr,t)),e.cuid=t=>e.check(Cn(Nr,t)),e.cuid2=t=>e.check(wn(Pr,t)),e.ulid=t=>e.check(Tn(Fr,t)),e.base64=t=>e.check(Mn(Hr,t)),e.base64url=t=>e.check(Nn(Ur,t)),e.xid=t=>e.check(En(Ir,t)),e.ksuid=t=>e.check(Dn(Lr,t)),e.ipv4=t=>e.check(On(Rr,t)),e.ipv6=t=>e.check(kn(zr,t)),e.cidrv4=t=>e.check(An(Br,t)),e.cidrv6=t=>e.check(jn(Vr,t)),e.e164=t=>e.check(Pn(Wr,t)),e.datetime=t=>e.check(ar(t)),e.date=t=>e.check(sr(t)),e.time=t=>e.check(lr(t)),e.duration=t=>e.check(dr(t))});function Dr(e){return pn(Er,e)}var J=n(`ZodStringFormat`,(e,t)=>{z.init(e,t),Tr.init(e,t)}),Or=n(`ZodEmail`,(e,t)=>{ft.init(e,t),J.init(e,t)}),kr=n(`ZodGUID`,(e,t)=>{ut.init(e,t),J.init(e,t)}),Y=n(`ZodUUID`,(e,t)=>{dt.init(e,t),J.init(e,t)}),Ar=n(`ZodURL`,(e,t)=>{pt.init(e,t),J.init(e,t)}),jr=n(`ZodEmoji`,(e,t)=>{mt.init(e,t),J.init(e,t)}),Mr=n(`ZodNanoID`,(e,t)=>{ht.init(e,t),J.init(e,t)}),Nr=n(`ZodCUID`,(e,t)=>{gt.init(e,t),J.init(e,t)}),Pr=n(`ZodCUID2`,(e,t)=>{_t.init(e,t),J.init(e,t)}),Fr=n(`ZodULID`,(e,t)=>{vt.init(e,t),J.init(e,t)}),Ir=n(`ZodXID`,(e,t)=>{yt.init(e,t),J.init(e,t)}),Lr=n(`ZodKSUID`,(e,t)=>{bt.init(e,t),J.init(e,t)}),Rr=n(`ZodIPv4`,(e,t)=>{Tt.init(e,t),J.init(e,t)}),zr=n(`ZodIPv6`,(e,t)=>{Et.init(e,t),J.init(e,t)}),Br=n(`ZodCIDRv4`,(e,t)=>{Dt.init(e,t),J.init(e,t)}),Vr=n(`ZodCIDRv6`,(e,t)=>{Ot.init(e,t),J.init(e,t)}),Hr=n(`ZodBase64`,(e,t)=>{At.init(e,t),J.init(e,t)}),Ur=n(`ZodBase64URL`,(e,t)=>{Mt.init(e,t),J.init(e,t)}),Wr=n(`ZodE164`,(e,t)=>{Nt.init(e,t),J.init(e,t)}),Gr=n(`ZodJWT`,(e,t)=>{Ft.init(e,t),J.init(e,t)}),Kr=n(`ZodUnknown`,(e,t)=>{It.init(e,t),q.init(e,t)});function qr(){return Bn(Kr)}var Jr=n(`ZodNever`,(e,t)=>{Lt.init(e,t),q.init(e,t)});function Yr(e){return Vn(Jr,e)}var Xr=n(`ZodArray`,(e,t)=>{zt.init(e,t),q.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(W(t,n)),e.nonempty=t=>e.check(W(1,t)),e.max=(t,n)=>e.check(Hn(t,n)),e.length=(t,n)=>e.check(Un(t,n)),e.unwrap=()=>e.element});function Zr(e,t){return er(Xr,e,t)}var Qr=n(`ZodObject`,(e,t)=>{Ut.init(e,t),q.init(e,t),p(e,`shape`,()=>t.shape),e.keyof=()=>ii(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:qr()}),e.loose=()=>e.clone({...e._zod.def,catchall:qr()}),e.strict=()=>e.clone({...e._zod.def,catchall:Yr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>se(e,t),e.safeExtend=t=>ce(e,t),e.merge=t=>le(e,t),e.pick=t=>ae(e,t),e.omit=t=>oe(e,t),e.partial=(...t)=>ue(Z,e,t[0]),e.required=(...t)=>de(mi,e,t[0])});function $r(e,t){return new Qr({type:`object`,shape:e??{},...x(t)})}var ei=n(`ZodUnion`,(e,t)=>{Gt.init(e,t),q.init(e,t),e.options=t.options});function ti(e,t){return new ei({type:`union`,options:e,...x(t)})}var ni=n(`ZodIntersection`,(e,t)=>{Kt.init(e,t),q.init(e,t)});function ri(e,t){return new ni({type:`intersection`,left:e,right:t})}var X=n(`ZodEnum`,(e,t)=>{Jt.init(e,t),q.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);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 X({...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 X({...t,checks:[],...x(r),entries:i})}});function ii(e,t){return new X({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...x(t)})}var ai=n(`ZodTransform`,(e,t)=>{Yt.init(e,t),q.init(e,t),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new i(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(E(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(E(t))}};let a=t.transform(n.value,n);return a instanceof Promise?a.then(e=>(n.value=e,n)):(n.value=a,n)}});function oi(e){return new ai({type:`transform`,transform:e})}var Z=n(`ZodOptional`,(e,t)=>{Zt.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function si(e){return new Z({type:`optional`,innerType:e})}var ci=n(`ZodNullable`,(e,t)=>{Qt.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function li(e){return new ci({type:`nullable`,innerType:e})}var ui=n(`ZodDefault`,(e,t)=>{$t.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function di(e,t){return new ui({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ne(t)}})}var fi=n(`ZodPrefault`,(e,t)=>{tn.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function pi(e,t){return new fi({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ne(t)}})}var mi=n(`ZodNonOptional`,(e,t)=>{nn.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function hi(e,t){return new mi({type:`nonoptional`,innerType:e,...x(t)})}var gi=n(`ZodCatch`,(e,t)=>{an.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function _i(e,t){return new gi({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var vi=n(`ZodPipe`,(e,t)=>{on.init(e,t),q.init(e,t),e.in=t.in,e.out=t.out});function yi(e,t){return new vi({type:`pipe`,in:e,out:t})}var bi=n(`ZodReadonly`,(e,t)=>{sn.init(e,t),q.init(e,t),e.unwrap=()=>e._zod.def.innerType});function xi(e){return new bi({type:`readonly`,innerType:e})}var Si=n(`ZodCustom`,(e,t)=>{ln.init(e,t),q.init(e,t)});function Ci(e,t={}){return tr(Si,e,t)}function wi(e){return nr(e)}var Ti=function(){function e(e){this.groups=[],this.each=!1,this.context=void 0,this.type=e.type,this.name=e.name,this.target=e.target,this.propertyName=e.propertyName,this.constraints=e?.constraints,this.constraintCls=e.constraintCls,this.validationTypeOptions=e.validationTypeOptions,e.validationOptions&&(this.message=e.validationOptions.message,this.groups=e.validationOptions.groups,this.always=e.validationOptions.always,this.each=e.validationOptions.each,this.context=e.validationOptions.context)}return e}(),Ei=function(){function e(){}return e.prototype.transform=function(e){var t=[];return Object.keys(e.properties).forEach(function(n){e.properties[n].forEach(function(r){var i={message:r.message,groups:r.groups,always:r.always,each:r.each},a={type:r.type,name:r.name,target:e.name,propertyName:n,constraints:r.constraints,validationTypeOptions:r.options,validationOptions:i};t.push(new Ti(a))})}),t},e}(),Di=function(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)},Oi=function(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a},ki=function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))};(function(){function e(){this.validationMetadatas=new Map,this.constraintMetadatas=new Map}return Object.defineProperty(e.prototype,"hasValidationMetaData",{get:function(){return!!this.validationMetadatas.size},enumerable:!1,configurable:!0}),e.prototype.addValidationSchema=function(e){var t=this;new Ei().transform(e).forEach(function(e){return t.addValidationMetadata(e)})},e.prototype.addValidationMetadata=function(e){var t=this.validationMetadatas.get(e.target);t?t.push(e):this.validationMetadatas.set(e.target,[e])},e.prototype.addConstraintMetadata=function(e){var t=this.constraintMetadatas.get(e.target);t?t.push(e):this.constraintMetadatas.set(e.target,[e])},e.prototype.groupByPropertyName=function(e){var t={};return e.forEach(function(e){t[e.propertyName]||(t[e.propertyName]=[]),t[e.propertyName].push(e)}),t},e.prototype.getTargetValidationMetadatas=function(e,t,n,r,i){var a,o,s=function(e){return e.always===void 0?e.groups&&e.groups.length?!1:n:e.always},c=function(e){return!!(r&&(!i||!i.length)&&e.groups&&e.groups.length)},l=(this.validationMetadatas.get(e)||[]).filter(function(n){return n.target!==e&&n.target!==t?!1:s(n)?!0:c(n)?!1:i&&i.length>0?n.groups&&!!n.groups.find(function(e){return i.indexOf(e)!==-1}):!0}),u=[];try{for(var d=Di(this.validationMetadatas.entries()),f=d.next();!f.done;f=d.next()){var p=Oi(f.value,2),m=p[0],h=p[1];e.prototype instanceof m&&u.push.apply(u,ki([],Oi(h),!1))}}catch(e){a={error:e}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(a)throw a.error}}var g=u.filter(function(t){return typeof t.target==`string`||t.target===e||t.target instanceof Function&&!(e.prototype instanceof t.target)?!1:s(t)?!0:c(t)?!1:i&&i.length>0?t.groups&&!!t.groups.find(function(e){return i.indexOf(e)!==-1}):!0}).filter(function(e){return!l.find(function(t){return t.propertyName===e.propertyName&&t.type===e.type})});return l.concat(g)},e.prototype.getTargetValidatorConstraints=function(e){return this.constraintMetadatas.get(e)||[]},e})(),function(){function e(){}return e.isValid=function(e){var t=this;return e!==`isValid`&&e!==`getMessage`&&Object.keys(this).map(function(e){return t[e]}).indexOf(e)!==-1},e.CUSTOM_VALIDATION=`customValidation`,e.NESTED_VALIDATION=`nestedValidation`,e.PROMISE_VALIDATION=`promiseValidation`,e.CONDITIONAL_VALIDATION=`conditionalValidation`,e.WHITELIST=`whitelistValidation`,e.IS_DEFINED=`isDefined`,e}();var Ai=new(function(){function e(){this.instances=[]}return e.prototype.get=function(e){var t=this.instances.find(function(t){return t.type===e});return t||(t={type:e,object:new e},this.instances.push(t)),t.object},e}()),ji,Q;function Mi(e){if(ji)try{var t=ji.get(e);if(t||!Q||!Q.fallback)return t}catch(e){if(!Q||!Q.fallbackOnErrors)throw e}return Ai.get(e)}(function(){function e(e,t,n){n===void 0&&(n=!1),this.target=e,this.name=t,this.async=n}return Object.defineProperty(e.prototype,"instance",{get:function(){return Mi(this.target)},enumerable:!1,configurable:!0}),e})();var $=function(e){return e.ACTOR=`ACTOR`,e.ADDRESS=`ADDRESS`,e.ARRAY=`ARRAY`,e.BOOLEAN=`BOOLEAN`,e.CURRENCY=`CURRENCY`,e.DATE=`DATE`,e.DATE_TIME=`DATE_TIME`,e.EMAILS=`EMAILS`,e.FILES=`FILES`,e.FULL_NAME=`FULL_NAME`,e.LINKS=`LINKS`,e.MORPH_RELATION=`MORPH_RELATION`,e.MULTI_SELECT=`MULTI_SELECT`,e.NUMBER=`NUMBER`,e.NUMERIC=`NUMERIC`,e.PHONES=`PHONES`,e.POSITION=`POSITION`,e.RATING=`RATING`,e.RAW_JSON=`RAW_JSON`,e.RELATION=`RELATION`,e.RICH_TEXT=`RICH_TEXT`,e.SELECT=`SELECT`,e.TEXT=`TEXT`,e.TS_VECTOR=`TS_VECTOR`,e.UUID=`UUID`,e}({}),Ni=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}({}),Pi={type:$.ACTOR,properties:[{name:`source`,type:$.SELECT,hidden:!1,isRequired:!0,options:Object.keys(Ni).map((t,n)=>({id:(0,e.v4)(),label:`${Ni[t].toLowerCase()}`,value:t,position:n}))},{name:`workspaceMemberId`,type:$.UUID,hidden:`input`,isRequired:!1},{name:`name`,type:$.TEXT,hidden:`input`,isRequired:!0},{name:`context`,type:$.RAW_JSON,hidden:!1,isRequired:!1}]},Fi={type:$.ADDRESS,properties:[{name:`addressStreet1`,type:$.TEXT,hidden:!1,isRequired:!1},{name:`addressStreet2`,type:$.TEXT,hidden:!1,isRequired:!1},{name:`addressCity`,type:$.TEXT,hidden:!1,isRequired:!1},{name:`addressPostcode`,type:$.TEXT,hidden:!1,isRequired:!1},{name:`addressState`,type:$.TEXT,hidden:!1,isRequired:!1},{name:`addressCountry`,type:$.TEXT,hidden:!1,isRequired:!1},{name:`addressLat`,type:$.NUMERIC,hidden:!1,isRequired:!1},{name:`addressLng`,type:$.NUMERIC,hidden:!1,isRequired:!1}]},Ii={type:$.CURRENCY,properties:[{name:`amountMicros`,type:$.NUMERIC,hidden:!1,isRequired:!1},{name:`currencyCode`,type:$.TEXT,hidden:!1,isRequired:!1}]},Li={type:$.EMAILS,properties:[{name:`primaryEmail`,type:$.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`additionalEmails`,type:$.RAW_JSON,hidden:!1,isRequired:!1}]},Ri={type:$.FULL_NAME,properties:[{name:`firstName`,type:$.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!1},{name:`lastName`,type:$.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!1}]},zi={type:$.LINKS,properties:[{name:`primaryLinkLabel`,type:$.TEXT,hidden:!1,isRequired:!1},{name:`primaryLinkUrl`,type:$.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`secondaryLinks`,type:$.RAW_JSON,hidden:!1,isRequired:!1}]},Bi={type:$.PHONES,properties:[{name:`primaryPhoneNumber`,type:$.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`primaryPhoneCountryCode`,type:$.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`primaryPhoneCallingCode`,type:$.TEXT,hidden:!1,isRequired:!1,isIncludedInUniqueConstraint:!0},{name:`additionalPhones`,type:$.RAW_JSON,hidden:!1,isRequired:!1}]},Vi={type:$.RICH_TEXT,properties:[{name:`blocknote`,type:$.TEXT,hidden:!1,isRequired:!1},{name:`markdown`,type:$.TEXT,hidden:!1,isRequired:!1}]};$r({blocknote:Dr().nullable().optional(),markdown:Dr().nullable()}),new Map([[$.LINKS,zi],[$.CURRENCY,Ii],[$.FULL_NAME,Ri],[$.ADDRESS,Fi],[$.ACTOR,Pi],[$.EMAILS,Li],[$.PHONES,Bi],[$.RICH_TEXT,Vi]]),$.RELATION,$.MORPH_RELATION,$.FILES,$.TS_VECTOR,$.TEXT,$.ARRAY,$.BOOLEAN,$.DATE,$.DATE_TIME,$.NUMBER,$.NUMERIC,$.RAW_JSON,$.RICH_TEXT,$.SELECT,$.MULTI_SELECT;var Hi=`TWENTY_API_URL`,Ui=`TWENTY_APP_ACCESS_TOKEN`,Wi=e=>{let t=JSON.parse(atob(e.split(`.`)[1]));return{workspaceId:t.workspaceId,applicationId:t.applicationId}},Gi=e=>{let t=process.env[Hi],n=process.env[Ui];if(!t||!n)throw Error(`getPublicAssetUrl can only be called from within a logic function or front component`);let{workspaceId:r,applicationId:i}=Wi(n),a=e.startsWith(`/`)?e.slice(1):e;return`${t}/public-assets/${r}/${i}/${(a.startsWith(`public/`)?a:`public/${a}`).split(`/`).map(encodeURIComponent).join(`/`)}`},Ki=e=>!(0,t.isUndefined)(e)&&!(0,t.isNull)(e);exports.getPublicAssetUrl=Gi,exports.isDefined=Ki;
|
|
2
21
|
//# sourceMappingURL=index.cjs.map
|