twenty-sdk 2.54.2 → 2.55.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.
@@ -71,5 +71,5 @@ Please compile your catalog first.
71
71
 
72
72
  `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=zt,c=!H.jitless,l=c&&Bt.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?Ki([],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 Yi(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=>!F(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=>I(e,r,U())))}),t)}var Xi=B(`$ZodUnion`,(e,t)=>{G.init(e,t),z(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),z(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),z(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)))}),z(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=>jt(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=>Yi(t,r,e,i)):Yi(o,r,e,i)}}),Zi=B(`$ZodIntersection`,(e,t)=>{G.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])=>$i(e,t,n)):$i(e,i,a)}});function Qi(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Vt(e)&&Vt(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=Qi(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=Qi(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 $i(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=Qi(t.value,n.value);if(!c.valid){if(F(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var ea=B(`$ZodEnum`,(e,t)=>{G.init(e,t);let n=Tt(t.entries),r=new Set(n);e._zod.values=r,z(e,`pattern`,e=>{let t=Tt(e.def.entries).filter(e=>Ut.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Wt(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}}),ta=B(`$ZodTransform`,(e,t)=>{G.init(e,t),e._zod.optin=`optional`,H.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new kn(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 V;return n.value=i,n}});function na(e,t){return e.value=t.issues.length?void 0:t.value,e}var ra=B(`$ZodOptional`,(e,t)=>{G.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,z(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),z(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${jt(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=>na(e,t)):na(e,r)}return t.innerType._zod.run(e,n)}}),ia=B(`$ZodExactOptional`,(e,t)=>{ra.init(e,t),z(e,`values`,e=>e.def.innerType._zod.values),z(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),aa=B(`$ZodNullable`,(e,t)=>{G.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin),z(e,`optout`,e=>e.def.innerType._zod.optout),z(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${jt(t.source)}|null)$`):void 0}),z(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)}),oa=B(`$ZodDefault`,(e,t)=>{G.init(e,t),e._zod.optin=`defaulted`,z(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=>sa(e,t)):sa(r,t)}});function sa(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ca=B(`$ZodPrefault`,(e,t)=>{G.init(e,t),e._zod.optin=`defaulted`,z(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))}),la=B(`$ZodNonOptional`,(e,t)=>{G.init(e,t),z(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=>ua(t,e)):ua(i,e)}});function ua(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 da(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>I(e,r,U()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var fa=B(`$ZodCatch`,(e,t)=>{G.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),z(e,`optout`,e=>e.def.innerType._zod.optout),z(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=>da(e,r,t,n)):da(e,r,t,n)}}),pa=B(`$ZodPipe`,(e,t)=>{G.init(e,t),z(e,`values`,e=>e.def.in._zod.values),z(e,`optin`,e=>e.def.in._zod.optin),z(e,`optout`,e=>e.def.out._zod.optout),z(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=>ma(e,t.in,n)):ma(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ma(e,t.out,n)):ma(r,t.out,n)}});function ma(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 ha=B(`$ZodReadonly`,(e,t)=>{G.init(e,t),z(e,`propValues`,e=>e.def.innerType._zod.propValues),z(e,`values`,e=>e.def.innerType._zod.values),z(e,`optin`,e=>e.def.innerType?._zod?.optin),z(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(ga):ga(r)}});function ga(e){return e.memo||(e.value=Object.freeze(e.value)),e}var _a=B(`$ZodCustom`,(e,t)=>{W.init(e,t),G.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=>va(t,n,r,e));va(i,n,r,e)}});function va(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(mn(e))}}var ya=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},ba=`~memo`,xa=[];function Sa(e){return typeof e==`object`&&!!e}function Ca(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var wa=new WeakMap,Ta=0,Ea=1,Da=2;function Oa(e,t,n){let r=wa.get(e);if(r!==void 0)return r?Da:Ta;if(t.has(e))return Da;t.add(e);let i=Ta,a=e=>{if(i!==Da&&e?._zod){let r=Oa(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=Ta;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Ea:o.value?._zod?Oa(o.value,t,n):Ta;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Mt(c);s(e?o(e,!0):Ea),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?Oa(r,t,!1):Ea);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),ka(e,i)}function ka(e,t){return t!==Ea&&wa.set(e,t===Da),t}function Aa(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var ja,Ma=[],Na={alloc(e,t,n){let r=ja;if(!r)return n;ja=void 0;let i={value:n,issues:null};return r.set(t.value,i),Ma.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`&&Fa(n,e.value))throw new ya;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=Oa(e,new Set,!1);if(i===Ta)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===Da||r?n=!0:r=!0}let l=s.value;if(!Sa(l))return t(s,c);let u=c[ba];u||(u={buckets:new WeakMap,backEdges:void 0},c[ba]=u);let d;i===c?d=a:(d=Aa(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(...Ca(f.issues)):(s.memo=!0,u.backEdges??=new WeakSet,u.backEdges.add(f.value)),s;ja=d;let p=Ma.length,m=t(s,c);ja=void 0;let h=Ma.length>p?Ma.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Ca(e.issues):xa),e)):(h&&(h.issues=m.issues.length?Ca(m.issues):xa),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Pa(){return Na}function Fa(e,t){let n=e[ba]?.backEdges;return n!==void 0&&Sa(t)&&n.has(t)}var Ia=()=>{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(pn(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Gt(e.values[0])}`:`Invalid option: expected one of ${Et(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`:``}: ${Et(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 La(){return{localeError:Ia()}}var Ra,za=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 Ba(){return new za}(Ra=globalThis).__zod_globalRegistry??(Ra.__zod_globalRegistry=Ba());var Va=globalThis.__zod_globalRegistry;function Ha(e){return e.checks&&=[...e.checks],e}function Ua(e,t){return new e(Ha({type:`string`,...P(t)}))}function Wa(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...P(t)})}function Ga(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...P(t)})}function Ka(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...P(t)})}function qa(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...P(t)})}function Ja(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...P(t)})}function Ya(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...P(t)})}function Xa(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...P(t)})}function Za(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...P(t)})}function Qa(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...P(t)})}function $a(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...P(t)})}function eo(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...P(t)})}function to(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...P(t)})}function no(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...P(t)})}function ro(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...P(t)})}function io(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...P(t)})}function ao(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...P(t)})}function oo(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...P(t)})}function so(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...P(t)})}function co(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...P(t)})}function lo(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...P(t)})}function uo(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...P(t)})}function fo(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...P(t)})}function po(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...P(t)})}function mo(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...P(t)})}function ho(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...P(t)})}function go(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...P(t)})}function _o(e){return new e({type:`unknown`})}function vo(e,t){return new e({type:`never`,...P(t)})}function yo(e,t){return new Ir({check:`max_length`,...P(t),maximum:e})}function bo(e,t){return new Lr({check:`min_length`,...P(t),minimum:e})}function xo(e,t){return new Rr({check:`length_equals`,...P(t),length:e})}function So(e,t){return new Br({check:`string_format`,format:`regex`,...P(t),pattern:e})}function Co(e){return new Vr({check:`string_format`,format:`lowercase`,...P(e)})}function wo(e){return new Hr({check:`string_format`,format:`uppercase`,...P(e)})}function To(e,t){return new Ur({check:`string_format`,format:`includes`,...P(t),includes:e})}function Eo(e,t){return new Wr({check:`string_format`,format:`starts_with`,...P(t),prefix:e})}function Do(e,t){return new Gr({check:`string_format`,format:`ends_with`,...P(t),suffix:e})}function Oo(e){return new Kr({check:`overwrite`,tx:e})}function ko(e){return Oo(t=>t.normalize(e))}function Ao(){return Oo(e=>e.trim())}function jo(){return Oo(e=>e.toLowerCase())}function Mo(){return Oo(e=>e.toUpperCase())}function No(){return Oo(e=>Lt(e))}function Po(e,t,n){return new e({type:`array`,element:t,...P(n)})}function Fo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...P(n)})}function Io(e,t){let n=Lo(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(mn(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(mn(r))}},e(t.value,t)),t);return n}function Lo(e,t){let n=new W({check:`custom`,...P(t)});return n._zod.check=e,n}function Ro(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&k(e,t,n[t]);return e}function zo(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??Va,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 Bo(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 q(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,q(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ro(o.schema,c),t.io===`input`&&J(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 Vo(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ho(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}/${Vo(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+Vo(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>
73
73
 
74
- 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 Uo(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;Uo(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 Wo=new Set([`type`,`properties`,`required`,`additionalProperties`]),Go=[`oneOf`,`anyOf`];function Ko(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function qo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Wo.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]??Ko(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}k(n,r,e.length===1?e[0]:qo(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=Ko(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 Jo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Wo)if(t in e)return;let n=t.filter(e=>Go.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=qo(t);else{let e=n[0],i=Go.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=>qo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ro(e,r))}function Yo(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)):Ro(i,s),Ro(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())Uo(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)??[])Jo(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)}Ro(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,k(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:Zo(t,`input`,e.processors),output:Zo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function J(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 J(r.element,n);if(r.type===`set`)return J(r.valueType,n);if(r.type===`lazy`)return J(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 J(r.innerType,n);if(r.type===`intersection`)return J(r.left,n)||J(r.right,n);if(r.type===`record`||r.type===`map`)return J(r.keyType,n)||J(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:J(r.in,n)||J(r.out,n);if(r.type===`object`){for(let e in r.shape)if(J(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(J(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(J(e,n))return!0;return!!(r.rest&&J(r.rest,n))}return!1}var Xo=(e,t={})=>n=>{let r=zo({...n,processors:t});return q(e,r),Ho(r,e),Yo(r,e)},Zo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=zo({...i??{},target:a,io:t,processors:n});return q(e,o),Ho(o,e),Yo(o,e)},Qo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},$o=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},es=(e,t)=>{Qo(e,`minimum`,t),$o(e,`maximum`,t)},ts=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ns=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},rs=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},is=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},as=(e,t)=>Qo(e,`minimum`,t.minimum),os=(e,t)=>$o(e,`maximum`,t.maximum),ss=e=>(t,n)=>{is(t,n.format);let[r,i]=e[n.format];Qo(t,`minimum`,r),$o(t,`maximum`,i)},cs={greater_than:(e,t)=>Qo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>$o(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ts(e,t.value),number_format:ss(qt),bigint_format:ss(Jt),min_length:as,max_length:os,length_equals:(e,t)=>es(e,t.length),min_size:as,max_size:os,size_equals:(e,t)=>es(e,t.size),string_format:(e,t)=>{is(e,t.format),t.pattern&&ns(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)=>rs(e,t.mime)};function ls(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)cs[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Qo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Qo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&$o(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&$o(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ts(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&rs(t,i.mime);for(let e of i.patterns??[])ns(t,e);return t}var us={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ds=new Map([[ki,Sr],[ji,Cr]]),fs=e=>ds.get(e)??e,ps=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ls(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=us[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(fs);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}))])}},ms=(e,t,n,r)=>{n.not={}},hs=(e,t,n,r)=>{let i=e._zod.def,a=Tt(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},gs=(e,t,n,r)=>{Bo(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},_s=(e,t,n,r)=>{Bo(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},vs=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ls(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=q(a.element,t,{...r,path:[...r.path,`items`]})};function ys(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?ys(t.out):t.type===`catch`?ys(t.innerType):e._zod.optin}var bs=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Bo(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)k(i.properties,e,q(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`?ys(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=q(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},xs=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>q(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ss=(e,t,n,r)=>{let i=e._zod.def,a=q(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=q(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)},Cs=(e,t,n,r)=>{let i=e._zod.def,a=q(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`}]},ws=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ts=Symbol();function Es(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Bo(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ts):JSON.parse(o)}var Ds=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Es(i.defaultValue,e,t,n,r);o!==Ts&&(n.default=o)},Os=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Es(i.defaultValue,e,t,n,r);o!==Ts&&(n._prefault=o)},ks=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Bo(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},As=(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;q(o,t,r);let s=t.seen.get(e);s.ref=o},js=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ms=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ns=new WeakSet([Object.prototype,Error.prototype]);function Ps(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 Y=B(`ZodError`,(e,t)=>{In.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Ns.has(n)||(Ns.add(n),Ps(n,`format`,e=>t=>zn(e,t)),Ps(n,`flatten`,e=>t=>Rn(e,t)),Ps(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Dt,2)}),Ps(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Dt,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Fs=Vn(Y),Is=Hn(Y),Ls=Un(Y),Rs=Gn(Y),zs=Zn(Y),Bs=Qn(Y),Vs=$n(Y),Hs=er(Y),Us=tr(Y),Ws=nr(Y),Gs=rr(Y),Ks=ir(Y);function qs(){H.localeError||U(La())}function Js(){H.memoizer||U({memoizer:Pa()})}var X=B(`ZodType`,(e,t)=>(qs(),G.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(M(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 N(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(nl(e,t))},superRefine(e,t){return this.check(rl(e,t))},overwrite(e){return this.check(Oo(e))},optional(){return Rc(this)},exactOptional(){return Bc(this)},nullable(){return Hc(this)},nullish(){return Rc(Hc(this))},nonoptional(e){return Jc(this,e)},array(){return Ec(this)},or(e){return Ac([this,e])},and(e){return Mc(this,e)},transform(e){return Qc(this,Ic(e))},default(e){return Wc(this,e)},prefault(e){return Kc(this,e)},catch(e){return Xc(this,e)},pipe(e){return Qc(this,e)},readonly(){return el(this)},describe(e){let t=this.clone();return Va.add(t,{description:e}),t},meta(...e){if(e.length===0)return Va.get(this);let t=this.clone();return Va.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 gn(this,`~standard`,{...Zr(this),jsonSchema:{input:Zo(this,`input`),output:Zo(this,`output`)}})},set"~standard"(e){L(this,`~standard`,e)},parse:function e(t,n){return Fs(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Is(this,t,n,{callee:e})},safeParse(e,t){return Ls(this,e,t)},async safeParseAsync(e,t){return Rs(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){L(this,`spa`,e)},validate(e,t){return Jn(this,e,t)},validateAsync(e,t){return Xn(this,e,t)},encode:function e(t,n){return zs(this,t,n,{callee:e})},decode:function e(t,n){return Bs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Vs(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Hs(this,t,n,{callee:e})},safeEncode(e,t){return Us(this,e,t)},safeDecode(e,t){return Ws(this,e,t)},async safeEncodeAsync(e,t){return Gs(this,e,t)},async safeDecodeAsync(e,t){return Ks(this,e,t)},toJSONSchema(e){return Xo(this,{})(e)},get description(){return Va.get(this)?.description},get _def(){return this._zod.def}}),Ys=B(`_ZodString`,(e,t)=>{Qr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r)},_n({format:e=>ls(e).format??null,minLength:e=>ls(e).minimum??null,maxLength:e=>ls(e).maximum??null},{regex(...e){return this.check(So(...e))},includes(...e){return this.check(To(...e))},startsWith(...e){return this.check(Eo(...e))},endsWith(...e){return this.check(Do(...e))},min(...e){return this.check(bo(...e))},max(...e){return this.check(yo(...e))},length(...e){return this.check(xo(...e))},nonempty(...e){return this.check(bo(1,...e))},lowercase(e){return this.check(Co(e))},uppercase(e){return this.check(wo(e))},trim(){return this.check(Ao())},normalize(...e){return this.check(ko(...e))},toLowerCase(){return this.check(jo())},toUpperCase(){return this.check(Mo())},slugify(){return this.check(No())}})),Xs=B(`ZodString`,(e,t)=>{Qr.init(e,t),Ys.init(e,t)},{email(e){return this.check(Wa(nc,e))},url(e){return this.check(Xa(ac,e))},jwt(e){return this.check(fo(bc,e))},emoji(e){return this.check(Za(oc,e))},guid(e){return this.check(Ga(rc,e))},uuid(e){return this.check(Ka(ic,e))},uuidv4(e){return this.check(qa(ic,e))},uuidv6(e){return this.check(Ja(ic,e))},uuidv7(e){return this.check(Ya(ic,e))},nanoid(e){return this.check(Qa(sc,e))},cuid(e){return this.check($a(cc,e))},cuid2(e){return this.check(eo(lc,e))},ulid(e){return this.check(to(uc,e))},base64(e){return this.check(co(_c,e))},base64url(e){return this.check(lo(vc,e))},xid(e){return this.check(no(dc,e))},ksuid(e){return this.check(ro(fc,e))},ipv4(e){return this.check(io(pc,e))},ipv6(e){return this.check(ao(mc,e))},cidrv4(e){return this.check(oo(hc,e))},cidrv6(e){return this.check(so(gc,e))},e164(e){return this.check(uo(yc,e))},datetime(e){return this.check(po(Qs,e))},date(e){return this.check(mo($s,e))},time(e){return this.check(ho(ec,e))},duration(e){return this.check(go(tc,e))}});function Zs(e){return Ua(Xs,e)}var Z=B(`ZodStringFormat`,(e,t)=>{K.init(e,t),Ys.init(e,t)}),Qs=B(`ZodISODateTime`,(e,t)=>{_i.init(e,t),Z.init(e,t)}),$s=B(`ZodISODate`,(e,t)=>{vi.init(e,t),Z.init(e,t)}),ec=B(`ZodISOTime`,(e,t)=>{yi.init(e,t),Z.init(e,t)}),tc=B(`ZodISODuration`,(e,t)=>{bi.init(e,t),Z.init(e,t)}),nc=B(`ZodEmail`,(e,t)=>{ti.init(e,t),Z.init(e,t)}),rc=B(`ZodGUID`,(e,t)=>{$r.init(e,t),Z.init(e,t)}),ic=B(`ZodUUID`,(e,t)=>{ei.init(e,t),Z.init(e,t)}),ac=B(`ZodURL`,(e,t)=>{li.init(e,t),Z.init(e,t)}),oc=B(`ZodEmoji`,(e,t)=>{ui.init(e,t),Z.init(e,t)}),sc=B(`ZodNanoID`,(e,t)=>{di.init(e,t),Z.init(e,t)}),cc=B(`ZodCUID`,(e,t)=>{fi.init(e,t),Z.init(e,t)}),lc=B(`ZodCUID2`,(e,t)=>{pi.init(e,t),Z.init(e,t)}),uc=B(`ZodULID`,(e,t)=>{mi.init(e,t),Z.init(e,t)}),dc=B(`ZodXID`,(e,t)=>{hi.init(e,t),Z.init(e,t)}),fc=B(`ZodKSUID`,(e,t)=>{gi.init(e,t),Z.init(e,t)}),pc=B(`ZodIPv4`,(e,t)=>{xi.init(e,t),Z.init(e,t)}),mc=B(`ZodIPv6`,(e,t)=>{wi.init(e,t),Z.init(e,t)}),hc=B(`ZodCIDRv4`,(e,t)=>{Ti.init(e,t),Z.init(e,t)}),gc=B(`ZodCIDRv6`,(e,t)=>{Di.init(e,t),Z.init(e,t)}),_c=B(`ZodBase64`,(e,t)=>{Ai.init(e,t),Z.init(e,t)}),vc=B(`ZodBase64URL`,(e,t)=>{Ni.init(e,t),Z.init(e,t)}),yc=B(`ZodE164`,(e,t)=>{Pi.init(e,t),Z.init(e,t)}),bc=B(`ZodJWT`,(e,t)=>{Ii.init(e,t),Z.init(e,t)}),xc=B(`ZodUnknown`,(e,t)=>{Li.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Sc(){return _o(xc)}var Cc=B(`ZodNever`,(e,t)=>{Ri.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r)});function wc(e){return vo(Cc,e)}var Tc=B(`ZodArray`,(e,t)=>{Js(),Hi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vs(e,t,n,r),e.element=t.element},{min(e,t){return this.check(bo(e,t))},nonempty(e){return this.check(bo(1,e))},max(e,t){return this.check(yo(e,t))},length(e,t){return this.check(xo(e,t))},unwrap(){return this.element}});function Ec(e,t){return Po(Tc,e,t)}var Dc=B(`ZodObject`,(e,t)=>{Js(),Ji.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bs(e,t,n,r),Sn(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Pc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(M(this._zod.def,{catchall:e}))},passthrough(){return this.clone(M(this._zod.def,{catchall:Sc()}))},loose(){return this.clone(M(this._zod.def,{catchall:Sc()}))},strict(){return this.clone(M(this._zod.def,{catchall:wc()}))},strip(){return this.clone(M(this._zod.def,{catchall:void 0}))},extend(e){return Qt(this,e)},safeExtend(e){return en(this,e)},merge(e){return tn(this,e)},pick(e){return Yt(this,e)},omit(e){return Zt(this,e)},partial(...e){return nn(Lc,this,e[0])},exactPartial(...e){return nn(zc,this,e[0],`exactPartial`)},required(...e){return rn(qc,this,e[0])}});function Oc(e,t){return new Dc({type:`object`,shape:e??{},...P(t)})}var kc=B(`ZodUnion`,(e,t)=>{Xi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xs(e,t,n,r),e.options=t.options});function Ac(e,t){return new kc({type:`union`,options:e,...P(t)})}var jc=B(`ZodIntersection`,(e,t)=>{Zi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r)});function Mc(e,t){return new jc({type:`intersection`,left:e,right:t})}var Nc=B(`ZodEnum`,(e,t)=>{ea.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(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 Nc({...t,checks:[],...P(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 Nc({...t,checks:[],...P(r),entries:i})}});function Pc(e,t){return new Nc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var Fc=B(`ZodTransform`,(e,t)=>{Js(),ta.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new kn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(mn(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(mn(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ic(e){return new Fc({type:`transform`,transform:e})}var Lc=B(`ZodOptional`,(e,t)=>{ra.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rc(e){return new Lc({type:`optional`,innerType:e})}var zc=B(`ZodExactOptional`,(e,t)=>{ia.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bc(e){return new zc({type:`optional`,innerType:e})}var Vc=B(`ZodNullable`,(e,t)=>{aa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hc(e){return new Vc({type:`nullable`,innerType:e})}var Uc=B(`ZodDefault`,(e,t)=>{oa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ds(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Wc(e,t){return new Uc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ht(t)}})}var Gc=B(`ZodPrefault`,(e,t)=>{ca.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Os(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Kc(e,t){return new Gc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ht(t)}})}var qc=B(`ZodNonOptional`,(e,t)=>{la.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jc(e,t){return new qc({type:`nonoptional`,innerType:e,...P(t)})}var Yc=B(`ZodCatch`,(e,t)=>{fa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ks(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Xc(e,t){return new Yc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:wn(t)})}var Zc=B(`ZodPipe`,(e,t)=>{pa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>As(e,t,n,r),e.in=t.in,e.out=t.out});function Qc(e,t){return new Zc({type:`pipe`,in:e,out:t})}var $c=B(`ZodReadonly`,(e,t)=>{ha.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function el(e){return new $c({type:`readonly`,innerType:e})}var tl=B(`ZodCustom`,(e,t)=>{_a.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r)});function nl(e,t={}){return Fo(tl,e,t)}function rl(e,t){return Io(e,t)}var Q=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}({}),il=function(e){return e.Verify=`/verify`,e.VerifyEmail=`/verify-email`,e.SignInUp=`/welcome`,e.Invite=`/invite/:workspaceInviteHash`,e.ResetPassword=`/reset-password/:passwordResetToken`,e.WorkspaceActivation=`/workspace-activation`,e.CreateProfile=`/create/profile`,e.SyncEmails=`/sync/emails`,e.InviteTeam=`/invite-team`,e.PlanRequired=`/plan-required`,e.PlanRequiredSuccess=`/plan-required/payment-success`,e.BookCall=`/book-call`,e.AiChat=`/chat/:threadId?`,e.AiChatInbox=`/inbox/:threadId?`,e.Index=`/`,e.Home=`/home`,e.TasksPage=`/objects/tasks`,e.OpportunitiesPage=`/objects/opportunities`,e.RecordIndexPage=`/objects/:objectNamePlural`,e.RecordShowPage=`/object/:objectNameSingular/:objectRecordId`,e.PageLayoutPage=`/page/:pageLayoutId`,e.WorkflowCoreShowPage=`/workflow/:coreWorkflowId`,e.AgentIndexPage=`/agents`,e.AgentShowPage=`/agent/:agentId`,e.Settings=`settings`,e.SettingsCatchAll=`/settings/*`,e.Developers=`developers`,e.DevelopersCatchAll=`/developers/*`,e.Authorize=`/authorize`,e.Dpa=`/dpa`,e.NotFoundWildcard=`*`,e.NotFound=`/not-found`,e}({}),al=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}({});Q.ACTOR,Q.SELECT,Object.keys(al).map((e,t)=>({id:(0,n.v4)(),label:`${al[e].toLowerCase()}`,value:e,position:t})),Q.UUID,Q.TEXT,Q.RAW_JSON,Q.ADDRESS,Q.TEXT,Q.TEXT,Q.TEXT,Q.TEXT,Q.TEXT,Q.TEXT,Q.NUMERIC,Q.NUMERIC,Q.CURRENCY,Q.NUMERIC,Q.TEXT,Q.EMAILS,Q.TEXT,Q.RAW_JSON,Q.FULL_NAME,Q.TEXT,Q.TEXT,Q.LINKS,Q.TEXT,Q.TEXT,Q.RAW_JSON,Q.PHONES,Q.TEXT,Q.TEXT,Q.TEXT,Q.RAW_JSON,Q.RICH_TEXT,Q.TEXT,Q.TEXT,Q.TEXT,Oc({tiptap:Zs().nullable().optional(),markdown:Zs().nullable().optional(),blocknote:Zs().nullable().optional()}),Q.LINKS,Q.CURRENCY,Q.FULL_NAME,Q.ADDRESS,Q.ACTOR,Q.EMAILS,Q.PHONES,Q.RICH_TEXT,Q.RELATION,Q.MORPH_RELATION,Q.FILES,Q.TS_VECTOR;var ol=function(e){return e.CommandMenuDisplay=`command-menu-display`,e.ViewRecord=`view-record`,e.ViewRecords=`view-records`,e.MergeRecords=`merge-records`,e.MergeWithRecord=`merge-with-record`,e.UpdateRecords=`update-records`,e.EditRichText=`edit-rich-text`,e.Copilot=`copilot`,e.WorkflowTriggerSelectType=`workflow-trigger-select-type`,e.WorkflowStepCreate=`workflow-step-create`,e.WorkflowStepEditType=`workflow-step-edit-type`,e.WorkflowStepView=`workflow-step-view`,e.WorkflowStepEdit=`workflow-step-edit`,e.WorkflowRunStepView=`workflow-run-step-view`,e.WorkflowStepSettings=`workflow-step-settings`,e.SearchRecords=`search-records`,e.SearchAiChats=`search-ai-chats`,e.AskAI=`ask-ai`,e.PageLayoutDashboardWidgetTypeSelect=`page-layout-dashboard-widget-type-select`,e.PageLayoutTabSettings=`page-layout-tab-settings`,e.PageLayoutWidgetSettings=`page-layout-widget-settings`,e.DashboardChartSettings=`dashboard-chart-settings`,e.DashboardIframeSettings=`dashboard-iframe-settings`,e.DashboardRecordTableSettings=`dashboard-record-table-settings`,e.RecordPageFieldsSettings=`record-page-fields-settings`,e.RecordPageFieldSettings=`record-page-field-settings`,e.ViewFrontComponent=`view-front-component`,e.CommandMenuEdit=`command-menu-edit`,e.PageLayoutRecordPageWidgetTypeSelect=`page-layout-record-page-widget-type-select`,e.ComposeEmail=`compose-email`,e.ComposeCalendarEvent=`compose-calendar-event`,e.CreateRelatedRecord=`create-related-record`,e.RecordCreationForm=`record-creation-form`,e.RecordCreationFormSettings=`record-creation-form-settings`,e.SendCampaign=`send-campaign`,e.SendCampaignTest=`send-campaign-test`,e.AddToMessageList=`add-to-message-list`,e.WorkflowVersions=`workflow-versions`,e.WorkflowVersion=`workflow-version`,e.EmailBlockSettings=`email-block-settings`,e.EmailPageStyle=`email-page-style`,e.EmailBlockStyle=`email-block-style`,e.SettingsMetadataTranslations=`settings-metadata-translations`,e.RoutedPage=`routed-page`,e.WorkflowCoreFilters=`workflow-core-filters`,e.AgentCoreFilters=`agent-core-filters`,e.ShareRecord=`share-record`,e.SnoozeAiChat=`snooze-ai-chat`,e.AssignAiChat=`assign-ai-chat`,e}({}),sl=`frontComponentHostCommunicationApi`;globalThis[sl]??={};var $=globalThis.frontComponentHostCommunicationApi,cl=()=>{let e=$.closeSidePanel;if(!g(e))throw Error(`closeSidePanelFunction is not set`);return e()},ll=e=>{let t=$.copyToClipboard;if(!g(t))throw Error(`copyToClipboardFunction is not set`);return t(e)},ul=e=>{let t=process.env.applicationVariables;if(t)return JSON.parse(t)[e]},dl=e=>{let t=$.enqueueSnackbar;if(!g(t))throw Error(`enqueueSnackbarFunction is not set`);return t(e)},fl=(e,t,n,r)=>{let i=$.navigate;if(!g(i))throw Error(`navigateFunction is not set`);return i(e,t,n,r)},pl=e=>{let t=$.openCommandConfirmationModal;if(!g(t))throw Error(`openCommandConfirmationModalFunction is not set`);return t(e)},ml=e=>{let t=$.openSidePanelPage;if(!g(t))throw Error(`openSidePanelPageFunction is not set`);return t(e)},hl=()=>{let e=$.unmountFrontComponent;if(!g(e))throw Error(`unmountFrontComponentFunction is not set`);return e()},gl=e=>{let t=$.updateProgress;if(!g(t))throw Error(`updateProgressFunction is not set`);return t(e)},_l=(e,t)=>{let n=$.uploadFile;if(!g(n))throw Error(`uploadFileFunction is not set`);return n(e,t)},vl=e=>e.colorScheme,yl=()=>d(vl),bl=e=>e.frontComponentId,xl=()=>d(bl),Sl=()=>{let t=p();return{locale:t,t:(0,e.useCallback)((e,n)=>bt(e,n,t),[t])}},Cl=e=>e.location??null,wl=()=>d(Cl),Tl=e=>e.selectedRecordIds.length===1?e.selectedRecordIds[0]:null,El=()=>d(Tl),Dl=e=>e.toolCall??null,Ol=()=>d(Dl),kl=e=>e.selectedRecordIds,Al=()=>d(kl),jl=e=>e.selectedRecordsFilter??null,Ml=()=>d(jl),Nl=e=>e.selectedObjectMetadata??null,Pl=()=>d(Nl),Fl=()=>d(e=>e.timelineActivityId),Il=e=>e.userId,Ll=()=>d(Il),Rl=e=>m(e),zl=()=>c()?.locale??`en`,Bl=(e,t)=>bt(e,t,zl()),Vl=e=>`${e}-command-error`,Hl=({execute:t})=>{let[n,r]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{n||(r(!0),(async()=>{await t(),await hl()})())},[t,n,xl()]),null},Ul=({to:t,params:n,queryParams:r,options:i})=>{let[a,o]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{a||(o(!0),(async()=>{await fl(t,n,r,i),await hl()})())},[t,n,r,i,a,xl()]),null},Wl=t=>{let[n,r]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{n||(r(!0),(async()=>{await ml(t),await hl()})())},[t,n,xl()]),null},Gl=({title:t,subtitle:n,execute:r,confirmButtonText:i,confirmButtonAccent:a})=>{let[o,s]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{o||(s(!0),(async()=>{await pl({title:t,subtitle:n,confirmButtonText:i,confirmButtonAccent:a})===`confirm`&&await r(),await hl()})())},[t,n,r,i,a,o,xl()]),null},Kl=async e=>{let{sendInboxMessage:t}=await new r.MetadataApiClient().mutation({sendInboxMessage:{__args:{input:e},threadId:!0}});return t},ql=/\[/g,Jl=/\]/g,Yl=/\r?\n/g,Xl=e=>e.replace(ql,`(`).replace(Jl,`)`).replace(Yl,` `).trim(),Zl=async({workspaceMemberId:e})=>{let{data:{workspaceMember:n}}=await new i.RestApiClient().get(`/rest/workspaceMembers/${e}`),r=`${n.name.firstName??``} ${n.name.lastName??``}`.trim();return wt({objectNameSingular:`workspaceMember`,recordId:e,displayName:Xl((0,t.isNonEmptyString)(r)?r:n.userEmail)})},Ql=({fullName:e,partName:n})=>{let r=(0,t.isObject)(e)?Reflect.get(e,n):void 0;return(0,t.isString)(r)?r:``},$l=({record:e,recordId:t,labelIdentifierField:n})=>{if(!g(n))return t;let r=e[n.name];return n.type===`FULL_NAME`?`${Ql({fullName:r,partName:`firstName`})} ${Ql({fullName:r,partName:`lastName`})}`.trim():g(r)?String(r):``},eu=async({metadataClient:e,objectMetadata:t})=>{if(!g(t.labelIdentifierFieldMetadataId))return;let{object:n}=await e.query({object:{__args:{id:t.id},fields:{__args:{filter:{id:{eq:t.labelIdentifierFieldMetadataId}},paging:{first:1}},edges:{node:{name:!0,type:!0}}}}});return n.fields.edges[0]?.node},tu=1e3,nu=async({metadataClient:e,objectNameSingular:t})=>{let{objects:n}=await e.query({objects:{__args:{filter:{},paging:{first:tu}},edges:{node:{id:!0,nameSingular:!0,namePlural:!0,labelIdentifierFieldMetadataId:!0}}}}),r=n.edges.find(({node:e})=>e.nameSingular===t)?.node;if(!g(r))throw Error(`This workspace has no ${t} object.`);return r},ru=async({objectNameSingular:e,recordId:t})=>{let n=new r.MetadataApiClient,a=await nu({metadataClient:n,objectNameSingular:e}),[o,s]=await Promise.all([eu({metadataClient:n,objectMetadata:a}),new i.RestApiClient().get(`/rest/${a.namePlural}/${t}`)]);return wt({objectNameSingular:e,recordId:t,displayName:Xl($l({record:s.data[e],recordId:t,labelIdentifierField:o}))})},iu=wt({objectNameSingular:Ct,recordId:Ct,displayName:`Ada`}),au=async e=>{await new r.MetadataApiClient().mutation({attachRecordToInboxThread:{__args:{input:e}}})},ou=async e=>{await new r.MetadataApiClient().mutation({detachRecordFromInboxThread:{__args:{input:e}}})};exports.AppPath=il,exports.Command=Hl,exports.CommandLink=Ul,exports.CommandModal=Gl,exports.CommandOpenSidePanelPage=Wl,exports.INBOX_ASSISTANT_MENTION=iu,exports.SidePanelPages=ol,exports.Trans=St,exports.attachRecordToInboxThread=au,exports.closeSidePanel=cl,exports.copyToClipboard=ll,exports.detachRecordFromInboxThread=ou,exports.enqueueSnackbar=dl,exports.getApplicationVariable=ul,exports.getFrontComponentCommandErrorDedupeKey=Vl,exports.inboxMention=Zl,exports.inboxReferenceRecord=ru,exports.msg=Rl,exports.navigate=fl,exports.openCommandConfirmationModal=pl,exports.openSidePanelPage=ml,exports.sendInboxMessage=Kl,exports.t=Bl,exports.unmountFrontComponent=hl,exports.updateProgress=gl,exports.uploadFile=_l,exports.useColorScheme=yl,exports.useFrontComponentExecutionContext=d,exports.useFrontComponentId=xl,exports.useLocale=p,exports.useLocation=wl,exports.useRecordId=El,exports.useSelectedObjectMetadata=Pl,exports.useSelectedRecordIds=Al,exports.useSelectedRecordsFilter=Ml,exports.useTimelineActivityId=Fl,exports.useToolCall=Ol,exports.useTranslate=Sl,exports.useUserId=Ll;
74
+ 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 Uo(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;Uo(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 Wo=new Set([`type`,`properties`,`required`,`additionalProperties`]),Go=[`oneOf`,`anyOf`];function Ko(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function qo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Wo.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]??Ko(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}k(n,r,e.length===1?e[0]:qo(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=Ko(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 Jo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Wo)if(t in e)return;let n=t.filter(e=>Go.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=qo(t);else{let e=n[0],i=Go.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=>qo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ro(e,r))}function Yo(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)):Ro(i,s),Ro(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())Uo(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)??[])Jo(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)}Ro(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,k(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:Zo(t,`input`,e.processors),output:Zo(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function J(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 J(r.element,n);if(r.type===`set`)return J(r.valueType,n);if(r.type===`lazy`)return J(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 J(r.innerType,n);if(r.type===`intersection`)return J(r.left,n)||J(r.right,n);if(r.type===`record`||r.type===`map`)return J(r.keyType,n)||J(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:J(r.in,n)||J(r.out,n);if(r.type===`object`){for(let e in r.shape)if(J(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(J(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(J(e,n))return!0;return!!(r.rest&&J(r.rest,n))}return!1}var Xo=(e,t={})=>n=>{let r=zo({...n,processors:t});return q(e,r),Ho(r,e),Yo(r,e)},Zo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=zo({...i??{},target:a,io:t,processors:n});return q(e,o),Ho(o,e),Yo(o,e)},Qo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},$o=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},es=(e,t)=>{Qo(e,`minimum`,t),$o(e,`maximum`,t)},ts=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ns=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},rs=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},is=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},as=(e,t)=>Qo(e,`minimum`,t.minimum),os=(e,t)=>$o(e,`maximum`,t.maximum),ss=e=>(t,n)=>{is(t,n.format);let[r,i]=e[n.format];Qo(t,`minimum`,r),$o(t,`maximum`,i)},cs={greater_than:(e,t)=>Qo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>$o(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ts(e,t.value),number_format:ss(qt),bigint_format:ss(Jt),min_length:as,max_length:os,length_equals:(e,t)=>es(e,t.length),min_size:as,max_size:os,size_equals:(e,t)=>es(e,t.size),string_format:(e,t)=>{is(e,t.format),t.pattern&&ns(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)=>rs(e,t.mime)};function ls(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)cs[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Qo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Qo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&$o(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&$o(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ts(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&rs(t,i.mime);for(let e of i.patterns??[])ns(t,e);return t}var us={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ds=new Map([[ki,Sr],[ji,Cr]]),fs=e=>ds.get(e)??e,ps=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ls(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=us[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(fs);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}))])}},ms=(e,t,n,r)=>{n.not={}},hs=(e,t,n,r)=>{let i=e._zod.def,a=Tt(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},gs=(e,t,n,r)=>{Bo(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},_s=(e,t,n,r)=>{Bo(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},vs=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ls(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=q(a.element,t,{...r,path:[...r.path,`items`]})};function ys(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?ys(t.out):t.type===`catch`?ys(t.innerType):e._zod.optin}var bs=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Bo(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)k(i.properties,e,q(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`?ys(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=q(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},xs=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>q(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Ss=(e,t,n,r)=>{let i=e._zod.def,a=q(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=q(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)},Cs=(e,t,n,r)=>{let i=e._zod.def,a=q(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`}]},ws=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ts=Symbol();function Es(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Bo(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Ts):JSON.parse(o)}var Ds=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Es(i.defaultValue,e,t,n,r);o!==Ts&&(n.default=o)},Os=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Es(i.defaultValue,e,t,n,r);o!==Ts&&(n._prefault=o)},ks=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Bo(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},As=(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;q(o,t,r);let s=t.seen.get(e);s.ref=o},js=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Ms=(e,t,n,r)=>{let i=e._zod.def;q(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Ns=new WeakSet([Object.prototype,Error.prototype]);function Ps(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 Y=B(`ZodError`,(e,t)=>{In.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);Ns.has(n)||(Ns.add(n),Ps(n,`format`,e=>t=>zn(e,t)),Ps(n,`flatten`,e=>t=>Rn(e,t)),Ps(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Dt,2)}),Ps(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Dt,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Fs=Vn(Y),Is=Hn(Y),Ls=Un(Y),Rs=Gn(Y),zs=Zn(Y),Bs=Qn(Y),Vs=$n(Y),Hs=er(Y),Us=tr(Y),Ws=nr(Y),Gs=rr(Y),Ks=ir(Y);function qs(){H.localeError||U(La())}function Js(){H.memoizer||U({memoizer:Pa()})}var X=B(`ZodType`,(e,t)=>(qs(),G.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(M(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 N(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(nl(e,t))},superRefine(e,t){return this.check(rl(e,t))},overwrite(e){return this.check(Oo(e))},optional(){return Rc(this)},exactOptional(){return Bc(this)},nullable(){return Hc(this)},nullish(){return Rc(Hc(this))},nonoptional(e){return Jc(this,e)},array(){return Ec(this)},or(e){return Ac([this,e])},and(e){return Mc(this,e)},transform(e){return Qc(this,Ic(e))},default(e){return Wc(this,e)},prefault(e){return Kc(this,e)},catch(e){return Xc(this,e)},pipe(e){return Qc(this,e)},readonly(){return el(this)},describe(e){let t=this.clone();return Va.add(t,{description:e}),t},meta(...e){if(e.length===0)return Va.get(this);let t=this.clone();return Va.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 gn(this,`~standard`,{...Zr(this),jsonSchema:{input:Zo(this,`input`),output:Zo(this,`output`)}})},set"~standard"(e){L(this,`~standard`,e)},parse:function e(t,n){return Fs(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Is(this,t,n,{callee:e})},safeParse(e,t){return Ls(this,e,t)},async safeParseAsync(e,t){return Rs(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){L(this,`spa`,e)},validate(e,t){return Jn(this,e,t)},validateAsync(e,t){return Xn(this,e,t)},encode:function e(t,n){return zs(this,t,n,{callee:e})},decode:function e(t,n){return Bs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Vs(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Hs(this,t,n,{callee:e})},safeEncode(e,t){return Us(this,e,t)},safeDecode(e,t){return Ws(this,e,t)},async safeEncodeAsync(e,t){return Gs(this,e,t)},async safeDecodeAsync(e,t){return Ks(this,e,t)},toJSONSchema(e){return Xo(this,{})(e)},get description(){return Va.get(this)?.description},get _def(){return this._zod.def}}),Ys=B(`_ZodString`,(e,t)=>{Qr.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r)},_n({format:e=>ls(e).format??null,minLength:e=>ls(e).minimum??null,maxLength:e=>ls(e).maximum??null},{regex(...e){return this.check(So(...e))},includes(...e){return this.check(To(...e))},startsWith(...e){return this.check(Eo(...e))},endsWith(...e){return this.check(Do(...e))},min(...e){return this.check(bo(...e))},max(...e){return this.check(yo(...e))},length(...e){return this.check(xo(...e))},nonempty(...e){return this.check(bo(1,...e))},lowercase(e){return this.check(Co(e))},uppercase(e){return this.check(wo(e))},trim(){return this.check(Ao())},normalize(...e){return this.check(ko(...e))},toLowerCase(){return this.check(jo())},toUpperCase(){return this.check(Mo())},slugify(){return this.check(No())}})),Xs=B(`ZodString`,(e,t)=>{Qr.init(e,t),Ys.init(e,t)},{email(e){return this.check(Wa(nc,e))},url(e){return this.check(Xa(ac,e))},jwt(e){return this.check(fo(bc,e))},emoji(e){return this.check(Za(oc,e))},guid(e){return this.check(Ga(rc,e))},uuid(e){return this.check(Ka(ic,e))},uuidv4(e){return this.check(qa(ic,e))},uuidv6(e){return this.check(Ja(ic,e))},uuidv7(e){return this.check(Ya(ic,e))},nanoid(e){return this.check(Qa(sc,e))},cuid(e){return this.check($a(cc,e))},cuid2(e){return this.check(eo(lc,e))},ulid(e){return this.check(to(uc,e))},base64(e){return this.check(co(_c,e))},base64url(e){return this.check(lo(vc,e))},xid(e){return this.check(no(dc,e))},ksuid(e){return this.check(ro(fc,e))},ipv4(e){return this.check(io(pc,e))},ipv6(e){return this.check(ao(mc,e))},cidrv4(e){return this.check(oo(hc,e))},cidrv6(e){return this.check(so(gc,e))},e164(e){return this.check(uo(yc,e))},datetime(e){return this.check(po(Qs,e))},date(e){return this.check(mo($s,e))},time(e){return this.check(ho(ec,e))},duration(e){return this.check(go(tc,e))}});function Zs(e){return Ua(Xs,e)}var Z=B(`ZodStringFormat`,(e,t)=>{K.init(e,t),Ys.init(e,t)}),Qs=B(`ZodISODateTime`,(e,t)=>{_i.init(e,t),Z.init(e,t)}),$s=B(`ZodISODate`,(e,t)=>{vi.init(e,t),Z.init(e,t)}),ec=B(`ZodISOTime`,(e,t)=>{yi.init(e,t),Z.init(e,t)}),tc=B(`ZodISODuration`,(e,t)=>{bi.init(e,t),Z.init(e,t)}),nc=B(`ZodEmail`,(e,t)=>{ti.init(e,t),Z.init(e,t)}),rc=B(`ZodGUID`,(e,t)=>{$r.init(e,t),Z.init(e,t)}),ic=B(`ZodUUID`,(e,t)=>{ei.init(e,t),Z.init(e,t)}),ac=B(`ZodURL`,(e,t)=>{li.init(e,t),Z.init(e,t)}),oc=B(`ZodEmoji`,(e,t)=>{ui.init(e,t),Z.init(e,t)}),sc=B(`ZodNanoID`,(e,t)=>{di.init(e,t),Z.init(e,t)}),cc=B(`ZodCUID`,(e,t)=>{fi.init(e,t),Z.init(e,t)}),lc=B(`ZodCUID2`,(e,t)=>{pi.init(e,t),Z.init(e,t)}),uc=B(`ZodULID`,(e,t)=>{mi.init(e,t),Z.init(e,t)}),dc=B(`ZodXID`,(e,t)=>{hi.init(e,t),Z.init(e,t)}),fc=B(`ZodKSUID`,(e,t)=>{gi.init(e,t),Z.init(e,t)}),pc=B(`ZodIPv4`,(e,t)=>{xi.init(e,t),Z.init(e,t)}),mc=B(`ZodIPv6`,(e,t)=>{wi.init(e,t),Z.init(e,t)}),hc=B(`ZodCIDRv4`,(e,t)=>{Ti.init(e,t),Z.init(e,t)}),gc=B(`ZodCIDRv6`,(e,t)=>{Di.init(e,t),Z.init(e,t)}),_c=B(`ZodBase64`,(e,t)=>{Ai.init(e,t),Z.init(e,t)}),vc=B(`ZodBase64URL`,(e,t)=>{Ni.init(e,t),Z.init(e,t)}),yc=B(`ZodE164`,(e,t)=>{Pi.init(e,t),Z.init(e,t)}),bc=B(`ZodJWT`,(e,t)=>{Ii.init(e,t),Z.init(e,t)}),xc=B(`ZodUnknown`,(e,t)=>{Li.init(e,t),X.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Sc(){return _o(xc)}var Cc=B(`ZodNever`,(e,t)=>{Ri.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r)});function wc(e){return vo(Cc,e)}var Tc=B(`ZodArray`,(e,t)=>{Js(),Hi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vs(e,t,n,r),e.element=t.element},{min(e,t){return this.check(bo(e,t))},nonempty(e){return this.check(bo(1,e))},max(e,t){return this.check(yo(e,t))},length(e,t){return this.check(xo(e,t))},unwrap(){return this.element}});function Ec(e,t){return Po(Tc,e,t)}var Dc=B(`ZodObject`,(e,t)=>{Js(),Ji.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bs(e,t,n,r),Sn(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Pc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(M(this._zod.def,{catchall:e}))},passthrough(){return this.clone(M(this._zod.def,{catchall:Sc()}))},loose(){return this.clone(M(this._zod.def,{catchall:Sc()}))},strict(){return this.clone(M(this._zod.def,{catchall:wc()}))},strip(){return this.clone(M(this._zod.def,{catchall:void 0}))},extend(e){return Qt(this,e)},safeExtend(e){return en(this,e)},merge(e){return tn(this,e)},pick(e){return Yt(this,e)},omit(e){return Zt(this,e)},partial(...e){return nn(Lc,this,e[0])},exactPartial(...e){return nn(zc,this,e[0],`exactPartial`)},required(...e){return rn(qc,this,e[0])}});function Oc(e,t){return new Dc({type:`object`,shape:e??{},...P(t)})}var kc=B(`ZodUnion`,(e,t)=>{Xi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xs(e,t,n,r),e.options=t.options});function Ac(e,t){return new kc({type:`union`,options:e,...P(t)})}var jc=B(`ZodIntersection`,(e,t)=>{Zi.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r)});function Mc(e,t){return new jc({type:`intersection`,left:e,right:t})}var Nc=B(`ZodEnum`,(e,t)=>{ea.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(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 Nc({...t,checks:[],...P(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 Nc({...t,checks:[],...P(r),entries:i})}});function Pc(e,t){return new Nc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var Fc=B(`ZodTransform`,(e,t)=>{Js(),ta.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new kn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(mn(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(mn(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Ic(e){return new Fc({type:`transform`,transform:e})}var Lc=B(`ZodOptional`,(e,t)=>{ra.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rc(e){return new Lc({type:`optional`,innerType:e})}var zc=B(`ZodExactOptional`,(e,t)=>{ia.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ms(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bc(e){return new zc({type:`optional`,innerType:e})}var Vc=B(`ZodNullable`,(e,t)=>{aa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hc(e){return new Vc({type:`nullable`,innerType:e})}var Uc=B(`ZodDefault`,(e,t)=>{oa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ds(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Wc(e,t){return new Uc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ht(t)}})}var Gc=B(`ZodPrefault`,(e,t)=>{ca.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Os(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Kc(e,t){return new Gc({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Ht(t)}})}var qc=B(`ZodNonOptional`,(e,t)=>{la.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jc(e,t){return new qc({type:`nonoptional`,innerType:e,...P(t)})}var Yc=B(`ZodCatch`,(e,t)=>{fa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ks(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Xc(e,t){return new Yc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:wn(t)})}var Zc=B(`ZodPipe`,(e,t)=>{pa.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>As(e,t,n,r),e.in=t.in,e.out=t.out});function Qc(e,t){return new Zc({type:`pipe`,in:e,out:t})}var $c=B(`ZodReadonly`,(e,t)=>{ha.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>js(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function el(e){return new $c({type:`readonly`,innerType:e})}var tl=B(`ZodCustom`,(e,t)=>{_a.init(e,t),X.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r)});function nl(e,t={}){return Fo(tl,e,t)}function rl(e,t){return Io(e,t)}var Q=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}({}),il=function(e){return e.Verify=`/verify`,e.VerifyEmail=`/verify-email`,e.SignInUp=`/welcome`,e.Invite=`/invite/:workspaceInviteHash`,e.ResetPassword=`/reset-password/:passwordResetToken`,e.WorkspaceActivation=`/workspace-activation`,e.CreateProfile=`/create/profile`,e.SyncEmails=`/sync/emails`,e.InviteTeam=`/invite-team`,e.PlanRequired=`/plan-required`,e.PlanRequiredSuccess=`/plan-required/payment-success`,e.BookCall=`/book-call`,e.AiChat=`/chat/:threadId?`,e.AiChatInbox=`/inbox/:threadId?`,e.GettingStarted=`/getting-started`,e.Index=`/`,e.Home=`/home`,e.TasksPage=`/objects/tasks`,e.OpportunitiesPage=`/objects/opportunities`,e.RecordIndexPage=`/objects/:objectNamePlural`,e.RecordShowPage=`/object/:objectNameSingular/:objectRecordId`,e.PageLayoutPage=`/page/:pageLayoutId`,e.WorkflowCoreShowPage=`/workflow/:coreWorkflowId`,e.AgentIndexPage=`/agents`,e.AgentShowPage=`/agent/:agentId`,e.Settings=`settings`,e.SettingsCatchAll=`/settings/*`,e.Developers=`developers`,e.DevelopersCatchAll=`/developers/*`,e.Authorize=`/authorize`,e.Dpa=`/dpa`,e.NotFoundWildcard=`*`,e.NotFound=`/not-found`,e}({}),al=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}({});Q.ACTOR,Q.SELECT,Object.keys(al).map((e,t)=>({id:(0,n.v4)(),label:`${al[e].toLowerCase()}`,value:e,position:t})),Q.UUID,Q.TEXT,Q.RAW_JSON,Q.ADDRESS,Q.TEXT,Q.TEXT,Q.TEXT,Q.TEXT,Q.TEXT,Q.TEXT,Q.NUMERIC,Q.NUMERIC,Q.CURRENCY,Q.NUMERIC,Q.TEXT,Q.EMAILS,Q.TEXT,Q.RAW_JSON,Q.FULL_NAME,Q.TEXT,Q.TEXT,Q.LINKS,Q.TEXT,Q.TEXT,Q.RAW_JSON,Q.PHONES,Q.TEXT,Q.TEXT,Q.TEXT,Q.RAW_JSON,Q.RICH_TEXT,Q.TEXT,Q.TEXT,Q.TEXT,Oc({tiptap:Zs().nullable().optional(),markdown:Zs().nullable().optional(),blocknote:Zs().nullable().optional()}),Q.LINKS,Q.CURRENCY,Q.FULL_NAME,Q.ADDRESS,Q.ACTOR,Q.EMAILS,Q.PHONES,Q.RICH_TEXT,Q.RELATION,Q.MORPH_RELATION,Q.FILES,Q.TS_VECTOR;var ol=function(e){return e.CommandMenuDisplay=`command-menu-display`,e.ViewRecord=`view-record`,e.ViewRecords=`view-records`,e.MergeRecords=`merge-records`,e.MergeWithRecord=`merge-with-record`,e.UpdateRecords=`update-records`,e.EditRichText=`edit-rich-text`,e.Copilot=`copilot`,e.WorkflowTriggerSelectType=`workflow-trigger-select-type`,e.WorkflowStepCreate=`workflow-step-create`,e.WorkflowStepEditType=`workflow-step-edit-type`,e.WorkflowStepView=`workflow-step-view`,e.WorkflowStepEdit=`workflow-step-edit`,e.WorkflowRunStepView=`workflow-run-step-view`,e.WorkflowStepSettings=`workflow-step-settings`,e.SearchRecords=`search-records`,e.SearchAiChats=`search-ai-chats`,e.AskAI=`ask-ai`,e.PageLayoutDashboardWidgetTypeSelect=`page-layout-dashboard-widget-type-select`,e.PageLayoutTabSettings=`page-layout-tab-settings`,e.PageLayoutWidgetSettings=`page-layout-widget-settings`,e.DashboardChartSettings=`dashboard-chart-settings`,e.DashboardIframeSettings=`dashboard-iframe-settings`,e.DashboardRecordTableSettings=`dashboard-record-table-settings`,e.RecordPageFieldsSettings=`record-page-fields-settings`,e.RecordPageFieldSettings=`record-page-field-settings`,e.ViewFrontComponent=`view-front-component`,e.CommandMenuEdit=`command-menu-edit`,e.PageLayoutRecordPageWidgetTypeSelect=`page-layout-record-page-widget-type-select`,e.ComposeEmail=`compose-email`,e.ComposeCalendarEvent=`compose-calendar-event`,e.CreateRelatedRecord=`create-related-record`,e.RecordCreationForm=`record-creation-form`,e.RecordCreationFormSettings=`record-creation-form-settings`,e.SendCampaign=`send-campaign`,e.SendCampaignTest=`send-campaign-test`,e.AddToMessageList=`add-to-message-list`,e.WorkflowVersions=`workflow-versions`,e.WorkflowVersion=`workflow-version`,e.EmailBlockSettings=`email-block-settings`,e.EmailPageStyle=`email-page-style`,e.EmailBlockStyle=`email-block-style`,e.SettingsMetadataTranslations=`settings-metadata-translations`,e.RoutedPage=`routed-page`,e.WorkflowCoreFilters=`workflow-core-filters`,e.AgentCoreFilters=`agent-core-filters`,e.ShareRecord=`share-record`,e.SnoozeAiChat=`snooze-ai-chat`,e.AssignAiChat=`assign-ai-chat`,e}({}),sl=`frontComponentHostCommunicationApi`;globalThis[sl]??={};var $=globalThis.frontComponentHostCommunicationApi,cl=()=>{let e=$.closeSidePanel;if(!g(e))throw Error(`closeSidePanelFunction is not set`);return e()},ll=e=>{let t=$.copyToClipboard;if(!g(t))throw Error(`copyToClipboardFunction is not set`);return t(e)},ul=e=>{let t=process.env.applicationVariables;if(t)return JSON.parse(t)[e]},dl=e=>{let t=$.enqueueSnackbar;if(!g(t))throw Error(`enqueueSnackbarFunction is not set`);return t(e)},fl=(e,t,n,r)=>{let i=$.navigate;if(!g(i))throw Error(`navigateFunction is not set`);return i(e,t,n,r)},pl=e=>{let t=$.openCommandConfirmationModal;if(!g(t))throw Error(`openCommandConfirmationModalFunction is not set`);return t(e)},ml=e=>{let t=$.openSidePanelPage;if(!g(t))throw Error(`openSidePanelPageFunction is not set`);return t(e)},hl=()=>{let e=$.unmountFrontComponent;if(!g(e))throw Error(`unmountFrontComponentFunction is not set`);return e()},gl=e=>{let t=$.updateProgress;if(!g(t))throw Error(`updateProgressFunction is not set`);return t(e)},_l=(e,t)=>{let n=$.uploadFile;if(!g(n))throw Error(`uploadFileFunction is not set`);return n(e,t)},vl=e=>e.colorScheme,yl=()=>d(vl),bl=e=>e.frontComponentId,xl=()=>d(bl),Sl=()=>{let t=p();return{locale:t,t:(0,e.useCallback)((e,n)=>bt(e,n,t),[t])}},Cl=e=>e.location??null,wl=()=>d(Cl),Tl=e=>e.selectedRecordIds.length===1?e.selectedRecordIds[0]:null,El=()=>d(Tl),Dl=e=>e.toolCall??null,Ol=()=>d(Dl),kl=e=>e.selectedRecordIds,Al=()=>d(kl),jl=e=>e.selectedRecordsFilter??null,Ml=()=>d(jl),Nl=e=>e.selectedObjectMetadata??null,Pl=()=>d(Nl),Fl=()=>d(e=>e.timelineActivityId),Il=e=>e.userId,Ll=()=>d(Il),Rl=e=>m(e),zl=()=>c()?.locale??`en`,Bl=(e,t)=>bt(e,t,zl()),Vl=e=>`${e}-command-error`,Hl=({execute:t})=>{let[n,r]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{n||(r(!0),(async()=>{await t(),await hl()})())},[t,n,xl()]),null},Ul=({to:t,params:n,queryParams:r,options:i})=>{let[a,o]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{a||(o(!0),(async()=>{await fl(t,n,r,i),await hl()})())},[t,n,r,i,a,xl()]),null},Wl=t=>{let[n,r]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{n||(r(!0),(async()=>{await ml(t),await hl()})())},[t,n,xl()]),null},Gl=({title:t,subtitle:n,execute:r,confirmButtonText:i,confirmButtonAccent:a})=>{let[o,s]=(0,e.useState)(!1);return(0,e.useEffect)(()=>{o||(s(!0),(async()=>{await pl({title:t,subtitle:n,confirmButtonText:i,confirmButtonAccent:a})===`confirm`&&await r(),await hl()})())},[t,n,r,i,a,o,xl()]),null},Kl=async e=>{let{sendInboxMessage:t}=await new r.MetadataApiClient().mutation({sendInboxMessage:{__args:{input:e},threadId:!0}});return t},ql=/\[/g,Jl=/\]/g,Yl=/\r?\n/g,Xl=e=>e.replace(ql,`(`).replace(Jl,`)`).replace(Yl,` `).trim(),Zl=async({workspaceMemberId:e})=>{let{data:{workspaceMember:n}}=await new i.RestApiClient().get(`/rest/workspaceMembers/${e}`),r=`${n.name.firstName??``} ${n.name.lastName??``}`.trim();return wt({objectNameSingular:`workspaceMember`,recordId:e,displayName:Xl((0,t.isNonEmptyString)(r)?r:n.userEmail)})},Ql=({fullName:e,partName:n})=>{let r=(0,t.isObject)(e)?Reflect.get(e,n):void 0;return(0,t.isString)(r)?r:``},$l=({record:e,recordId:t,labelIdentifierField:n})=>{if(!g(n))return t;let r=e[n.name];return n.type===`FULL_NAME`?`${Ql({fullName:r,partName:`firstName`})} ${Ql({fullName:r,partName:`lastName`})}`.trim():g(r)?String(r):``},eu=async({metadataClient:e,objectMetadata:t})=>{if(!g(t.labelIdentifierFieldMetadataId))return;let{object:n}=await e.query({object:{__args:{id:t.id},fields:{__args:{filter:{id:{eq:t.labelIdentifierFieldMetadataId}},paging:{first:1}},edges:{node:{name:!0,type:!0}}}}});return n.fields.edges[0]?.node},tu=1e3,nu=async({metadataClient:e,objectNameSingular:t})=>{let{objects:n}=await e.query({objects:{__args:{filter:{},paging:{first:tu}},edges:{node:{id:!0,nameSingular:!0,namePlural:!0,labelIdentifierFieldMetadataId:!0}}}}),r=n.edges.find(({node:e})=>e.nameSingular===t)?.node;if(!g(r))throw Error(`This workspace has no ${t} object.`);return r},ru=async({objectNameSingular:e,recordId:t})=>{let n=new r.MetadataApiClient,a=await nu({metadataClient:n,objectNameSingular:e}),[o,s]=await Promise.all([eu({metadataClient:n,objectMetadata:a}),new i.RestApiClient().get(`/rest/${a.namePlural}/${t}`)]);return wt({objectNameSingular:e,recordId:t,displayName:Xl($l({record:s.data[e],recordId:t,labelIdentifierField:o}))})},iu=wt({objectNameSingular:Ct,recordId:Ct,displayName:`Ada`}),au=async e=>{await new r.MetadataApiClient().mutation({attachRecordToInboxThread:{__args:{input:e}}})},ou=async e=>{await new r.MetadataApiClient().mutation({detachRecordFromInboxThread:{__args:{input:e}}})};exports.AppPath=il,exports.Command=Hl,exports.CommandLink=Ul,exports.CommandModal=Gl,exports.CommandOpenSidePanelPage=Wl,exports.INBOX_ASSISTANT_MENTION=iu,exports.SidePanelPages=ol,exports.Trans=St,exports.attachRecordToInboxThread=au,exports.closeSidePanel=cl,exports.copyToClipboard=ll,exports.detachRecordFromInboxThread=ou,exports.enqueueSnackbar=dl,exports.getApplicationVariable=ul,exports.getFrontComponentCommandErrorDedupeKey=Vl,exports.inboxMention=Zl,exports.inboxReferenceRecord=ru,exports.msg=Rl,exports.navigate=fl,exports.openCommandConfirmationModal=pl,exports.openSidePanelPage=ml,exports.sendInboxMessage=Kl,exports.t=Bl,exports.unmountFrontComponent=hl,exports.updateProgress=gl,exports.uploadFile=_l,exports.useColorScheme=yl,exports.useFrontComponentExecutionContext=d,exports.useFrontComponentId=xl,exports.useLocale=p,exports.useLocation=wl,exports.useRecordId=El,exports.useSelectedObjectMetadata=Pl,exports.useSelectedRecordIds=Al,exports.useSelectedRecordsFilter=Ml,exports.useTimelineActivityId=Fl,exports.useToolCall=Ol,exports.useTranslate=Sl,exports.useUserId=Ll;
75
75
  //# sourceMappingURL=index.cjs.map