@objectstack/account 6.8.1 → 6.9.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.
@@ -99,7 +99,7 @@ The cached manifest will be removed. The app will remain loaded in the running k
99
99
 
100
100
  `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=qa,s=!Ma.jitless,c=s&&Ja.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Cc([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Ec(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=>!lo(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=>mo(e,r,Na())))}),t)}var Dc=N(`$ZodUnion`,(e,t)=>{Fs.init(e,t),Va(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Va(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Va(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Va(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=>Ra(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=>Ec(t,r,e,i)):Ec(o,r,e,i)}}),Oc=N(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Dc.init(e,t);let n=e._zod.parse;Va(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=Ia(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!qa(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),kc=N(`$ZodIntersection`,(e,t)=>{Fs.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])=>jc(e,t,n)):jc(e,i,a)}});function Ac(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ya(e)&&Ya(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=Ac(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=Ac(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 jc(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),lo(e))return e;let o=Ac(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Mc=N(`$ZodTuple`,(e,t)=>{Fs.init(e,t);let n=t.items;e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({input:a,inst:e,expected:`tuple`,code:`invalid_type`}),r;r.value=[];let o=[],s=Nc(n,`optin`),c=Nc(n,`optout`);if(!t.rest){if(a.length<s)return r.issues.push({code:`too_small`,minimum:s,inclusive:!0,input:a,inst:e,origin:`array`}),r;a.length>n.length&&r.issues.push({code:`too_big`,maximum:n.length,inclusive:!0,input:a,inst:e,origin:`array`})}let l=Array(n.length);for(let e=0;e<n.length;e++){let t=n[e]._zod.run({value:a[e],issues:[]},i);t instanceof Promise?o.push(t.then(t=>{l[e]=t})):l[e]=t}if(t.rest){let e=n.length-1,s=a.slice(n.length);for(let n of s){e++;let a=t.rest._zod.run({value:n,issues:[]},i);a instanceof Promise?o.push(a.then(t=>Pc(t,r,e))):Pc(a,r,e)}}return o.length?Promise.all(o).then(()=>Fc(l,r,n,a,c)):Fc(l,r,n,a,c)}});function Nc(e,t){for(let n=e.length-1;n>=0;n--)if(e[n]._zod[t]!==`optional`)return n+1;return 0}function Pc(e,t,n){e.issues.length&&t.issues.push(...fo(n,e.issues)),t.value[n]=e.value}function Fc(e,t,n,r,i){for(let a=0;a<n.length;a++){let n=e[a],o=a<r.length;if(n.issues.length){if(!o&&a>=i){t.value.length=a;break}t.issues.push(...fo(a,n.issues))}t.value[a]=n.value}for(let e=t.value.length-1;e>=r.length&&n[e]._zod.optout===`optional`&&t.value[e]===void 0;e--)t.value.length=e;return t}var Ic=N(`$ZodRecord`,(e,t)=>{Fs.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Ya(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>mo(e,r,Na())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...fo(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...fo(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof o==`string`&&ds.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>mo(e,r,Na())),input:o,path:[o],inst:e});continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...fo(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...fo(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Lc=N(`$ZodEnum`,(e,t)=>{Fs.init(e,t);let n=Pa(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>Za.has(typeof e)).map(e=>typeof e==`string`?Qa(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}}),Rc=N(`$ZodLiteral`,(e,t)=>{if(Fs.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?Qa(e):e?Qa(e.toString()):String(e)).join(`|`)})$`),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),zc=N(`$ZodTransform`,(e,t)=>{Fs.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ja(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.fallback=!0,n));if(i instanceof Promise)throw new Aa;return n.value=i,n.fallback=!0,n}});function Bc(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Vc=N(`$ZodOptional`,(e,t)=>{Fs.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Va(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Va(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ra(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Bc(e,r)):Bc(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Hc=N(`$ZodExactOptional`,(e,t)=>{Vc.init(e,t),Va(e._zod,`values`,()=>t.innerType._zod.values),Va(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Uc=N(`$ZodNullable`,(e,t)=>{Fs.init(e,t),Va(e._zod,`optin`,()=>t.innerType._zod.optin),Va(e._zod,`optout`,()=>t.innerType._zod.optout),Va(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ra(e.source)}|null)$`):void 0}),Va(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)}),Wc=N(`$ZodDefault`,(e,t)=>{Fs.init(e,t),e._zod.optin=`optional`,Va(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=>Gc(e,t)):Gc(r,t)}});function Gc(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Kc=N(`$ZodPrefault`,(e,t)=>{Fs.init(e,t),e._zod.optin=`optional`,Va(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))}),qc=N(`$ZodNonOptional`,(e,t)=>{Fs.init(e,t),Va(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=>Jc(t,e)):Jc(i,e)}});function Jc(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 Yc=N(`$ZodCatch`,(e,t)=>{Fs.init(e,t),e._zod.optin=`optional`,Va(e._zod,`optout`,()=>t.innerType._zod.optout),Va(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=>mo(e,n,Na()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>mo(e,n,Na()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),Xc=N(`$ZodPipe`,(e,t)=>{Fs.init(e,t),Va(e._zod,`values`,()=>t.in._zod.values),Va(e._zod,`optin`,()=>t.in._zod.optin),Va(e._zod,`optout`,()=>t.out._zod.optout),Va(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=>Zc(e,t.in,n)):Zc(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Zc(e,t.out,n)):Zc(r,t.out,n)}});function Zc(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var Qc=N(`$ZodReadonly`,(e,t)=>{Fs.init(e,t),Va(e._zod,`propValues`,()=>t.innerType._zod.propValues),Va(e._zod,`values`,()=>t.innerType._zod.values),Va(e._zod,`optin`,()=>t.innerType?._zod?.optin),Va(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($c):$c(r)}});function $c(e){return e.value=Object.freeze(e.value),e}var el=N(`$ZodFunction`,(e,t)=>(Fs.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if(typeof t!=`function`)throw Error(`implement() must be called with a function`);return function(...n){let r=e._def.input?Co(e._def.input,n):n,i=Reflect.apply(t,this,r);return e._def.output?Co(e._def.output,i):i}},e.implementAsync=t=>{if(typeof t!=`function`)throw Error(`implementAsync() must be called with a function`);return async function(...n){let r=e._def.input?await To(e._def.input,n):n,i=await Reflect.apply(t,this,r);return e._def.output?await To(e._def.output,i):i}},e._zod.parse=(t,n)=>typeof t.value==`function`?(e._def.output&&e._def.output._zod.def.type===`promise`?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t):(t.issues.push({code:`invalid_type`,expected:`function`,input:t.value,inst:e}),t),e.input=(...t)=>{let n=e.constructor;return Array.isArray(t[0])?new n({type:`function`,input:new Mc({type:`tuple`,items:t[0],rest:t[1]}),output:e._def.output}):new n({type:`function`,input:t[0],output:e._def.output})},e.output=t=>{let n=e.constructor;return new n({type:`function`,input:e._def.input,output:t})},e)),tl=N(`$ZodPromise`,(e,t)=>{Fs.init(e,t),e._zod.parse=(e,n)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},n))}),nl=N(`$ZodLazy`,(e,t)=>{Fs.init(e,t),Va(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),Va(e._zod,`pattern`,()=>e._zod.innerType?._zod?.pattern),Va(e._zod,`propValues`,()=>e._zod.innerType?._zod?.propValues),Va(e._zod,`optin`,()=>e._zod.innerType?._zod?.optin??void 0),Va(e._zod,`optout`,()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),rl=N(`$ZodCustom`,(e,t)=>{gs.init(e,t),Fs.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=>il(t,n,r,e));il(i,n,r,e)}});function il(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(go(e))}}var al,ol=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 sl(){return new ol}(al=globalThis).__zod_globalRegistry??(al.__zod_globalRegistry=sl());var cl=globalThis.__zod_globalRegistry;function ll(e,t){return new e({type:`string`,...P(t)})}function ul(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...P(t)})}function dl(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...P(t)})}function fl(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...P(t)})}function pl(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...P(t)})}function ml(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...P(t)})}function hl(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...P(t)})}function gl(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...P(t)})}function _l(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...P(t)})}function vl(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...P(t)})}function yl(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...P(t)})}function bl(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...P(t)})}function xl(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...P(t)})}function Sl(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...P(t)})}function Cl(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...P(t)})}function wl(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...P(t)})}function Tl(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...P(t)})}function El(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...P(t)})}function Dl(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...P(t)})}function Ol(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...P(t)})}function kl(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...P(t)})}function Al(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...P(t)})}function jl(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...P(t)})}function Ml(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...P(t)})}function Nl(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...P(t)})}function Pl(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...P(t)})}function Fl(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...P(t)})}function Il(e,t){return new e({type:`number`,checks:[],...P(t)})}function Ll(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...P(t)})}function Rl(e,t){return new e({type:`boolean`,...P(t)})}function zl(e,t){return new e({type:`null`,...P(t)})}function Bl(e){return new e({type:`any`})}function Vl(e){return new e({type:`unknown`})}function Hl(e,t){return new e({type:`never`,...P(t)})}function Ul(e,t){return new e({type:`void`,...P(t)})}function Wl(e,t){return new e({type:`date`,...P(t)})}function Gl(e,t){return new vs({check:`less_than`,...P(t),value:e,inclusive:!1})}function Kl(e,t){return new vs({check:`less_than`,...P(t),value:e,inclusive:!0})}function ql(e,t){return new ys({check:`greater_than`,...P(t),value:e,inclusive:!1})}function Jl(e,t){return new ys({check:`greater_than`,...P(t),value:e,inclusive:!0})}function Yl(e,t){return new bs({check:`multiple_of`,...P(t),value:e})}function Xl(e,t){return new Ss({check:`max_length`,...P(t),maximum:e})}function Zl(e,t){return new Cs({check:`min_length`,...P(t),minimum:e})}function Ql(e,t){return new ws({check:`length_equals`,...P(t),length:e})}function $l(e,t){return new Es({check:`string_format`,format:`regex`,...P(t),pattern:e})}function eu(e){return new Ds({check:`string_format`,format:`lowercase`,...P(e)})}function tu(e){return new Os({check:`string_format`,format:`uppercase`,...P(e)})}function nu(e,t){return new ks({check:`string_format`,format:`includes`,...P(t),includes:e})}function ru(e,t){return new As({check:`string_format`,format:`starts_with`,...P(t),prefix:e})}function iu(e,t){return new js({check:`string_format`,format:`ends_with`,...P(t),suffix:e})}function au(e){return new Ms({check:`overwrite`,tx:e})}function ou(e){return au(t=>t.normalize(e))}function su(){return au(e=>e.trim())}function cu(){return au(e=>e.toLowerCase())}function lu(){return au(e=>e.toUpperCase())}function uu(){return au(e=>Ga(e))}function du(e,t,n){return new e({type:`array`,element:t,...P(n)})}function fu(e,t,n){let r=P(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function pu(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...P(n)})}function mu(e,t){let n=hu(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(go(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(go(r))}},e(t.value,t)),t);return n}function hu(e,t){let n=new gs({check:`custom`,...P(t)});return n._zod.check=e,n}function gu(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??cl,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function _u(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);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,_u(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&bu(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 vu(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);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}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+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>
101
101
 
102
- 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}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function yu(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)):Object.assign(i,s),Object.assign(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??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);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)}Object.assign(i,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??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}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:Su(t,`input`,e.processors),output:Su(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function bu(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 bu(r.element,n);if(r.type===`set`)return bu(r.valueType,n);if(r.type===`lazy`)return bu(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`)return bu(r.innerType,n);if(r.type===`intersection`)return bu(r.left,n)||bu(r.right,n);if(r.type===`record`||r.type===`map`)return bu(r.keyType,n)||bu(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:bu(r.in,n)||bu(r.out,n);if(r.type===`object`){for(let e in r.shape)if(bu(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(bu(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(bu(e,n))return!0;return!!(r.rest&&bu(r.rest,n))}return!1}var xu=(e,t={})=>n=>{let r=gu({...n,processors:t});return _u(e,r),vu(r,e),yu(r,e)},Su=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=gu({...i??{},target:a,io:t,processors:n});return _u(e,o),vu(o,e),yu(o,e)},Cu={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},wu=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Cu[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];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}))])}},Tu=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Eu=(e,t,n,r)=>{n.type=`boolean`},Du=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Ou=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},ku=(e,t,n,r)=>{n.not={}},Au=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},ju=(e,t,n,r)=>{let i=e._zod.def,a=Pa(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Mu=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Nu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Pu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Fu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Iu=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=_u(a.element,t,{...r,path:[...r.path,`items`]})},Lu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=_u(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=_u(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ru=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>_u(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},zu=(e,t,n,r)=>{let i=e._zod.def,a=_u(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=_u(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Bu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>_u(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?_u(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},Vu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=_u(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=_u(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=_u(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Hu=(e,t,n,r)=>{let i=e._zod.def,a=_u(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`}]},Uu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Wu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Gu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ku=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},qu=(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;_u(o,t,r);let s=t.seen.get(e);s.ref=o},Ju=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Yu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Xu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zu=(e,t,n,r)=>{let i=e._zod.innerType;_u(i,t,r);let a=t.seen.get(e);a.ref=i},Qu=N(`ZodISODateTime`,(e,t)=>{Ys.init(e,t),wd.init(e,t)});function $u(e){return Ml(Qu,e)}var ed=N(`ZodISODate`,(e,t)=>{Xs.init(e,t),wd.init(e,t)});function td(e){return Nl(ed,e)}var nd=N(`ZodISOTime`,(e,t)=>{Zs.init(e,t),wd.init(e,t)});function rd(e){return Pl(nd,e)}var id=N(`ZodISODuration`,(e,t)=>{Qs.init(e,t),wd.init(e,t)});function ad(e){return Fl(id,e)}var od=N(`ZodError`,(e,t)=>{vo.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>xo(e,t)},flatten:{value:t=>bo(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Fa,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Fa,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),sd=So(od),cd=wo(od),ld=Eo(od),ud=Oo(od),dd=Ao(od),fd=jo(od),pd=Mo(od),md=No(od),hd=Po(od),gd=Fo(od),_d=Io(od),vd=Lo(od),yd=new WeakMap;function bd(e,t,n){let r=Object.getPrototypeOf(e),i=yd.get(r);if(i||(i=new Set,yd.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var xd=N(`ZodType`,(e,t)=>(Fs.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Su(e,`input`),output:Su(e,`output`)}}),e.toJSONSchema=xu(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>sd(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ld(e,t,n),e.parseAsync=async(t,n)=>cd(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ud(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>dd(e,t,n),e.decode=(t,n)=>fd(e,t,n),e.encodeAsync=async(t,n)=>pd(e,t,n),e.decodeAsync=async(t,n)=>md(e,t,n),e.safeEncode=(t,n)=>hd(e,t,n),e.safeDecode=(t,n)=>gd(e,t,n),e.safeEncodeAsync=async(t,n)=>_d(e,t,n),e.safeDecodeAsync=async(t,n)=>vd(e,t,n),bd(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Ua(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 $a(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Kf(e,t))},superRefine(e,t){return this.check(qf(e,t))},overwrite(e){return this.check(au(e))},optional(){return xf(this)},exactOptional(){return Cf(this)},nullable(){return Tf(this)},nullish(){return xf(Tf(this))},nonoptional(e){return jf(this,e)},array(){return z(this)},or(e){return V([this,e])},and(e){return ff(this,e)},transform(e){return Ff(this,yf(e))},default(e){return Df(this,e)},prefault(e){return kf(this,e)},catch(e){return Nf(this,e)},pipe(e){return Ff(this,e)},readonly(){return Lf(this)},describe(e){let t=this.clone();return cl.add(t,{description:e}),t},meta(...e){if(e.length===0)return cl.get(this);let t=this.clone();return cl.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return cl.get(e)?.description},configurable:!0}),e)),Sd=N(`_ZodString`,(e,t)=>{Is.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wu(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,bd(e,`_ZodString`,{regex(...e){return this.check($l(...e))},includes(...e){return this.check(nu(...e))},startsWith(...e){return this.check(ru(...e))},endsWith(...e){return this.check(iu(...e))},min(...e){return this.check(Zl(...e))},max(...e){return this.check(Xl(...e))},length(...e){return this.check(Ql(...e))},nonempty(...e){return this.check(Zl(1,...e))},lowercase(e){return this.check(eu(e))},uppercase(e){return this.check(tu(e))},trim(){return this.check(su())},normalize(...e){return this.check(ou(...e))},toLowerCase(){return this.check(cu())},toUpperCase(){return this.check(lu())},slugify(){return this.check(uu())}})}),Cd=N(`ZodString`,(e,t)=>{Is.init(e,t),Sd.init(e,t),e.email=t=>e.check(ul(Td,t)),e.url=t=>e.check(gl(Od,t)),e.jwt=t=>e.check(jl(Ud,t)),e.emoji=t=>e.check(_l(kd,t)),e.guid=t=>e.check(dl(Ed,t)),e.uuid=t=>e.check(fl(Dd,t)),e.uuidv4=t=>e.check(pl(Dd,t)),e.uuidv6=t=>e.check(ml(Dd,t)),e.uuidv7=t=>e.check(hl(Dd,t)),e.nanoid=t=>e.check(vl(Ad,t)),e.guid=t=>e.check(dl(Ed,t)),e.cuid=t=>e.check(yl(jd,t)),e.cuid2=t=>e.check(bl(Md,t)),e.ulid=t=>e.check(xl(Nd,t)),e.base64=t=>e.check(Ol(Bd,t)),e.base64url=t=>e.check(kl(Vd,t)),e.xid=t=>e.check(Sl(Pd,t)),e.ksuid=t=>e.check(Cl(Fd,t)),e.ipv4=t=>e.check(wl(Id,t)),e.ipv6=t=>e.check(Tl(Ld,t)),e.cidrv4=t=>e.check(El(Rd,t)),e.cidrv6=t=>e.check(Dl(zd,t)),e.e164=t=>e.check(Al(Hd,t)),e.datetime=t=>e.check($u(t)),e.date=t=>e.check(td(t)),e.time=t=>e.check(rd(t)),e.duration=t=>e.check(ad(t))});function F(e){return ll(Cd,e)}var wd=N(`ZodStringFormat`,(e,t)=>{Ls.init(e,t),Sd.init(e,t)}),Td=N(`ZodEmail`,(e,t)=>{Bs.init(e,t),wd.init(e,t)}),Ed=N(`ZodGUID`,(e,t)=>{Rs.init(e,t),wd.init(e,t)}),Dd=N(`ZodUUID`,(e,t)=>{zs.init(e,t),wd.init(e,t)}),Od=N(`ZodURL`,(e,t)=>{Vs.init(e,t),wd.init(e,t)}),kd=N(`ZodEmoji`,(e,t)=>{Hs.init(e,t),wd.init(e,t)}),Ad=N(`ZodNanoID`,(e,t)=>{Us.init(e,t),wd.init(e,t)}),jd=N(`ZodCUID`,(e,t)=>{Ws.init(e,t),wd.init(e,t)}),Md=N(`ZodCUID2`,(e,t)=>{Gs.init(e,t),wd.init(e,t)}),Nd=N(`ZodULID`,(e,t)=>{Ks.init(e,t),wd.init(e,t)}),Pd=N(`ZodXID`,(e,t)=>{qs.init(e,t),wd.init(e,t)}),Fd=N(`ZodKSUID`,(e,t)=>{Js.init(e,t),wd.init(e,t)}),Id=N(`ZodIPv4`,(e,t)=>{$s.init(e,t),wd.init(e,t)}),Ld=N(`ZodIPv6`,(e,t)=>{ec.init(e,t),wd.init(e,t)}),Rd=N(`ZodCIDRv4`,(e,t)=>{tc.init(e,t),wd.init(e,t)}),zd=N(`ZodCIDRv6`,(e,t)=>{nc.init(e,t),wd.init(e,t)}),Bd=N(`ZodBase64`,(e,t)=>{ic.init(e,t),wd.init(e,t)}),Vd=N(`ZodBase64URL`,(e,t)=>{oc.init(e,t),wd.init(e,t)}),Hd=N(`ZodE164`,(e,t)=>{sc.init(e,t),wd.init(e,t)}),Ud=N(`ZodJWT`,(e,t)=>{lc.init(e,t),wd.init(e,t)}),Wd=N(`ZodNumber`,(e,t)=>{uc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tu(e,t,n,r),bd(e,`ZodNumber`,{gt(e,t){return this.check(ql(e,t))},gte(e,t){return this.check(Jl(e,t))},min(e,t){return this.check(Jl(e,t))},lt(e,t){return this.check(Gl(e,t))},lte(e,t){return this.check(Kl(e,t))},max(e,t){return this.check(Kl(e,t))},int(e){return this.check(Kd(e))},safe(e){return this.check(Kd(e))},positive(e){return this.check(ql(0,e))},nonnegative(e){return this.check(Jl(0,e))},negative(e){return this.check(Gl(0,e))},nonpositive(e){return this.check(Kl(0,e))},multipleOf(e,t){return this.check(Yl(e,t))},step(e,t){return this.check(Yl(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function I(e){return Il(Wd,e)}var Gd=N(`ZodNumberFormat`,(e,t)=>{dc.init(e,t),Wd.init(e,t)});function Kd(e){return Ll(Gd,e)}var qd=N(`ZodBoolean`,(e,t)=>{fc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eu(e,t,n,r)});function L(e){return Rl(qd,e)}var Jd=N(`ZodNull`,(e,t)=>{pc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Du(e,t,n,r)});function Yd(e){return zl(Jd,e)}var Xd=N(`ZodAny`,(e,t)=>{mc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Zd(){return Bl(Xd)}var Qd=N(`ZodUnknown`,(e,t)=>{hc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function R(){return Vl(Qd)}var $d=N(`ZodNever`,(e,t)=>{gc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ku(e,t,n,r)});function ef(e){return Hl($d,e)}var tf=N(`ZodVoid`,(e,t)=>{_c.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ou(e,t,n,r)});function nf(e){return Ul(tf,e)}var rf=N(`ZodDate`,(e,t)=>{vc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Au(e,t,n,r),e.min=(t,n)=>e.check(Jl(t,n)),e.max=(t,n)=>e.check(Kl(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function af(e){return Wl(rf,e)}var of=N(`ZodArray`,(e,t)=>{bc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iu(e,t,n,r),e.element=t.element,bd(e,`ZodArray`,{min(e,t){return this.check(Zl(e,t))},nonempty(e){return this.check(Zl(1,e))},max(e,t){return this.check(Xl(e,t))},length(e,t){return this.check(Ql(e,t))},unwrap(){return this.element}})});function z(e,t){return du(of,e,t)}var sf=N(`ZodObject`,(e,t)=>{Tc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lu(e,t,n,r),Va(e,`shape`,()=>t.shape),bd(e,`ZodObject`,{keyof(){return U(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:R()})},loose(){return this.clone({...this._zod.def,catchall:R()})},strict(){return this.clone({...this._zod.def,catchall:ef()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return io(this,e)},safeExtend(e){return ao(this,e)},merge(e){return oo(this,e)},pick(e){return no(this,e)},omit(e){return ro(this,e)},partial(...e){return so(bf,this,e[0])},required(...e){return co(Af,this,e[0])}})});function B(e,t){return new sf({type:`object`,shape:e??{},...P(t)})}var cf=N(`ZodUnion`,(e,t)=>{Dc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ru(e,t,n,r),e.options=t.options});function V(e,t){return new cf({type:`union`,options:e,...P(t)})}var lf=N(`ZodDiscriminatedUnion`,(e,t)=>{cf.init(e,t),Oc.init(e,t)});function uf(e,t,n){return new lf({type:`union`,options:t,discriminator:e,...P(n)})}var df=N(`ZodIntersection`,(e,t)=>{kc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zu(e,t,n,r)});function ff(e,t){return new df({type:`intersection`,left:e,right:t})}var pf=N(`ZodTuple`,(e,t)=>{Mc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bu(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function mf(e,t,n){let r=t instanceof Fs;return new pf({type:`tuple`,items:e,rest:r?t:null,...P(r?n:t)})}var hf=N(`ZodRecord`,(e,t)=>{Ic.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vu(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function H(e,t,n){return!t||!t._zod?new hf({type:`record`,keyType:F(),valueType:e,...P(t)}):new hf({type:`record`,keyType:e,valueType:t,...P(n)})}var gf=N(`ZodEnum`,(e,t)=>{Lc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ju(e,t,n,r),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 gf({...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 gf({...t,checks:[],...P(r),entries:i})}});function U(e,t){return new gf({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var _f=N(`ZodLiteral`,(e,t)=>{Rc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mu(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function W(e,t){return new _f({type:`literal`,values:Array.isArray(e)?e:[e],...P(t)})}var vf=N(`ZodTransform`,(e,t)=>{zc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fu(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ja(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(go(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(go(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function yf(e){return new vf({type:`transform`,transform:e})}var bf=N(`ZodOptional`,(e,t)=>{Vc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xf(e){return new bf({type:`optional`,innerType:e})}var Sf=N(`ZodExactOptional`,(e,t)=>{Hc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cf(e){return new Sf({type:`optional`,innerType:e})}var wf=N(`ZodNullable`,(e,t)=>{Uc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tf(e){return new wf({type:`nullable`,innerType:e})}var Ef=N(`ZodDefault`,(e,t)=>{Wc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Df(e,t){return new Ef({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Xa(t)}})}var Of=N(`ZodPrefault`,(e,t)=>{Kc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kf(e,t){return new Of({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Xa(t)}})}var Af=N(`ZodNonOptional`,(e,t)=>{qc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jf(e,t){return new Af({type:`nonoptional`,innerType:e,...P(t)})}var Mf=N(`ZodCatch`,(e,t)=>{Yc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ku(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Nf(e,t){return new Mf({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Pf=N(`ZodPipe`,(e,t)=>{Xc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qu(e,t,n,r),e.in=t.in,e.out=t.out});function Ff(e,t){return new Pf({type:`pipe`,in:e,out:t})}var If=N(`ZodReadonly`,(e,t)=>{Qc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ju(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Lf(e){return new If({type:`readonly`,innerType:e})}var Rf=N(`ZodLazy`,(e,t)=>{nl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zu(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function zf(e){return new Rf({type:`lazy`,getter:e})}var Bf=N(`ZodPromise`,(e,t)=>{tl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vf(e){return new Bf({type:`promise`,innerType:e})}var Hf=N(`ZodFunction`,(e,t)=>{el.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pu(e,t,n,r)});function Uf(e){return new Hf({type:`function`,input:Array.isArray(e?.input)?mf(e?.input):e?.input??z(R()),output:e?.output??R()})}var Wf=N(`ZodCustom`,(e,t)=>{rl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nu(e,t,n,r)});function Gf(e,t){return fu(Wf,e??(()=>!0),t)}function Kf(e,t={}){return pu(Wf,e,t)}function qf(e,t){return mu(e,t)}var Jf=c(_(),1);function G(e){if(typeof process<`u`&&{}.OS_EAGER_SCHEMAS===`1`)return e();let t,n=()=>(t===void 0&&(t=e()),t);return new Proxy(function(){},{get(e,t){let r=n(),i=r[t];return typeof i==`function`?i.bind(r):i},set(e,t,r){let i=n();return i[t]=r,!0},has(e,t){return t in n()},ownKeys(){return Reflect.ownKeys(n())},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(n(),t)},getPrototypeOf(){return Reflect.getPrototypeOf(n())}})}var Yf=G(()=>B({$field:F().describe(`Field Reference/Column Name`)}));G(()=>B({$eq:Zd().optional(),$ne:Zd().optional()})),G(()=>B({$gt:V([I(),af(),Yf]).optional(),$gte:V([I(),af(),Yf]).optional(),$lt:V([I(),af(),Yf]).optional(),$lte:V([I(),af(),Yf]).optional()})),G(()=>B({$in:z(Zd()).optional(),$nin:z(Zd()).optional()})),G(()=>B({$between:mf([V([I(),af(),Yf]),V([I(),af(),Yf])]).optional()})),G(()=>B({$contains:F().optional(),$notContains:F().optional(),$startsWith:F().optional(),$endsWith:F().optional()})),G(()=>B({$null:L().optional(),$exists:L().optional()}));var Xf=G(()=>B({$eq:Zd().optional(),$ne:Zd().optional(),$gt:V([I(),af(),Yf]).optional(),$gte:V([I(),af(),Yf]).optional(),$lt:V([I(),af(),Yf]).optional(),$lte:V([I(),af(),Yf]).optional(),$in:z(Zd()).optional(),$nin:z(Zd()).optional(),$between:mf([V([I(),af(),Yf]),V([I(),af(),Yf])]).optional(),$contains:F().optional(),$notContains:F().optional(),$startsWith:F().optional(),$endsWith:F().optional(),$null:L().optional(),$exists:L().optional()})),Zf=zf(()=>H(F(),R()).and(B({$and:z(Zf).optional(),$or:z(Zf).optional(),$not:Zf.optional()})));G(()=>B({where:Zf.optional()}));var Qf=zf(()=>B({$and:z(V([H(F(),Xf),Qf])).optional(),$or:z(V([H(F(),Xf),Qf])).optional(),$not:V([H(F(),Xf),Qf]).optional()})),$f=new Set([`=`,`==`,`!=`,`<>`,`>`,`>=`,`<`,`<=`,`in`,`nin`,`not_in`,`contains`,`notcontains`,`not_contains`,`like`,`startswith`,`starts_with`,`endswith`,`ends_with`,`between`,`is_null`,`is_not_null`]);function ep(e){if(!Array.isArray(e)||e.length===0)return!1;let t=e[0];if(typeof t==`string`){let n=t.toLowerCase();if(n===`and`||n===`or`)return e.length>=2&&e.slice(1).every(e=>ep(e));if(e.length>=2&&typeof e[1]==`string`)return $f.has(e[1].toLowerCase())}return e.every(e=>ep(e))?e.length>0:!1}var tp=[`$eq`,`$ne`,`$gt`,`$gte`,`$lt`,`$lte`,`$in`,`$nin`,`$between`,`$contains`,`$notContains`,`$startsWith`,`$endsWith`,`$null`,`$exists`],np=[`$and`,`$or`,`$not`];[...tp,...np];var rp=G(()=>B({field:F(),order:U([`asc`,`desc`]).default(`asc`)})),ip=U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`,`array_agg`,`string_agg`]),ap=U([`day`,`week`,`month`,`quarter`,`year`]),op=G(()=>V([F(),B({field:F().describe(`Field to group by`),dateGranularity:ap.optional().describe(`Bucket date values into uniform periods (day/week/month/quarter/year)`),alias:F().optional().describe(`Alias for the projected group value`)})])),sp=G(()=>B({function:ip.describe(`Aggregation function`),field:F().optional().describe(`Field to aggregate (optional for COUNT(*))`),alias:F().describe(`Result column alias`),distinct:L().optional().describe(`Apply DISTINCT before aggregation`),filter:Zf.optional().describe(`Filter/Condition to apply to the aggregation (FILTER WHERE clause)`)})),cp=U([`inner`,`left`,`right`,`full`]),lp=U([`auto`,`database`,`hash`,`loop`]),up=zf(()=>B({type:cp.describe(`Join type`),strategy:lp.optional().describe(`Execution strategy hint`),object:F().describe(`Object/table to join`),alias:F().optional().describe(`Table alias`),on:Zf.describe(`Join condition`),subquery:zf(()=>_p).optional().describe(`Subquery instead of object`)})),dp=U([`row_number`,`rank`,`dense_rank`,`percent_rank`,`lag`,`lead`,`first_value`,`last_value`,`sum`,`avg`,`count`,`min`,`max`]),fp=G(()=>B({partitionBy:z(F()).optional().describe(`PARTITION BY fields`),orderBy:z(rp).optional().describe(`ORDER BY specification`),frame:B({type:U([`rows`,`range`]).optional(),start:F().optional().describe(`Frame start (e.g., "UNBOUNDED PRECEDING", "1 PRECEDING")`),end:F().optional().describe(`Frame end (e.g., "CURRENT ROW", "1 FOLLOWING")`)}).optional().describe(`Window frame specification`)})),pp=G(()=>B({function:dp.describe(`Window function name`),field:F().optional().describe(`Field to operate on (for aggregate window functions)`),alias:F().describe(`Result column alias`),over:fp.describe(`Window specification (OVER clause)`)})),mp=zf(()=>V([F(),B({field:F(),fields:z(mp).optional(),alias:F().optional()})])),hp=G(()=>B({query:F().describe(`Search query text`),fields:z(F()).optional().describe(`Fields to search in (if not specified, searches all text fields)`),fuzzy:L().optional().default(!1).describe(`Enable fuzzy matching (tolerates typos)`),operator:U([`and`,`or`]).optional().default(`or`).describe(`Logical operator between terms`),boost:H(F(),I()).optional().describe(`Field-specific relevance boosting (field name -> boost factor)`),minScore:I().optional().describe(`Minimum relevance score threshold`),language:F().optional().describe(`Language for text analysis (e.g., "en", "zh", "es")`),highlight:L().optional().default(!1).describe(`Enable search result highlighting`)})),gp=B({object:F().describe(`Object name (e.g. account)`),fields:z(mp).optional().describe(`Fields to retrieve`),where:Zf.optional().describe(`Filtering criteria (WHERE)`),search:hp.optional().describe(`Full-text search configuration ($search parameter)`),orderBy:z(rp).optional().describe(`Sorting instructions (ORDER BY)`),limit:I().optional().describe(`Max records to return (LIMIT)`),offset:I().optional().describe(`Records to skip (OFFSET)`),top:I().optional().describe(`Alias for limit (OData compatibility)`),cursor:H(F(),R()).optional().describe(`Cursor for keyset pagination`),joins:z(up).optional().describe(`Explicit Table Joins`),aggregations:z(sp).optional().describe(`Aggregation functions`),groupBy:z(op).optional().describe("GROUP BY targets (strings or `{field, dateGranularity?}` objects for date bucketing)"),having:Zf.optional().describe(`HAVING clause for aggregation filtering`),windowFunctions:z(pp).optional().describe(`Window functions with OVER clause`),distinct:L().optional().describe(`SELECT DISTINCT flag`)}),_p=G(()=>gp.extend({expand:zf(()=>H(F(),_p)).optional().describe(`Recursive relation loading map. Keys are lookup/master_detail field names; values are nested QueryAST objects that control select, filter, sort, and further expansion on the related object. The engine resolves expand via batch $in queries (driver-agnostic) with a default max depth of 3.`)})),vp=[`today`,`yesterday`,`tomorrow`,`now`],yp=[`current_week_start`,`current_week_end`,`current_month_start`,`current_month_end`,`current_quarter_start`,`current_quarter_end`,`current_year_start`,`current_year_end`,`last_week_start`,`last_week_end`,`last_month_start`,`last_month_end`,`last_quarter_start`,`last_quarter_end`,`last_year_start`,`last_year_end`,`next_week_start`,`next_week_end`,`next_month_start`,`next_month_end`,`next_quarter_start`,`next_quarter_end`,`next_year_start`,`next_year_end`],bp=[`week_start`,`week_end`,`month_start`,`month_end`,`quarter_start`,`quarter_end`,`year_start`,`year_end`],xp=[...vp,...yp,...bp],Sp=/^(\d+)_(minutes?|hours?|days?|weeks?|months?|years?)_(ago|from_now)$/,Cp=[`minute`,`hour`,`day`,`week`,`month`,`year`];function wp(e){return xp.includes(e)||Sp.test(e)}F().refine(wp,{message:`Unknown date macro. Must be a fixed token (see DATE_MACRO_TOKENS) or match {N_<unit>_(ago|from_now)} where unit is one of: `+Cp.join(`, `)});var Tp=/^\$?\{([a-zA-Z0-9_]+)\}$/;F().refine(e=>{let t=e.match(Tp);return!!t&&wp(t[1])},{message:`Not a recognised {date-macro} placeholder`});var Ep=G(()=>F().min(2,{message:`System identifier must be at least 2 characters`}).regex(/^[a-z][a-z0-9_.]*$/,{message:`System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., "user_profile" or "order.created")`}).describe(`System identifier (lowercase with underscores or dots)`)),Dp=G(()=>F().min(2,{message:`Identifier must be at least 2 characters`}).regex(/^[a-z][a-z0-9_]*$/,{message:`Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., "user_profile")`}).describe(`Snake case identifier (lowercase with underscores only)`));G(()=>F().min(3,{message:`Event name must be at least 3 characters`}).regex(/^[a-z][a-z0-9_.]*$/,{message:`Event name must be lowercase with dots for namespacing (e.g., "user.created", "order.paid")`}).describe(`Event name (lowercase with dot notation for namespacing)`));var Op=U([`cel`,`js`,`cron`,`template`]),kp=B({rationale:F().optional(),generatedBy:F().optional()}),Ap=B({dialect:Op,source:F().min(1).optional(),ast:R().optional(),meta:kp.optional()}).refine(e=>e.source!==void 0||e.ast!==void 0,{message:"Expression requires at least one of `source` or `ast`"}),jp=V([F().min(1).transform(e=>({dialect:`cel`,source:e})),Ap]);V([F().min(1).transform(e=>({dialect:`cron`,source:e})),Ap]);var Mp=V([F().min(1).transform(e=>({dialect:`template`,source:e})),Ap]),Np=G(()=>U([`aes-256-gcm`,`aes-256-cbc`,`chacha20-poly1305`]).describe(`Supported encryption algorithm`)),Pp=G(()=>U([`local`,`aws-kms`,`azure-key-vault`,`gcp-kms`,`hashicorp-vault`]).describe(`Key management service provider`)),Fp=G(()=>B({enabled:L().default(!1).describe(`Enable automatic key rotation`),frequencyDays:I().min(1).default(90).describe(`Rotation frequency in days`),retainOldVersions:I().default(3).describe(`Number of old key versions to retain`),autoRotate:L().default(!0).describe(`Automatically rotate without manual approval`)}).describe(`Policy for automatic encryption key rotation`)),Ip=G(()=>B({enabled:L().default(!1).describe(`Enable field-level encryption`),algorithm:Np.default(`aes-256-gcm`).describe(`Encryption algorithm`),keyManagement:B({provider:Pp.describe(`Key management service provider`),keyId:F().optional().describe(`Key identifier in the provider`),rotationPolicy:Fp.optional().describe(`Key rotation policy`)}).describe(`Key management configuration`),scope:U([`field`,`record`,`table`,`database`]).describe(`Encryption scope level`),deterministicEncryption:L().default(!1).describe(`Allows equality queries on encrypted data`),searchableEncryption:L().default(!1).describe(`Allows search on encrypted data`)}).describe(`Field-level encryption configuration`));G(()=>B({fieldName:F().describe(`Name of the field to encrypt`),encryptionConfig:Ip.describe(`Encryption settings for this field`),indexable:L().default(!1).describe(`Allow indexing on encrypted field`)}).describe(`Per-field encryption assignment`));var Lp=G(()=>U([`redact`,`partial`,`hash`,`tokenize`,`randomize`,`nullify`,`substitute`]).describe(`Data masking strategy for PII protection`)),Rp=G(()=>B({field:F().describe(`Field name to apply masking to`),strategy:Lp.describe(`Masking strategy to use`),pattern:F().optional().describe(`Regex pattern for partial masking`),preserveFormat:L().default(!0).describe(`Keep the original data format after masking`),preserveLength:L().default(!0).describe(`Keep the original data length after masking`),roles:z(F()).optional().describe(`Roles that see masked data`),exemptRoles:z(F()).optional().describe(`Roles that see unmasked data`)}).describe(`Masking rule for a single field`));G(()=>B({enabled:L().default(!1).describe(`Enable data masking`),rules:z(Rp).describe(`List of field-level masking rules`),auditUnmasking:L().default(!0).describe(`Log when masked data is accessed unmasked`)}).describe(`Top-level data masking configuration for PII protection`));var zp=U(`text.textarea.email.url.phone.password.markdown.html.richtext.number.currency.percent.date.datetime.time.boolean.toggle.select.multiselect.radio.checkboxes.lookup.master_detail.tree.image.file.avatar.video.audio.formula.summary.autonumber.composite.repeater.location.address.code.json.color.rating.slider.signature.qrcode.progress.tags.vector`.split(`.`)),Bp=G(()=>B({label:F().describe(`Display label (human-readable, any case allowed)`),value:Ep.describe(`Stored value (lowercase machine identifier)`),color:F().optional().describe(`Color code for badges/charts`),default:L().optional().describe(`Is default option`)}));G(()=>B({latitude:I().min(-90).max(90).describe(`Latitude coordinate`),longitude:I().min(-180).max(180).describe(`Longitude coordinate`),altitude:I().optional().describe(`Altitude in meters`),accuracy:I().optional().describe(`Accuracy in meters`)}));var Vp=G(()=>B({precision:I().int().min(0).max(10).default(2).describe(`Decimal precision (default: 2)`),currencyMode:U([`dynamic`,`fixed`]).default(`dynamic`).describe(`Currency mode: dynamic (user selectable) or fixed (single currency)`),defaultCurrency:F().length(3).default(`CNY`).describe(`Default or fixed currency code (ISO 4217, e.g., USD, CNY, EUR)`)}));G(()=>B({value:I().describe(`Monetary amount`),currency:F().length(3).describe(`Currency code (ISO 4217)`)})),G(()=>B({street:F().optional().describe(`Street address`),city:F().optional().describe(`City name`),state:F().optional().describe(`State/Province`),postalCode:F().optional().describe(`Postal/ZIP code`),country:F().optional().describe(`Country name or code`),countryCode:F().optional().describe(`ISO country code (e.g., US, GB)`),formatted:F().optional().describe(`Formatted address string`)}));var Hp=G(()=>B({dimensions:I().int().min(1).max(1e4).describe(`Vector dimensionality (e.g., 1536 for OpenAI embeddings)`),distanceMetric:U([`cosine`,`euclidean`,`dotProduct`,`manhattan`]).default(`cosine`).describe(`Distance/similarity metric for vector search`),normalized:L().default(!1).describe(`Whether vectors are normalized (unit length)`),indexed:L().default(!0).describe(`Whether to create a vector index for fast similarity search`),indexType:U([`hnsw`,`ivfflat`,`flat`]).optional().describe(`Vector index algorithm (HNSW for high accuracy, IVFFlat for large datasets)`)})),Up=G(()=>B({minSize:I().min(0).optional().describe(`Minimum file size in bytes`),maxSize:I().min(1).optional().describe(`Maximum file size in bytes (e.g., 10485760 = 10MB)`),allowedTypes:z(F()).optional().describe(`Allowed file extensions (e.g., [".pdf", ".docx", ".jpg"])`),blockedTypes:z(F()).optional().describe(`Blocked file extensions (e.g., [".exe", ".bat", ".sh"])`),allowedMimeTypes:z(F()).optional().describe(`Allowed MIME types (e.g., ["image/jpeg", "application/pdf"])`),blockedMimeTypes:z(F()).optional().describe(`Blocked MIME types`),virusScan:L().default(!1).describe(`Enable virus scanning for uploaded files`),virusScanProvider:U([`clamav`,`virustotal`,`metadefender`,`custom`]).optional().describe(`Virus scanning service provider`),virusScanOnUpload:L().default(!0).describe(`Scan files immediately on upload`),quarantineOnThreat:L().default(!0).describe(`Quarantine files if threat detected`),storageProvider:F().optional().describe(`Object storage provider name (references ObjectStorageConfig)`),storageBucket:F().optional().describe(`Target bucket name`),storagePrefix:F().optional().describe(`Storage path prefix (e.g., "uploads/documents/")`),imageValidation:B({minWidth:I().min(1).optional().describe(`Minimum image width in pixels`),maxWidth:I().min(1).optional().describe(`Maximum image width in pixels`),minHeight:I().min(1).optional().describe(`Minimum image height in pixels`),maxHeight:I().min(1).optional().describe(`Maximum image height in pixels`),aspectRatio:F().optional().describe(`Required aspect ratio (e.g., "16:9", "1:1")`),generateThumbnails:L().default(!1).describe(`Auto-generate thumbnails`),thumbnailSizes:z(B({name:F().describe(`Thumbnail variant name (e.g., "small", "medium", "large")`),width:I().min(1).describe(`Thumbnail width in pixels`),height:I().min(1).describe(`Thumbnail height in pixels`),crop:L().default(!1).describe(`Crop to exact dimensions`)})).optional().describe(`Thumbnail size configurations`),preserveMetadata:L().default(!1).describe(`Preserve EXIF metadata`),autoRotate:L().default(!0).describe(`Auto-rotate based on EXIF orientation`)}).optional().describe(`Image-specific validation rules`),allowMultiple:L().default(!1).describe(`Allow multiple file uploads (overrides field.multiple)`),allowReplace:L().default(!0).describe(`Allow replacing existing files`),allowDelete:L().default(!0).describe(`Allow deleting uploaded files`),requireUpload:L().default(!1).describe(`Require at least one file when field is required`),extractMetadata:L().default(!0).describe(`Extract file metadata (name, size, type, etc.)`),extractText:L().default(!1).describe(`Extract text content from documents (OCR/parsing)`),versioningEnabled:L().default(!1).describe(`Keep previous versions of replaced files`),maxVersions:I().min(1).optional().describe(`Maximum number of versions to retain`),publicRead:L().default(!1).describe(`Allow public read access to uploaded files`),presignedUrlExpiry:I().min(60).max(604800).default(3600).describe(`Presigned URL expiration in seconds (default: 1 hour)`)}).refine(e=>!(e.minSize!==void 0&&e.maxSize!==void 0&&e.minSize>e.maxSize),{message:`minSize must be less than or equal to maxSize`}).refine(e=>!(e.virusScanProvider!==void 0&&e.virusScan!==!0),{message:`virusScanProvider requires virusScan to be enabled`})),Wp=G(()=>B({uniqueness:L().default(!1).describe(`Enforce unique values across all records`),completeness:I().min(0).max(1).default(0).describe(`Minimum ratio of non-null values (0-1, default: 0 = no requirement)`),accuracy:B({source:F().describe(`Reference data source for validation (e.g., "api.verify.com", "master_data")`),threshold:I().min(0).max(1).describe(`Minimum accuracy threshold (0-1, e.g., 0.95 = 95% match required)`)}).optional().describe(`Accuracy validation configuration`)})),Gp=G(()=>B({enabled:L().describe(`Enable caching for computed field results`),ttl:I().min(0).describe(`Cache TTL in seconds (0 = no expiration)`),invalidateOn:z(F()).describe(`Field paths that invalidate cache (e.g., ["inventory.quantity", "pricing.base_price"])`)})),Kp=G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Machine name (snake_case)`).optional(),label:F().optional().describe(`Human readable label`),type:zp.describe(`Field Data Type`),description:F().optional().describe(`Tooltip/Help text`),format:F().optional().describe(`Format string (e.g. email, phone)`),columnName:F().optional().describe(`Physical column name in the target datasource. Defaults to the field key when not set.`),required:L().default(!1).describe(`Is required`),searchable:L().default(!1).describe(`Is searchable`),multiple:L().default(!1).describe(`Allow multiple values (Stores as Array/JSON). Applicable for select, lookup, file, image.`),unique:L().default(!1).describe(`Is unique constraint`),defaultValue:R().optional().describe(`Default value`),maxLength:I().optional().describe(`Max character length`),minLength:I().optional().describe(`Min character length`),precision:I().optional().describe(`Total digits`),scale:I().optional().describe(`Decimal places`),min:I().optional().describe(`Minimum value`),max:I().optional().describe(`Maximum value`),options:z(Bp).optional().describe(`Static options for select/multiselect`),reference:F().optional().describe(`Target object name (snake_case) for lookup/master_detail fields. Required for relationship types. Used by $expand to resolve foreign key IDs into full objects.`),referenceFilters:z(F()).optional().describe(`Filters applied to lookup dialogs (e.g. "active = true")`),writeRequiresMasterRead:L().optional().describe(`If true, user needs read access to master record to edit this field`),deleteBehavior:U([`set_null`,`cascade`,`restrict`]).optional().default(`set_null`).describe(`What happens if referenced record is deleted`),expression:jp.optional().describe("Formula expression (CEL). e.g. F`record.amount * 0.1`"),summaryOperations:B({object:F().describe(`Source child object name for roll-up`),field:F().describe(`Field on child object to aggregate`),function:U([`count`,`sum`,`min`,`max`,`avg`]).describe(`Aggregation function to apply`)}).optional().describe(`Roll-up summary definition`),language:F().optional().describe(`Programming language for syntax highlighting (e.g., javascript, python, sql)`),theme:F().optional().describe(`Code editor theme (e.g., dark, light, monokai)`),lineNumbers:L().optional().describe(`Show line numbers in code editor`),maxRating:I().optional().describe(`Maximum rating value (default: 5)`),allowHalf:L().optional().describe(`Allow half-star ratings`),displayMap:L().optional().describe(`Display map widget for location field`),allowGeocoding:L().optional().describe(`Allow address-to-coordinate conversion`),addressFormat:U([`us`,`uk`,`international`]).optional().describe(`Address format template`),colorFormat:U([`hex`,`rgb`,`rgba`,`hsl`]).optional().describe(`Color value format`),allowAlpha:L().optional().describe(`Allow transparency/alpha channel`),presetColors:z(F()).optional().describe(`Preset color options`),step:I().optional().describe(`Step increment for slider (default: 1)`),showValue:L().optional().describe(`Display current value on slider`),marks:H(F(),F()).optional().describe(`Custom marks/labels at specific values (e.g., {0: "Low", 50: "Medium", 100: "High"})`),barcodeFormat:U([`qr`,`ean13`,`ean8`,`code128`,`code39`,`upca`,`upce`]).optional().describe(`Barcode format type`),qrErrorCorrection:U([`L`,`M`,`Q`,`H`]).optional().describe(`QR code error correction level (L=7%, M=15%, Q=25%, H=30%). Only applicable when barcodeFormat is "qr"`),displayValue:L().optional().describe(`Display human-readable value below barcode/QR code`),allowScanning:L().optional().describe(`Enable camera scanning for barcode/QR code input`),currencyConfig:Vp.optional().describe(`Configuration for currency field type`),vectorConfig:Hp.optional().describe(`Configuration for vector field type (AI/ML embeddings)`),fileAttachmentConfig:Up.optional().describe(`Configuration for file and attachment field types`),encryptionConfig:Ip.optional().describe(`Field-level encryption configuration for sensitive data (GDPR/HIPAA/PCI-DSS)`),maskingRule:Rp.optional().describe(`Data masking rules for PII protection`),auditTrail:L().default(!1).describe(`Enable detailed audit trail for this field (tracks all changes with user and timestamp)`),dependencies:z(F()).optional().describe(`Array of field names that this field depends on (for formulas, visibility rules, etc.)`),cached:Gp.optional().describe(`Caching configuration for computed/formula fields`),dataQuality:Wp.optional().describe(`Data quality validation and monitoring rules`),group:F().optional().describe(`Field group name for organizing fields in forms and layouts (e.g., "contact_info", "billing", "system")`),conditionalRequired:jp.optional().describe("Predicate (CEL) — field is required when TRUE. e.g. P`record.status == 'closed_won'`"),hidden:L().default(!1).describe(`Hidden from default UI`),readonly:L().default(!1).describe(`Read-only in UI`),system:L().optional().describe(`Auto-injected system/audit field (e.g. created_at, updated_by, organization_id). Tools that surface system fields separately from author-declared business fields should branch on this flag.`),sortable:L().optional().default(!0).describe(`Whether field is sortable in list views`),inlineHelpText:F().optional().describe(`Help text displayed below the field in forms`),trackFeedHistory:L().optional().describe(`Track field changes in Chatter/activity feed (Salesforce pattern)`),caseSensitive:L().optional().describe(`Whether text comparisons are case-sensitive`),autonumberFormat:F().optional().describe(`Auto-number display format pattern (e.g., "CASE-{0000}")`),index:L().default(!1).describe(`Create standard database index`),externalId:L().default(!1).describe(`Is external ID for upsert operations`)})),qp=B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique rule name (snake_case)`),label:F().optional().describe(`Human-readable label for the rule listing`),description:F().optional().describe(`Administrative notes explaining the business reason`),active:L().default(!0),events:z(U([`insert`,`update`,`delete`])).default([`insert`,`update`]).describe(`Validation contexts`),priority:I().int().min(0).max(9999).default(100).describe(`Execution priority (lower runs first, default: 100)`),tags:z(F()).optional().describe(`Categorization tags (e.g., "compliance", "billing")`),severity:U([`error`,`warning`,`info`]).default(`error`),message:F().describe(`Error message to display to the user`)}),Jp=G(()=>qp.extend({type:W(`script`),condition:jp.describe("Predicate (CEL). If TRUE, validation fails. e.g. P`record.amount < 0`")})),Yp=G(()=>qp.extend({type:W(`unique`),fields:z(F()).describe(`Fields that must be combined unique`),scope:jp.optional().describe("Predicate (CEL) limiting uniqueness scope. e.g. P`record.active == true`"),caseSensitive:L().default(!0)})),Xp=G(()=>qp.extend({type:W(`state_machine`),field:F().describe(`State field (e.g. status)`),transitions:H(F(),z(F())).describe(`Map of { OldState: [AllowedNewStates] }`)})),Zp=G(()=>qp.extend({type:W(`format`),field:F(),regex:F().optional(),format:U([`email`,`url`,`phone`,`json`]).optional()})),Qp=G(()=>qp.extend({type:W(`cross_field`),condition:jp.describe("Predicate (CEL) comparing fields. e.g. P`record.end_date > record.start_date`"),fields:z(F()).describe(`Fields involved in the validation`)})),$p=G(()=>qp.extend({type:W(`json_schema`),field:F().describe(`JSON field to validate`),schema:H(F(),R()).describe(`JSON Schema object definition`)})),em=G(()=>qp.extend({type:W(`async`),field:F().describe(`Field to validate`),validatorUrl:F().optional().describe(`External API endpoint for validation`),method:U([`GET`,`POST`]).default(`GET`).describe(`HTTP method for external call`),headers:H(F(),F()).optional().describe(`Custom headers for the request`),validatorFunction:F().optional().describe(`Reference to custom validator function`),timeout:I().optional().default(5e3).describe(`Timeout in milliseconds`),debounce:I().optional().describe(`Debounce delay in milliseconds`),params:H(F(),R()).optional().describe(`Additional parameters to pass to validator`)})),tm=G(()=>qp.extend({type:W(`custom`),handler:F().describe(`Name of the custom validation function registered in the system`),params:H(F(),R()).optional().describe(`Parameters passed to the custom handler`)})),nm=zf(()=>uf(`type`,[Jp,Yp,Xp,Zp,Qp,$p,em,tm,rm])),rm=G(()=>qp.extend({type:W(`conditional`),when:jp.describe("Predicate (CEL). e.g. P`record.type == 'enterprise'`"),then:nm.describe(`Validation rule to apply when condition is true`),otherwise:nm.optional().describe(`Validation rule to apply when condition is false`)})),im=G(()=>V([F().describe(`Action Name`),B({type:F(),params:H(F(),R()).optional()})])),am=G(()=>V([F().describe(`Guard Name (e.g., "isManager", "amountGT1000")`),B({type:F(),params:H(F(),R()).optional()})])),om=G(()=>B({target:F().optional().describe(`Target State ID`),cond:am.optional().describe(`Condition (Guard) required to take this path`),actions:z(im).optional().describe(`Actions to execute during transition`),description:F().optional().describe(`Human readable description of this rule`)}));G(()=>B({type:F().describe(`Event Type (e.g. "APPROVE", "REJECT", "Submit")`),schema:H(F(),R()).optional().describe(`Expected event payload structure`)}));var sm=zf(()=>B({type:U([`atomic`,`compound`,`parallel`,`final`,`history`]).default(`atomic`),entry:z(im).optional().describe(`Actions to run when entering this state`),exit:z(im).optional().describe(`Actions to run when leaving this state`),on:H(F(),V([F(),om,z(om)])).optional().describe(`Map of Event Type -> Transition Definition`),always:z(om).optional(),initial:F().optional().describe(`Initial child state (if compound)`),states:H(F(),sm).optional(),meta:B({label:F().optional(),description:F().optional(),color:F().optional(),aiInstructions:F().optional().describe(`Specific instructions for AI when in this state`)}).optional()})),cm=G(()=>B({id:Dp.describe(`Unique Machine ID`),description:F().optional(),contextSchema:H(F(),R()).optional().describe(`Zod Schema for the machine context/memory`),initial:F().describe(`Initial State ID`),states:H(F(),sm).describe(`State Nodes`),on:H(F(),V([F(),om,z(om)])).optional()}));G(()=>B({key:F().describe(`Translation key (e.g., "views.task_list.label")`),defaultValue:F().optional().describe(`Fallback value when translation key is not found`),params:H(F(),V([F(),I(),L()])).optional().describe(`Interpolation parameters (e.g., { count: 5 })`)}));var lm=G(()=>F().describe(`Display label (plain string; i18n keys are auto-generated by the framework)`)),um=G(()=>B({ariaLabel:lm.optional().describe(`Accessible label for screen readers (WAI-ARIA aria-label)`),ariaDescribedBy:F().optional().describe(`ID of element providing additional description (WAI-ARIA aria-describedby)`),role:F().optional().describe(`WAI-ARIA role attribute (e.g., "dialog", "navigation", "alert")`)}).describe(`ARIA accessibility attributes`));G(()=>B({key:F().describe(`Translation key`),zero:F().optional().describe(`Zero form (e.g., "No items")`),one:F().optional().describe(`Singular form (e.g., "{count} item")`),two:F().optional().describe(`Dual form (e.g., "{count} items" for exactly 2)`),few:F().optional().describe(`Few form (e.g., for 2-4 in some languages)`),many:F().optional().describe(`Many form (e.g., for 5+ in some languages)`),other:F().describe(`Default plural form (e.g., "{count} items")`)}).describe(`ICU plural rules for a translation key`));var dm=G(()=>B({style:U([`decimal`,`currency`,`percent`,`unit`]).default(`decimal`).describe(`Number formatting style`),currency:F().optional().describe(`ISO 4217 currency code (e.g., "USD", "EUR")`),unit:F().optional().describe(`Unit for unit formatting (e.g., "kilometer", "liter")`),minimumFractionDigits:I().optional().describe(`Minimum number of fraction digits`),maximumFractionDigits:I().optional().describe(`Maximum number of fraction digits`),useGrouping:L().optional().describe(`Whether to use grouping separators (e.g., 1,000)`)}).describe(`Number formatting rules`)),fm=G(()=>B({dateStyle:U([`full`,`long`,`medium`,`short`]).optional().describe(`Date display style`),timeStyle:U([`full`,`long`,`medium`,`short`]).optional().describe(`Time display style`),timeZone:F().optional().describe(`IANA time zone (e.g., "America/New_York")`),hour12:L().optional().describe(`Use 12-hour format`)}).describe(`Date/time formatting rules`));G(()=>B({code:F().describe(`BCP 47 language code (e.g., "en-US", "zh-CN")`),fallbackChain:z(F()).optional().describe(`Fallback language codes in priority order (e.g., ["zh-TW", "en"])`),direction:U([`ltr`,`rtl`]).default(`ltr`).describe(`Text direction: left-to-right or right-to-left`),numberFormat:dm.optional().describe(`Default number formatting rules`),dateFormat:fm.optional().describe(`Default date/time formatting rules`)}).describe(`Locale configuration`));var pm=U([`api.read`,`api.write`,`crypto.uuid`,`crypto.hash`,`log`]),mm=uf(`language`,[B({language:W(`expression`),source:F().min(1).describe(`Formula expression source`)}).describe(`L1 expression body — pure formula, no IO`),B({language:W(`js`),source:F().min(1).describe(`Function body source`),capabilities:z(pm).default([]).describe(`Granted capability tokens`),timeoutMs:I().int().positive().max(3e4).optional().describe(`Per-invocation timeout (ms)`),memoryMb:I().int().positive().max(256).optional().describe(`Per-invocation memory cap (MB)`)}).describe(`L2 sandboxed JS body — runs inside an isolated VM with declared capabilities`)]).describe(`Hook/Action body — expression (L1) or sandboxed JS (L2)`),hm=G(()=>B({name:F().optional(),field:Dp.optional(),objectOverride:Dp.optional(),label:lm.optional(),type:zp.optional(),required:L().optional().default(!1),options:z(B({label:lm,value:F()})).optional(),placeholder:F().optional(),helpText:F().optional(),defaultValue:R().optional(),defaultFromRow:L().optional()}).refine(e=>!!e.name||!!e.field,{message:`ActionParam requires either "name" or "field"`})),gm=U([`script`,`url`,`modal`,`flow`,`api`,`form`]),_m=new Set(gm.options.filter(e=>e!==`script`)),vm=G(()=>B({name:Dp.describe(`Machine name (lowercase snake_case)`),label:lm.describe(`Display label`),objectName:F().regex(/^[a-z_][a-z0-9_]*$/).optional().describe(`Target object this action belongs to. When set, the action is auto-merged into the object's actions array by defineStack().`),icon:F().optional().describe(`Icon name`),locations:z(U([`list_toolbar`,`list_item`,`record_header`,`record_more`,`record_related`,`global_nav`])).optional().describe(`Locations where this action is visible`),component:U([`action:button`,`action:icon`,`action:menu`,`action:group`]).optional().describe(`Visual component override`),type:gm.default(`script`).describe(`Action functionality type`),target:F().optional().describe(`URL, Script Name, Flow ID, or API Endpoint`),body:mm.optional().describe("Action body — expression (L1) or sandboxed JS (L2). Only used when type is `script`."),execute:F().optional().describe(`@deprecated — Use target instead. Auto-migrated to target during parsing.`),params:z(hm).optional().describe(`Input parameters required from user`),variant:U([`primary`,`secondary`,`danger`,`ghost`,`link`]).optional().describe(`Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent)`),confirmText:lm.optional().describe(`Confirmation message before execution`),successMessage:lm.optional().describe(`Success message to show after execution`),refreshAfter:L().default(!1).describe(`Refresh view after execution`),visible:jp.optional().describe(`Visibility predicate (CEL).`),disabled:V([L(),jp]).optional().describe(`Boolean or predicate (CEL) — action is disabled when TRUE.`),shortcut:F().optional().describe(`Keyboard shortcut to trigger this action (e.g., "Ctrl+S")`),bulkEnabled:L().optional().describe(`Whether this action can be applied to multiple selected records`),aiExposed:L().optional().describe(`Set to false to keep this action out of the AI tool registry.`),recordIdParam:F().optional().describe(`Body key to inject the row id into when running from a list_item context.`),recordIdField:F().optional().describe(`Row field whose value seeds recordIdParam. Defaults to "id".`),bodyShape:V([W(`flat`),B({wrap:F()})]).optional().describe(`Body wrapping: flat (default) or { wrap: key } to nest user-collected params under a key.`),method:U([`POST`,`PATCH`,`PUT`,`DELETE`]).optional().describe(`HTTP method for type:"api" actions. Defaults to POST.`),bodyExtra:H(F(),R()).optional().describe(`Constant body fields merged into the API request (applied last; overrides user params).`),mode:U([`create`,`edit`,`delete`,`custom`]).optional().describe(`Semantic mode of the action.`),timeout:I().optional().describe(`Maximum execution time in milliseconds for the action`),aria:um.optional().describe(`ARIA accessibility attributes`)}).transform(e=>e.execute&&!e.target?{...e,target:e.execute}:e).refine(e=>!(_m.has(e.type)&&!e.target),{message:`Action 'target' is required when type is 'url', 'flow', 'modal', 'api', or 'form'.`,path:[`target`]})),ym=G(()=>B({enabled:L().default(!1).describe(`Enable public sharing`),publicLink:F().optional().describe(`Generated public share URL`),password:F().optional().describe(`Password required to access shared link`),allowedDomains:z(F()).optional().describe(`Restrict access to specific email domains (e.g. ["example.com"])`),expiresAt:F().optional().describe(`Expiration date/time in ISO 8601 format`),allowAnonymous:L().optional().default(!1).describe(`Allow access without authentication`)}));G(()=>B({enabled:L().default(!1).describe(`Enable iframe embedding`),allowedOrigins:z(F()).optional().describe(`Allowed iframe parent origins (e.g. ["https://example.com"])`),width:F().optional().default(`100%`).describe(`Embed width (CSS value)`),height:F().optional().default(`600px`).describe(`Embed height (CSS value)`),showHeader:L().optional().default(!0).describe(`Show interface header in embed`),showNavigation:L().optional().default(!1).describe(`Show navigation in embed`),responsive:L().optional().default(!0).describe(`Enable responsive resizing`)}));var bm=U([`xs`,`sm`,`md`,`lg`,`xl`,`2xl`]),xm=G(()=>B({xs:I().min(1).max(12).optional(),sm:I().min(1).max(12).optional(),md:I().min(1).max(12).optional(),lg:I().min(1).max(12).optional(),xl:I().min(1).max(12).optional(),"2xl":I().min(1).max(12).optional()}).describe(`Grid columns per breakpoint (1-12)`)),Sm=G(()=>B({xs:I().optional(),sm:I().optional(),md:I().optional(),lg:I().optional(),xl:I().optional(),"2xl":I().optional()}).describe(`Display order per breakpoint`)),Cm=G(()=>B({breakpoint:bm.optional().describe(`Minimum breakpoint for visibility`),hiddenOn:z(bm).optional().describe(`Hide on these breakpoints`),columns:xm.optional().describe(`Grid columns per breakpoint`),order:Sm.optional().describe(`Display order per breakpoint`)}).describe(`Responsive layout configuration`)),wm=G(()=>B({lazyLoad:L().optional().describe(`Enable lazy loading (defer rendering until visible)`),virtualScroll:B({enabled:L().default(!1).describe(`Enable virtual scrolling`),itemHeight:I().optional().describe(`Fixed item height in pixels (for estimation)`),overscan:I().optional().describe(`Number of extra items to render outside viewport`)}).optional().describe(`Virtual scrolling configuration`),cacheStrategy:U([`none`,`cache-first`,`network-first`,`stale-while-revalidate`]).optional().describe(`Client-side data caching strategy`),prefetch:L().optional().describe(`Prefetch data before component is visible`),pageSize:I().optional().describe(`Number of items per page for pagination`),debounceMs:I().optional().describe(`Debounce interval for user interactions in milliseconds`)}).describe(`Performance optimization configuration`)),Tm=U([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`,`HEAD`,`OPTIONS`]),Em=G(()=>U([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`])),Dm=G(()=>B({url:F().describe(`API endpoint URL`),method:Em.optional().default(`GET`).describe(`HTTP method`),headers:H(F(),F()).optional().describe(`Custom HTTP headers`),params:H(F(),R()).optional().describe(`Query parameters`),body:R().optional().describe(`Request body for POST/PUT/PATCH`)}));G(()=>B({enabled:L().default(!0).describe(`Enable CORS`),origins:V([F(),z(F())]).default(`*`).describe(`Allowed origins (* for all)`),methods:z(Tm).optional().describe(`Allowed HTTP methods`),credentials:L().default(!1).describe(`Allow credentials (cookies, authorization headers)`),maxAge:I().int().optional().describe(`Preflight cache duration in seconds`)})),G(()=>B({enabled:L().default(!1).describe(`Enable rate limiting`),windowMs:I().int().default(6e4).describe(`Time window in milliseconds`),maxRequests:I().int().default(100).describe(`Max requests per window`)})),G(()=>B({path:F().describe(`URL path to serve from`),directory:F().describe(`Physical directory to serve`),cacheControl:F().optional().describe(`Cache-Control header value`)}));var Om=G(()=>uf(`provider`,[B({provider:W(`object`),object:F().describe(`Target object name`)}),B({provider:W(`api`),read:Dm.optional().describe(`Configuration for fetching data`),write:Dm.optional().describe(`Configuration for submitting data (for forms/editable tables)`)}),B({provider:W(`value`),items:z(R()).describe(`Static data array`)}),B({provider:W(`schema`),schemaId:F().describe(`Schema identifier — typically the metadata type name`),schema:H(F(),R()).optional().describe(`Inline JSON Schema (Draft 2020-12). Optional when schemaId is resolvable.`)})])),km=G(()=>B({field:F().describe(`Field name to filter on`),operator:F().describe(`Filter operator (e.g. equals, not_equals, contains, this_quarter)`),value:V([F(),I(),L(),Yd(),z(V([F(),I()]))]).optional().describe(`Filter value`)}).describe(`View filter rule`)),Am=G(()=>U([`none`,`count`,`count_empty`,`count_filled`,`count_unique`,`percent_empty`,`percent_filled`,`sum`,`avg`,`min`,`max`]).describe(`Aggregation function for column footer summary`)),jm=G(()=>B({field:F().describe(`Field name (snake_case)`),label:lm.optional().describe(`Display label override`),width:I().positive().optional().describe(`Column width in pixels`),align:U([`left`,`center`,`right`]).optional().describe(`Text alignment`),hidden:L().optional().describe(`Hide column by default`),sortable:L().optional().describe(`Allow sorting by this column`),resizable:L().optional().describe(`Allow resizing this column`),wrap:L().optional().describe(`Allow text wrapping`),type:F().optional().describe(`Renderer type override (e.g., "currency", "date")`),pinned:U([`left`,`right`]).optional().describe(`Pin/freeze column to left or right side`),summary:Am.optional().describe(`Footer aggregation function for this column`),link:L().optional().describe(`Functions as the primary navigation link (triggers View navigation)`),action:F().optional().describe(`Registered Action ID to execute when clicked`)})),Mm=G(()=>B({type:U([`none`,`single`,`multiple`]).default(`none`).describe(`Selection mode`)})),Nm=G(()=>B({pageSize:I().int().positive().default(25).describe(`Number of records per page`),pageSizeOptions:z(I().int().positive()).optional().describe(`Available page size options`)})),Pm=G(()=>U([`compact`,`short`,`medium`,`tall`,`extra_tall`]).describe(`Row height / density setting for list view`)),Fm=G(()=>B({field:F().describe(`Field name to group by`),order:U([`asc`,`desc`]).default(`asc`).describe(`Group sort order`),collapsed:L().default(!1).describe(`Collapse groups by default`)})),Im=G(()=>B({fields:z(Fm).min(1).describe(`Fields to group by (supports up to 3 levels)`)}).describe(`Record grouping configuration`)),Lm=G(()=>B({coverField:F().optional().describe(`Attachment/image field to display as card cover`),coverFit:U([`cover`,`contain`]).default(`cover`).describe(`Image fit mode for card cover`),cardSize:U([`small`,`medium`,`large`]).default(`medium`).describe(`Card size in gallery view`),titleField:F().optional().describe(`Field to display as card title`),visibleFields:z(F()).optional().describe(`Fields to display on card body`)}).describe(`Gallery/card view configuration`)),Rm=G(()=>B({startDateField:F().describe(`Field for timeline item start date`),endDateField:F().optional().describe(`Field for timeline item end date`),titleField:F().describe(`Field to display as timeline item title`),groupByField:F().optional().describe(`Field to group timeline rows`),colorField:F().optional().describe(`Field to determine item color`),scale:U([`hour`,`day`,`week`,`month`,`quarter`,`year`]).default(`week`).describe(`Default timeline scale`)}).describe(`Timeline view configuration`)),zm=G(()=>B({type:U([`personal`,`collaborative`]).default(`collaborative`).describe(`View ownership type`),lockedBy:F().optional().describe(`User who locked the view configuration`)}).describe(`View sharing and access configuration`)),Bm=G(()=>B({field:F().describe(`Field to derive color from (typically a select/status field)`),colors:H(F(),F()).optional().describe(`Map of field value to color (hex/token)`)}).describe(`Row color configuration based on field values`)),Vm=G(()=>U([`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`]).describe(`Visualization type that users can switch to`)),Hm=G(()=>B({sort:L().default(!0).describe(`Allow users to sort records`),search:L().default(!0).describe(`Allow users to search records`),filter:L().default(!0).describe(`Allow users to filter records`),rowHeight:L().default(!0).describe(`Allow users to toggle row height/density`),addRecordForm:L().default(!1).describe(`Add records through a form instead of inline`),buttons:z(F()).optional().describe(`Custom action button IDs to show in the toolbar`)}).describe(`User action toggles for the view toolbar`)),Um=G(()=>B({showDescription:L().default(!0).describe(`Show the view description text`),allowedVisualizations:z(Vm).optional().describe(`Whitelist of visualization types users can switch between (e.g. ["grid", "gallery", "kanban"])`)}).describe(`Appearance and visualization configuration`)),Wm=G(()=>B({name:Dp.describe(`Tab identifier (snake_case)`),label:lm.optional().describe(`Display label`),icon:F().optional().describe(`Tab icon name`),view:F().optional().describe(`Referenced list view name from listViews`),filter:z(km).optional().describe(`Tab-specific filter criteria`),order:I().int().min(0).optional().describe(`Tab display order`),pinned:L().default(!1).describe(`Pin tab (cannot be removed by users)`),isDefault:L().default(!1).describe(`Set as the default active tab`),visible:L().default(!0).describe(`Tab visibility`)}).describe(`Tab configuration for multi-tab view interface`)),Gm=G(()=>B({enabled:L().default(!0).describe(`Show the add record entry point`),position:U([`top`,`bottom`,`both`]).default(`bottom`).describe(`Position of the add record button`),mode:U([`inline`,`form`,`modal`]).default(`inline`).describe(`How to add a new record`),formView:F().optional().describe(`Named form view to use when mode is "form" or "modal"`)}).describe(`Add record entry point configuration`)),Km=G(()=>B({groupByField:F().describe(`Field to group columns by (usually status/select)`),summarizeField:F().optional().describe(`Field to sum at top of column (e.g. amount)`),columns:z(F()).describe(`Fields to show on cards`)})),qm=G(()=>B({chartType:U([`bar`,`line`,`pie`,`area`,`scatter`]).default(`bar`).describe(`Chart visualisation type`),xAxisField:F().describe(`Field used as the X axis / category dimension`),yAxisFields:z(F()).min(1).describe(`Field(s) used as the Y axis / measures`),aggregation:U([`sum`,`avg`,`count`,`min`,`max`]).optional().describe(`Aggregation function applied to Y axis fields`),groupByField:F().optional().describe(`Optional field used to split / stack the chart`)}).describe(`List chart view configuration`)),Jm=G(()=>B({startDateField:F(),endDateField:F().optional(),titleField:F(),colorField:F().optional()})),Ym=G(()=>B({startDateField:F(),endDateField:F(),titleField:F(),progressField:F().optional(),dependenciesField:F().optional()})),Xm=G(()=>U([`page`,`drawer`,`modal`,`split`,`popover`,`new_window`,`none`])),Zm=G(()=>B({mode:Xm.default(`page`),view:F().optional().describe(`Name of the form view to use for details (e.g. "summary_view", "edit_form")`),preventNavigation:L().default(!1).describe(`Disable standard navigation entirely`),openNewTab:L().default(!1).describe(`Force open in new tab (applies to page mode)`),width:V([F(),I()]).optional().describe(`Width of the drawer/modal (e.g. "600px", "50%")`)})),Qm=G(()=>B({name:Dp.optional().describe(`Internal view name (lowercase snake_case)`),label:lm.optional(),type:U([`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`,`chart`]).default(`grid`),data:Om.optional().describe(`Data source configuration (defaults to "object" provider)`),columns:V([z(F()),z(jm)]).describe(`Fields to display as columns`),filter:z(km).optional().describe(`Filter criteria (JSON Rules)`),sort:V([F(),z(B({field:F(),order:U([`asc`,`desc`])}))]).optional(),searchableFields:z(F()).optional().describe(`Fields enabled for search`),filterableFields:z(F()).optional().describe(`Fields enabled for end-user filtering in the top bar`),resizable:L().optional().describe(`Enable column resizing`),striped:L().optional().describe(`Striped row styling`),bordered:L().optional().describe(`Show borders`),compactToolbar:L().optional().describe(`Collapse Group/Color/Density/Hide-fields into a single View settings popover`),selection:Mm.optional().describe(`Row selection configuration`),navigation:Zm.optional().describe(`Configuration for item click navigation (page, drawer, modal, etc.)`),pagination:Nm.optional().describe(`Pagination configuration`),kanban:Km.optional(),calendar:Jm.optional(),gantt:Ym.optional(),gallery:Lm.optional(),timeline:Rm.optional(),chart:qm.optional(),description:lm.optional().describe(`View description for documentation/tooltips`),sharing:zm.optional().describe(`View sharing and access configuration`),rowHeight:Pm.optional().describe(`Row height / density setting`),grouping:Im.optional().describe(`Group records by one or more fields`),rowColor:Bm.optional().describe(`Color rows based on field value`),hiddenFields:z(F()).optional().describe(`Fields to hide in this specific view`),fieldOrder:z(F()).optional().describe(`Explicit field display order for this view`),rowActions:z(F()).optional().describe(`Actions available for individual row items`),bulkActions:z(F()).optional().describe(`Actions available when multiple rows are selected`),bulkActionDefs:z(H(F(),Zd())).optional().describe(`Rich bulk action definitions (schema-driven, executed via BulkActionDialog)`),virtualScroll:L().optional().describe(`Enable virtual scrolling for large datasets`),conditionalFormatting:z(B({condition:jp.describe(`Predicate (CEL) to evaluate.`),style:H(F(),F()).describe(`CSS styles to apply when condition is true`)})).optional().describe(`Conditional formatting rules for list rows`),inlineEdit:L().optional().describe(`Allow inline editing of records directly in the list view`),exportOptions:z(U([`csv`,`xlsx`,`pdf`,`json`])).optional().describe(`Available export format options`),userActions:Hm.optional().describe(`User action toggles for the view toolbar`),appearance:Um.optional().describe(`Appearance and visualization configuration`),tabs:z(Wm).optional().describe(`Tab definitions for multi-tab view interface`),addRecord:Gm.optional().describe(`Add record entry point configuration`),showRecordCount:L().optional().describe(`Show record count at the bottom of the list`),allowPrinting:L().optional().describe(`Allow users to print the view`),emptyState:B({title:lm.optional(),message:lm.optional(),icon:F().optional()}).optional().describe(`Empty state configuration when no records found`),aria:um.optional().describe(`ARIA accessibility attributes for the list view`),responsive:Cm.optional().describe(`Responsive layout configuration`),performance:wm.optional().describe(`Performance optimization settings`)})),$m=G(()=>B({field:F().describe(`Field name (snake_case)`),type:zp.optional().describe(`Field type (auto-infers widget if omitted)`),options:z(Bp).optional().describe(`Options for select/multiselect/radio/checkboxes fields`),reference:F().optional().describe(`Target object name for lookup/master_detail fields`),maxLength:I().optional().describe(`Maximum character length (for text/textarea/email/url/phone)`),minLength:I().optional().describe(`Minimum character length`),min:I().optional().describe(`Minimum value (for number/currency/percent/slider)`),max:I().optional().describe(`Maximum value`),precision:I().optional().describe(`Total digits (for number/currency)`),scale:I().optional().describe(`Decimal places`),multiple:L().optional().describe(`Allow multiple values (for select/lookup/file/image)`),label:lm.optional().describe(`Display label override`),placeholder:lm.optional().describe(`Placeholder text`),helpText:lm.optional().describe(`Help/hint text`),readonly:L().optional().describe(`Read-only override`),immutable:L().optional().describe(`Editable on create, locked once the record exists (e.g. machine names).`),required:L().optional().describe(`Required override`),hidden:L().optional().describe(`Hidden override`),colSpan:I().int().min(1).max(4).optional().describe(`Column span in grid layout (1-4)`),widget:F().optional().describe(`Custom widget/component name (overrides type-based inference)`),language:F().optional().describe(`Code editor language (for type=code)`),fields:z(zf(()=>$m)).optional().describe(`Sub-fields for composite/repeater types`),dependsOn:F().optional().describe(`Parent field name for cascading`),visibleOn:jp.optional().describe(`Visibility predicate (CEL).`)})),eh=G(()=>B({label:lm.optional(),description:F().optional().describe(`Optional description rendered under the section header.`),collapsible:L().default(!1),collapsed:L().default(!1),visibleOn:jp.optional().describe(`Visibility predicate (CEL). Hides the whole section when false.`),columns:V([U([`1`,`2`,`3`,`4`]),W(1),W(2),W(3),W(4)]).default(1).transform(e=>typeof e==`string`?parseInt(e):e),fields:z(V([F(),$m]))})),th=G(()=>B({type:U([`simple`,`tabbed`,`wizard`,`split`,`drawer`,`modal`]).default(`simple`),data:Om.optional().describe(`Data source configuration (defaults to "object" provider)`),sections:z(eh).optional(),groups:z(eh).optional(),defaultSort:z(B({field:F().describe(`Field name to sort by`),order:U([`asc`,`desc`]).default(`desc`).describe(`Sort direction`)})).optional().describe(`Default sort order for related list views within this form`),sharing:ym.optional().describe(`Public sharing configuration for this form`),submitBehavior:V([B({kind:W(`thank-you`),title:F().optional(),message:F().optional()}),B({kind:W(`redirect`),url:F(),delayMs:I().int().min(0).optional()}),B({kind:W(`continue`)}),B({kind:W(`next-record`)})]).optional().describe(`Post-submit behavior`),aria:um.optional().describe(`ARIA accessibility attributes for the form view`)}));G(()=>B({list:Qm.optional(),form:th.optional(),listViews:H(F(),Qm).optional().describe(`Additional named list views`),formViews:H(F(),th).optional().describe(`Additional named form views`)}));function nh(e){let{schemaId:t,...n}=e;return th.parse({...n,data:{provider:`schema`,schemaId:t}})}var rh=U([`get`,`list`,`create`,`update`,`delete`,`upsert`,`bulk`,`aggregate`,`history`,`search`,`restore`,`purge`,`import`,`export`]),ih=B({trackHistory:L().default(!1).describe(`Enable field history tracking for audit compliance`),searchable:L().default(!0).describe(`Index records for global search`),apiEnabled:L().default(!0).describe(`Expose object via automatic APIs`),apiMethods:z(rh).optional().describe(`Whitelist of allowed API operations`),files:L().default(!1).describe(`Enable file attachments and document management`),feeds:L().default(!1).describe(`Enable social feed, comments, and mentions (Chatter-like)`),activities:L().default(!1).describe(`Enable standard tasks and events tracking`),trash:L().default(!0).describe(`Enable soft-delete with restore capability`),mru:L().default(!0).describe(`Track Most Recently Used (MRU) list for users`),clone:L().default(!0).describe(`Allow record deep cloning`)}),ah=G(()=>B({name:F().optional().describe(`Index name (auto-generated if not provided)`),fields:z(F()).describe(`Fields included in the index`),type:U([`btree`,`hash`,`gin`,`gist`,`fulltext`]).optional().default(`btree`).describe(`Index algorithm type`),unique:L().optional().default(!1).describe(`Whether the index enforces uniqueness`),partial:F().optional().describe(`Partial index condition (SQL WHERE clause for conditional indexes)`)})),oh=G(()=>B({fields:z(F()).describe(`Fields to index for full-text search weighting`),displayFields:z(F()).optional().describe(`Fields to display in search result cards`),filters:z(F()).optional().describe(`Default filters for search results`)})),sh=G(()=>B({enabled:L().describe(`Enable multi-tenancy for this object`),strategy:U([`shared`,`isolated`,`hybrid`]).describe(`Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)`),tenantField:F().default(`tenant_id`).describe(`Field name for tenant identifier`),crossTenantAccess:L().default(!1).describe(`Allow cross-tenant data access (with explicit permission)`)})),ch=G(()=>B({enabled:L().describe(`Enable soft delete (trash/recycle bin)`),field:F().default(`deleted_at`).describe(`Field name for soft delete timestamp`),cascadeDelete:L().default(!1).describe(`Cascade soft delete to related records`)})),lh=G(()=>B({enabled:L().describe(`Enable record versioning`),strategy:U([`snapshot`,`delta`,`event-sourcing`]).describe(`Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)`),retentionDays:I().min(1).optional().describe(`Number of days to retain old versions (undefined = infinite)`),versionField:F().default(`version`).describe(`Field name for version number/timestamp`)})),uh=G(()=>B({enabled:L().describe(`Enable table partitioning`),strategy:U([`range`,`hash`,`list`]).describe(`Partitioning strategy: range (date ranges), hash (consistent hashing), list (predefined values)`),key:F().describe(`Field name to partition by`),interval:F().optional().describe(`Partition interval for range strategy (e.g., "1 month", "1 year")`)}).refine(e=>!(e.strategy===`range`&&!e.interval),{message:`interval is required when strategy is "range"`})),dh=G(()=>B({enabled:L().describe(`Enable Change Data Capture`),events:z(U([`insert`,`update`,`delete`])).describe(`Event types to capture`),destination:F().describe(`Destination endpoint (e.g., "kafka://topic", "webhook://url")`)})),fh=G(()=>B({key:F().regex(/^[a-z_][a-z0-9_]*$/,{message:`Field group key must be lowercase snake_case (e.g., "contact_info", "billing", "system")`}).describe(`Group machine key (snake_case). Referenced by Field.group.`),label:F().describe(`Group display label`),icon:F().optional().describe(`Icon name (Lucide/Material) for the group header`),description:F().optional().describe(`Optional description shown under the group header`),defaultExpanded:L().optional().default(!0).describe(`Whether the group is expanded by default`),visibleOn:jp.optional().describe(`Visibility predicate (CEL); group is hidden when FALSE.`)})),ph=B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Machine unique key (snake_case). Immutable.`),label:F().optional().describe(`Human readable singular label (e.g. "Account")`),pluralLabel:F().optional().describe(`Human readable plural label (e.g. "Accounts")`),description:F().optional().describe(`Developer documentation / description`),icon:F().optional().describe(`Icon name (Lucide/Material) for UI representation`),tags:z(F()).optional().describe(`Categorization tags (e.g. "sales", "system", "reference")`),active:L().optional().default(!0).describe(`Is the object active and usable`),isSystem:L().optional().default(!1).describe(`Is system object (protected from deletion)`),abstract:L().optional().default(!1).describe(`Is abstract base object (cannot be instantiated)`),managedBy:U([`platform`,`config`,`system`,`append-only`,`better-auth`]).optional().describe(`Lifecycle bucket — platform (user CRUD) | config (admin authored) | system (engine-managed) | append-only (audit) | better-auth (identity). UI clients honour the resolved affordance matrix.`),userActions:B({create:L().optional().describe(`Show generic "New" button.`),import:L().optional().describe(`Show CSV import wizard entry.`),edit:L().optional().describe(`Allow inline / form edit of existing rows.`),delete:L().optional().describe(`Show row-level delete + bulk delete.`),exportCsv:L().optional().describe(`Show CSV export entry.`)}).optional().describe(`Per-object override of the resolved CRUD affordance matrix.`),systemFields:V([W(!1),B({tenant:L().optional().describe(`Inject organization_id (multi-tenant only). Default true.`),owner:L().optional().describe(`Reserved for future owner_id auto-injection.`),audit:L().optional().describe(`Reserved for future created_by/updated_by auto-injection.`)})]).optional().describe(`Opt out of, or selectively disable, registry-level system-field auto-injection.`),datasource:F().optional().default(`default`).describe(`Target Datasource ID. "default" is the primary DB.`),fields:H(F().regex(/^[a-z_][a-z0-9_]*$/,{message:`Field names must be lowercase snake_case (e.g., "first_name", "company", "annual_revenue")`}),Kp).describe(`Field definitions map. Keys must be snake_case identifiers.`),indexes:z(ah).optional().describe(`Database performance indexes`),fieldGroups:z(fh).refine(e=>new Set(e.map(e=>e.key)).size===e.length,{message:`fieldGroups[].key must be unique within an object`}).optional().describe(`Ordered list of field groups (array order = display order). See ObjectFieldGroupSchema.`),tenancy:sh.optional().describe(`Multi-tenancy configuration for SaaS applications`),softDelete:ch.optional().describe(`Soft delete (trash/recycle bin) configuration`),versioning:lh.optional().describe(`Record versioning and history tracking configuration`),partitioning:uh.optional().describe(`Table partitioning configuration for performance`),cdc:dh.optional().describe(`Change Data Capture (CDC) configuration for real-time data streaming`),validations:z(nm).optional().describe(`Object-level validation rules`),stateMachines:H(F(),cm).optional().describe(`Named state machines for parallel lifecycles (e.g., status, payment, approval)`),displayNameField:F().optional().describe(`Field to use as the record display name (e.g., "name", "title"). Defaults to "name" if present.`),recordName:B({type:U([`text`,`autonumber`]).describe(`Record name type: text (user-entered) or autonumber (system-generated)`),displayFormat:F().optional().describe(`Auto-number format pattern (e.g., "CASE-{0000}", "INV-{YYYY}-{0000}")`),startNumber:I().int().min(0).optional().describe(`Starting number for autonumber (default: 1)`)}).optional().describe(`Record name generation configuration (Salesforce pattern)`),titleFormat:Mp.optional().describe(`Title template — supports {{record.field}} interpolation. Overrides displayNameField.`),compactLayout:z(F()).optional().describe(`Primary fields for hover/cards/lookups`),listViews:H(F(),Qm).optional().describe(`Built-in named list views (segmented tabs) shipped with the object schema`),defaultDetailForm:F().optional().describe(`Name of the default FormView for record detail / edit screens`),search:oh.optional().describe(`Search engine configuration`),enable:ih.optional().describe(`Enabled system features modules`),recordTypes:z(F()).optional().describe(`Record type names for this object`),sharingModel:U([`private`,`read`,`read_write`,`full`]).optional().describe(`Default sharing model`),keyPrefix:F().max(5).optional().describe(`Short prefix for record IDs (e.g., "001" for Account)`),detail:B({renderViaSchema:L().optional().describe(`Opt this object out of the schema-driven detail renderer`),hideReferenceRail:L().optional().describe(`Suppress the right-hand reference-rail on the detail page`),hideRelatedTab:L().optional().describe(`Suppress the Related tab on the detail page`)}).passthrough().optional().describe(`Detail-page UI hints consumed by @object-ui/plugin-detail synth`),actions:z(vm).optional().describe(`Actions associated with this object (auto-populated from top-level actions via objectName)`)});function mh(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}G(()=>Object.assign(ph,{create:e=>{let t={...e,label:e.label??mh(e.name)};return ph.parse(t)}})),U([`own`,`extend`]),G(()=>B({extend:F().describe(`Target object name (FQN) to extend`),fields:H(F(),Kp).optional().describe(`Fields to add/override`),label:F().optional().describe(`Override label for the extended object`),pluralLabel:F().optional().describe(`Override plural label for the extended object`),description:F().optional().describe(`Override description for the extended object`),validations:z(nm).optional().describe(`Additional validation rules to merge into the target object`),indexes:z(ah).optional().describe(`Additional indexes to merge into the target object`),priority:I().int().min(0).max(999).default(200).describe(`Merge priority (higher = applied later)`)}));var hh=U([`beforeFind`,`afterFind`,`beforeFindOne`,`afterFindOne`,`beforeCount`,`afterCount`,`beforeAggregate`,`afterAggregate`,`beforeInsert`,`afterInsert`,`beforeUpdate`,`afterUpdate`,`beforeDelete`,`afterDelete`,`beforeUpdateMany`,`afterUpdateMany`,`beforeDeleteMany`,`afterDeleteMany`]);G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Hook unique name (snake_case)`),label:F().optional().describe(`Description of what this hook does`),object:V([F(),z(F())]).describe(`Target object(s)`),events:z(hh).describe(`Lifecycle events`),handler:V([F(),Gf(e=>typeof e==`function`,{message:`Expected function`})]).optional().describe("Handler function name (string, post-build) or inline function (pre-build) — DEPRECATED, prefer `body`"),body:mm.optional().describe(`Hook body — expression (L1) or sandboxed JS (L2)`),priority:I().default(100).describe(`Execution priority`),async:L().default(!1).describe(`Run specifically as fire-and-forget`),condition:jp.optional().describe('Predicate (CEL); hook runs only when TRUE. e.g. P`record.status == "closed" && record.amount > 1000`'),description:F().optional().describe(`Human-readable description of what this hook does`),retryPolicy:B({maxRetries:I().default(3).describe(`Maximum retry attempts on failure`),backoffMs:I().default(1e3).describe(`Backoff delay between retries in milliseconds`)}).optional().describe(`Retry policy for failed hook executions`),timeout:I().optional().describe(`Maximum execution time in milliseconds before the hook is aborted`),onError:U([`abort`,`log`]).default(`abort`).describe(`Error handling strategy`)})),G(()=>B({id:F().optional().describe(`Unique execution ID for tracing`),object:F(),event:hh,input:H(F(),R()).describe(`Mutable input parameters`),result:R().optional().describe(`Operation result (After hooks only)`),previous:H(F(),R()).optional().describe(`Record state before operation`),session:B({userId:F().optional(),tenantId:F().optional(),roles:z(F()).optional(),accessToken:F().optional(),isSystem:L().optional().describe(`True when the call was made with an elevated system context (engine self-writes)`)}).optional().describe(`Current session context`),transaction:R().optional().describe(`Database transaction handle`),ql:R().describe(`ObjectQL Engine Reference`),api:R().optional().describe(`Cross-object data access (ScopedContext)`),user:B({id:F().optional(),name:F().optional(),email:F().optional()}).optional().describe(`Current user info shortcut`)}));var gh=U([`none`,`constant`,`lookup`,`split`,`join`,`javascript`,`map`]),_h=G(()=>B({source:V([F(),z(F())]).describe(`Source column header(s)`),target:V([F(),z(F())]).describe(`Target object field(s)`),transform:gh.default(`none`),params:B({value:R().optional(),object:F().optional(),fromField:F().optional(),toField:F().optional(),autoCreate:L().optional(),valueMap:H(F(),R()).optional(),separator:F().optional()}).optional()}));G(()=>B({name:Dp.describe(`Mapping unique name (lowercase snake_case)`),label:F().optional(),sourceFormat:U([`csv`,`json`,`xml`,`sql`]).default(`csv`),targetObject:F().describe(`Target Object Name`),fieldMapping:z(_h),mode:U([`insert`,`update`,`upsert`]).default(`insert`),upsertKey:z(F()).optional().describe(`Fields to match for upsert (e.g. email)`),extractQuery:_p.optional().describe(`Query to run for export only`),errorPolicy:U([`skip`,`abort`,`retry`]).default(`skip`),batchSize:I().default(1e3)}));var vh=G(()=>B({userId:F().optional(),tenantId:F().optional(),roles:z(F()).default([]),permissions:z(F()).default([]),systemPermissions:z(F()).optional(),tabPermissions:H(F(),U([`visible`,`hidden`,`default_on`,`default_off`])).optional(),org_user_ids:z(F()).optional(),isSystem:L().default(!1),accessToken:F().optional(),transaction:R().optional(),traceId:F().optional()})),yh=G(()=>V([H(F(),R()),Zf]).describe(`Data Engine query filter conditions`)),bh=G(()=>V([H(F(),U([`asc`,`desc`])),H(F(),V([W(1),W(-1)])),z(rp)]).describe(`Sort order definition`)),xh=G(()=>B({context:vh.optional()})),Sh=G(()=>xh.extend({where:V([H(F(),R()),Zf]).optional(),fields:z(mp).optional(),orderBy:z(rp).optional(),limit:I().optional(),offset:I().optional(),top:I().optional(),cursor:H(F(),R()).optional(),search:hp.optional(),expand:zf(()=>H(F(),_p)).optional(),distinct:L().optional()}).describe(`QueryAST-aligned query options for IDataEngine.find() operations`));G(()=>xh.extend({filter:yh.optional(),select:z(F()).optional(),sort:bh.optional(),limit:I().int().min(1).optional(),skip:I().int().min(0).optional(),top:I().int().min(1).optional(),populate:z(F()).optional()}).describe(`Query options for IDataEngine.find() operations`));var Ch=G(()=>xh.extend({returning:L().default(!0).optional()}).describe(`Options for DataEngine.insert operations`)),wh=G(()=>xh.extend({where:V([H(F(),R()),Zf]).optional(),upsert:L().default(!1).optional(),multi:L().default(!1).optional(),returning:L().default(!1).optional()}).describe(`QueryAST-aligned options for DataEngine.update operations`));G(()=>xh.extend({filter:yh.optional(),upsert:L().default(!1).optional(),multi:L().default(!1).optional(),returning:L().default(!1).optional()}).describe(`Options for DataEngine.update operations`));var Th=G(()=>xh.extend({where:V([H(F(),R()),Zf]).optional(),multi:L().default(!1).optional()}).describe(`QueryAST-aligned options for DataEngine.delete operations`));G(()=>xh.extend({filter:yh.optional(),multi:L().default(!1).optional()}).describe(`Options for DataEngine.delete operations`));var Eh=G(()=>xh.extend({where:V([H(F(),R()),Zf]).optional(),groupBy:z(F()).optional(),aggregations:z(sp).optional()}).describe(`QueryAST-aligned options for DataEngine.aggregate operations`));G(()=>xh.extend({filter:yh.optional(),groupBy:z(F()).optional(),aggregations:z(B({field:F(),method:U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`]),alias:F().optional()})).optional()}).describe(`Options for DataEngine.aggregate operations`));var Dh=G(()=>xh.extend({where:V([H(F(),R()),Zf]).optional()}).describe(`QueryAST-aligned options for DataEngine.count operations`));G(()=>xh.extend({filter:yh.optional()}).describe(`Options for DataEngine.count operations`)),G(()=>B({find:Uf().input(mf([F(),Sh.optional()])).output(Vf(z(R()))),findOne:Uf().input(mf([F(),Sh.optional()])).output(Vf(R())),insert:Uf().input(mf([F(),V([H(F(),R()),z(H(F(),R()))]),Ch.optional()])).output(Vf(R())),update:Uf().input(mf([F(),H(F(),R()),wh.optional()])).output(Vf(R())),delete:Uf().input(mf([F(),Th.optional()])).output(Vf(R())),count:Uf().input(mf([F(),Dh.optional()])).output(Vf(I())),aggregate:Uf().input(mf([F(),Eh])).output(Vf(z(R())))}).describe(`Standard Data Engine Contract`));var Oh={filter:yh.optional()},kh=Sh.extend({...Oh,select:z(F()).optional(),sort:bh.optional(),skip:I().int().min(0).optional(),populate:z(F()).optional()}),Ah=G(()=>B({method:W(`find`),object:F(),query:kh.optional()})),jh=G(()=>B({method:W(`findOne`),object:F(),query:kh.optional()})),Mh=G(()=>B({method:W(`insert`),object:F(),data:V([H(F(),R()),z(H(F(),R()))]),options:Ch.optional()})),Nh=G(()=>B({method:W(`update`),object:F(),data:H(F(),R()),id:V([F(),I()]).optional().describe(`ID for single update, or use where in options`),options:wh.extend(Oh).optional()})),Ph=G(()=>B({method:W(`delete`),object:F(),id:V([F(),I()]).optional().describe(`ID for single delete, or use where in options`),options:Th.extend(Oh).optional()})),Fh=G(()=>B({method:W(`count`),object:F(),query:Dh.extend(Oh).optional()})),Ih=G(()=>B({method:W(`aggregate`),object:F(),query:Eh.extend(Oh)})),Lh=G(()=>B({method:W(`execute`),command:R(),options:H(F(),R()).optional()})),Rh=G(()=>B({method:W(`vectorFind`),object:F(),vector:z(I()),where:V([H(F(),R()),Zf]).optional(),fields:z(F()).optional(),limit:I().int().default(5).optional(),threshold:I().optional()})),zh=G(()=>B({method:W(`batch`),requests:z(uf(`method`,[Ah,jh,Mh,Nh,Ph,Fh,Ih,Lh,Rh])),transaction:L().default(!0).optional()}));G(()=>uf(`method`,[Ah,jh,Mh,Nh,Ph,Fh,Ih,zh,Lh,Rh]).describe(`Virtual ObjectQL Request Protocol`)),U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`,`percentile`,`median`,`stddev`,`variance`]).describe(`Standard aggregation functions`);var Bh=U([`asc`,`desc`]).describe(`Sort order direction`);G(()=>B({field:F().describe(`Field name to sort by`),order:Bh.describe(`Sort direction`)}).describe(`Sort field and direction pair`)),U([`insert`,`update`,`delete`,`upsert`]).describe(`Data mutation event types`);var Vh=U([`read_uncommitted`,`read_committed`,`repeatable_read`,`serializable`,`snapshot`]).describe(`Transaction isolation levels (snake_case standard)`);U([`lru`,`lfu`,`ttl`,`fifo`]).describe(`Cache eviction strategy`);var Hh=G(()=>B({transaction:R().optional().describe(`Transaction handle`),timeout:I().optional().describe(`Timeout in ms`),skipCache:L().optional().describe(`Bypass cache`),traceContext:H(F(),F()).optional().describe(`OpenTelemetry context or request ID`),tenantId:F().optional().describe(`Tenant Isolation identifier`)})),Uh=G(()=>B({create:L().default(!0).describe(`Supports CREATE operations`),read:L().default(!0).describe(`Supports READ operations`),update:L().default(!0).describe(`Supports UPDATE operations`),delete:L().default(!0).describe(`Supports DELETE operations`),bulkCreate:L().default(!1).describe(`Supports bulk CREATE operations`),bulkUpdate:L().default(!1).describe(`Supports bulk UPDATE operations`),bulkDelete:L().default(!1).describe(`Supports bulk DELETE operations`),transactions:L().default(!1).describe(`Supports ACID transactions`),savepoints:L().default(!1).describe(`Supports transaction savepoints`),isolationLevels:z(Vh).optional().describe(`Supported isolation levels`),queryFilters:L().default(!0).describe(`Supports WHERE clause filtering`),queryAggregations:L().default(!1).describe(`Supports GROUP BY and aggregation functions`),queryDateGranularity:H(ap,L()).optional().describe(`Per-granularity native date bucketing (day/week/month/quarter/year). Missing keys fall back to in-memory bucketing.`),querySorting:L().default(!0).describe(`Supports ORDER BY sorting`),queryPagination:L().default(!0).describe(`Supports LIMIT/OFFSET pagination`),queryWindowFunctions:L().default(!1).describe(`Supports window functions with OVER clause`),querySubqueries:L().default(!1).describe(`Supports subqueries`),queryCTE:L().default(!1).describe(`Supports Common Table Expressions (WITH clause)`),joins:L().default(!1).describe(`Supports SQL joins`),fullTextSearch:L().default(!1).describe(`Supports full-text search`),jsonQuery:L().default(!1).describe(`Supports JSON field querying`),geospatialQuery:L().default(!1).describe(`Supports geospatial queries`),streaming:L().default(!1).describe(`Supports result streaming (cursors/iterators)`),jsonFields:L().default(!1).describe(`Supports JSON field types`),arrayFields:L().default(!1).describe(`Supports array field types`),vectorSearch:L().default(!1).describe(`Supports vector embeddings and similarity search`),schemaSync:L().default(!1).describe(`Supports automatic schema synchronization`),batchSchemaSync:L().default(!1).describe(`Supports batched schema sync to reduce schema DDL round-trips`),migrations:L().default(!1).describe(`Supports database migrations`),indexes:L().default(!1).describe(`Supports index creation and management`),connectionPooling:L().default(!1).describe(`Supports connection pooling`),preparedStatements:L().default(!1).describe(`Supports prepared statements (SQL injection prevention)`),queryCache:L().default(!1).describe(`Supports query result caching`)}));G(()=>B({name:F().describe(`Driver unique name`),version:F().describe(`Driver version`),supports:Uh,connect:Uf().input(mf([])).output(Vf(nf())).describe(`Establish connection`),disconnect:Uf().input(mf([])).output(Vf(nf())).describe(`Close connection`),checkHealth:Uf().input(mf([])).output(Vf(L())).describe(`Health check`),getPoolStats:Uf().input(mf([])).output(B({total:I(),idle:I(),active:I(),waiting:I()}).optional()).optional().describe(`Get connection pool statistics`),execute:Uf().input(mf([R(),z(R()).optional(),Hh.optional()])).output(Vf(R())).describe(`Execute raw command`),find:Uf().input(mf([F(),_p,Hh.optional()])).output(Vf(z(H(F(),R())))).describe(`Find records`),findStream:Uf().input(mf([F(),_p,Hh.optional()])).output(R()).describe(`Stream records (AsyncIterable)`),findOne:Uf().input(mf([F(),_p,Hh.optional()])).output(Vf(H(F(),R()).nullable())).describe(`Find one record`),create:Uf().input(mf([F(),H(F(),R()),Hh.optional()])).output(Vf(H(F(),R()))).describe(`Create record`),update:Uf().input(mf([F(),F().or(I()),H(F(),R()),Hh.optional()])).output(Vf(H(F(),R()))).describe(`Update record`),upsert:Uf().input(mf([F(),H(F(),R()),z(F()).optional(),Hh.optional()])).output(Vf(H(F(),R()))).describe(`Upsert record`),delete:Uf().input(mf([F(),F().or(I()),Hh.optional()])).output(Vf(L())).describe(`Delete record`),count:Uf().input(mf([F(),_p.optional(),Hh.optional()])).output(Vf(I())).describe(`Count records`),bulkCreate:Uf().input(mf([F(),z(H(F(),R())),Hh.optional()])).output(Vf(z(H(F(),R())))),bulkUpdate:Uf().input(mf([F(),z(B({id:F().or(I()),data:H(F(),R())})),Hh.optional()])).output(Vf(z(H(F(),R())))),bulkDelete:Uf().input(mf([F(),z(F().or(I())),Hh.optional()])).output(Vf(nf())),updateMany:Uf().input(mf([F(),_p,H(F(),R()),Hh.optional()])).output(Vf(I())).optional(),deleteMany:Uf().input(mf([F(),_p,Hh.optional()])).output(Vf(I())).optional(),beginTransaction:Uf().input(mf([B({isolationLevel:Vh.optional()}).optional()])).output(Vf(R())).describe(`Start transaction`),commit:Uf().input(mf([R()])).output(Vf(nf())).describe(`Commit transaction`),rollback:Uf().input(mf([R()])).output(Vf(nf())).describe(`Rollback transaction`),syncSchema:Uf().input(mf([F(),R(),Hh.optional()])).output(Vf(nf())).describe(`Sync object schema to DB`),syncSchemasBatch:Uf().input(mf([z(B({object:F(),schema:R()})),Hh.optional()])).output(Vf(nf())).optional().describe(`Batch sync multiple schemas in one round-trip`),dropTable:Uf().input(mf([F(),Hh.optional()])).output(Vf(nf())),explain:Uf().input(mf([F(),_p,Hh.optional()])).output(Vf(R())).optional()}));var Wh=G(()=>B({min:I().min(0).default(2).describe(`Minimum number of connections in pool`),max:I().min(1).default(10).describe(`Maximum number of connections in pool`),idleTimeoutMillis:I().min(0).default(3e4).describe(`Time in ms before idle connection is closed`),connectionTimeoutMillis:I().min(0).default(5e3).describe(`Time in ms to wait for available connection`)})),Gh=G(()=>B({name:F().describe(`Driver instance name`),type:U([`sql`,`nosql`,`cache`,`search`,`graph`,`timeseries`]).describe(`Driver type category`),capabilities:Uh.describe(`Driver capability flags`),connectionString:F().optional().describe(`Database connection string (driver-specific format)`),poolConfig:Wh.optional().describe(`Connection pool configuration`)})),Kh=G(()=>U([`postgresql`,`mysql`,`sqlite`,`mssql`,`oracle`,`mariadb`])),qh=G(()=>B({text:F().describe(`SQL type for text fields (e.g., VARCHAR, TEXT)`),number:F().describe(`SQL type for number fields (e.g., NUMERIC, DECIMAL, INT)`),boolean:F().describe(`SQL type for boolean fields (e.g., BOOLEAN, BIT)`),date:F().describe(`SQL type for date fields (e.g., DATE)`),datetime:F().describe(`SQL type for datetime fields (e.g., TIMESTAMP, DATETIME)`),json:F().optional().describe(`SQL type for JSON fields (e.g., JSON, JSONB)`),uuid:F().optional().describe(`SQL type for UUID fields (e.g., UUID, CHAR(36))`),binary:F().optional().describe(`SQL type for binary fields (e.g., BLOB, BYTEA)`)})),Jh=G(()=>B({rejectUnauthorized:L().default(!0).describe(`Reject connections with invalid certificates`),ca:F().optional().describe(`CA certificate file path or content`),cert:F().optional().describe(`Client certificate file path or content`),key:F().optional().describe(`Client private key file path or content`)}).refine(e=>e.cert!==void 0==(e.key!==void 0),{message:`Client certificate (cert) and private key (key) must be provided together`}));G(()=>Gh.extend({type:W(`sql`).describe(`Driver type must be "sql"`),dialect:Kh.describe(`SQL database dialect`),dataTypeMapping:qh.describe(`SQL data type mapping configuration`),ssl:L().default(!1).describe(`Enable SSL/TLS connection`),sslConfig:Jh.optional().describe(`SSL/TLS configuration (required when ssl is true)`)}).refine(e=>!(e.ssl&&!e.sslConfig),{message:`sslConfig is required when ssl is true`}));var Yh=G(()=>U([`mongodb`,`couchdb`,`dynamodb`,`cassandra`,`redis`,`elasticsearch`,`neo4j`,`orientdb`]));G(()=>U([`find`,`findOne`,`insert`,`update`,`delete`,`aggregate`,`mapReduce`,`count`,`distinct`,`createIndex`,`dropIndex`]));var Xh=G(()=>U([`all`,`quorum`,`one`,`local_quorum`,`each_quorum`,`eventual`])),Zh=G(()=>U([`single`,`compound`,`unique`,`text`,`geospatial`,`hashed`,`ttl`,`sparse`])),Qh=G(()=>B({enabled:L().default(!1).describe(`Enable sharding`),shardKey:F().optional().describe(`Field to use as shard key`),shardingStrategy:U([`hash`,`range`,`zone`]).optional().describe(`Sharding strategy`),numShards:I().int().positive().optional().describe(`Number of shards`)})),$h=G(()=>B({enabled:L().default(!1).describe(`Enable replication`),replicaSetName:F().optional().describe(`Replica set name`),replicas:I().int().positive().optional().describe(`Number of replicas`),readPreference:U([`primary`,`primaryPreferred`,`secondary`,`secondaryPreferred`,`nearest`]).optional().describe(`Read preference for replica set`),writeConcern:U([`majority`,`acknowledged`,`unacknowledged`]).optional().describe(`Write concern level`)})),eg=G(()=>B({enabled:L().default(!1).describe(`Enable schema validation`),validationLevel:U([`strict`,`moderate`,`off`]).optional().describe(`Validation strictness`),validationAction:U([`error`,`warn`]).optional().describe(`Action on validation failure`),jsonSchema:H(F(),R()).optional().describe(`JSON Schema for validation`)})),tg=G(()=>B({text:F().describe(`NoSQL type for text fields`),number:F().describe(`NoSQL type for number fields`),boolean:F().describe(`NoSQL type for boolean fields`),date:F().describe(`NoSQL type for date fields`),datetime:F().describe(`NoSQL type for datetime fields`),json:F().optional().describe(`NoSQL type for JSON/object fields`),uuid:F().optional().describe(`NoSQL type for UUID fields`),binary:F().optional().describe(`NoSQL type for binary fields`),array:F().optional().describe(`NoSQL type for array fields`),objectId:F().optional().describe(`NoSQL type for ObjectID fields (MongoDB)`),geopoint:F().optional().describe(`NoSQL type for geospatial point fields`)}));G(()=>Gh.extend({type:W(`nosql`).describe(`Driver type must be "nosql"`),databaseType:Yh.describe(`Specific NoSQL database type`),dataTypeMapping:tg.describe(`NoSQL data type mapping configuration`),consistency:Xh.optional().describe(`Consistency level for operations`),replication:$h.optional().describe(`Replication configuration`),sharding:Qh.optional().describe(`Sharding configuration`),schemaValidation:eg.optional().describe(`Document schema validation`),region:F().optional().describe(`AWS region (for managed NoSQL services)`),accessKeyId:F().optional().describe(`AWS access key ID`),secretAccessKey:F().optional().describe(`AWS secret access key`),ttlField:F().optional().describe(`Field name for TTL (auto-deletion)`),maxDocumentSize:I().int().positive().optional().describe(`Maximum document size in bytes`),collectionPrefix:F().optional().describe(`Prefix for collection/table names`)}));var ng=G(()=>B({consistency:Xh.optional().describe(`Consistency level override`),readFromSecondary:L().optional().describe(`Allow reading from secondary replicas`),projection:H(F(),V([W(0),W(1)])).optional().describe(`Field projection`),timeout:I().int().positive().optional().describe(`Query timeout (ms)`),useCursor:L().optional().describe(`Use cursor instead of loading all results`),batchSize:I().int().positive().optional().describe(`Cursor batch size`),profile:L().optional().describe(`Enable query profiling`),hint:F().optional().describe(`Index hint for query optimization`)})),rg=G(()=>B({operator:F().describe(`Aggregation operator (e.g., $match, $group, $sort)`),options:H(F(),R()).describe(`Stage-specific options`)}));G(()=>B({collection:F().describe(`Collection/table name`),stages:z(rg).describe(`Aggregation pipeline stages`),options:ng.optional().describe(`Query options`)})),G(()=>B({name:F().describe(`Index name`),type:Zh.describe(`Index type`),fields:z(B({field:F().describe(`Field name`),order:U([`asc`,`desc`,`text`,`2dsphere`]).optional().describe(`Index order or type`)})).describe(`Fields to index`),unique:L().default(!1).describe(`Enforce uniqueness`),sparse:L().default(!1).describe(`Sparse index`),expireAfterSeconds:I().int().positive().optional().describe(`TTL in seconds`),partialFilterExpression:H(F(),R()).optional().describe(`Partial index filter`),background:L().default(!1).describe(`Create index in background`)})),G(()=>B({readConcern:U([`local`,`majority`,`linearizable`,`snapshot`]).optional().describe(`Read concern level`),writeConcern:U([`majority`,`acknowledged`,`unacknowledged`]).optional().describe(`Write concern level`),readPreference:U([`primary`,`primaryPreferred`,`secondary`,`secondaryPreferred`,`nearest`]).optional().describe(`Read preference`),maxCommitTimeMS:I().int().positive().optional().describe(`Transaction commit timeout (ms)`)}));var ig=U([`insert`,`update`,`upsert`,`replace`,`ignore`]),ag=G(()=>B({object:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Target Object Name`),externalId:F().default(`name`).describe(`Field match for uniqueness check`),mode:ig.default(`upsert`).describe(`Conflict resolution strategy`),env:z(U([`prod`,`dev`,`test`])).default([`prod`,`dev`,`test`]).describe(`Applicable environments`),records:z(H(F(),R())).describe(`Data records`)}));nh({schemaId:`object`,type:`simple`,sections:[{label:`Basics`,description:`Identity, labels, and taxonomy.`,columns:2,fields:[{field:`name`,type:`text`,required:!0,immutable:!0,colSpan:1,helpText:`snake_case unique identifier (immutable after creation)`},{field:`label`,type:`text`,colSpan:1,helpText:`Singular display name (e.g. "Account")`},{field:`pluralLabel`,type:`text`,colSpan:1,helpText:`Plural display name (e.g. "Accounts")`},{field:`icon`,type:`text`,colSpan:1,helpText:`Lucide icon name (e.g. "building", "users")`},{field:`description`,type:`textarea`,colSpan:2,helpText:`Developer documentation`},{field:`tags`,type:`tags`,colSpan:2,helpText:`Categorization tags (e.g. "sales", "system")`},{field:`active`,type:`boolean`,colSpan:1,helpText:`Is the object active and usable`},{field:`isSystem`,type:`boolean`,colSpan:1,helpText:`System object (protected from deletion)`},{field:`abstract`,type:`boolean`,colSpan:1,helpText:`Abstract base (cannot be instantiated)`}]},{label:`Fields`,description:`Define the data model — each row becomes a column in the database table.`,fields:[{field:`fields`,type:`repeater`,widget:`grid`,required:!0,helpText:`Add the columns this object will store`,fields:[{field:`name`,type:`text`,required:!0,immutable:!0,helpText:`snake_case identifier`},{field:`label`,type:`text`,helpText:`Display label`},{field:`type`,type:`select`,required:!0,helpText:`Field type`},{field:`required`,type:`boolean`},{field:`reference`,type:`text`,helpText:`Target object (for lookup/master_detail)`}]}]},{label:`Capabilities`,description:`System features and API exposure.`,collapsible:!0,collapsed:!0,fields:[{field:`capabilities`,type:`composite`,helpText:`Enable/disable system features`,fields:[{field:`trackHistory`,type:`boolean`},{field:`searchable`,type:`boolean`},{field:`apiEnabled`,type:`boolean`},{field:`files`,type:`boolean`},{field:`feeds`,type:`boolean`},{field:`activities`,type:`boolean`},{field:`trash`,type:`boolean`},{field:`mru`,type:`boolean`},{field:`clone`,type:`boolean`}]}]},{label:`Advanced`,description:`State machines, actions, and storage.`,collapsible:!0,collapsed:!0,fields:[{field:`datasource`,type:`text`,helpText:`Target datasource ID (default: "default")`}]}]}),nh({schemaId:`field`,type:`simple`,sections:[{label:`Basics`,description:`Core field identity and constraints.`,columns:2,fields:[{field:`name`,required:!0,immutable:!0,colSpan:1,helpText:`Unique identifier (snake_case, immutable after creation)`},{field:`label`,required:!0,colSpan:1,helpText:`Display name for users`},{field:`type`,required:!0,colSpan:1,helpText:`Data type of this field`},{field:`group`,colSpan:1,helpText:`Group name for form layout`},{field:`description`,widget:`textarea`,colSpan:2,helpText:`Help text shown to users`},{field:`required`,colSpan:1,helpText:`User must provide a value`},{field:`unique`,colSpan:1,helpText:`No two records can have the same value`},{field:`multiple`,colSpan:1,helpText:`Allow multiple values (for select/lookup)`}]},{label:`Configuration`,description:`Field-type specific settings (visible blocks depend on the chosen type).`,fields:[{field:`defaultValue`,helpText:`Default value for new records`},{field:`minLength`,visibleOn:`data.type == 'text' || data.type == 'textarea' || data.type == 'email'`,helpText:`Minimum character length`},{field:`maxLength`,visibleOn:`data.type == 'text' || data.type == 'textarea' || data.type == 'email'`,helpText:`Maximum character length`},{field:`min`,visibleOn:`data.type == 'number' || data.type == 'currency'`,helpText:`Minimum value`},{field:`max`,visibleOn:`data.type == 'number' || data.type == 'currency'`,helpText:`Maximum value`},{field:`precision`,visibleOn:`data.type == 'currency' || data.type == 'number'`,helpText:`Decimal places (e.g., 2 for $10.50)`},{field:`scale`,visibleOn:`data.type == 'number'`,helpText:`Number of decimal digits`},{field:`options`,type:`repeater`,visibleOn:`data.type == 'select' || data.type == 'multiselect'`,helpText:`Available options (label/value pairs)`},{field:`reference`,widget:`ref:object`,visibleOn:`data.type == 'lookup' || data.type == 'master_detail'`,helpText:`Referenced object name`},{field:`referenceFilters`,widget:`string-tags`,visibleOn:`data.type == 'lookup' || data.type == 'master_detail'`,helpText:`Filter expressions (e.g., "active = true")`},{field:`deleteBehavior`,visibleOn:`data.type == 'lookup' || data.type == 'master_detail'`,helpText:`What happens when referenced record is deleted`}]},{label:`Formula & Computed`,description:`Calculated values and roll-up summaries.`,collapsible:!0,collapsed:!0,fields:[{field:`expression`,widget:`textarea`,helpText:`CEL expression to calculate this field (makes it read-only)`},{field:`summaryOperations`,type:`composite`,helpText:`Roll-up summary configuration (for parent-child relationships)`},{field:`cached`,type:`composite`,helpText:`Caching configuration for computed fields`}]},{label:`Advanced`,description:`Database, UI, audit, and security settings.`,collapsible:!0,collapsed:!0,columns:2,fields:[{field:`columnName`,colSpan:2,helpText:`Physical column name in database (defaults to field name)`},{field:`index`,colSpan:1,helpText:`Create database index for faster queries`},{field:`externalId`,colSpan:1,helpText:`Mark as external ID for upsert operations`},{field:`readonly`,colSpan:1,helpText:`Field is read-only in forms`},{field:`hidden`,colSpan:1,helpText:`Hide field from default UI views`},{field:`searchable`,colSpan:1,helpText:`Include in global search results`},{field:`sortable`,colSpan:1,helpText:`Allow sorting lists by this field`},{field:`auditTrail`,colSpan:1,helpText:`Track detailed changes with user and timestamp`},{field:`trackFeedHistory`,colSpan:1,helpText:`Show changes in activity feed`},{field:`encryptionConfig`,type:`composite`,colSpan:2,helpText:`Field-level encryption (GDPR/HIPAA/PCI-DSS)`},{field:`maskingRule`,type:`composite`,colSpan:2,helpText:`Data masking rules for PII protection`}]}]}),nh({schemaId:`hook`,type:`simple`,sections:[{label:`Identity`,description:`What this hook is and when it fires.`,columns:2,fields:[{field:`name`,type:`text`,required:!0,immutable:!0,colSpan:1,helpText:`snake_case identifier (immutable after creation)`},{field:`label`,type:`text`,colSpan:1},{field:`description`,type:`textarea`,colSpan:2},{field:`object`,type:`text`,required:!0,colSpan:1,helpText:`Target object name (or "*" for global)`},{field:`events`,type:`tags`,required:!0,colSpan:1,helpText:`Lifecycle events (e.g. beforeInsert, afterUpdate)`},{field:`priority`,type:`number`,colSpan:1,helpText:`Lower numbers run first`}]},{label:`Body`,description:`Inline expression or sandboxed JavaScript executed when the hook fires.`,fields:[{field:`body`,type:`composite`,helpText:`Either an L1 expression or an L2 sandboxed JS body`,fields:[{field:`language`,type:`select`,required:!0,helpText:`expression = pure formula; js = sandboxed JavaScript`,options:[{label:`Expression (L1)`,value:`expression`},{label:`JavaScript (L2 sandboxed)`,value:`js`}]},{field:`source`,type:`code`,language:`javascript`,required:!0,helpText:`Function body source — no top-level imports`},{field:`capabilities`,type:`tags`,helpText:`Allowed ctx APIs (api.read, api.write, crypto.uuid, log, …)`},{field:`timeoutMs`,type:`number`,helpText:`Per-invocation timeout (ms)`}]}]},{label:`Legacy handler`,description:`Function name reference — deprecated in favour of body.`,collapsible:!0,collapsed:!0,fields:[{field:`handler`,type:`text`,helpText:"Handler function name (deprecated — prefer `body`)"}]},{label:`Execution`,collapsible:!0,collapsed:!0,columns:2,fields:[{field:`async`,type:`boolean`,colSpan:1,helpText:`Run in background, do not block the transaction`},{field:`onError`,type:`select`,colSpan:1,options:[{label:`Abort`,value:`abort`},{label:`Log`,value:`log`}]},{field:`condition`,type:`code`,language:`javascript`,colSpan:2,helpText:`Optional formula — skip the hook when this evaluates to false`}]}]});var og=G(()=>B({field:F().describe(`Source field name containing the reference value`),targetObject:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Target object name (snake_case)`),targetField:F().default(`name`).describe(`Field on target object used for matching`),fieldType:U([`lookup`,`master_detail`]).describe(`Relationship field type`)}).describe(`Describes how a field reference is resolved during seed loading`)),sg=G(()=>B({object:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Object name (snake_case)`),dependsOn:z(F()).describe(`Objects this object depends on`),references:z(og).describe(`Field-level reference details`)}).describe(`Object node in the seed data dependency graph`)),cg=G(()=>B({nodes:z(sg).describe(`All objects in the dependency graph`),insertOrder:z(F()).describe(`Topologically sorted insert order`),circularDependencies:z(z(F())).default([]).describe(`Circular dependency chains (e.g., [["a", "b", "a"]])`)}).describe(`Complete object dependency graph for seed data loading`)),lg=G(()=>B({sourceObject:F().describe(`Object with the broken reference`),field:F().describe(`Field name with unresolved reference`),targetObject:F().describe(`Target object searched for the reference`),targetField:F().describe(`ExternalId field used for matching`),attemptedValue:R().describe(`Value that failed to resolve`),recordIndex:I().int().min(0).describe(`Index of the record in the dataset`),message:F().describe(`Human-readable error description`)}).describe(`Actionable error for a failed reference resolution`)),ug=G(()=>B({dryRun:L().default(!1).describe(`Validate references without writing data`),haltOnError:L().default(!1).describe(`Stop on first reference resolution error`),multiPass:L().default(!0).describe(`Enable multi-pass loading for circular dependencies`),defaultMode:ig.default(`upsert`).describe(`Default conflict resolution strategy`),batchSize:I().int().min(1).default(1e3).describe(`Maximum records per batch insert/upsert`),transaction:L().default(!1).describe(`Wrap entire load in a transaction (all-or-nothing)`),env:U([`prod`,`dev`,`test`]).optional().describe(`Only load datasets matching this environment`),organizationId:F().min(1).optional().describe(`Target organization id for per-tenant seed replay`)}).describe(`Seed data loader configuration`)),dg=G(()=>B({object:F().describe(`Object that was loaded`),mode:ig.describe(`Import mode used`),inserted:I().int().min(0).describe(`Records inserted`),updated:I().int().min(0).describe(`Records updated`),skipped:I().int().min(0).describe(`Records skipped`),errored:I().int().min(0).describe(`Records with errors`),total:I().int().min(0).describe(`Total records in dataset`),referencesResolved:I().int().min(0).describe(`References resolved via externalId`),referencesDeferred:I().int().min(0).describe(`References deferred to second pass`),errors:z(lg).default([]).describe(`Reference resolution errors`)}).describe(`Result of loading a single dataset`));G(()=>B({success:L().describe(`Overall success status`),dryRun:L().describe(`Whether this was a dry-run`),dependencyGraph:cg.describe(`Object dependency graph`),results:z(dg).describe(`Per-object load results`),errors:z(lg).describe(`All reference resolution errors`),summary:B({objectsProcessed:I().int().min(0).describe(`Total objects processed`),totalRecords:I().int().min(0).describe(`Total records across all objects`),totalInserted:I().int().min(0).describe(`Total records inserted`),totalUpdated:I().int().min(0).describe(`Total records updated`),totalSkipped:I().int().min(0).describe(`Total records skipped`),totalErrored:I().int().min(0).describe(`Total records with errors`),totalReferencesResolved:I().int().min(0).describe(`Total references resolved`),totalReferencesDeferred:I().int().min(0).describe(`Total references deferred`),circularDependencyCount:I().int().min(0).describe(`Circular dependency chains detected`),durationMs:I().min(0).describe(`Load duration in milliseconds`)}).describe(`Summary statistics`)}).describe(`Complete seed loader result`)),G(()=>B({datasets:z(ag).min(1).describe(`Datasets to load`),config:ug.default(()=>ug.parse({})).describe(`Loader configuration`)}).describe(`Seed loader request with datasets and configuration`));var fg=G(()=>B({versionNumber:I().describe(`Version number`),createdAt:I().describe(`Creation timestamp`),createdBy:F().describe(`Creator user ID`),size:I().describe(`File size in bytes`),checksum:F().describe(`File checksum`),downloadUrl:F().url().describe(`Download URL`),isLatest:L().optional().default(!1).describe(`Is latest version`)})),pg=G(()=>B({id:F().describe(`Template ID`),name:F().describe(`Template name`),description:F().optional().describe(`Template description`),fileUrl:F().url().describe(`Template file URL`),fileType:F().describe(`File MIME type`),placeholders:z(B({key:F().describe(`Placeholder key`),label:F().describe(`Placeholder label`),type:U([`text`,`number`,`date`,`image`]).describe(`Placeholder type`),required:L().optional().default(!1).describe(`Is required`)})).describe(`Template placeholders`)})),mg=G(()=>B({provider:U([`docusign`,`adobe-sign`,`hellosign`,`custom`]).describe(`E-signature provider`),enabled:L().optional().default(!1).describe(`E-signature enabled`),signers:z(B({email:F().email().describe(`Signer email`),name:F().describe(`Signer name`),role:F().describe(`Signer role`),order:I().describe(`Signing order`)})).describe(`Document signers`),expirationDays:I().optional().default(30).describe(`Expiration days`),reminderDays:I().optional().default(7).describe(`Reminder interval days`)}));G(()=>B({id:F().describe(`Document ID`),name:F().describe(`Document name`),description:F().optional().describe(`Document description`),fileType:F().describe(`File MIME type`),fileSize:I().describe(`File size in bytes`),category:F().optional().describe(`Document category`),tags:z(F()).optional().describe(`Document tags`),versioning:B({enabled:L().describe(`Versioning enabled`),versions:z(fg).describe(`Version history`),majorVersion:I().describe(`Major version`),minorVersion:I().describe(`Minor version`)}).optional().describe(`Version control`),template:pg.optional().describe(`Document template`),eSignature:mg.optional().describe(`E-signature config`),access:B({isPublic:L().optional().default(!1).describe(`Public access`),sharedWith:z(F()).optional().describe(`Shared with`),expiresAt:I().optional().describe(`Access expiration`)}).optional().describe(`Access control`),metadata:H(F(),R()).optional().describe(`Custom metadata`)}));var hg=G(()=>uf(`type`,[B({type:W(`constant`),value:R().describe(`Constant value to use`)}).describe(`Set a constant value`),B({type:W(`cast`),targetType:U([`string`,`number`,`boolean`,`date`]).describe(`Target data type`)}).describe(`Cast to a specific data type`),B({type:W(`lookup`),table:F().describe(`Lookup table name`),keyField:F().describe(`Field to match on`),valueField:F().describe(`Field to retrieve`)}).describe(`Lookup value from another table`),B({type:W(`javascript`),expression:jp.describe(`JS expression (dialect="js" recommended). e.g. value.toUpperCase()`)}).describe(`Custom JavaScript transformation`),B({type:W(`map`),mappings:H(F(),R()).describe(`Value mappings (e.g., {"Active": "active"})`)}).describe(`Map values using a dictionary`)])),gg=G(()=>B({source:F().describe(`Source field name`),target:F().describe(`Target field name`),transform:hg.optional().describe(`Transformation to apply`),defaultValue:R().optional().describe(`Default if source is null/undefined`)})),_g=G(()=>B({id:F().describe(`Data source ID`),name:F().describe(`Data source name`),type:U([`odata`,`rest-api`,`graphql`,`custom`]).describe(`Protocol type`),endpoint:F().url().describe(`API endpoint URL`),authentication:B({type:U([`oauth2`,`api-key`,`basic`,`none`]).describe(`Auth type`),config:H(F(),R()).describe(`Auth configuration`)}).describe(`Authentication`)})),vg=G(()=>gg.extend({type:F().optional().describe(`Field type`),readonly:L().optional().default(!0).describe(`Read-only field`)}));G(()=>B({fieldName:F().describe(`Field name`),dataSource:_g.describe(`External data source`),query:B({endpoint:F().describe(`Query endpoint path`),method:U([`GET`,`POST`]).optional().default(`GET`).describe(`HTTP method`),parameters:H(F(),R()).optional().describe(`Query parameters`)}).describe(`Query configuration`),fieldMappings:z(vg).describe(`Field mappings`),caching:B({enabled:L().optional().default(!0).describe(`Cache enabled`),ttl:I().optional().default(300).describe(`Cache TTL (seconds)`),strategy:U([`lru`,`lfu`,`ttl`]).optional().default(`ttl`).describe(`Cache strategy`)}).optional().describe(`Caching configuration`),fallback:B({enabled:L().optional().default(!0).describe(`Fallback enabled`),defaultValue:R().optional().describe(`Default fallback value`),showError:L().optional().default(!0).describe(`Show error to user`)}).optional().describe(`Fallback configuration`),rateLimit:B({requestsPerSecond:I().describe(`Requests per second limit`),burstSize:I().optional().describe(`Burst size`)}).optional().describe(`Rate limiting`),retry:B({maxRetries:I().min(0).default(3).describe(`Maximum retry attempts`),initialDelayMs:I().default(1e3).describe(`Initial retry delay in milliseconds`),maxDelayMs:I().default(3e4).describe(`Maximum retry delay in milliseconds`),backoffMultiplier:I().default(2).describe(`Exponential backoff multiplier`),retryableStatusCodes:z(I()).default([429,500,502,503,504]).describe(`HTTP status codes that are retryable`)}).optional().describe(`Retry configuration with exponential backoff`),transform:B({request:B({headers:H(F(),F()).optional().describe(`Additional request headers`),queryParams:H(F(),F()).optional().describe(`Additional query parameters`)}).optional().describe(`Request transformation`),response:B({dataPath:F().optional().describe(`JSONPath to extract data (e.g., "$.data.results")`),totalPath:F().optional().describe(`JSONPath to extract total count (e.g., "$.meta.total")`)}).optional().describe(`Response transformation`)}).optional().describe(`Request/response transformation pipeline`),pagination:B({type:U([`offset`,`cursor`,`page`]).default(`offset`).describe(`Pagination type`),pageSize:I().default(100).describe(`Items per page`),maxPages:I().optional().describe(`Maximum number of pages to fetch`)}).optional().describe(`Pagination configuration for external data`)}));var yg=F().describe(`Underlying driver identifier`);G(()=>B({id:F().describe(`Unique driver identifier (e.g. "postgres")`),label:F().describe(`Display label (e.g. "PostgreSQL")`),description:F().optional(),icon:F().optional(),configSchema:H(F(),R()).describe(`JSON Schema for connection configuration`),capabilities:zf(()=>bg).optional()}));var bg=B({transactions:L().default(!1),queryFilters:L().default(!1),queryAggregations:L().default(!1),querySorting:L().default(!1),queryPagination:L().default(!1),queryWindowFunctions:L().default(!1),querySubqueries:L().default(!1),joins:L().default(!1),fullTextSearch:L().default(!1),readOnly:L().default(!1),dynamicSchema:L().default(!1)});G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique datasource identifier`),label:F().optional().describe(`Display label`),driver:yg.describe(`Underlying driver type`),config:H(F(),R()).describe(`Driver specific configuration`),pool:B({min:I().default(0).describe(`Minimum connections`),max:I().default(10).describe(`Maximum connections`),idleTimeoutMillis:I().default(3e4).describe(`Idle timeout`),connectionTimeoutMillis:I().default(3e3).describe(`Connection establishment timeout`)}).optional().describe(`Connection pool settings`),readReplicas:z(H(F(),R())).optional().describe(`Read-only replica configurations`),capabilities:bg.optional().describe(`Capability overrides`),healthCheck:B({enabled:L().default(!0).describe(`Enable health check endpoint`),intervalMs:I().default(3e4).describe(`Health check interval in milliseconds`),timeoutMs:I().default(5e3).describe(`Health check timeout in milliseconds`)}).optional().describe(`Datasource health check configuration`),ssl:B({enabled:L().default(!1).describe(`Enable SSL/TLS for database connection`),rejectUnauthorized:L().default(!0).describe(`Reject connections with invalid/self-signed certificates`),ca:F().optional().describe(`CA certificate (PEM format or path to file)`),cert:F().optional().describe(`Client certificate (PEM format or path to file)`),key:F().optional().describe(`Client private key (PEM format or path to file)`)}).optional().describe(`SSL/TLS configuration for secure database connections`),retryPolicy:B({maxRetries:I().default(3).describe(`Maximum number of retry attempts`),baseDelayMs:I().default(1e3).describe(`Base delay between retries in milliseconds`),maxDelayMs:I().default(3e4).describe(`Maximum delay between retries in milliseconds`),backoffMultiplier:I().default(2).describe(`Exponential backoff multiplier`)}).optional().describe(`Connection retry policy for transient failures`),description:F().optional().describe(`Internal description`),active:L().default(!0).describe(`Is datasource enabled`)}));var xg=U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`,`number`,`string`,`boolean`]),Sg=U([`string`,`number`,`boolean`,`time`,`geo`]),Cg=U([`second`,`minute`,`hour`,`day`,`week`,`month`,`quarter`,`year`]),wg=G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique metric ID`),label:F().describe(`Human readable label`),description:F().optional(),type:xg,sql:F().describe(`SQL expression or field reference`),filters:z(B({sql:F()})).optional(),format:F().optional()})),Tg=G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique dimension ID`),label:F().describe(`Human readable label`),description:F().optional(),type:Sg,sql:F().describe(`SQL expression or column reference`),granularities:z(Cg).optional()})),Eg=G(()=>B({name:F().describe(`Target cube name`),relationship:U([`one_to_one`,`one_to_many`,`many_to_one`]).default(`many_to_one`),sql:F().describe(`Join condition (ON clause)`)}));G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Cube name (snake_case)`),title:F().optional(),description:F().optional(),sql:F().describe(`Base SQL statement or Table Name`),measures:H(F(),wg).describe(`Quantitative metrics`),dimensions:H(F(),Tg).describe(`Qualitative attributes`),joins:H(F(),Eg).optional(),refreshKey:B({every:F().optional(),sql:F().optional()}).optional(),public:L().default(!1)})),G(()=>B({cube:F().optional().describe(`Target cube name (optional when provided externally, e.g. in API request wrapper)`),measures:z(F()).describe(`List of metrics to calculate`),dimensions:z(F()).optional().describe(`List of dimensions to group by`),where:Zf.optional().describe(`Filtering criteria (canonical Query DSL FilterCondition)`),timeDimensions:z(B({dimension:F(),granularity:Cg.optional(),dateRange:V([F(),z(F())]).optional()})).optional(),order:H(F(),U([`asc`,`desc`])).optional(),limit:I().optional(),offset:I().optional(),timezone:F().optional().default(`UTC`)}));var Dg=U([`comment`,`field_change`,`task`,`event`,`email`,`call`,`note`,`file`,`record_create`,`record_delete`,`approval`,`sharing`,`system`]),Og=G(()=>B({type:U([`user`,`team`,`record`]).describe(`Mention target type`),id:F().describe(`Target ID`),name:F().describe(`Display name for rendering`),offset:I().int().min(0).describe(`Character offset in body text`),length:I().int().min(1).describe(`Length of mention token in body text`)})),kg=G(()=>B({field:F().describe(`Field machine name`),fieldLabel:F().optional().describe(`Field display label`),oldValue:R().optional().describe(`Previous value`),newValue:R().optional().describe(`New value`),oldDisplayValue:F().optional().describe(`Human-readable old value`),newDisplayValue:F().optional().describe(`Human-readable new value`)})),Ag=G(()=>B({emoji:F().describe(`Emoji character or shortcode (e.g., "👍", ":thumbsup:")`),userIds:z(F()).describe(`Users who reacted`),count:I().int().min(1).describe(`Total reaction count`)})),jg=G(()=>B({type:U([`user`,`system`,`service`,`automation`]).describe(`Actor type`),id:F().describe(`Actor ID`),name:F().optional().describe(`Actor display name`),avatarUrl:F().url().optional().describe(`Actor avatar URL`),source:F().optional().describe(`Source application (e.g., "Omni", "API", "Studio")`)})),Mg=U([`public`,`internal`,`private`]);G(()=>B({id:F().describe(`Feed item ID`),type:Dg.describe(`Activity type`),object:F().describe(`Object name (e.g., "account")`),recordId:F().describe(`Record ID this feed item belongs to`),actor:jg.describe(`Who performed this action`),body:F().optional().describe(`Rich text body (Markdown supported)`),mentions:z(Og).optional().describe(`Mentioned users/teams/records`),changes:z(kg).optional().describe(`Field-level changes`),reactions:z(Ag).optional().describe(`Emoji reactions on this item`),parentId:F().optional().describe(`Parent feed item ID for threaded replies`),replyCount:I().int().min(0).default(0).describe(`Number of replies`),pinned:L().default(!1).describe(`Whether the feed item is pinned to the top of the timeline`),pinnedAt:F().datetime().optional().describe(`Timestamp when the item was pinned`),pinnedBy:F().optional().describe(`User ID who pinned the item`),starred:L().default(!1).describe(`Whether the feed item is starred/bookmarked by the current user`),starredAt:F().datetime().optional().describe(`Timestamp when the item was starred`),visibility:Mg.default(`public`).describe(`Visibility: public (all users), internal (team only), private (author + mentioned)`),createdAt:F().datetime().describe(`Creation timestamp`),updatedAt:F().datetime().optional().describe(`Last update timestamp`),editedAt:F().datetime().optional().describe(`When comment was last edited`),isEdited:L().default(!1).describe(`Whether comment has been edited`)})),U([`all`,`comments_only`,`changes_only`,`tasks_only`]);var Ng=U([`comment`,`mention`,`field_change`,`task`,`approval`,`all`]),Pg=U([`in_app`,`email`,`push`,`slack`]);G(()=>B({object:F().describe(`Object name`),recordId:F().describe(`Record ID`),userId:F().describe(`Subscribing user ID`),events:z(Ng).default([`all`]).describe(`Event types to receive notifications for`),channels:z(Pg).default([`in_app`]).describe(`Notification delivery channels`),active:L().default(!0).describe(`Whether the subscription is active`),createdAt:F().datetime().describe(`Subscription creation timestamp`)}));var Fg=G(()=>U([`header`,`subdomain`,`path`,`token`,`lookup`]).describe(`Strategy for resolving tenant identity from request context`)),Ig=G(()=>B({name:F().min(1).describe(`Turso database group name`),primaryLocation:F().min(2).describe(`Primary Turso region code (e.g., iad, lhr, nrt)`),replicaLocations:z(F().min(2)).default([]).describe(`Additional replica region codes`),schemaDatabase:F().optional().describe(`Schema database name for multi-db schemas`)}).describe(`Turso database group configuration`)),Lg=G(()=>B({onTenantCreate:B({autoCreate:L().default(!0).describe(`Auto-create database on tenant registration`),group:F().optional().describe(`Turso group for the new database`),applyGroupSchema:L().default(!0).describe(`Apply shared schema from group`),seedData:L().default(!1).describe(`Populate seed data on creation`)}).describe(`Tenant creation hook`),onTenantDelete:B({immediate:L().default(!1).describe(`Destroy database immediately`),gracePeriodHours:I().int().min(0).default(72).describe(`Grace period before permanent deletion`),createBackup:L().default(!0).describe(`Create backup before deletion`)}).describe(`Tenant deletion hook`),onTenantSuspend:B({revokeTokens:L().default(!0).describe(`Revoke auth tokens on suspension`),readOnly:L().default(!0).describe(`Set database to read-only on suspension`)}).describe(`Tenant suspension hook`)}).describe(`Tenant database lifecycle hooks`));G(()=>B({organizationSlug:F().min(1).describe(`Turso organization slug`),urlTemplate:F().min(1).describe(`URL template with {tenant_id} placeholder`),groupAuthToken:F().min(1).describe(`Group-level auth token for platform operations`),tenantResolverStrategy:Fg.default(`token`),group:Ig.optional().describe(`Database group configuration`),lifecycle:Lg.optional().describe(`Lifecycle hooks`),maxCachedConnections:I().int().min(1).default(100).describe(`Max cached tenant connections (LRU)`),connectionCacheTTL:I().int().min(0).default(300).describe(`Connection cache TTL in seconds`)}).describe(`Turso multi-tenant router configuration`));var Rg=(e=>l===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(l===void 0?e:l)[t]}):e:l)(function(e){if(l!==void 0)return l.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),zg={debug:0,info:1,warn:2,error:3,fatal:4,silent:5},Bg={debug:`\x1B[36m`,info:`\x1B[32m`,warn:`\x1B[33m`,error:`\x1B[31m`,fatal:`\x1B[35m`,silent:``},Vg=`\x1B[0m`,Hg=class e{constructor(e={},t={}){this.config={name:e.name,level:e.level??`info`,format:e.format??`pretty`,redact:e.redact??[`password`,`token`,`secret`,`key`],sourceLocation:e.sourceLocation??!1,file:e.file,rotation:e.rotation??{maxSize:`10m`,maxFiles:5}},this.bindings=t,this.config.file&&typeof process<`u`&&this.openFileStream(this.config.file)}openFileStream(e){try{let t=Rg(`fs`),n=Rg(`path`).dirname(e);t.mkdirSync(n,{recursive:!0}),this.fileStream=t.createWriteStream(e,{flags:`a`})}catch{}}isEnabled(e){return zg[e]>=zg[this.config.level]}redactSensitive(e){if(!e||typeof e!=`object`)return e;let t=Array.isArray(e)?[...e]:{...e};for(let e in t){let n=e.toLowerCase();this.config.redact.some(e=>n.includes(e.toLowerCase()))?t[e]=`***REDACTED***`:typeof t[e]==`object`&&t[e]!==null&&(t[e]=this.redactSensitive(t[e]))}return t}write(e,t,n,r){if(!this.isEnabled(e))return;let i=this.redactSensitive({...this.bindings,...n,...r?{error:{message:r.message,stack:r.stack}}:{}}),a=Object.keys(i).length>0,o=new Date().toISOString(),s;if(this.config.format===`json`)s=JSON.stringify({time:o,level:e,...this.config.name?{name:this.config.name}:{},msg:t,...i});else if(this.config.format===`text`){let n=[o,e.toUpperCase(),t];a&&n.push(JSON.stringify(i)),s=n.join(` | `)}else{let n=Bg[e]||``,r=this.config.name?`[${this.config.name}] `:``;s=`${n}${o} ${e.toUpperCase()}${Vg} ${r}${t}`,a&&(s+=` ${JSON.stringify(i)}`)}let c=s+`
102
+ 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}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function yu(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)):Object.assign(i,s),Object.assign(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??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);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)}Object.assign(i,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??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}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:Su(t,`input`,e.processors),output:Su(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function bu(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 bu(r.element,n);if(r.type===`set`)return bu(r.valueType,n);if(r.type===`lazy`)return bu(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`)return bu(r.innerType,n);if(r.type===`intersection`)return bu(r.left,n)||bu(r.right,n);if(r.type===`record`||r.type===`map`)return bu(r.keyType,n)||bu(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:bu(r.in,n)||bu(r.out,n);if(r.type===`object`){for(let e in r.shape)if(bu(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(bu(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(bu(e,n))return!0;return!!(r.rest&&bu(r.rest,n))}return!1}var xu=(e,t={})=>n=>{let r=gu({...n,processors:t});return _u(e,r),vu(r,e),yu(r,e)},Su=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=gu({...i??{},target:a,io:t,processors:n});return _u(e,o),vu(o,e),yu(o,e)},Cu={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},wu=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Cu[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];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}))])}},Tu=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;typeof s==`string`&&s.includes(`int`)?i.type=`integer`:i.type=`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Eu=(e,t,n,r)=>{n.type=`boolean`},Du=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Ou=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Void cannot be represented in JSON Schema`)},ku=(e,t,n,r)=>{n.not={}},Au=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Date cannot be represented in JSON Schema`)},ju=(e,t,n,r)=>{let i=e._zod.def,a=Pa(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Mu=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);if(a.length!==0)if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a},Nu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Pu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Function types cannot be represented in JSON Schema`)},Fu=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Iu=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=_u(a.element,t,{...r,path:[...r.path,`items`]})},Lu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=_u(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=_u(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ru=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>_u(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},zu=(e,t,n,r)=>{let i=e._zod.def,a=_u(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=_u(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Bu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>_u(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?_u(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null;t.target===`draft-2020-12`?(i.prefixItems=c,l&&(i.items=l)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),i.minItems=c.length,l||(i.maxItems=c.length)):(i.items=c,l&&(i.additionalItems=l));let{minimum:u,maximum:d}=e._zod.bag;typeof u==`number`&&(i.minItems=u),typeof d==`number`&&(i.maxItems=d)},Vu=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=_u(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else (t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=_u(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=_u(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Hu=(e,t,n,r)=>{let i=e._zod.def,a=_u(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`}]},Uu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Wu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Gu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Ku=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},qu=(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;_u(o,t,r);let s=t.seen.get(e);s.ref=o},Ju=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Yu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Xu=(e,t,n,r)=>{let i=e._zod.def;_u(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zu=(e,t,n,r)=>{let i=e._zod.innerType;_u(i,t,r);let a=t.seen.get(e);a.ref=i},Qu=N(`ZodISODateTime`,(e,t)=>{Ys.init(e,t),wd.init(e,t)});function $u(e){return Ml(Qu,e)}var ed=N(`ZodISODate`,(e,t)=>{Xs.init(e,t),wd.init(e,t)});function td(e){return Nl(ed,e)}var nd=N(`ZodISOTime`,(e,t)=>{Zs.init(e,t),wd.init(e,t)});function rd(e){return Pl(nd,e)}var id=N(`ZodISODuration`,(e,t)=>{Qs.init(e,t),wd.init(e,t)});function ad(e){return Fl(id,e)}var od=N(`ZodError`,(e,t)=>{vo.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>xo(e,t)},flatten:{value:t=>bo(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Fa,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Fa,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),sd=So(od),cd=wo(od),ld=Eo(od),ud=Oo(od),dd=Ao(od),fd=jo(od),pd=Mo(od),md=No(od),hd=Po(od),gd=Fo(od),_d=Io(od),vd=Lo(od),yd=new WeakMap;function bd(e,t,n){let r=Object.getPrototypeOf(e),i=yd.get(r);if(i||(i=new Set,yd.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var xd=N(`ZodType`,(e,t)=>(Fs.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Su(e,`input`),output:Su(e,`output`)}}),e.toJSONSchema=xu(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>sd(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ld(e,t,n),e.parseAsync=async(t,n)=>cd(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>ud(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>dd(e,t,n),e.decode=(t,n)=>fd(e,t,n),e.encodeAsync=async(t,n)=>pd(e,t,n),e.decodeAsync=async(t,n)=>md(e,t,n),e.safeEncode=(t,n)=>hd(e,t,n),e.safeDecode=(t,n)=>gd(e,t,n),e.safeEncodeAsync=async(t,n)=>_d(e,t,n),e.safeDecodeAsync=async(t,n)=>vd(e,t,n),bd(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Ua(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 $a(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Kf(e,t))},superRefine(e,t){return this.check(qf(e,t))},overwrite(e){return this.check(au(e))},optional(){return xf(this)},exactOptional(){return Cf(this)},nullable(){return Tf(this)},nullish(){return xf(Tf(this))},nonoptional(e){return jf(this,e)},array(){return z(this)},or(e){return V([this,e])},and(e){return ff(this,e)},transform(e){return Ff(this,yf(e))},default(e){return Df(this,e)},prefault(e){return kf(this,e)},catch(e){return Nf(this,e)},pipe(e){return Ff(this,e)},readonly(){return Lf(this)},describe(e){let t=this.clone();return cl.add(t,{description:e}),t},meta(...e){if(e.length===0)return cl.get(this);let t=this.clone();return cl.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return cl.get(e)?.description},configurable:!0}),e)),Sd=N(`_ZodString`,(e,t)=>{Is.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wu(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,bd(e,`_ZodString`,{regex(...e){return this.check($l(...e))},includes(...e){return this.check(nu(...e))},startsWith(...e){return this.check(ru(...e))},endsWith(...e){return this.check(iu(...e))},min(...e){return this.check(Zl(...e))},max(...e){return this.check(Xl(...e))},length(...e){return this.check(Ql(...e))},nonempty(...e){return this.check(Zl(1,...e))},lowercase(e){return this.check(eu(e))},uppercase(e){return this.check(tu(e))},trim(){return this.check(su())},normalize(...e){return this.check(ou(...e))},toLowerCase(){return this.check(cu())},toUpperCase(){return this.check(lu())},slugify(){return this.check(uu())}})}),Cd=N(`ZodString`,(e,t)=>{Is.init(e,t),Sd.init(e,t),e.email=t=>e.check(ul(Td,t)),e.url=t=>e.check(gl(Od,t)),e.jwt=t=>e.check(jl(Ud,t)),e.emoji=t=>e.check(_l(kd,t)),e.guid=t=>e.check(dl(Ed,t)),e.uuid=t=>e.check(fl(Dd,t)),e.uuidv4=t=>e.check(pl(Dd,t)),e.uuidv6=t=>e.check(ml(Dd,t)),e.uuidv7=t=>e.check(hl(Dd,t)),e.nanoid=t=>e.check(vl(Ad,t)),e.guid=t=>e.check(dl(Ed,t)),e.cuid=t=>e.check(yl(jd,t)),e.cuid2=t=>e.check(bl(Md,t)),e.ulid=t=>e.check(xl(Nd,t)),e.base64=t=>e.check(Ol(Bd,t)),e.base64url=t=>e.check(kl(Vd,t)),e.xid=t=>e.check(Sl(Pd,t)),e.ksuid=t=>e.check(Cl(Fd,t)),e.ipv4=t=>e.check(wl(Id,t)),e.ipv6=t=>e.check(Tl(Ld,t)),e.cidrv4=t=>e.check(El(Rd,t)),e.cidrv6=t=>e.check(Dl(zd,t)),e.e164=t=>e.check(Al(Hd,t)),e.datetime=t=>e.check($u(t)),e.date=t=>e.check(td(t)),e.time=t=>e.check(rd(t)),e.duration=t=>e.check(ad(t))});function F(e){return ll(Cd,e)}var wd=N(`ZodStringFormat`,(e,t)=>{Ls.init(e,t),Sd.init(e,t)}),Td=N(`ZodEmail`,(e,t)=>{Bs.init(e,t),wd.init(e,t)}),Ed=N(`ZodGUID`,(e,t)=>{Rs.init(e,t),wd.init(e,t)}),Dd=N(`ZodUUID`,(e,t)=>{zs.init(e,t),wd.init(e,t)}),Od=N(`ZodURL`,(e,t)=>{Vs.init(e,t),wd.init(e,t)}),kd=N(`ZodEmoji`,(e,t)=>{Hs.init(e,t),wd.init(e,t)}),Ad=N(`ZodNanoID`,(e,t)=>{Us.init(e,t),wd.init(e,t)}),jd=N(`ZodCUID`,(e,t)=>{Ws.init(e,t),wd.init(e,t)}),Md=N(`ZodCUID2`,(e,t)=>{Gs.init(e,t),wd.init(e,t)}),Nd=N(`ZodULID`,(e,t)=>{Ks.init(e,t),wd.init(e,t)}),Pd=N(`ZodXID`,(e,t)=>{qs.init(e,t),wd.init(e,t)}),Fd=N(`ZodKSUID`,(e,t)=>{Js.init(e,t),wd.init(e,t)}),Id=N(`ZodIPv4`,(e,t)=>{$s.init(e,t),wd.init(e,t)}),Ld=N(`ZodIPv6`,(e,t)=>{ec.init(e,t),wd.init(e,t)}),Rd=N(`ZodCIDRv4`,(e,t)=>{tc.init(e,t),wd.init(e,t)}),zd=N(`ZodCIDRv6`,(e,t)=>{nc.init(e,t),wd.init(e,t)}),Bd=N(`ZodBase64`,(e,t)=>{ic.init(e,t),wd.init(e,t)}),Vd=N(`ZodBase64URL`,(e,t)=>{oc.init(e,t),wd.init(e,t)}),Hd=N(`ZodE164`,(e,t)=>{sc.init(e,t),wd.init(e,t)}),Ud=N(`ZodJWT`,(e,t)=>{lc.init(e,t),wd.init(e,t)}),Wd=N(`ZodNumber`,(e,t)=>{uc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tu(e,t,n,r),bd(e,`ZodNumber`,{gt(e,t){return this.check(ql(e,t))},gte(e,t){return this.check(Jl(e,t))},min(e,t){return this.check(Jl(e,t))},lt(e,t){return this.check(Gl(e,t))},lte(e,t){return this.check(Kl(e,t))},max(e,t){return this.check(Kl(e,t))},int(e){return this.check(Kd(e))},safe(e){return this.check(Kd(e))},positive(e){return this.check(ql(0,e))},nonnegative(e){return this.check(Jl(0,e))},negative(e){return this.check(Gl(0,e))},nonpositive(e){return this.check(Kl(0,e))},multipleOf(e,t){return this.check(Yl(e,t))},step(e,t){return this.check(Yl(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function I(e){return Il(Wd,e)}var Gd=N(`ZodNumberFormat`,(e,t)=>{dc.init(e,t),Wd.init(e,t)});function Kd(e){return Ll(Gd,e)}var qd=N(`ZodBoolean`,(e,t)=>{fc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Eu(e,t,n,r)});function L(e){return Rl(qd,e)}var Jd=N(`ZodNull`,(e,t)=>{pc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Du(e,t,n,r)});function Yd(e){return zl(Jd,e)}var Xd=N(`ZodAny`,(e,t)=>{mc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Zd(){return Bl(Xd)}var Qd=N(`ZodUnknown`,(e,t)=>{hc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function R(){return Vl(Qd)}var $d=N(`ZodNever`,(e,t)=>{gc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ku(e,t,n,r)});function ef(e){return Hl($d,e)}var tf=N(`ZodVoid`,(e,t)=>{_c.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ou(e,t,n,r)});function nf(e){return Ul(tf,e)}var rf=N(`ZodDate`,(e,t)=>{vc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Au(e,t,n,r),e.min=(t,n)=>e.check(Jl(t,n)),e.max=(t,n)=>e.check(Kl(t,n));let n=e._zod.bag;e.minDate=n.minimum?new Date(n.minimum):null,e.maxDate=n.maximum?new Date(n.maximum):null});function af(e){return Wl(rf,e)}var of=N(`ZodArray`,(e,t)=>{bc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iu(e,t,n,r),e.element=t.element,bd(e,`ZodArray`,{min(e,t){return this.check(Zl(e,t))},nonempty(e){return this.check(Zl(1,e))},max(e,t){return this.check(Xl(e,t))},length(e,t){return this.check(Ql(e,t))},unwrap(){return this.element}})});function z(e,t){return du(of,e,t)}var sf=N(`ZodObject`,(e,t)=>{Tc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lu(e,t,n,r),Va(e,`shape`,()=>t.shape),bd(e,`ZodObject`,{keyof(){return U(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:R()})},loose(){return this.clone({...this._zod.def,catchall:R()})},strict(){return this.clone({...this._zod.def,catchall:ef()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return io(this,e)},safeExtend(e){return ao(this,e)},merge(e){return oo(this,e)},pick(e){return no(this,e)},omit(e){return ro(this,e)},partial(...e){return so(bf,this,e[0])},required(...e){return co(Af,this,e[0])}})});function B(e,t){return new sf({type:`object`,shape:e??{},...P(t)})}var cf=N(`ZodUnion`,(e,t)=>{Dc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ru(e,t,n,r),e.options=t.options});function V(e,t){return new cf({type:`union`,options:e,...P(t)})}var lf=N(`ZodDiscriminatedUnion`,(e,t)=>{cf.init(e,t),Oc.init(e,t)});function uf(e,t,n){return new lf({type:`union`,options:t,discriminator:e,...P(n)})}var df=N(`ZodIntersection`,(e,t)=>{kc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zu(e,t,n,r)});function ff(e,t){return new df({type:`intersection`,left:e,right:t})}var pf=N(`ZodTuple`,(e,t)=>{Mc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bu(e,t,n,r),e.rest=t=>e.clone({...e._zod.def,rest:t})});function mf(e,t,n){let r=t instanceof Fs;return new pf({type:`tuple`,items:e,rest:r?t:null,...P(r?n:t)})}var hf=N(`ZodRecord`,(e,t)=>{Ic.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vu(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function H(e,t,n){return!t||!t._zod?new hf({type:`record`,keyType:F(),valueType:e,...P(t)}):new hf({type:`record`,keyType:e,valueType:t,...P(n)})}var gf=N(`ZodEnum`,(e,t)=>{Lc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ju(e,t,n,r),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 gf({...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 gf({...t,checks:[],...P(r),entries:i})}});function U(e,t){return new gf({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var _f=N(`ZodLiteral`,(e,t)=>{Rc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mu(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function W(e,t){return new _f({type:`literal`,values:Array.isArray(e)?e:[e],...P(t)})}var vf=N(`ZodTransform`,(e,t)=>{zc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fu(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new ja(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(go(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(go(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function yf(e){return new vf({type:`transform`,transform:e})}var bf=N(`ZodOptional`,(e,t)=>{Vc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function xf(e){return new bf({type:`optional`,innerType:e})}var Sf=N(`ZodExactOptional`,(e,t)=>{Hc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cf(e){return new Sf({type:`optional`,innerType:e})}var wf=N(`ZodNullable`,(e,t)=>{Uc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tf(e){return new wf({type:`nullable`,innerType:e})}var Ef=N(`ZodDefault`,(e,t)=>{Wc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Df(e,t){return new Ef({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Xa(t)}})}var Of=N(`ZodPrefault`,(e,t)=>{Kc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function kf(e,t){return new Of({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Xa(t)}})}var Af=N(`ZodNonOptional`,(e,t)=>{qc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jf(e,t){return new Af({type:`nonoptional`,innerType:e,...P(t)})}var Mf=N(`ZodCatch`,(e,t)=>{Yc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ku(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Nf(e,t){return new Mf({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Pf=N(`ZodPipe`,(e,t)=>{Xc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qu(e,t,n,r),e.in=t.in,e.out=t.out});function Ff(e,t){return new Pf({type:`pipe`,in:e,out:t})}var If=N(`ZodReadonly`,(e,t)=>{Qc.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ju(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Lf(e){return new If({type:`readonly`,innerType:e})}var Rf=N(`ZodLazy`,(e,t)=>{nl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zu(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function zf(e){return new Rf({type:`lazy`,getter:e})}var Bf=N(`ZodPromise`,(e,t)=>{tl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yu(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Vf(e){return new Bf({type:`promise`,innerType:e})}var Hf=N(`ZodFunction`,(e,t)=>{el.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pu(e,t,n,r)});function Uf(e){return new Hf({type:`function`,input:Array.isArray(e?.input)?mf(e?.input):e?.input??z(R()),output:e?.output??R()})}var Wf=N(`ZodCustom`,(e,t)=>{rl.init(e,t),xd.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Nu(e,t,n,r)});function Gf(e,t){return fu(Wf,e??(()=>!0),t)}function Kf(e,t={}){return pu(Wf,e,t)}function qf(e,t){return mu(e,t)}var Jf=c(_(),1);function G(e){if(typeof process<`u`&&{}.OS_EAGER_SCHEMAS===`1`)return e();let t,n=()=>(t===void 0&&(t=e()),t);return new Proxy(function(){},{get(e,t){let r=n(),i=r[t];return typeof i==`function`?i.bind(r):i},set(e,t,r){let i=n();return i[t]=r,!0},has(e,t){return t in n()},ownKeys(){return Reflect.ownKeys(n())},getOwnPropertyDescriptor(e,t){return Reflect.getOwnPropertyDescriptor(n(),t)},getPrototypeOf(){return Reflect.getPrototypeOf(n())}})}var Yf=G(()=>B({$field:F().describe(`Field Reference/Column Name`)}));G(()=>B({$eq:Zd().optional(),$ne:Zd().optional()})),G(()=>B({$gt:V([I(),af(),Yf]).optional(),$gte:V([I(),af(),Yf]).optional(),$lt:V([I(),af(),Yf]).optional(),$lte:V([I(),af(),Yf]).optional()})),G(()=>B({$in:z(Zd()).optional(),$nin:z(Zd()).optional()})),G(()=>B({$between:mf([V([I(),af(),Yf]),V([I(),af(),Yf])]).optional()})),G(()=>B({$contains:F().optional(),$notContains:F().optional(),$startsWith:F().optional(),$endsWith:F().optional()})),G(()=>B({$null:L().optional(),$exists:L().optional()}));var Xf=G(()=>B({$eq:Zd().optional(),$ne:Zd().optional(),$gt:V([I(),af(),Yf]).optional(),$gte:V([I(),af(),Yf]).optional(),$lt:V([I(),af(),Yf]).optional(),$lte:V([I(),af(),Yf]).optional(),$in:z(Zd()).optional(),$nin:z(Zd()).optional(),$between:mf([V([I(),af(),Yf]),V([I(),af(),Yf])]).optional(),$contains:F().optional(),$notContains:F().optional(),$startsWith:F().optional(),$endsWith:F().optional(),$null:L().optional(),$exists:L().optional()})),Zf=zf(()=>H(F(),R()).and(B({$and:z(Zf).optional(),$or:z(Zf).optional(),$not:Zf.optional()})));G(()=>B({where:Zf.optional()}));var Qf=zf(()=>B({$and:z(V([H(F(),Xf),Qf])).optional(),$or:z(V([H(F(),Xf),Qf])).optional(),$not:V([H(F(),Xf),Qf]).optional()})),$f=new Set([`=`,`==`,`!=`,`<>`,`>`,`>=`,`<`,`<=`,`in`,`nin`,`not_in`,`contains`,`notcontains`,`not_contains`,`like`,`startswith`,`starts_with`,`endswith`,`ends_with`,`between`,`is_null`,`is_not_null`]);function ep(e){if(!Array.isArray(e)||e.length===0)return!1;let t=e[0];if(typeof t==`string`){let n=t.toLowerCase();if(n===`and`||n===`or`)return e.length>=2&&e.slice(1).every(e=>ep(e));if(e.length>=2&&typeof e[1]==`string`)return $f.has(e[1].toLowerCase())}return e.every(e=>ep(e))?e.length>0:!1}var tp=[`$eq`,`$ne`,`$gt`,`$gte`,`$lt`,`$lte`,`$in`,`$nin`,`$between`,`$contains`,`$notContains`,`$startsWith`,`$endsWith`,`$null`,`$exists`],np=[`$and`,`$or`,`$not`];[...tp,...np];var rp=G(()=>B({field:F(),order:U([`asc`,`desc`]).default(`asc`)})),ip=U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`,`array_agg`,`string_agg`]),ap=U([`day`,`week`,`month`,`quarter`,`year`]),op=G(()=>V([F(),B({field:F().describe(`Field to group by`),dateGranularity:ap.optional().describe(`Bucket date values into uniform periods (day/week/month/quarter/year)`),alias:F().optional().describe(`Alias for the projected group value`)})])),sp=G(()=>B({function:ip.describe(`Aggregation function`),field:F().optional().describe(`Field to aggregate (optional for COUNT(*))`),alias:F().describe(`Result column alias`),distinct:L().optional().describe(`Apply DISTINCT before aggregation`),filter:Zf.optional().describe(`Filter/Condition to apply to the aggregation (FILTER WHERE clause)`)})),cp=U([`inner`,`left`,`right`,`full`]),lp=U([`auto`,`database`,`hash`,`loop`]),up=zf(()=>B({type:cp.describe(`Join type`),strategy:lp.optional().describe(`Execution strategy hint`),object:F().describe(`Object/table to join`),alias:F().optional().describe(`Table alias`),on:Zf.describe(`Join condition`),subquery:zf(()=>_p).optional().describe(`Subquery instead of object`)})),dp=U([`row_number`,`rank`,`dense_rank`,`percent_rank`,`lag`,`lead`,`first_value`,`last_value`,`sum`,`avg`,`count`,`min`,`max`]),fp=G(()=>B({partitionBy:z(F()).optional().describe(`PARTITION BY fields`),orderBy:z(rp).optional().describe(`ORDER BY specification`),frame:B({type:U([`rows`,`range`]).optional(),start:F().optional().describe(`Frame start (e.g., "UNBOUNDED PRECEDING", "1 PRECEDING")`),end:F().optional().describe(`Frame end (e.g., "CURRENT ROW", "1 FOLLOWING")`)}).optional().describe(`Window frame specification`)})),pp=G(()=>B({function:dp.describe(`Window function name`),field:F().optional().describe(`Field to operate on (for aggregate window functions)`),alias:F().describe(`Result column alias`),over:fp.describe(`Window specification (OVER clause)`)})),mp=zf(()=>V([F(),B({field:F(),fields:z(mp).optional(),alias:F().optional()})])),hp=G(()=>B({query:F().describe(`Search query text`),fields:z(F()).optional().describe(`Fields to search in (if not specified, searches all text fields)`),fuzzy:L().optional().default(!1).describe(`Enable fuzzy matching (tolerates typos)`),operator:U([`and`,`or`]).optional().default(`or`).describe(`Logical operator between terms`),boost:H(F(),I()).optional().describe(`Field-specific relevance boosting (field name -> boost factor)`),minScore:I().optional().describe(`Minimum relevance score threshold`),language:F().optional().describe(`Language for text analysis (e.g., "en", "zh", "es")`),highlight:L().optional().default(!1).describe(`Enable search result highlighting`)})),gp=B({object:F().describe(`Object name (e.g. account)`),fields:z(mp).optional().describe(`Fields to retrieve`),where:Zf.optional().describe(`Filtering criteria (WHERE)`),search:hp.optional().describe(`Full-text search configuration ($search parameter)`),orderBy:z(rp).optional().describe(`Sorting instructions (ORDER BY)`),limit:I().optional().describe(`Max records to return (LIMIT)`),offset:I().optional().describe(`Records to skip (OFFSET)`),top:I().optional().describe(`Alias for limit (OData compatibility)`),cursor:H(F(),R()).optional().describe(`Cursor for keyset pagination`),joins:z(up).optional().describe(`Explicit Table Joins`),aggregations:z(sp).optional().describe(`Aggregation functions`),groupBy:z(op).optional().describe("GROUP BY targets (strings or `{field, dateGranularity?}` objects for date bucketing)"),having:Zf.optional().describe(`HAVING clause for aggregation filtering`),windowFunctions:z(pp).optional().describe(`Window functions with OVER clause`),distinct:L().optional().describe(`SELECT DISTINCT flag`)}),_p=G(()=>gp.extend({expand:zf(()=>H(F(),_p)).optional().describe(`Recursive relation loading map. Keys are lookup/master_detail field names; values are nested QueryAST objects that control select, filter, sort, and further expansion on the related object. The engine resolves expand via batch $in queries (driver-agnostic) with a default max depth of 3.`)})),vp=[`today`,`yesterday`,`tomorrow`,`now`],yp=[`current_week_start`,`current_week_end`,`current_month_start`,`current_month_end`,`current_quarter_start`,`current_quarter_end`,`current_year_start`,`current_year_end`,`last_week_start`,`last_week_end`,`last_month_start`,`last_month_end`,`last_quarter_start`,`last_quarter_end`,`last_year_start`,`last_year_end`,`next_week_start`,`next_week_end`,`next_month_start`,`next_month_end`,`next_quarter_start`,`next_quarter_end`,`next_year_start`,`next_year_end`],bp=[`week_start`,`week_end`,`month_start`,`month_end`,`quarter_start`,`quarter_end`,`year_start`,`year_end`],xp=[...vp,...yp,...bp],Sp=/^(\d+)_(minutes?|hours?|days?|weeks?|months?|years?)_(ago|from_now)$/,Cp=[`minute`,`hour`,`day`,`week`,`month`,`year`];function wp(e){return xp.includes(e)||Sp.test(e)}F().refine(wp,{message:`Unknown date macro. Must be a fixed token (see DATE_MACRO_TOKENS) or match {N_<unit>_(ago|from_now)} where unit is one of: `+Cp.join(`, `)});var Tp=/^\$?\{([a-zA-Z0-9_]+)\}$/;F().refine(e=>{let t=e.match(Tp);return!!t&&wp(t[1])},{message:`Not a recognised {date-macro} placeholder`});var Ep=G(()=>F().min(2,{message:`System identifier must be at least 2 characters`}).regex(/^[a-z][a-z0-9_.]*$/,{message:`System identifier must be lowercase, starting with a letter, and may contain letters, numbers, underscores, or dots (e.g., "user_profile" or "order.created")`}).describe(`System identifier (lowercase with underscores or dots)`)),Dp=G(()=>F().min(2,{message:`Identifier must be at least 2 characters`}).regex(/^[a-z][a-z0-9_]*$/,{message:`Identifier must be lowercase snake_case, starting with a letter, and may contain only letters, numbers, and underscores (e.g., "user_profile")`}).describe(`Snake case identifier (lowercase with underscores only)`));G(()=>F().min(3,{message:`Event name must be at least 3 characters`}).regex(/^[a-z][a-z0-9_.]*$/,{message:`Event name must be lowercase with dots for namespacing (e.g., "user.created", "order.paid")`}).describe(`Event name (lowercase with dot notation for namespacing)`));var Op=U([`cel`,`js`,`cron`,`template`]),kp=B({rationale:F().optional(),generatedBy:F().optional()}),Ap=B({dialect:Op,source:F().min(1).optional(),ast:R().optional(),meta:kp.optional()}).refine(e=>e.source!==void 0||e.ast!==void 0,{message:"Expression requires at least one of `source` or `ast`"}),jp=V([F().min(1).transform(e=>({dialect:`cel`,source:e})),Ap]);V([F().min(1).transform(e=>({dialect:`cron`,source:e})),Ap]);var Mp=V([F().min(1).transform(e=>({dialect:`template`,source:e})),Ap]),Np=G(()=>U([`aes-256-gcm`,`aes-256-cbc`,`chacha20-poly1305`]).describe(`Supported encryption algorithm`)),Pp=G(()=>U([`local`,`aws-kms`,`azure-key-vault`,`gcp-kms`,`hashicorp-vault`]).describe(`Key management service provider`)),Fp=G(()=>B({enabled:L().default(!1).describe(`Enable automatic key rotation`),frequencyDays:I().min(1).default(90).describe(`Rotation frequency in days`),retainOldVersions:I().default(3).describe(`Number of old key versions to retain`),autoRotate:L().default(!0).describe(`Automatically rotate without manual approval`)}).describe(`Policy for automatic encryption key rotation`)),Ip=G(()=>B({enabled:L().default(!1).describe(`Enable field-level encryption`),algorithm:Np.default(`aes-256-gcm`).describe(`Encryption algorithm`),keyManagement:B({provider:Pp.describe(`Key management service provider`),keyId:F().optional().describe(`Key identifier in the provider`),rotationPolicy:Fp.optional().describe(`Key rotation policy`)}).describe(`Key management configuration`),scope:U([`field`,`record`,`table`,`database`]).describe(`Encryption scope level`),deterministicEncryption:L().default(!1).describe(`Allows equality queries on encrypted data`),searchableEncryption:L().default(!1).describe(`Allows search on encrypted data`)}).describe(`Field-level encryption configuration`));G(()=>B({fieldName:F().describe(`Name of the field to encrypt`),encryptionConfig:Ip.describe(`Encryption settings for this field`),indexable:L().default(!1).describe(`Allow indexing on encrypted field`)}).describe(`Per-field encryption assignment`));var Lp=G(()=>U([`redact`,`partial`,`hash`,`tokenize`,`randomize`,`nullify`,`substitute`]).describe(`Data masking strategy for PII protection`)),Rp=G(()=>B({field:F().describe(`Field name to apply masking to`),strategy:Lp.describe(`Masking strategy to use`),pattern:F().optional().describe(`Regex pattern for partial masking`),preserveFormat:L().default(!0).describe(`Keep the original data format after masking`),preserveLength:L().default(!0).describe(`Keep the original data length after masking`),roles:z(F()).optional().describe(`Roles that see masked data`),exemptRoles:z(F()).optional().describe(`Roles that see unmasked data`)}).describe(`Masking rule for a single field`));G(()=>B({enabled:L().default(!1).describe(`Enable data masking`),rules:z(Rp).describe(`List of field-level masking rules`),auditUnmasking:L().default(!0).describe(`Log when masked data is accessed unmasked`)}).describe(`Top-level data masking configuration for PII protection`));var zp=U(`text.textarea.email.url.phone.password.markdown.html.richtext.number.currency.percent.date.datetime.time.boolean.toggle.select.multiselect.radio.checkboxes.lookup.master_detail.tree.image.file.avatar.video.audio.formula.summary.autonumber.composite.repeater.location.address.code.json.color.rating.slider.signature.qrcode.progress.tags.vector`.split(`.`)),Bp=G(()=>B({label:F().describe(`Display label (human-readable, any case allowed)`),value:Ep.describe(`Stored value (lowercase machine identifier)`),color:F().optional().describe(`Color code for badges/charts`),default:L().optional().describe(`Is default option`)}));G(()=>B({latitude:I().min(-90).max(90).describe(`Latitude coordinate`),longitude:I().min(-180).max(180).describe(`Longitude coordinate`),altitude:I().optional().describe(`Altitude in meters`),accuracy:I().optional().describe(`Accuracy in meters`)}));var Vp=G(()=>B({precision:I().int().min(0).max(10).default(2).describe(`Decimal precision (default: 2)`),currencyMode:U([`dynamic`,`fixed`]).default(`dynamic`).describe(`Currency mode: dynamic (user selectable) or fixed (single currency)`),defaultCurrency:F().length(3).default(`CNY`).describe(`Default or fixed currency code (ISO 4217, e.g., USD, CNY, EUR)`)}));G(()=>B({value:I().describe(`Monetary amount`),currency:F().length(3).describe(`Currency code (ISO 4217)`)})),G(()=>B({street:F().optional().describe(`Street address`),city:F().optional().describe(`City name`),state:F().optional().describe(`State/Province`),postalCode:F().optional().describe(`Postal/ZIP code`),country:F().optional().describe(`Country name or code`),countryCode:F().optional().describe(`ISO country code (e.g., US, GB)`),formatted:F().optional().describe(`Formatted address string`)}));var Hp=G(()=>B({dimensions:I().int().min(1).max(1e4).describe(`Vector dimensionality (e.g., 1536 for OpenAI embeddings)`),distanceMetric:U([`cosine`,`euclidean`,`dotProduct`,`manhattan`]).default(`cosine`).describe(`Distance/similarity metric for vector search`),normalized:L().default(!1).describe(`Whether vectors are normalized (unit length)`),indexed:L().default(!0).describe(`Whether to create a vector index for fast similarity search`),indexType:U([`hnsw`,`ivfflat`,`flat`]).optional().describe(`Vector index algorithm (HNSW for high accuracy, IVFFlat for large datasets)`)})),Up=G(()=>B({minSize:I().min(0).optional().describe(`Minimum file size in bytes`),maxSize:I().min(1).optional().describe(`Maximum file size in bytes (e.g., 10485760 = 10MB)`),allowedTypes:z(F()).optional().describe(`Allowed file extensions (e.g., [".pdf", ".docx", ".jpg"])`),blockedTypes:z(F()).optional().describe(`Blocked file extensions (e.g., [".exe", ".bat", ".sh"])`),allowedMimeTypes:z(F()).optional().describe(`Allowed MIME types (e.g., ["image/jpeg", "application/pdf"])`),blockedMimeTypes:z(F()).optional().describe(`Blocked MIME types`),virusScan:L().default(!1).describe(`Enable virus scanning for uploaded files`),virusScanProvider:U([`clamav`,`virustotal`,`metadefender`,`custom`]).optional().describe(`Virus scanning service provider`),virusScanOnUpload:L().default(!0).describe(`Scan files immediately on upload`),quarantineOnThreat:L().default(!0).describe(`Quarantine files if threat detected`),storageProvider:F().optional().describe(`Object storage provider name (references ObjectStorageConfig)`),storageBucket:F().optional().describe(`Target bucket name`),storagePrefix:F().optional().describe(`Storage path prefix (e.g., "uploads/documents/")`),imageValidation:B({minWidth:I().min(1).optional().describe(`Minimum image width in pixels`),maxWidth:I().min(1).optional().describe(`Maximum image width in pixels`),minHeight:I().min(1).optional().describe(`Minimum image height in pixels`),maxHeight:I().min(1).optional().describe(`Maximum image height in pixels`),aspectRatio:F().optional().describe(`Required aspect ratio (e.g., "16:9", "1:1")`),generateThumbnails:L().default(!1).describe(`Auto-generate thumbnails`),thumbnailSizes:z(B({name:F().describe(`Thumbnail variant name (e.g., "small", "medium", "large")`),width:I().min(1).describe(`Thumbnail width in pixels`),height:I().min(1).describe(`Thumbnail height in pixels`),crop:L().default(!1).describe(`Crop to exact dimensions`)})).optional().describe(`Thumbnail size configurations`),preserveMetadata:L().default(!1).describe(`Preserve EXIF metadata`),autoRotate:L().default(!0).describe(`Auto-rotate based on EXIF orientation`)}).optional().describe(`Image-specific validation rules`),allowMultiple:L().default(!1).describe(`Allow multiple file uploads (overrides field.multiple)`),allowReplace:L().default(!0).describe(`Allow replacing existing files`),allowDelete:L().default(!0).describe(`Allow deleting uploaded files`),requireUpload:L().default(!1).describe(`Require at least one file when field is required`),extractMetadata:L().default(!0).describe(`Extract file metadata (name, size, type, etc.)`),extractText:L().default(!1).describe(`Extract text content from documents (OCR/parsing)`),versioningEnabled:L().default(!1).describe(`Keep previous versions of replaced files`),maxVersions:I().min(1).optional().describe(`Maximum number of versions to retain`),publicRead:L().default(!1).describe(`Allow public read access to uploaded files`),presignedUrlExpiry:I().min(60).max(604800).default(3600).describe(`Presigned URL expiration in seconds (default: 1 hour)`)}).refine(e=>!(e.minSize!==void 0&&e.maxSize!==void 0&&e.minSize>e.maxSize),{message:`minSize must be less than or equal to maxSize`}).refine(e=>!(e.virusScanProvider!==void 0&&e.virusScan!==!0),{message:`virusScanProvider requires virusScan to be enabled`})),Wp=G(()=>B({uniqueness:L().default(!1).describe(`Enforce unique values across all records`),completeness:I().min(0).max(1).default(0).describe(`Minimum ratio of non-null values (0-1, default: 0 = no requirement)`),accuracy:B({source:F().describe(`Reference data source for validation (e.g., "api.verify.com", "master_data")`),threshold:I().min(0).max(1).describe(`Minimum accuracy threshold (0-1, e.g., 0.95 = 95% match required)`)}).optional().describe(`Accuracy validation configuration`)})),Gp=G(()=>B({enabled:L().describe(`Enable caching for computed field results`),ttl:I().min(0).describe(`Cache TTL in seconds (0 = no expiration)`),invalidateOn:z(F()).describe(`Field paths that invalidate cache (e.g., ["inventory.quantity", "pricing.base_price"])`)})),Kp=G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Machine name (snake_case)`).optional(),label:F().optional().describe(`Human readable label`),type:zp.describe(`Field Data Type`),description:F().optional().describe(`Tooltip/Help text`),format:F().optional().describe(`Format string (e.g. email, phone)`),columnName:F().optional().describe(`Physical column name in the target datasource. Defaults to the field key when not set.`),required:L().default(!1).describe(`Is required`),searchable:L().default(!1).describe(`Is searchable`),multiple:L().default(!1).describe(`Allow multiple values (Stores as Array/JSON). Applicable for select, lookup, file, image.`),unique:L().default(!1).describe(`Is unique constraint`),defaultValue:R().optional().describe(`Default value`),maxLength:I().optional().describe(`Max character length`),minLength:I().optional().describe(`Min character length`),precision:I().optional().describe(`Total digits`),scale:I().optional().describe(`Decimal places`),min:I().optional().describe(`Minimum value`),max:I().optional().describe(`Maximum value`),options:z(Bp).optional().describe(`Static options for select/multiselect`),reference:F().optional().describe(`Target object name (snake_case) for lookup/master_detail fields. Required for relationship types. Used by $expand to resolve foreign key IDs into full objects.`),referenceFilters:z(F()).optional().describe(`Filters applied to lookup dialogs (e.g. "active = true")`),writeRequiresMasterRead:L().optional().describe(`If true, user needs read access to master record to edit this field`),deleteBehavior:U([`set_null`,`cascade`,`restrict`]).optional().default(`set_null`).describe(`What happens if referenced record is deleted`),expression:jp.optional().describe("Formula expression (CEL). e.g. F`record.amount * 0.1`"),summaryOperations:B({object:F().describe(`Source child object name for roll-up`),field:F().describe(`Field on child object to aggregate`),function:U([`count`,`sum`,`min`,`max`,`avg`]).describe(`Aggregation function to apply`)}).optional().describe(`Roll-up summary definition`),language:F().optional().describe(`Programming language for syntax highlighting (e.g., javascript, python, sql)`),theme:F().optional().describe(`Code editor theme (e.g., dark, light, monokai)`),lineNumbers:L().optional().describe(`Show line numbers in code editor`),maxRating:I().optional().describe(`Maximum rating value (default: 5)`),allowHalf:L().optional().describe(`Allow half-star ratings`),displayMap:L().optional().describe(`Display map widget for location field`),allowGeocoding:L().optional().describe(`Allow address-to-coordinate conversion`),addressFormat:U([`us`,`uk`,`international`]).optional().describe(`Address format template`),colorFormat:U([`hex`,`rgb`,`rgba`,`hsl`]).optional().describe(`Color value format`),allowAlpha:L().optional().describe(`Allow transparency/alpha channel`),presetColors:z(F()).optional().describe(`Preset color options`),step:I().optional().describe(`Step increment for slider (default: 1)`),showValue:L().optional().describe(`Display current value on slider`),marks:H(F(),F()).optional().describe(`Custom marks/labels at specific values (e.g., {0: "Low", 50: "Medium", 100: "High"})`),barcodeFormat:U([`qr`,`ean13`,`ean8`,`code128`,`code39`,`upca`,`upce`]).optional().describe(`Barcode format type`),qrErrorCorrection:U([`L`,`M`,`Q`,`H`]).optional().describe(`QR code error correction level (L=7%, M=15%, Q=25%, H=30%). Only applicable when barcodeFormat is "qr"`),displayValue:L().optional().describe(`Display human-readable value below barcode/QR code`),allowScanning:L().optional().describe(`Enable camera scanning for barcode/QR code input`),currencyConfig:Vp.optional().describe(`Configuration for currency field type`),vectorConfig:Hp.optional().describe(`Configuration for vector field type (AI/ML embeddings)`),fileAttachmentConfig:Up.optional().describe(`Configuration for file and attachment field types`),encryptionConfig:Ip.optional().describe(`Field-level encryption configuration for sensitive data (GDPR/HIPAA/PCI-DSS)`),maskingRule:Rp.optional().describe(`Data masking rules for PII protection`),auditTrail:L().default(!1).describe(`Enable detailed audit trail for this field (tracks all changes with user and timestamp)`),dependencies:z(F()).optional().describe(`Array of field names that this field depends on (for formulas, visibility rules, etc.)`),cached:Gp.optional().describe(`Caching configuration for computed/formula fields`),dataQuality:Wp.optional().describe(`Data quality validation and monitoring rules`),group:F().optional().describe(`Field group name for organizing fields in forms and layouts (e.g., "contact_info", "billing", "system")`),conditionalRequired:jp.optional().describe("Predicate (CEL) — field is required when TRUE. e.g. P`record.status == 'closed_won'`"),hidden:L().default(!1).describe(`Hidden from default UI`),readonly:L().default(!1).describe(`Read-only in UI`),system:L().optional().describe(`Auto-injected system/audit field (e.g. created_at, updated_by, organization_id). Tools that surface system fields separately from author-declared business fields should branch on this flag.`),sortable:L().optional().default(!0).describe(`Whether field is sortable in list views`),inlineHelpText:F().optional().describe(`Help text displayed below the field in forms`),trackFeedHistory:L().optional().describe(`Track field changes in Chatter/activity feed (Salesforce pattern)`),caseSensitive:L().optional().describe(`Whether text comparisons are case-sensitive`),autonumberFormat:F().optional().describe(`Auto-number display format pattern (e.g., "CASE-{0000}")`),index:L().default(!1).describe(`Create standard database index`),externalId:L().default(!1).describe(`Is external ID for upsert operations`)})),qp=B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique rule name (snake_case)`),label:F().optional().describe(`Human-readable label for the rule listing`),description:F().optional().describe(`Administrative notes explaining the business reason`),active:L().default(!0),events:z(U([`insert`,`update`,`delete`])).default([`insert`,`update`]).describe(`Validation contexts`),priority:I().int().min(0).max(9999).default(100).describe(`Execution priority (lower runs first, default: 100)`),tags:z(F()).optional().describe(`Categorization tags (e.g., "compliance", "billing")`),severity:U([`error`,`warning`,`info`]).default(`error`),message:F().describe(`Error message to display to the user`)}),Jp=G(()=>qp.extend({type:W(`script`),condition:jp.describe("Predicate (CEL). If TRUE, validation fails. e.g. P`record.amount < 0`")})),Yp=G(()=>qp.extend({type:W(`unique`),fields:z(F()).describe(`Fields that must be combined unique`),scope:jp.optional().describe("Predicate (CEL) limiting uniqueness scope. e.g. P`record.active == true`"),caseSensitive:L().default(!0)})),Xp=G(()=>qp.extend({type:W(`state_machine`),field:F().describe(`State field (e.g. status)`),transitions:H(F(),z(F())).describe(`Map of { OldState: [AllowedNewStates] }`)})),Zp=G(()=>qp.extend({type:W(`format`),field:F(),regex:F().optional(),format:U([`email`,`url`,`phone`,`json`]).optional()})),Qp=G(()=>qp.extend({type:W(`cross_field`),condition:jp.describe("Predicate (CEL) comparing fields. e.g. P`record.end_date > record.start_date`"),fields:z(F()).describe(`Fields involved in the validation`)})),$p=G(()=>qp.extend({type:W(`json_schema`),field:F().describe(`JSON field to validate`),schema:H(F(),R()).describe(`JSON Schema object definition`)})),em=G(()=>qp.extend({type:W(`async`),field:F().describe(`Field to validate`),validatorUrl:F().optional().describe(`External API endpoint for validation`),method:U([`GET`,`POST`]).default(`GET`).describe(`HTTP method for external call`),headers:H(F(),F()).optional().describe(`Custom headers for the request`),validatorFunction:F().optional().describe(`Reference to custom validator function`),timeout:I().optional().default(5e3).describe(`Timeout in milliseconds`),debounce:I().optional().describe(`Debounce delay in milliseconds`),params:H(F(),R()).optional().describe(`Additional parameters to pass to validator`)})),tm=G(()=>qp.extend({type:W(`custom`),handler:F().describe(`Name of the custom validation function registered in the system`),params:H(F(),R()).optional().describe(`Parameters passed to the custom handler`)})),nm=zf(()=>uf(`type`,[Jp,Yp,Xp,Zp,Qp,$p,em,tm,rm])),rm=G(()=>qp.extend({type:W(`conditional`),when:jp.describe("Predicate (CEL). e.g. P`record.type == 'enterprise'`"),then:nm.describe(`Validation rule to apply when condition is true`),otherwise:nm.optional().describe(`Validation rule to apply when condition is false`)})),im=G(()=>V([F().describe(`Action Name`),B({type:F(),params:H(F(),R()).optional()})])),am=G(()=>V([F().describe(`Guard Name (e.g., "isManager", "amountGT1000")`),B({type:F(),params:H(F(),R()).optional()})])),om=G(()=>B({target:F().optional().describe(`Target State ID`),cond:am.optional().describe(`Condition (Guard) required to take this path`),actions:z(im).optional().describe(`Actions to execute during transition`),description:F().optional().describe(`Human readable description of this rule`)}));G(()=>B({type:F().describe(`Event Type (e.g. "APPROVE", "REJECT", "Submit")`),schema:H(F(),R()).optional().describe(`Expected event payload structure`)}));var sm=zf(()=>B({type:U([`atomic`,`compound`,`parallel`,`final`,`history`]).default(`atomic`),entry:z(im).optional().describe(`Actions to run when entering this state`),exit:z(im).optional().describe(`Actions to run when leaving this state`),on:H(F(),V([F(),om,z(om)])).optional().describe(`Map of Event Type -> Transition Definition`),always:z(om).optional(),initial:F().optional().describe(`Initial child state (if compound)`),states:H(F(),sm).optional(),meta:B({label:F().optional(),description:F().optional(),color:F().optional(),aiInstructions:F().optional().describe(`Specific instructions for AI when in this state`)}).optional()})),cm=G(()=>B({id:Dp.describe(`Unique Machine ID`),description:F().optional(),contextSchema:H(F(),R()).optional().describe(`Zod Schema for the machine context/memory`),initial:F().describe(`Initial State ID`),states:H(F(),sm).describe(`State Nodes`),on:H(F(),V([F(),om,z(om)])).optional()}));G(()=>B({key:F().describe(`Translation key (e.g., "views.task_list.label")`),defaultValue:F().optional().describe(`Fallback value when translation key is not found`),params:H(F(),V([F(),I(),L()])).optional().describe(`Interpolation parameters (e.g., { count: 5 })`)}));var lm=G(()=>F().describe(`Display label (plain string; i18n keys are auto-generated by the framework)`)),um=G(()=>B({ariaLabel:lm.optional().describe(`Accessible label for screen readers (WAI-ARIA aria-label)`),ariaDescribedBy:F().optional().describe(`ID of element providing additional description (WAI-ARIA aria-describedby)`),role:F().optional().describe(`WAI-ARIA role attribute (e.g., "dialog", "navigation", "alert")`)}).describe(`ARIA accessibility attributes`));G(()=>B({key:F().describe(`Translation key`),zero:F().optional().describe(`Zero form (e.g., "No items")`),one:F().optional().describe(`Singular form (e.g., "{count} item")`),two:F().optional().describe(`Dual form (e.g., "{count} items" for exactly 2)`),few:F().optional().describe(`Few form (e.g., for 2-4 in some languages)`),many:F().optional().describe(`Many form (e.g., for 5+ in some languages)`),other:F().describe(`Default plural form (e.g., "{count} items")`)}).describe(`ICU plural rules for a translation key`));var dm=G(()=>B({style:U([`decimal`,`currency`,`percent`,`unit`]).default(`decimal`).describe(`Number formatting style`),currency:F().optional().describe(`ISO 4217 currency code (e.g., "USD", "EUR")`),unit:F().optional().describe(`Unit for unit formatting (e.g., "kilometer", "liter")`),minimumFractionDigits:I().optional().describe(`Minimum number of fraction digits`),maximumFractionDigits:I().optional().describe(`Maximum number of fraction digits`),useGrouping:L().optional().describe(`Whether to use grouping separators (e.g., 1,000)`)}).describe(`Number formatting rules`)),fm=G(()=>B({dateStyle:U([`full`,`long`,`medium`,`short`]).optional().describe(`Date display style`),timeStyle:U([`full`,`long`,`medium`,`short`]).optional().describe(`Time display style`),timeZone:F().optional().describe(`IANA time zone (e.g., "America/New_York")`),hour12:L().optional().describe(`Use 12-hour format`)}).describe(`Date/time formatting rules`));G(()=>B({code:F().describe(`BCP 47 language code (e.g., "en-US", "zh-CN")`),fallbackChain:z(F()).optional().describe(`Fallback language codes in priority order (e.g., ["zh-TW", "en"])`),direction:U([`ltr`,`rtl`]).default(`ltr`).describe(`Text direction: left-to-right or right-to-left`),numberFormat:dm.optional().describe(`Default number formatting rules`),dateFormat:fm.optional().describe(`Default date/time formatting rules`)}).describe(`Locale configuration`));var pm=U([`api.read`,`api.write`,`crypto.uuid`,`crypto.hash`,`log`]),mm=uf(`language`,[B({language:W(`expression`),source:F().min(1).describe(`Formula expression source`)}).describe(`L1 expression body — pure formula, no IO`),B({language:W(`js`),source:F().min(1).describe(`Function body source`),capabilities:z(pm).default([]).describe(`Granted capability tokens`),timeoutMs:I().int().positive().max(3e4).optional().describe(`Per-invocation timeout (ms)`),memoryMb:I().int().positive().max(256).optional().describe(`Per-invocation memory cap (MB)`)}).describe(`L2 sandboxed JS body — runs inside an isolated VM with declared capabilities`)]).describe(`Hook/Action body — expression (L1) or sandboxed JS (L2)`),hm=G(()=>B({name:F().optional(),field:Dp.optional(),objectOverride:Dp.optional(),label:lm.optional(),type:zp.optional(),required:L().optional().default(!1),options:z(B({label:lm,value:F()})).optional(),placeholder:F().optional(),helpText:F().optional(),defaultValue:R().optional(),defaultFromRow:L().optional()}).refine(e=>!!e.name||!!e.field,{message:`ActionParam requires either "name" or "field"`})),gm=U([`script`,`url`,`modal`,`flow`,`api`,`form`]),_m=new Set(gm.options.filter(e=>e!==`script`)),vm=G(()=>B({name:Dp.describe(`Machine name (lowercase snake_case)`),label:lm.describe(`Display label`),objectName:F().regex(/^[a-z_][a-z0-9_]*$/).optional().describe(`Target object this action belongs to. When set, the action is auto-merged into the object's actions array by defineStack().`),icon:F().optional().describe(`Icon name`),locations:z(U([`list_toolbar`,`list_item`,`record_header`,`record_more`,`record_related`,`global_nav`])).optional().describe(`Locations where this action is visible`),component:U([`action:button`,`action:icon`,`action:menu`,`action:group`]).optional().describe(`Visual component override`),type:gm.default(`script`).describe(`Action functionality type`),target:F().optional().describe(`URL, Script Name, Flow ID, or API Endpoint`),body:mm.optional().describe("Action body — expression (L1) or sandboxed JS (L2). Only used when type is `script`."),execute:F().optional().describe(`@deprecated — Use target instead. Auto-migrated to target during parsing.`),params:z(hm).optional().describe(`Input parameters required from user`),variant:U([`primary`,`secondary`,`danger`,`ghost`,`link`]).optional().describe(`Button visual variant for styling (primary = highlighted, danger = destructive, ghost = transparent)`),confirmText:lm.optional().describe(`Confirmation message before execution`),successMessage:lm.optional().describe(`Success message to show after execution`),refreshAfter:L().default(!1).describe(`Refresh view after execution`),visible:jp.optional().describe(`Visibility predicate (CEL).`),disabled:V([L(),jp]).optional().describe(`Boolean or predicate (CEL) — action is disabled when TRUE.`),shortcut:F().optional().describe(`Keyboard shortcut to trigger this action (e.g., "Ctrl+S")`),bulkEnabled:L().optional().describe(`Whether this action can be applied to multiple selected records`),aiExposed:L().optional().describe(`Set to false to keep this action out of the AI tool registry.`),recordIdParam:F().optional().describe(`Body key to inject the row id into when running from a list_item context.`),recordIdField:F().optional().describe(`Row field whose value seeds recordIdParam. Defaults to "id".`),bodyShape:V([W(`flat`),B({wrap:F()})]).optional().describe(`Body wrapping: flat (default) or { wrap: key } to nest user-collected params under a key.`),method:U([`POST`,`PATCH`,`PUT`,`DELETE`]).optional().describe(`HTTP method for type:"api" actions. Defaults to POST.`),bodyExtra:H(F(),R()).optional().describe(`Constant body fields merged into the API request (applied last; overrides user params).`),mode:U([`create`,`edit`,`delete`,`custom`]).optional().describe(`Semantic mode of the action.`),timeout:I().optional().describe(`Maximum execution time in milliseconds for the action`),aria:um.optional().describe(`ARIA accessibility attributes`)}).transform(e=>e.execute&&!e.target?{...e,target:e.execute}:e).refine(e=>!(_m.has(e.type)&&!e.target),{message:`Action 'target' is required when type is 'url', 'flow', 'modal', 'api', or 'form'.`,path:[`target`]})),ym=G(()=>B({enabled:L().default(!1).describe(`Enable public sharing`),publicLink:F().optional().describe(`Generated public share URL`),password:F().optional().describe(`Password required to access shared link`),allowedDomains:z(F()).optional().describe(`Restrict access to specific email domains (e.g. ["example.com"])`),expiresAt:F().optional().describe(`Expiration date/time in ISO 8601 format`),allowAnonymous:L().optional().default(!1).describe(`Allow access without authentication`)}));G(()=>B({enabled:L().default(!1).describe(`Enable iframe embedding`),allowedOrigins:z(F()).optional().describe(`Allowed iframe parent origins (e.g. ["https://example.com"])`),width:F().optional().default(`100%`).describe(`Embed width (CSS value)`),height:F().optional().default(`600px`).describe(`Embed height (CSS value)`),showHeader:L().optional().default(!0).describe(`Show interface header in embed`),showNavigation:L().optional().default(!1).describe(`Show navigation in embed`),responsive:L().optional().default(!0).describe(`Enable responsive resizing`)}));var bm=U([`xs`,`sm`,`md`,`lg`,`xl`,`2xl`]),xm=G(()=>B({xs:I().min(1).max(12).optional(),sm:I().min(1).max(12).optional(),md:I().min(1).max(12).optional(),lg:I().min(1).max(12).optional(),xl:I().min(1).max(12).optional(),"2xl":I().min(1).max(12).optional()}).describe(`Grid columns per breakpoint (1-12)`)),Sm=G(()=>B({xs:I().optional(),sm:I().optional(),md:I().optional(),lg:I().optional(),xl:I().optional(),"2xl":I().optional()}).describe(`Display order per breakpoint`)),Cm=G(()=>B({breakpoint:bm.optional().describe(`Minimum breakpoint for visibility`),hiddenOn:z(bm).optional().describe(`Hide on these breakpoints`),columns:xm.optional().describe(`Grid columns per breakpoint`),order:Sm.optional().describe(`Display order per breakpoint`)}).describe(`Responsive layout configuration`)),wm=G(()=>B({lazyLoad:L().optional().describe(`Enable lazy loading (defer rendering until visible)`),virtualScroll:B({enabled:L().default(!1).describe(`Enable virtual scrolling`),itemHeight:I().optional().describe(`Fixed item height in pixels (for estimation)`),overscan:I().optional().describe(`Number of extra items to render outside viewport`)}).optional().describe(`Virtual scrolling configuration`),cacheStrategy:U([`none`,`cache-first`,`network-first`,`stale-while-revalidate`]).optional().describe(`Client-side data caching strategy`),prefetch:L().optional().describe(`Prefetch data before component is visible`),pageSize:I().optional().describe(`Number of items per page for pagination`),debounceMs:I().optional().describe(`Debounce interval for user interactions in milliseconds`)}).describe(`Performance optimization configuration`)),Tm=U([`GET`,`POST`,`PUT`,`DELETE`,`PATCH`,`HEAD`,`OPTIONS`]),Em=G(()=>U([`GET`,`POST`,`PUT`,`PATCH`,`DELETE`])),Dm=G(()=>B({url:F().describe(`API endpoint URL`),method:Em.optional().default(`GET`).describe(`HTTP method`),headers:H(F(),F()).optional().describe(`Custom HTTP headers`),params:H(F(),R()).optional().describe(`Query parameters`),body:R().optional().describe(`Request body for POST/PUT/PATCH`)}));G(()=>B({enabled:L().default(!0).describe(`Enable CORS`),origins:V([F(),z(F())]).default(`*`).describe(`Allowed origins (* for all)`),methods:z(Tm).optional().describe(`Allowed HTTP methods`),credentials:L().default(!1).describe(`Allow credentials (cookies, authorization headers)`),maxAge:I().int().optional().describe(`Preflight cache duration in seconds`)})),G(()=>B({enabled:L().default(!1).describe(`Enable rate limiting`),windowMs:I().int().default(6e4).describe(`Time window in milliseconds`),maxRequests:I().int().default(100).describe(`Max requests per window`)})),G(()=>B({path:F().describe(`URL path to serve from`),directory:F().describe(`Physical directory to serve`),cacheControl:F().optional().describe(`Cache-Control header value`)}));var Om=G(()=>uf(`provider`,[B({provider:W(`object`),object:F().describe(`Target object name`)}),B({provider:W(`api`),read:Dm.optional().describe(`Configuration for fetching data`),write:Dm.optional().describe(`Configuration for submitting data (for forms/editable tables)`)}),B({provider:W(`value`),items:z(R()).describe(`Static data array`)}),B({provider:W(`schema`),schemaId:F().describe(`Schema identifier — typically the metadata type name`),schema:H(F(),R()).optional().describe(`Inline JSON Schema (Draft 2020-12). Optional when schemaId is resolvable.`)})])),km=G(()=>B({field:F().describe(`Field name to filter on`),operator:F().describe(`Filter operator (e.g. equals, not_equals, contains, this_quarter)`),value:V([F(),I(),L(),Yd(),z(V([F(),I()]))]).optional().describe(`Filter value`)}).describe(`View filter rule`)),Am=G(()=>U([`none`,`count`,`count_empty`,`count_filled`,`count_unique`,`percent_empty`,`percent_filled`,`sum`,`avg`,`min`,`max`]).describe(`Aggregation function for column footer summary`)),jm=G(()=>B({field:F().describe(`Field name (snake_case)`),label:lm.optional().describe(`Display label override`),width:I().positive().optional().describe(`Column width in pixels`),align:U([`left`,`center`,`right`]).optional().describe(`Text alignment`),hidden:L().optional().describe(`Hide column by default`),sortable:L().optional().describe(`Allow sorting by this column`),resizable:L().optional().describe(`Allow resizing this column`),wrap:L().optional().describe(`Allow text wrapping`),type:F().optional().describe(`Renderer type override (e.g., "currency", "date")`),pinned:U([`left`,`right`]).optional().describe(`Pin/freeze column to left or right side`),summary:Am.optional().describe(`Footer aggregation function for this column`),link:L().optional().describe(`Functions as the primary navigation link (triggers View navigation)`),action:F().optional().describe(`Registered Action ID to execute when clicked`)})),Mm=G(()=>B({type:U([`none`,`single`,`multiple`]).default(`none`).describe(`Selection mode`)})),Nm=G(()=>B({pageSize:I().int().positive().default(25).describe(`Number of records per page`),pageSizeOptions:z(I().int().positive()).optional().describe(`Available page size options`)})),Pm=G(()=>U([`compact`,`short`,`medium`,`tall`,`extra_tall`]).describe(`Row height / density setting for list view`)),Fm=G(()=>B({field:F().describe(`Field name to group by`),order:U([`asc`,`desc`]).default(`asc`).describe(`Group sort order`),collapsed:L().default(!1).describe(`Collapse groups by default`)})),Im=G(()=>B({fields:z(Fm).min(1).describe(`Fields to group by (supports up to 3 levels)`)}).describe(`Record grouping configuration`)),Lm=G(()=>B({coverField:F().optional().describe(`Attachment/image field to display as card cover`),coverFit:U([`cover`,`contain`]).default(`cover`).describe(`Image fit mode for card cover`),cardSize:U([`small`,`medium`,`large`]).default(`medium`).describe(`Card size in gallery view`),titleField:F().optional().describe(`Field to display as card title`),visibleFields:z(F()).optional().describe(`Fields to display on card body`)}).describe(`Gallery/card view configuration`)),Rm=G(()=>B({startDateField:F().describe(`Field for timeline item start date`),endDateField:F().optional().describe(`Field for timeline item end date`),titleField:F().describe(`Field to display as timeline item title`),groupByField:F().optional().describe(`Field to group timeline rows`),colorField:F().optional().describe(`Field to determine item color`),scale:U([`hour`,`day`,`week`,`month`,`quarter`,`year`]).default(`week`).describe(`Default timeline scale`)}).describe(`Timeline view configuration`)),zm=G(()=>B({type:U([`personal`,`collaborative`]).default(`collaborative`).describe(`View ownership type`),lockedBy:F().optional().describe(`User who locked the view configuration`)}).describe(`View sharing and access configuration`)),Bm=G(()=>B({field:F().describe(`Field to derive color from (typically a select/status field)`),colors:H(F(),F()).optional().describe(`Map of field value to color (hex/token)`)}).describe(`Row color configuration based on field values`)),Vm=G(()=>U([`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`]).describe(`Visualization type that users can switch to`)),Hm=G(()=>B({sort:L().default(!0).describe(`Allow users to sort records`),search:L().default(!0).describe(`Allow users to search records`),filter:L().default(!0).describe(`Allow users to filter records`),rowHeight:L().default(!0).describe(`Allow users to toggle row height/density`),addRecordForm:L().default(!1).describe(`Add records through a form instead of inline`),buttons:z(F()).optional().describe(`Custom action button IDs to show in the toolbar`)}).describe(`User action toggles for the view toolbar`)),Um=G(()=>B({showDescription:L().default(!0).describe(`Show the view description text`),allowedVisualizations:z(Vm).optional().describe(`Whitelist of visualization types users can switch between (e.g. ["grid", "gallery", "kanban"])`)}).describe(`Appearance and visualization configuration`)),Wm=G(()=>B({name:Dp.describe(`Tab identifier (snake_case)`),label:lm.optional().describe(`Display label`),icon:F().optional().describe(`Tab icon name`),view:F().optional().describe(`Referenced list view name from listViews`),filter:z(km).optional().describe(`Tab-specific filter criteria`),order:I().int().min(0).optional().describe(`Tab display order`),pinned:L().default(!1).describe(`Pin tab (cannot be removed by users)`),isDefault:L().default(!1).describe(`Set as the default active tab`),visible:L().default(!0).describe(`Tab visibility`)}).describe(`Tab configuration for multi-tab view interface`)),Gm=G(()=>B({enabled:L().default(!0).describe(`Show the add record entry point`),position:U([`top`,`bottom`,`both`]).default(`bottom`).describe(`Position of the add record button`),mode:U([`inline`,`form`,`modal`]).default(`inline`).describe(`How to add a new record`),formView:F().optional().describe(`Named form view to use when mode is "form" or "modal"`)}).describe(`Add record entry point configuration`)),Km=G(()=>B({groupByField:F().describe(`Field to group columns by (usually status/select)`),summarizeField:F().optional().describe(`Field to sum at top of column (e.g. amount)`),columns:z(F()).describe(`Fields to show on cards`)})),qm=G(()=>B({chartType:U([`bar`,`line`,`pie`,`area`,`scatter`]).default(`bar`).describe(`Chart visualisation type`),xAxisField:F().describe(`Field used as the X axis / category dimension`),yAxisFields:z(F()).min(1).describe(`Field(s) used as the Y axis / measures`),aggregation:U([`sum`,`avg`,`count`,`min`,`max`]).optional().describe(`Aggregation function applied to Y axis fields`),groupByField:F().optional().describe(`Optional field used to split / stack the chart`)}).describe(`List chart view configuration`)),Jm=G(()=>B({startDateField:F(),endDateField:F().optional(),titleField:F(),colorField:F().optional()})),Ym=G(()=>B({startDateField:F(),endDateField:F(),titleField:F(),progressField:F().optional(),dependenciesField:F().optional()})),Xm=G(()=>U([`page`,`drawer`,`modal`,`split`,`popover`,`new_window`,`none`])),Zm=G(()=>B({mode:Xm.default(`page`),view:F().optional().describe(`Name of the form view to use for details (e.g. "summary_view", "edit_form")`),preventNavigation:L().default(!1).describe(`Disable standard navigation entirely`),openNewTab:L().default(!1).describe(`Force open in new tab (applies to page mode)`),width:V([F(),I()]).optional().describe(`Width of the drawer/modal (e.g. "600px", "50%")`)})),Qm=G(()=>B({name:Dp.optional().describe(`Internal view name (lowercase snake_case)`),label:lm.optional(),type:U([`grid`,`kanban`,`gallery`,`calendar`,`timeline`,`gantt`,`map`,`chart`]).default(`grid`),data:Om.optional().describe(`Data source configuration (defaults to "object" provider)`),columns:V([z(F()),z(jm)]).describe(`Fields to display as columns`),filter:z(km).optional().describe(`Filter criteria (JSON Rules)`),sort:V([F(),z(B({field:F(),order:U([`asc`,`desc`])}))]).optional(),searchableFields:z(F()).optional().describe(`Fields enabled for search`),filterableFields:z(F()).optional().describe(`Fields enabled for end-user filtering in the top bar`),resizable:L().optional().describe(`Enable column resizing`),striped:L().optional().describe(`Striped row styling`),bordered:L().optional().describe(`Show borders`),compactToolbar:L().optional().describe(`Collapse Group/Color/Density/Hide-fields into a single View settings popover`),selection:Mm.optional().describe(`Row selection configuration`),navigation:Zm.optional().describe(`Configuration for item click navigation (page, drawer, modal, etc.)`),pagination:Nm.optional().describe(`Pagination configuration`),kanban:Km.optional(),calendar:Jm.optional(),gantt:Ym.optional(),gallery:Lm.optional(),timeline:Rm.optional(),chart:qm.optional(),description:lm.optional().describe(`View description for documentation/tooltips`),sharing:zm.optional().describe(`View sharing and access configuration`),rowHeight:Pm.optional().describe(`Row height / density setting`),grouping:Im.optional().describe(`Group records by one or more fields`),rowColor:Bm.optional().describe(`Color rows based on field value`),hiddenFields:z(F()).optional().describe(`Fields to hide in this specific view`),fieldOrder:z(F()).optional().describe(`Explicit field display order for this view`),rowActions:z(F()).optional().describe(`Actions available for individual row items`),bulkActions:z(F()).optional().describe(`Actions available when multiple rows are selected`),bulkActionDefs:z(H(F(),Zd())).optional().describe(`Rich bulk action definitions (schema-driven, executed via BulkActionDialog)`),virtualScroll:L().optional().describe(`Enable virtual scrolling for large datasets`),conditionalFormatting:z(B({condition:jp.describe(`Predicate (CEL) to evaluate.`),style:H(F(),F()).describe(`CSS styles to apply when condition is true`)})).optional().describe(`Conditional formatting rules for list rows`),inlineEdit:L().optional().describe(`Allow inline editing of records directly in the list view`),exportOptions:z(U([`csv`,`xlsx`,`pdf`,`json`])).optional().describe(`Available export format options`),userActions:Hm.optional().describe(`User action toggles for the view toolbar`),appearance:Um.optional().describe(`Appearance and visualization configuration`),tabs:z(Wm).optional().describe(`Tab definitions for multi-tab view interface`),addRecord:Gm.optional().describe(`Add record entry point configuration`),showRecordCount:L().optional().describe(`Show record count at the bottom of the list`),allowPrinting:L().optional().describe(`Allow users to print the view`),emptyState:B({title:lm.optional(),message:lm.optional(),icon:F().optional()}).optional().describe(`Empty state configuration when no records found`),aria:um.optional().describe(`ARIA accessibility attributes for the list view`),responsive:Cm.optional().describe(`Responsive layout configuration`),performance:wm.optional().describe(`Performance optimization settings`)})),$m=G(()=>B({field:F().describe(`Field name (snake_case)`),type:zp.optional().describe(`Field type (auto-infers widget if omitted)`),options:z(Bp).optional().describe(`Options for select/multiselect/radio/checkboxes fields`),reference:F().optional().describe(`Target object name for lookup/master_detail fields`),maxLength:I().optional().describe(`Maximum character length (for text/textarea/email/url/phone)`),minLength:I().optional().describe(`Minimum character length`),min:I().optional().describe(`Minimum value (for number/currency/percent/slider)`),max:I().optional().describe(`Maximum value`),precision:I().optional().describe(`Total digits (for number/currency)`),scale:I().optional().describe(`Decimal places`),multiple:L().optional().describe(`Allow multiple values (for select/lookup/file/image)`),label:lm.optional().describe(`Display label override`),placeholder:lm.optional().describe(`Placeholder text`),helpText:lm.optional().describe(`Help/hint text`),readonly:L().optional().describe(`Read-only override`),immutable:L().optional().describe(`Editable on create, locked once the record exists (e.g. machine names).`),required:L().optional().describe(`Required override`),hidden:L().optional().describe(`Hidden override`),colSpan:I().int().min(1).max(4).optional().describe(`Column span in grid layout (1-4)`),widget:F().optional().describe(`Custom widget/component name (overrides type-based inference)`),language:F().optional().describe(`Code editor language (for type=code)`),fields:z(zf(()=>$m)).optional().describe(`Sub-fields for composite/repeater types`),dependsOn:F().optional().describe(`Parent field name for cascading`),visibleOn:jp.optional().describe(`Visibility predicate (CEL).`)})),eh=G(()=>B({label:lm.optional(),description:F().optional().describe(`Optional description rendered under the section header.`),collapsible:L().default(!1),collapsed:L().default(!1),visibleOn:jp.optional().describe(`Visibility predicate (CEL). Hides the whole section when false.`),columns:V([U([`1`,`2`,`3`,`4`]),W(1),W(2),W(3),W(4)]).default(1).transform(e=>typeof e==`string`?parseInt(e):e),fields:z(V([F(),$m]))})),th=G(()=>B({type:U([`simple`,`tabbed`,`wizard`,`split`,`drawer`,`modal`]).default(`simple`),data:Om.optional().describe(`Data source configuration (defaults to "object" provider)`),sections:z(eh).optional(),groups:z(eh).optional(),defaultSort:z(B({field:F().describe(`Field name to sort by`),order:U([`asc`,`desc`]).default(`desc`).describe(`Sort direction`)})).optional().describe(`Default sort order for related list views within this form`),sharing:ym.optional().describe(`Public sharing configuration for this form`),submitBehavior:V([B({kind:W(`thank-you`),title:F().optional(),message:F().optional()}),B({kind:W(`redirect`),url:F(),delayMs:I().int().min(0).optional()}),B({kind:W(`continue`)}),B({kind:W(`next-record`)})]).optional().describe(`Post-submit behavior`),aria:um.optional().describe(`ARIA accessibility attributes for the form view`)}));G(()=>B({list:Qm.optional(),form:th.optional(),listViews:H(F(),Qm).optional().describe(`Additional named list views`),formViews:H(F(),th).optional().describe(`Additional named form views`)}));function nh(e){let{schemaId:t,...n}=e;return th.parse({...n,data:{provider:`schema`,schemaId:t}})}var rh=U([`get`,`list`,`create`,`update`,`delete`,`upsert`,`bulk`,`aggregate`,`history`,`search`,`restore`,`purge`,`import`,`export`]),ih=B({trackHistory:L().default(!1).describe(`Enable field history tracking for audit compliance`),searchable:L().default(!0).describe(`Index records for global search`),apiEnabled:L().default(!0).describe(`Expose object via automatic APIs`),apiMethods:z(rh).optional().describe(`Whitelist of allowed API operations`),files:L().default(!1).describe(`Enable file attachments and document management`),feeds:L().default(!1).describe(`Enable social feed, comments, and mentions (Chatter-like)`),activities:L().default(!1).describe(`Enable standard tasks and events tracking`),trash:L().default(!0).describe(`Enable soft-delete with restore capability`),mru:L().default(!0).describe(`Track Most Recently Used (MRU) list for users`),clone:L().default(!0).describe(`Allow record deep cloning`)}),ah=G(()=>B({name:F().optional().describe(`Index name (auto-generated if not provided)`),fields:z(F()).describe(`Fields included in the index`),type:U([`btree`,`hash`,`gin`,`gist`,`fulltext`]).optional().default(`btree`).describe(`Index algorithm type`),unique:L().optional().default(!1).describe(`Whether the index enforces uniqueness`),partial:F().optional().describe(`Partial index condition (SQL WHERE clause for conditional indexes)`)})),oh=G(()=>B({fields:z(F()).describe(`Fields to index for full-text search weighting`),displayFields:z(F()).optional().describe(`Fields to display in search result cards`),filters:z(F()).optional().describe(`Default filters for search results`)})),sh=G(()=>B({enabled:L().describe(`Enable multi-tenancy for this object`),strategy:U([`shared`,`isolated`,`hybrid`]).describe(`Tenant isolation strategy: shared (single DB, row-level), isolated (separate DB per tenant), hybrid (mix)`),tenantField:F().default(`tenant_id`).describe(`Field name for tenant identifier`),crossTenantAccess:L().default(!1).describe(`Allow cross-tenant data access (with explicit permission)`)})),ch=G(()=>B({enabled:L().describe(`Enable soft delete (trash/recycle bin)`),field:F().default(`deleted_at`).describe(`Field name for soft delete timestamp`),cascadeDelete:L().default(!1).describe(`Cascade soft delete to related records`)})),lh=G(()=>B({enabled:L().describe(`Enable record versioning`),strategy:U([`snapshot`,`delta`,`event-sourcing`]).describe(`Versioning strategy: snapshot (full copy), delta (changes only), event-sourcing (event log)`),retentionDays:I().min(1).optional().describe(`Number of days to retain old versions (undefined = infinite)`),versionField:F().default(`version`).describe(`Field name for version number/timestamp`)})),uh=G(()=>B({enabled:L().describe(`Enable table partitioning`),strategy:U([`range`,`hash`,`list`]).describe(`Partitioning strategy: range (date ranges), hash (consistent hashing), list (predefined values)`),key:F().describe(`Field name to partition by`),interval:F().optional().describe(`Partition interval for range strategy (e.g., "1 month", "1 year")`)}).refine(e=>!(e.strategy===`range`&&!e.interval),{message:`interval is required when strategy is "range"`})),dh=G(()=>B({enabled:L().describe(`Enable Change Data Capture`),events:z(U([`insert`,`update`,`delete`])).describe(`Event types to capture`),destination:F().describe(`Destination endpoint (e.g., "kafka://topic", "webhook://url")`)})),fh=G(()=>B({key:F().regex(/^[a-z_][a-z0-9_]*$/,{message:`Field group key must be lowercase snake_case (e.g., "contact_info", "billing", "system")`}).describe(`Group machine key (snake_case). Referenced by Field.group.`),label:F().describe(`Group display label`),icon:F().optional().describe(`Icon name (Lucide/Material) for the group header`),description:F().optional().describe(`Optional description shown under the group header`),defaultExpanded:L().optional().default(!0).describe(`Whether the group is expanded by default`),visibleOn:jp.optional().describe(`Visibility predicate (CEL); group is hidden when FALSE.`)})),ph=B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Machine unique key (snake_case). Immutable.`),label:F().optional().describe(`Human readable singular label (e.g. "Account")`),pluralLabel:F().optional().describe(`Human readable plural label (e.g. "Accounts")`),description:F().optional().describe(`Developer documentation / description`),icon:F().optional().describe(`Icon name (Lucide/Material) for UI representation`),tags:z(F()).optional().describe(`Categorization tags (e.g. "sales", "system", "reference")`),active:L().optional().default(!0).describe(`Is the object active and usable`),isSystem:L().optional().default(!1).describe(`Is system object (protected from deletion)`),abstract:L().optional().default(!1).describe(`Is abstract base object (cannot be instantiated)`),managedBy:U([`platform`,`config`,`system`,`append-only`,`better-auth`]).optional().describe(`Lifecycle bucket — platform (user CRUD) | config (admin authored) | system (engine-managed) | append-only (audit) | better-auth (identity). UI clients honour the resolved affordance matrix.`),userActions:B({create:L().optional().describe(`Show generic "New" button.`),import:L().optional().describe(`Show CSV import wizard entry.`),edit:L().optional().describe(`Allow inline / form edit of existing rows.`),delete:L().optional().describe(`Show row-level delete + bulk delete.`),exportCsv:L().optional().describe(`Show CSV export entry.`)}).optional().describe(`Per-object override of the resolved CRUD affordance matrix.`),systemFields:V([W(!1),B({tenant:L().optional().describe(`Inject organization_id (multi-tenant only). Default true.`),owner:L().optional().describe(`Reserved for future owner_id auto-injection.`),audit:L().optional().describe(`Reserved for future created_by/updated_by auto-injection.`)})]).optional().describe(`Opt out of, or selectively disable, registry-level system-field auto-injection.`),datasource:F().optional().default(`default`).describe(`Target Datasource ID. "default" is the primary DB.`),fields:H(F().regex(/^[a-z_][a-z0-9_]*$/,{message:`Field names must be lowercase snake_case (e.g., "first_name", "company", "annual_revenue")`}),Kp).describe(`Field definitions map. Keys must be snake_case identifiers.`),indexes:z(ah).optional().describe(`Database performance indexes`),fieldGroups:z(fh).refine(e=>new Set(e.map(e=>e.key)).size===e.length,{message:`fieldGroups[].key must be unique within an object`}).optional().describe(`Ordered list of field groups (array order = display order). See ObjectFieldGroupSchema.`),tenancy:sh.optional().describe(`Multi-tenancy configuration for SaaS applications`),softDelete:ch.optional().describe(`Soft delete (trash/recycle bin) configuration`),versioning:lh.optional().describe(`Record versioning and history tracking configuration`),partitioning:uh.optional().describe(`Table partitioning configuration for performance`),cdc:dh.optional().describe(`Change Data Capture (CDC) configuration for real-time data streaming`),validations:z(nm).optional().describe(`Object-level validation rules`),stateMachines:H(F(),cm).optional().describe(`Named state machines for parallel lifecycles (e.g., status, payment, approval)`),displayNameField:F().optional().describe(`Field to use as the record display name (e.g., "name", "title"). Defaults to "name" if present.`),recordName:B({type:U([`text`,`autonumber`]).describe(`Record name type: text (user-entered) or autonumber (system-generated)`),displayFormat:F().optional().describe(`Auto-number format pattern (e.g., "CASE-{0000}", "INV-{YYYY}-{0000}")`),startNumber:I().int().min(0).optional().describe(`Starting number for autonumber (default: 1)`)}).optional().describe(`Record name generation configuration (Salesforce pattern)`),titleFormat:Mp.optional().describe(`Title template — supports {{record.field}} interpolation. Overrides displayNameField.`),compactLayout:z(F()).optional().describe(`Primary fields for hover/cards/lookups`),listViews:H(F(),Qm).optional().describe(`Built-in named list views (segmented tabs) shipped with the object schema`),defaultDetailForm:F().optional().describe(`Name of the default FormView for record detail / edit screens`),search:oh.optional().describe(`Search engine configuration`),enable:ih.optional().describe(`Enabled system features modules`),recordTypes:z(F()).optional().describe(`Record type names for this object`),sharingModel:U([`private`,`read`,`read_write`,`full`]).optional().describe(`Default sharing model`),publicSharing:B({enabled:L().default(!1).describe(`Allow records of this object to be published via share link`),allowedAudiences:z(U([`public`,`link_only`,`signed_in`,`email`])).optional().describe(`Audiences callers may select when creating a link`),allowedPermissions:z(U([`view`,`comment`,`edit`])).optional().describe(`Permission levels selectable on the share dialog`),maxExpiryDays:I().int().positive().optional().describe(`Reject links with expiry beyond this many days`),redactFields:z(F()).optional().describe(`Field names removed from records served via a share token`),eligibility:F().optional().describe(`CEL expression that must evaluate to true on the target record`)}).optional().describe(`Public share-link policy (Notion/Figma-style link sharing)`),keyPrefix:F().max(5).optional().describe(`Short prefix for record IDs (e.g., "001" for Account)`),detail:B({renderViaSchema:L().optional().describe(`Opt this object out of the schema-driven detail renderer`),hideReferenceRail:L().optional().describe(`Suppress the right-hand reference-rail on the detail page`),hideRelatedTab:L().optional().describe(`Suppress the Related tab on the detail page`)}).passthrough().optional().describe(`Detail-page UI hints consumed by @object-ui/plugin-detail synth`),actions:z(vm).optional().describe(`Actions associated with this object (auto-populated from top-level actions via objectName)`)});function mh(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}G(()=>Object.assign(ph,{create:e=>{let t={...e,label:e.label??mh(e.name)};return ph.parse(t)}})),U([`own`,`extend`]),G(()=>B({extend:F().describe(`Target object name (FQN) to extend`),fields:H(F(),Kp).optional().describe(`Fields to add/override`),label:F().optional().describe(`Override label for the extended object`),pluralLabel:F().optional().describe(`Override plural label for the extended object`),description:F().optional().describe(`Override description for the extended object`),validations:z(nm).optional().describe(`Additional validation rules to merge into the target object`),indexes:z(ah).optional().describe(`Additional indexes to merge into the target object`),priority:I().int().min(0).max(999).default(200).describe(`Merge priority (higher = applied later)`)}));var hh=U([`beforeFind`,`afterFind`,`beforeFindOne`,`afterFindOne`,`beforeCount`,`afterCount`,`beforeAggregate`,`afterAggregate`,`beforeInsert`,`afterInsert`,`beforeUpdate`,`afterUpdate`,`beforeDelete`,`afterDelete`,`beforeUpdateMany`,`afterUpdateMany`,`beforeDeleteMany`,`afterDeleteMany`]);G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Hook unique name (snake_case)`),label:F().optional().describe(`Description of what this hook does`),object:V([F(),z(F())]).describe(`Target object(s)`),events:z(hh).describe(`Lifecycle events`),handler:V([F(),Gf(e=>typeof e==`function`,{message:`Expected function`})]).optional().describe("Handler function name (string, post-build) or inline function (pre-build) — DEPRECATED, prefer `body`"),body:mm.optional().describe(`Hook body — expression (L1) or sandboxed JS (L2)`),priority:I().default(100).describe(`Execution priority`),async:L().default(!1).describe(`Run specifically as fire-and-forget`),condition:jp.optional().describe('Predicate (CEL); hook runs only when TRUE. e.g. P`record.status == "closed" && record.amount > 1000`'),description:F().optional().describe(`Human-readable description of what this hook does`),retryPolicy:B({maxRetries:I().default(3).describe(`Maximum retry attempts on failure`),backoffMs:I().default(1e3).describe(`Backoff delay between retries in milliseconds`)}).optional().describe(`Retry policy for failed hook executions`),timeout:I().optional().describe(`Maximum execution time in milliseconds before the hook is aborted`),onError:U([`abort`,`log`]).default(`abort`).describe(`Error handling strategy`)})),G(()=>B({id:F().optional().describe(`Unique execution ID for tracing`),object:F(),event:hh,input:H(F(),R()).describe(`Mutable input parameters`),result:R().optional().describe(`Operation result (After hooks only)`),previous:H(F(),R()).optional().describe(`Record state before operation`),session:B({userId:F().optional(),tenantId:F().optional(),roles:z(F()).optional(),accessToken:F().optional(),isSystem:L().optional().describe(`True when the call was made with an elevated system context (engine self-writes)`)}).optional().describe(`Current session context`),transaction:R().optional().describe(`Database transaction handle`),ql:R().describe(`ObjectQL Engine Reference`),api:R().optional().describe(`Cross-object data access (ScopedContext)`),user:B({id:F().optional(),name:F().optional(),email:F().optional()}).optional().describe(`Current user info shortcut`)}));var gh=U([`none`,`constant`,`lookup`,`split`,`join`,`javascript`,`map`]),_h=G(()=>B({source:V([F(),z(F())]).describe(`Source column header(s)`),target:V([F(),z(F())]).describe(`Target object field(s)`),transform:gh.default(`none`),params:B({value:R().optional(),object:F().optional(),fromField:F().optional(),toField:F().optional(),autoCreate:L().optional(),valueMap:H(F(),R()).optional(),separator:F().optional()}).optional()}));G(()=>B({name:Dp.describe(`Mapping unique name (lowercase snake_case)`),label:F().optional(),sourceFormat:U([`csv`,`json`,`xml`,`sql`]).default(`csv`),targetObject:F().describe(`Target Object Name`),fieldMapping:z(_h),mode:U([`insert`,`update`,`upsert`]).default(`insert`),upsertKey:z(F()).optional().describe(`Fields to match for upsert (e.g. email)`),extractQuery:_p.optional().describe(`Query to run for export only`),errorPolicy:U([`skip`,`abort`,`retry`]).default(`skip`),batchSize:I().default(1e3)}));var vh=G(()=>B({userId:F().optional(),tenantId:F().optional(),roles:z(F()).default([]),permissions:z(F()).default([]),systemPermissions:z(F()).optional(),tabPermissions:H(F(),U([`visible`,`hidden`,`default_on`,`default_off`])).optional(),org_user_ids:z(F()).optional(),isSystem:L().default(!1),accessToken:F().optional(),transaction:R().optional(),traceId:F().optional()})),yh=G(()=>V([H(F(),R()),Zf]).describe(`Data Engine query filter conditions`)),bh=G(()=>V([H(F(),U([`asc`,`desc`])),H(F(),V([W(1),W(-1)])),z(rp)]).describe(`Sort order definition`)),xh=G(()=>B({context:vh.optional()})),Sh=G(()=>xh.extend({where:V([H(F(),R()),Zf]).optional(),fields:z(mp).optional(),orderBy:z(rp).optional(),limit:I().optional(),offset:I().optional(),top:I().optional(),cursor:H(F(),R()).optional(),search:hp.optional(),expand:zf(()=>H(F(),_p)).optional(),distinct:L().optional()}).describe(`QueryAST-aligned query options for IDataEngine.find() operations`));G(()=>xh.extend({filter:yh.optional(),select:z(F()).optional(),sort:bh.optional(),limit:I().int().min(1).optional(),skip:I().int().min(0).optional(),top:I().int().min(1).optional(),populate:z(F()).optional()}).describe(`Query options for IDataEngine.find() operations`));var Ch=G(()=>xh.extend({returning:L().default(!0).optional()}).describe(`Options for DataEngine.insert operations`)),wh=G(()=>xh.extend({where:V([H(F(),R()),Zf]).optional(),upsert:L().default(!1).optional(),multi:L().default(!1).optional(),returning:L().default(!1).optional()}).describe(`QueryAST-aligned options for DataEngine.update operations`));G(()=>xh.extend({filter:yh.optional(),upsert:L().default(!1).optional(),multi:L().default(!1).optional(),returning:L().default(!1).optional()}).describe(`Options for DataEngine.update operations`));var Th=G(()=>xh.extend({where:V([H(F(),R()),Zf]).optional(),multi:L().default(!1).optional()}).describe(`QueryAST-aligned options for DataEngine.delete operations`));G(()=>xh.extend({filter:yh.optional(),multi:L().default(!1).optional()}).describe(`Options for DataEngine.delete operations`));var Eh=G(()=>xh.extend({where:V([H(F(),R()),Zf]).optional(),groupBy:z(F()).optional(),aggregations:z(sp).optional()}).describe(`QueryAST-aligned options for DataEngine.aggregate operations`));G(()=>xh.extend({filter:yh.optional(),groupBy:z(F()).optional(),aggregations:z(B({field:F(),method:U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`]),alias:F().optional()})).optional()}).describe(`Options for DataEngine.aggregate operations`));var Dh=G(()=>xh.extend({where:V([H(F(),R()),Zf]).optional()}).describe(`QueryAST-aligned options for DataEngine.count operations`));G(()=>xh.extend({filter:yh.optional()}).describe(`Options for DataEngine.count operations`)),G(()=>B({find:Uf().input(mf([F(),Sh.optional()])).output(Vf(z(R()))),findOne:Uf().input(mf([F(),Sh.optional()])).output(Vf(R())),insert:Uf().input(mf([F(),V([H(F(),R()),z(H(F(),R()))]),Ch.optional()])).output(Vf(R())),update:Uf().input(mf([F(),H(F(),R()),wh.optional()])).output(Vf(R())),delete:Uf().input(mf([F(),Th.optional()])).output(Vf(R())),count:Uf().input(mf([F(),Dh.optional()])).output(Vf(I())),aggregate:Uf().input(mf([F(),Eh])).output(Vf(z(R())))}).describe(`Standard Data Engine Contract`));var Oh={filter:yh.optional()},kh=Sh.extend({...Oh,select:z(F()).optional(),sort:bh.optional(),skip:I().int().min(0).optional(),populate:z(F()).optional()}),Ah=G(()=>B({method:W(`find`),object:F(),query:kh.optional()})),jh=G(()=>B({method:W(`findOne`),object:F(),query:kh.optional()})),Mh=G(()=>B({method:W(`insert`),object:F(),data:V([H(F(),R()),z(H(F(),R()))]),options:Ch.optional()})),Nh=G(()=>B({method:W(`update`),object:F(),data:H(F(),R()),id:V([F(),I()]).optional().describe(`ID for single update, or use where in options`),options:wh.extend(Oh).optional()})),Ph=G(()=>B({method:W(`delete`),object:F(),id:V([F(),I()]).optional().describe(`ID for single delete, or use where in options`),options:Th.extend(Oh).optional()})),Fh=G(()=>B({method:W(`count`),object:F(),query:Dh.extend(Oh).optional()})),Ih=G(()=>B({method:W(`aggregate`),object:F(),query:Eh.extend(Oh)})),Lh=G(()=>B({method:W(`execute`),command:R(),options:H(F(),R()).optional()})),Rh=G(()=>B({method:W(`vectorFind`),object:F(),vector:z(I()),where:V([H(F(),R()),Zf]).optional(),fields:z(F()).optional(),limit:I().int().default(5).optional(),threshold:I().optional()})),zh=G(()=>B({method:W(`batch`),requests:z(uf(`method`,[Ah,jh,Mh,Nh,Ph,Fh,Ih,Lh,Rh])),transaction:L().default(!0).optional()}));G(()=>uf(`method`,[Ah,jh,Mh,Nh,Ph,Fh,Ih,zh,Lh,Rh]).describe(`Virtual ObjectQL Request Protocol`)),U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`,`percentile`,`median`,`stddev`,`variance`]).describe(`Standard aggregation functions`);var Bh=U([`asc`,`desc`]).describe(`Sort order direction`);G(()=>B({field:F().describe(`Field name to sort by`),order:Bh.describe(`Sort direction`)}).describe(`Sort field and direction pair`)),U([`insert`,`update`,`delete`,`upsert`]).describe(`Data mutation event types`);var Vh=U([`read_uncommitted`,`read_committed`,`repeatable_read`,`serializable`,`snapshot`]).describe(`Transaction isolation levels (snake_case standard)`);U([`lru`,`lfu`,`ttl`,`fifo`]).describe(`Cache eviction strategy`);var Hh=G(()=>B({transaction:R().optional().describe(`Transaction handle`),timeout:I().optional().describe(`Timeout in ms`),skipCache:L().optional().describe(`Bypass cache`),traceContext:H(F(),F()).optional().describe(`OpenTelemetry context or request ID`),tenantId:F().optional().describe(`Tenant Isolation identifier`)})),Uh=G(()=>B({create:L().default(!0).describe(`Supports CREATE operations`),read:L().default(!0).describe(`Supports READ operations`),update:L().default(!0).describe(`Supports UPDATE operations`),delete:L().default(!0).describe(`Supports DELETE operations`),bulkCreate:L().default(!1).describe(`Supports bulk CREATE operations`),bulkUpdate:L().default(!1).describe(`Supports bulk UPDATE operations`),bulkDelete:L().default(!1).describe(`Supports bulk DELETE operations`),transactions:L().default(!1).describe(`Supports ACID transactions`),savepoints:L().default(!1).describe(`Supports transaction savepoints`),isolationLevels:z(Vh).optional().describe(`Supported isolation levels`),queryFilters:L().default(!0).describe(`Supports WHERE clause filtering`),queryAggregations:L().default(!1).describe(`Supports GROUP BY and aggregation functions`),queryDateGranularity:H(ap,L()).optional().describe(`Per-granularity native date bucketing (day/week/month/quarter/year). Missing keys fall back to in-memory bucketing.`),querySorting:L().default(!0).describe(`Supports ORDER BY sorting`),queryPagination:L().default(!0).describe(`Supports LIMIT/OFFSET pagination`),queryWindowFunctions:L().default(!1).describe(`Supports window functions with OVER clause`),querySubqueries:L().default(!1).describe(`Supports subqueries`),queryCTE:L().default(!1).describe(`Supports Common Table Expressions (WITH clause)`),joins:L().default(!1).describe(`Supports SQL joins`),fullTextSearch:L().default(!1).describe(`Supports full-text search`),jsonQuery:L().default(!1).describe(`Supports JSON field querying`),geospatialQuery:L().default(!1).describe(`Supports geospatial queries`),streaming:L().default(!1).describe(`Supports result streaming (cursors/iterators)`),jsonFields:L().default(!1).describe(`Supports JSON field types`),arrayFields:L().default(!1).describe(`Supports array field types`),vectorSearch:L().default(!1).describe(`Supports vector embeddings and similarity search`),schemaSync:L().default(!1).describe(`Supports automatic schema synchronization`),batchSchemaSync:L().default(!1).describe(`Supports batched schema sync to reduce schema DDL round-trips`),migrations:L().default(!1).describe(`Supports database migrations`),indexes:L().default(!1).describe(`Supports index creation and management`),connectionPooling:L().default(!1).describe(`Supports connection pooling`),preparedStatements:L().default(!1).describe(`Supports prepared statements (SQL injection prevention)`),queryCache:L().default(!1).describe(`Supports query result caching`)}));G(()=>B({name:F().describe(`Driver unique name`),version:F().describe(`Driver version`),supports:Uh,connect:Uf().input(mf([])).output(Vf(nf())).describe(`Establish connection`),disconnect:Uf().input(mf([])).output(Vf(nf())).describe(`Close connection`),checkHealth:Uf().input(mf([])).output(Vf(L())).describe(`Health check`),getPoolStats:Uf().input(mf([])).output(B({total:I(),idle:I(),active:I(),waiting:I()}).optional()).optional().describe(`Get connection pool statistics`),execute:Uf().input(mf([R(),z(R()).optional(),Hh.optional()])).output(Vf(R())).describe(`Execute raw command`),find:Uf().input(mf([F(),_p,Hh.optional()])).output(Vf(z(H(F(),R())))).describe(`Find records`),findStream:Uf().input(mf([F(),_p,Hh.optional()])).output(R()).describe(`Stream records (AsyncIterable)`),findOne:Uf().input(mf([F(),_p,Hh.optional()])).output(Vf(H(F(),R()).nullable())).describe(`Find one record`),create:Uf().input(mf([F(),H(F(),R()),Hh.optional()])).output(Vf(H(F(),R()))).describe(`Create record`),update:Uf().input(mf([F(),F().or(I()),H(F(),R()),Hh.optional()])).output(Vf(H(F(),R()))).describe(`Update record`),upsert:Uf().input(mf([F(),H(F(),R()),z(F()).optional(),Hh.optional()])).output(Vf(H(F(),R()))).describe(`Upsert record`),delete:Uf().input(mf([F(),F().or(I()),Hh.optional()])).output(Vf(L())).describe(`Delete record`),count:Uf().input(mf([F(),_p.optional(),Hh.optional()])).output(Vf(I())).describe(`Count records`),bulkCreate:Uf().input(mf([F(),z(H(F(),R())),Hh.optional()])).output(Vf(z(H(F(),R())))),bulkUpdate:Uf().input(mf([F(),z(B({id:F().or(I()),data:H(F(),R())})),Hh.optional()])).output(Vf(z(H(F(),R())))),bulkDelete:Uf().input(mf([F(),z(F().or(I())),Hh.optional()])).output(Vf(nf())),updateMany:Uf().input(mf([F(),_p,H(F(),R()),Hh.optional()])).output(Vf(I())).optional(),deleteMany:Uf().input(mf([F(),_p,Hh.optional()])).output(Vf(I())).optional(),beginTransaction:Uf().input(mf([B({isolationLevel:Vh.optional()}).optional()])).output(Vf(R())).describe(`Start transaction`),commit:Uf().input(mf([R()])).output(Vf(nf())).describe(`Commit transaction`),rollback:Uf().input(mf([R()])).output(Vf(nf())).describe(`Rollback transaction`),syncSchema:Uf().input(mf([F(),R(),Hh.optional()])).output(Vf(nf())).describe(`Sync object schema to DB`),syncSchemasBatch:Uf().input(mf([z(B({object:F(),schema:R()})),Hh.optional()])).output(Vf(nf())).optional().describe(`Batch sync multiple schemas in one round-trip`),dropTable:Uf().input(mf([F(),Hh.optional()])).output(Vf(nf())),explain:Uf().input(mf([F(),_p,Hh.optional()])).output(Vf(R())).optional()}));var Wh=G(()=>B({min:I().min(0).default(2).describe(`Minimum number of connections in pool`),max:I().min(1).default(10).describe(`Maximum number of connections in pool`),idleTimeoutMillis:I().min(0).default(3e4).describe(`Time in ms before idle connection is closed`),connectionTimeoutMillis:I().min(0).default(5e3).describe(`Time in ms to wait for available connection`)})),Gh=G(()=>B({name:F().describe(`Driver instance name`),type:U([`sql`,`nosql`,`cache`,`search`,`graph`,`timeseries`]).describe(`Driver type category`),capabilities:Uh.describe(`Driver capability flags`),connectionString:F().optional().describe(`Database connection string (driver-specific format)`),poolConfig:Wh.optional().describe(`Connection pool configuration`)})),Kh=G(()=>U([`postgresql`,`mysql`,`sqlite`,`mssql`,`oracle`,`mariadb`])),qh=G(()=>B({text:F().describe(`SQL type for text fields (e.g., VARCHAR, TEXT)`),number:F().describe(`SQL type for number fields (e.g., NUMERIC, DECIMAL, INT)`),boolean:F().describe(`SQL type for boolean fields (e.g., BOOLEAN, BIT)`),date:F().describe(`SQL type for date fields (e.g., DATE)`),datetime:F().describe(`SQL type for datetime fields (e.g., TIMESTAMP, DATETIME)`),json:F().optional().describe(`SQL type for JSON fields (e.g., JSON, JSONB)`),uuid:F().optional().describe(`SQL type for UUID fields (e.g., UUID, CHAR(36))`),binary:F().optional().describe(`SQL type for binary fields (e.g., BLOB, BYTEA)`)})),Jh=G(()=>B({rejectUnauthorized:L().default(!0).describe(`Reject connections with invalid certificates`),ca:F().optional().describe(`CA certificate file path or content`),cert:F().optional().describe(`Client certificate file path or content`),key:F().optional().describe(`Client private key file path or content`)}).refine(e=>e.cert!==void 0==(e.key!==void 0),{message:`Client certificate (cert) and private key (key) must be provided together`}));G(()=>Gh.extend({type:W(`sql`).describe(`Driver type must be "sql"`),dialect:Kh.describe(`SQL database dialect`),dataTypeMapping:qh.describe(`SQL data type mapping configuration`),ssl:L().default(!1).describe(`Enable SSL/TLS connection`),sslConfig:Jh.optional().describe(`SSL/TLS configuration (required when ssl is true)`)}).refine(e=>!(e.ssl&&!e.sslConfig),{message:`sslConfig is required when ssl is true`}));var Yh=G(()=>U([`mongodb`,`couchdb`,`dynamodb`,`cassandra`,`redis`,`elasticsearch`,`neo4j`,`orientdb`]));G(()=>U([`find`,`findOne`,`insert`,`update`,`delete`,`aggregate`,`mapReduce`,`count`,`distinct`,`createIndex`,`dropIndex`]));var Xh=G(()=>U([`all`,`quorum`,`one`,`local_quorum`,`each_quorum`,`eventual`])),Zh=G(()=>U([`single`,`compound`,`unique`,`text`,`geospatial`,`hashed`,`ttl`,`sparse`])),Qh=G(()=>B({enabled:L().default(!1).describe(`Enable sharding`),shardKey:F().optional().describe(`Field to use as shard key`),shardingStrategy:U([`hash`,`range`,`zone`]).optional().describe(`Sharding strategy`),numShards:I().int().positive().optional().describe(`Number of shards`)})),$h=G(()=>B({enabled:L().default(!1).describe(`Enable replication`),replicaSetName:F().optional().describe(`Replica set name`),replicas:I().int().positive().optional().describe(`Number of replicas`),readPreference:U([`primary`,`primaryPreferred`,`secondary`,`secondaryPreferred`,`nearest`]).optional().describe(`Read preference for replica set`),writeConcern:U([`majority`,`acknowledged`,`unacknowledged`]).optional().describe(`Write concern level`)})),eg=G(()=>B({enabled:L().default(!1).describe(`Enable schema validation`),validationLevel:U([`strict`,`moderate`,`off`]).optional().describe(`Validation strictness`),validationAction:U([`error`,`warn`]).optional().describe(`Action on validation failure`),jsonSchema:H(F(),R()).optional().describe(`JSON Schema for validation`)})),tg=G(()=>B({text:F().describe(`NoSQL type for text fields`),number:F().describe(`NoSQL type for number fields`),boolean:F().describe(`NoSQL type for boolean fields`),date:F().describe(`NoSQL type for date fields`),datetime:F().describe(`NoSQL type for datetime fields`),json:F().optional().describe(`NoSQL type for JSON/object fields`),uuid:F().optional().describe(`NoSQL type for UUID fields`),binary:F().optional().describe(`NoSQL type for binary fields`),array:F().optional().describe(`NoSQL type for array fields`),objectId:F().optional().describe(`NoSQL type for ObjectID fields (MongoDB)`),geopoint:F().optional().describe(`NoSQL type for geospatial point fields`)}));G(()=>Gh.extend({type:W(`nosql`).describe(`Driver type must be "nosql"`),databaseType:Yh.describe(`Specific NoSQL database type`),dataTypeMapping:tg.describe(`NoSQL data type mapping configuration`),consistency:Xh.optional().describe(`Consistency level for operations`),replication:$h.optional().describe(`Replication configuration`),sharding:Qh.optional().describe(`Sharding configuration`),schemaValidation:eg.optional().describe(`Document schema validation`),region:F().optional().describe(`AWS region (for managed NoSQL services)`),accessKeyId:F().optional().describe(`AWS access key ID`),secretAccessKey:F().optional().describe(`AWS secret access key`),ttlField:F().optional().describe(`Field name for TTL (auto-deletion)`),maxDocumentSize:I().int().positive().optional().describe(`Maximum document size in bytes`),collectionPrefix:F().optional().describe(`Prefix for collection/table names`)}));var ng=G(()=>B({consistency:Xh.optional().describe(`Consistency level override`),readFromSecondary:L().optional().describe(`Allow reading from secondary replicas`),projection:H(F(),V([W(0),W(1)])).optional().describe(`Field projection`),timeout:I().int().positive().optional().describe(`Query timeout (ms)`),useCursor:L().optional().describe(`Use cursor instead of loading all results`),batchSize:I().int().positive().optional().describe(`Cursor batch size`),profile:L().optional().describe(`Enable query profiling`),hint:F().optional().describe(`Index hint for query optimization`)})),rg=G(()=>B({operator:F().describe(`Aggregation operator (e.g., $match, $group, $sort)`),options:H(F(),R()).describe(`Stage-specific options`)}));G(()=>B({collection:F().describe(`Collection/table name`),stages:z(rg).describe(`Aggregation pipeline stages`),options:ng.optional().describe(`Query options`)})),G(()=>B({name:F().describe(`Index name`),type:Zh.describe(`Index type`),fields:z(B({field:F().describe(`Field name`),order:U([`asc`,`desc`,`text`,`2dsphere`]).optional().describe(`Index order or type`)})).describe(`Fields to index`),unique:L().default(!1).describe(`Enforce uniqueness`),sparse:L().default(!1).describe(`Sparse index`),expireAfterSeconds:I().int().positive().optional().describe(`TTL in seconds`),partialFilterExpression:H(F(),R()).optional().describe(`Partial index filter`),background:L().default(!1).describe(`Create index in background`)})),G(()=>B({readConcern:U([`local`,`majority`,`linearizable`,`snapshot`]).optional().describe(`Read concern level`),writeConcern:U([`majority`,`acknowledged`,`unacknowledged`]).optional().describe(`Write concern level`),readPreference:U([`primary`,`primaryPreferred`,`secondary`,`secondaryPreferred`,`nearest`]).optional().describe(`Read preference`),maxCommitTimeMS:I().int().positive().optional().describe(`Transaction commit timeout (ms)`)}));var ig=U([`insert`,`update`,`upsert`,`replace`,`ignore`]),ag=G(()=>B({object:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Target Object Name`),externalId:F().default(`name`).describe(`Field match for uniqueness check`),mode:ig.default(`upsert`).describe(`Conflict resolution strategy`),env:z(U([`prod`,`dev`,`test`])).default([`prod`,`dev`,`test`]).describe(`Applicable environments`),records:z(H(F(),R())).describe(`Data records`)}));nh({schemaId:`object`,type:`simple`,sections:[{label:`Basics`,description:`Identity, labels, and taxonomy.`,columns:2,fields:[{field:`name`,type:`text`,required:!0,immutable:!0,colSpan:1,helpText:`snake_case unique identifier (immutable after creation)`},{field:`label`,type:`text`,colSpan:1,helpText:`Singular display name (e.g. "Account")`},{field:`pluralLabel`,type:`text`,colSpan:1,helpText:`Plural display name (e.g. "Accounts")`},{field:`icon`,type:`text`,colSpan:1,helpText:`Lucide icon name (e.g. "building", "users")`},{field:`description`,type:`textarea`,colSpan:2,helpText:`Developer documentation`},{field:`tags`,type:`tags`,colSpan:2,helpText:`Categorization tags (e.g. "sales", "system")`},{field:`active`,type:`boolean`,colSpan:1,helpText:`Is the object active and usable`},{field:`isSystem`,type:`boolean`,colSpan:1,helpText:`System object (protected from deletion)`},{field:`abstract`,type:`boolean`,colSpan:1,helpText:`Abstract base (cannot be instantiated)`}]},{label:`Fields`,description:`Define the data model — each row becomes a column in the database table.`,fields:[{field:`fields`,type:`repeater`,widget:`grid`,required:!0,helpText:`Add the columns this object will store`,fields:[{field:`name`,type:`text`,required:!0,immutable:!0,helpText:`snake_case identifier`},{field:`label`,type:`text`,helpText:`Display label`},{field:`type`,type:`select`,required:!0,helpText:`Field type`},{field:`required`,type:`boolean`},{field:`reference`,type:`text`,helpText:`Target object (for lookup/master_detail)`}]}]},{label:`Capabilities`,description:`System features and API exposure.`,collapsible:!0,collapsed:!0,fields:[{field:`capabilities`,type:`composite`,helpText:`Enable/disable system features`,fields:[{field:`trackHistory`,type:`boolean`},{field:`searchable`,type:`boolean`},{field:`apiEnabled`,type:`boolean`},{field:`files`,type:`boolean`},{field:`feeds`,type:`boolean`},{field:`activities`,type:`boolean`},{field:`trash`,type:`boolean`},{field:`mru`,type:`boolean`},{field:`clone`,type:`boolean`}]}]},{label:`Advanced`,description:`State machines, actions, and storage.`,collapsible:!0,collapsed:!0,fields:[{field:`datasource`,type:`text`,helpText:`Target datasource ID (default: "default")`}]}]}),nh({schemaId:`field`,type:`simple`,sections:[{label:`Basics`,description:`Core field identity and constraints.`,columns:2,fields:[{field:`name`,required:!0,immutable:!0,colSpan:1,helpText:`Unique identifier (snake_case, immutable after creation)`},{field:`label`,required:!0,colSpan:1,helpText:`Display name for users`},{field:`type`,required:!0,colSpan:1,helpText:`Data type of this field`},{field:`group`,colSpan:1,helpText:`Group name for form layout`},{field:`description`,widget:`textarea`,colSpan:2,helpText:`Help text shown to users`},{field:`required`,colSpan:1,helpText:`User must provide a value`},{field:`unique`,colSpan:1,helpText:`No two records can have the same value`},{field:`multiple`,colSpan:1,helpText:`Allow multiple values (for select/lookup)`}]},{label:`Configuration`,description:`Field-type specific settings (visible blocks depend on the chosen type).`,fields:[{field:`defaultValue`,helpText:`Default value for new records`},{field:`minLength`,visibleOn:`data.type == 'text' || data.type == 'textarea' || data.type == 'email'`,helpText:`Minimum character length`},{field:`maxLength`,visibleOn:`data.type == 'text' || data.type == 'textarea' || data.type == 'email'`,helpText:`Maximum character length`},{field:`min`,visibleOn:`data.type == 'number' || data.type == 'currency'`,helpText:`Minimum value`},{field:`max`,visibleOn:`data.type == 'number' || data.type == 'currency'`,helpText:`Maximum value`},{field:`precision`,visibleOn:`data.type == 'currency' || data.type == 'number'`,helpText:`Decimal places (e.g., 2 for $10.50)`},{field:`scale`,visibleOn:`data.type == 'number'`,helpText:`Number of decimal digits`},{field:`options`,type:`repeater`,visibleOn:`data.type == 'select' || data.type == 'multiselect'`,helpText:`Available options (label/value pairs)`},{field:`reference`,widget:`ref:object`,visibleOn:`data.type == 'lookup' || data.type == 'master_detail'`,helpText:`Referenced object name`},{field:`referenceFilters`,widget:`string-tags`,visibleOn:`data.type == 'lookup' || data.type == 'master_detail'`,helpText:`Filter expressions (e.g., "active = true")`},{field:`deleteBehavior`,visibleOn:`data.type == 'lookup' || data.type == 'master_detail'`,helpText:`What happens when referenced record is deleted`}]},{label:`Formula & Computed`,description:`Calculated values and roll-up summaries.`,collapsible:!0,collapsed:!0,fields:[{field:`expression`,widget:`textarea`,helpText:`CEL expression to calculate this field (makes it read-only)`},{field:`summaryOperations`,type:`composite`,helpText:`Roll-up summary configuration (for parent-child relationships)`},{field:`cached`,type:`composite`,helpText:`Caching configuration for computed fields`}]},{label:`Advanced`,description:`Database, UI, audit, and security settings.`,collapsible:!0,collapsed:!0,columns:2,fields:[{field:`columnName`,colSpan:2,helpText:`Physical column name in database (defaults to field name)`},{field:`index`,colSpan:1,helpText:`Create database index for faster queries`},{field:`externalId`,colSpan:1,helpText:`Mark as external ID for upsert operations`},{field:`readonly`,colSpan:1,helpText:`Field is read-only in forms`},{field:`hidden`,colSpan:1,helpText:`Hide field from default UI views`},{field:`searchable`,colSpan:1,helpText:`Include in global search results`},{field:`sortable`,colSpan:1,helpText:`Allow sorting lists by this field`},{field:`auditTrail`,colSpan:1,helpText:`Track detailed changes with user and timestamp`},{field:`trackFeedHistory`,colSpan:1,helpText:`Show changes in activity feed`},{field:`encryptionConfig`,type:`composite`,colSpan:2,helpText:`Field-level encryption (GDPR/HIPAA/PCI-DSS)`},{field:`maskingRule`,type:`composite`,colSpan:2,helpText:`Data masking rules for PII protection`}]}]}),nh({schemaId:`hook`,type:`simple`,sections:[{label:`Identity`,description:`What this hook is and when it fires.`,columns:2,fields:[{field:`name`,type:`text`,required:!0,immutable:!0,colSpan:1,helpText:`snake_case identifier (immutable after creation)`},{field:`label`,type:`text`,colSpan:1},{field:`description`,type:`textarea`,colSpan:2},{field:`object`,type:`text`,required:!0,colSpan:1,helpText:`Target object name (or "*" for global)`},{field:`events`,type:`tags`,required:!0,colSpan:1,helpText:`Lifecycle events (e.g. beforeInsert, afterUpdate)`},{field:`priority`,type:`number`,colSpan:1,helpText:`Lower numbers run first`}]},{label:`Body`,description:`Inline expression or sandboxed JavaScript executed when the hook fires.`,fields:[{field:`body`,type:`composite`,helpText:`Either an L1 expression or an L2 sandboxed JS body`,fields:[{field:`language`,type:`select`,required:!0,helpText:`expression = pure formula; js = sandboxed JavaScript`,options:[{label:`Expression (L1)`,value:`expression`},{label:`JavaScript (L2 sandboxed)`,value:`js`}]},{field:`source`,type:`code`,language:`javascript`,required:!0,helpText:`Function body source — no top-level imports`},{field:`capabilities`,type:`tags`,helpText:`Allowed ctx APIs (api.read, api.write, crypto.uuid, log, …)`},{field:`timeoutMs`,type:`number`,helpText:`Per-invocation timeout (ms)`}]}]},{label:`Legacy handler`,description:`Function name reference — deprecated in favour of body.`,collapsible:!0,collapsed:!0,fields:[{field:`handler`,type:`text`,helpText:"Handler function name (deprecated — prefer `body`)"}]},{label:`Execution`,collapsible:!0,collapsed:!0,columns:2,fields:[{field:`async`,type:`boolean`,colSpan:1,helpText:`Run in background, do not block the transaction`},{field:`onError`,type:`select`,colSpan:1,options:[{label:`Abort`,value:`abort`},{label:`Log`,value:`log`}]},{field:`condition`,type:`code`,language:`javascript`,colSpan:2,helpText:`Optional formula — skip the hook when this evaluates to false`}]}]});var og=G(()=>B({field:F().describe(`Source field name containing the reference value`),targetObject:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Target object name (snake_case)`),targetField:F().default(`name`).describe(`Field on target object used for matching`),fieldType:U([`lookup`,`master_detail`]).describe(`Relationship field type`)}).describe(`Describes how a field reference is resolved during seed loading`)),sg=G(()=>B({object:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Object name (snake_case)`),dependsOn:z(F()).describe(`Objects this object depends on`),references:z(og).describe(`Field-level reference details`)}).describe(`Object node in the seed data dependency graph`)),cg=G(()=>B({nodes:z(sg).describe(`All objects in the dependency graph`),insertOrder:z(F()).describe(`Topologically sorted insert order`),circularDependencies:z(z(F())).default([]).describe(`Circular dependency chains (e.g., [["a", "b", "a"]])`)}).describe(`Complete object dependency graph for seed data loading`)),lg=G(()=>B({sourceObject:F().describe(`Object with the broken reference`),field:F().describe(`Field name with unresolved reference`),targetObject:F().describe(`Target object searched for the reference`),targetField:F().describe(`ExternalId field used for matching`),attemptedValue:R().describe(`Value that failed to resolve`),recordIndex:I().int().min(0).describe(`Index of the record in the dataset`),message:F().describe(`Human-readable error description`)}).describe(`Actionable error for a failed reference resolution`)),ug=G(()=>B({dryRun:L().default(!1).describe(`Validate references without writing data`),haltOnError:L().default(!1).describe(`Stop on first reference resolution error`),multiPass:L().default(!0).describe(`Enable multi-pass loading for circular dependencies`),defaultMode:ig.default(`upsert`).describe(`Default conflict resolution strategy`),batchSize:I().int().min(1).default(1e3).describe(`Maximum records per batch insert/upsert`),transaction:L().default(!1).describe(`Wrap entire load in a transaction (all-or-nothing)`),env:U([`prod`,`dev`,`test`]).optional().describe(`Only load datasets matching this environment`),organizationId:F().min(1).optional().describe(`Target organization id for per-tenant seed replay`)}).describe(`Seed data loader configuration`)),dg=G(()=>B({object:F().describe(`Object that was loaded`),mode:ig.describe(`Import mode used`),inserted:I().int().min(0).describe(`Records inserted`),updated:I().int().min(0).describe(`Records updated`),skipped:I().int().min(0).describe(`Records skipped`),errored:I().int().min(0).describe(`Records with errors`),total:I().int().min(0).describe(`Total records in dataset`),referencesResolved:I().int().min(0).describe(`References resolved via externalId`),referencesDeferred:I().int().min(0).describe(`References deferred to second pass`),errors:z(lg).default([]).describe(`Reference resolution errors`)}).describe(`Result of loading a single dataset`));G(()=>B({success:L().describe(`Overall success status`),dryRun:L().describe(`Whether this was a dry-run`),dependencyGraph:cg.describe(`Object dependency graph`),results:z(dg).describe(`Per-object load results`),errors:z(lg).describe(`All reference resolution errors`),summary:B({objectsProcessed:I().int().min(0).describe(`Total objects processed`),totalRecords:I().int().min(0).describe(`Total records across all objects`),totalInserted:I().int().min(0).describe(`Total records inserted`),totalUpdated:I().int().min(0).describe(`Total records updated`),totalSkipped:I().int().min(0).describe(`Total records skipped`),totalErrored:I().int().min(0).describe(`Total records with errors`),totalReferencesResolved:I().int().min(0).describe(`Total references resolved`),totalReferencesDeferred:I().int().min(0).describe(`Total references deferred`),circularDependencyCount:I().int().min(0).describe(`Circular dependency chains detected`),durationMs:I().min(0).describe(`Load duration in milliseconds`)}).describe(`Summary statistics`)}).describe(`Complete seed loader result`)),G(()=>B({datasets:z(ag).min(1).describe(`Datasets to load`),config:ug.default(()=>ug.parse({})).describe(`Loader configuration`)}).describe(`Seed loader request with datasets and configuration`));var fg=G(()=>B({versionNumber:I().describe(`Version number`),createdAt:I().describe(`Creation timestamp`),createdBy:F().describe(`Creator user ID`),size:I().describe(`File size in bytes`),checksum:F().describe(`File checksum`),downloadUrl:F().url().describe(`Download URL`),isLatest:L().optional().default(!1).describe(`Is latest version`)})),pg=G(()=>B({id:F().describe(`Template ID`),name:F().describe(`Template name`),description:F().optional().describe(`Template description`),fileUrl:F().url().describe(`Template file URL`),fileType:F().describe(`File MIME type`),placeholders:z(B({key:F().describe(`Placeholder key`),label:F().describe(`Placeholder label`),type:U([`text`,`number`,`date`,`image`]).describe(`Placeholder type`),required:L().optional().default(!1).describe(`Is required`)})).describe(`Template placeholders`)})),mg=G(()=>B({provider:U([`docusign`,`adobe-sign`,`hellosign`,`custom`]).describe(`E-signature provider`),enabled:L().optional().default(!1).describe(`E-signature enabled`),signers:z(B({email:F().email().describe(`Signer email`),name:F().describe(`Signer name`),role:F().describe(`Signer role`),order:I().describe(`Signing order`)})).describe(`Document signers`),expirationDays:I().optional().default(30).describe(`Expiration days`),reminderDays:I().optional().default(7).describe(`Reminder interval days`)}));G(()=>B({id:F().describe(`Document ID`),name:F().describe(`Document name`),description:F().optional().describe(`Document description`),fileType:F().describe(`File MIME type`),fileSize:I().describe(`File size in bytes`),category:F().optional().describe(`Document category`),tags:z(F()).optional().describe(`Document tags`),versioning:B({enabled:L().describe(`Versioning enabled`),versions:z(fg).describe(`Version history`),majorVersion:I().describe(`Major version`),minorVersion:I().describe(`Minor version`)}).optional().describe(`Version control`),template:pg.optional().describe(`Document template`),eSignature:mg.optional().describe(`E-signature config`),access:B({isPublic:L().optional().default(!1).describe(`Public access`),sharedWith:z(F()).optional().describe(`Shared with`),expiresAt:I().optional().describe(`Access expiration`)}).optional().describe(`Access control`),metadata:H(F(),R()).optional().describe(`Custom metadata`)}));var hg=G(()=>uf(`type`,[B({type:W(`constant`),value:R().describe(`Constant value to use`)}).describe(`Set a constant value`),B({type:W(`cast`),targetType:U([`string`,`number`,`boolean`,`date`]).describe(`Target data type`)}).describe(`Cast to a specific data type`),B({type:W(`lookup`),table:F().describe(`Lookup table name`),keyField:F().describe(`Field to match on`),valueField:F().describe(`Field to retrieve`)}).describe(`Lookup value from another table`),B({type:W(`javascript`),expression:jp.describe(`JS expression (dialect="js" recommended). e.g. value.toUpperCase()`)}).describe(`Custom JavaScript transformation`),B({type:W(`map`),mappings:H(F(),R()).describe(`Value mappings (e.g., {"Active": "active"})`)}).describe(`Map values using a dictionary`)])),gg=G(()=>B({source:F().describe(`Source field name`),target:F().describe(`Target field name`),transform:hg.optional().describe(`Transformation to apply`),defaultValue:R().optional().describe(`Default if source is null/undefined`)})),_g=G(()=>B({id:F().describe(`Data source ID`),name:F().describe(`Data source name`),type:U([`odata`,`rest-api`,`graphql`,`custom`]).describe(`Protocol type`),endpoint:F().url().describe(`API endpoint URL`),authentication:B({type:U([`oauth2`,`api-key`,`basic`,`none`]).describe(`Auth type`),config:H(F(),R()).describe(`Auth configuration`)}).describe(`Authentication`)})),vg=G(()=>gg.extend({type:F().optional().describe(`Field type`),readonly:L().optional().default(!0).describe(`Read-only field`)}));G(()=>B({fieldName:F().describe(`Field name`),dataSource:_g.describe(`External data source`),query:B({endpoint:F().describe(`Query endpoint path`),method:U([`GET`,`POST`]).optional().default(`GET`).describe(`HTTP method`),parameters:H(F(),R()).optional().describe(`Query parameters`)}).describe(`Query configuration`),fieldMappings:z(vg).describe(`Field mappings`),caching:B({enabled:L().optional().default(!0).describe(`Cache enabled`),ttl:I().optional().default(300).describe(`Cache TTL (seconds)`),strategy:U([`lru`,`lfu`,`ttl`]).optional().default(`ttl`).describe(`Cache strategy`)}).optional().describe(`Caching configuration`),fallback:B({enabled:L().optional().default(!0).describe(`Fallback enabled`),defaultValue:R().optional().describe(`Default fallback value`),showError:L().optional().default(!0).describe(`Show error to user`)}).optional().describe(`Fallback configuration`),rateLimit:B({requestsPerSecond:I().describe(`Requests per second limit`),burstSize:I().optional().describe(`Burst size`)}).optional().describe(`Rate limiting`),retry:B({maxRetries:I().min(0).default(3).describe(`Maximum retry attempts`),initialDelayMs:I().default(1e3).describe(`Initial retry delay in milliseconds`),maxDelayMs:I().default(3e4).describe(`Maximum retry delay in milliseconds`),backoffMultiplier:I().default(2).describe(`Exponential backoff multiplier`),retryableStatusCodes:z(I()).default([429,500,502,503,504]).describe(`HTTP status codes that are retryable`)}).optional().describe(`Retry configuration with exponential backoff`),transform:B({request:B({headers:H(F(),F()).optional().describe(`Additional request headers`),queryParams:H(F(),F()).optional().describe(`Additional query parameters`)}).optional().describe(`Request transformation`),response:B({dataPath:F().optional().describe(`JSONPath to extract data (e.g., "$.data.results")`),totalPath:F().optional().describe(`JSONPath to extract total count (e.g., "$.meta.total")`)}).optional().describe(`Response transformation`)}).optional().describe(`Request/response transformation pipeline`),pagination:B({type:U([`offset`,`cursor`,`page`]).default(`offset`).describe(`Pagination type`),pageSize:I().default(100).describe(`Items per page`),maxPages:I().optional().describe(`Maximum number of pages to fetch`)}).optional().describe(`Pagination configuration for external data`)}));var yg=F().describe(`Underlying driver identifier`);G(()=>B({id:F().describe(`Unique driver identifier (e.g. "postgres")`),label:F().describe(`Display label (e.g. "PostgreSQL")`),description:F().optional(),icon:F().optional(),configSchema:H(F(),R()).describe(`JSON Schema for connection configuration`),capabilities:zf(()=>bg).optional()}));var bg=B({transactions:L().default(!1),queryFilters:L().default(!1),queryAggregations:L().default(!1),querySorting:L().default(!1),queryPagination:L().default(!1),queryWindowFunctions:L().default(!1),querySubqueries:L().default(!1),joins:L().default(!1),fullTextSearch:L().default(!1),readOnly:L().default(!1),dynamicSchema:L().default(!1)});G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique datasource identifier`),label:F().optional().describe(`Display label`),driver:yg.describe(`Underlying driver type`),config:H(F(),R()).describe(`Driver specific configuration`),pool:B({min:I().default(0).describe(`Minimum connections`),max:I().default(10).describe(`Maximum connections`),idleTimeoutMillis:I().default(3e4).describe(`Idle timeout`),connectionTimeoutMillis:I().default(3e3).describe(`Connection establishment timeout`)}).optional().describe(`Connection pool settings`),readReplicas:z(H(F(),R())).optional().describe(`Read-only replica configurations`),capabilities:bg.optional().describe(`Capability overrides`),healthCheck:B({enabled:L().default(!0).describe(`Enable health check endpoint`),intervalMs:I().default(3e4).describe(`Health check interval in milliseconds`),timeoutMs:I().default(5e3).describe(`Health check timeout in milliseconds`)}).optional().describe(`Datasource health check configuration`),ssl:B({enabled:L().default(!1).describe(`Enable SSL/TLS for database connection`),rejectUnauthorized:L().default(!0).describe(`Reject connections with invalid/self-signed certificates`),ca:F().optional().describe(`CA certificate (PEM format or path to file)`),cert:F().optional().describe(`Client certificate (PEM format or path to file)`),key:F().optional().describe(`Client private key (PEM format or path to file)`)}).optional().describe(`SSL/TLS configuration for secure database connections`),retryPolicy:B({maxRetries:I().default(3).describe(`Maximum number of retry attempts`),baseDelayMs:I().default(1e3).describe(`Base delay between retries in milliseconds`),maxDelayMs:I().default(3e4).describe(`Maximum delay between retries in milliseconds`),backoffMultiplier:I().default(2).describe(`Exponential backoff multiplier`)}).optional().describe(`Connection retry policy for transient failures`),description:F().optional().describe(`Internal description`),active:L().default(!0).describe(`Is datasource enabled`)}));var xg=U([`count`,`sum`,`avg`,`min`,`max`,`count_distinct`,`number`,`string`,`boolean`]),Sg=U([`string`,`number`,`boolean`,`time`,`geo`]),Cg=U([`second`,`minute`,`hour`,`day`,`week`,`month`,`quarter`,`year`]),wg=G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique metric ID`),label:F().describe(`Human readable label`),description:F().optional(),type:xg,sql:F().describe(`SQL expression or field reference`),filters:z(B({sql:F()})).optional(),format:F().optional()})),Tg=G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Unique dimension ID`),label:F().describe(`Human readable label`),description:F().optional(),type:Sg,sql:F().describe(`SQL expression or column reference`),granularities:z(Cg).optional()})),Eg=G(()=>B({name:F().describe(`Target cube name`),relationship:U([`one_to_one`,`one_to_many`,`many_to_one`]).default(`many_to_one`),sql:F().describe(`Join condition (ON clause)`)}));G(()=>B({name:F().regex(/^[a-z_][a-z0-9_]*$/).describe(`Cube name (snake_case)`),title:F().optional(),description:F().optional(),sql:F().describe(`Base SQL statement or Table Name`),measures:H(F(),wg).describe(`Quantitative metrics`),dimensions:H(F(),Tg).describe(`Qualitative attributes`),joins:H(F(),Eg).optional(),refreshKey:B({every:F().optional(),sql:F().optional()}).optional(),public:L().default(!1)})),G(()=>B({cube:F().optional().describe(`Target cube name (optional when provided externally, e.g. in API request wrapper)`),measures:z(F()).describe(`List of metrics to calculate`),dimensions:z(F()).optional().describe(`List of dimensions to group by`),where:Zf.optional().describe(`Filtering criteria (canonical Query DSL FilterCondition)`),timeDimensions:z(B({dimension:F(),granularity:Cg.optional(),dateRange:V([F(),z(F())]).optional()})).optional(),order:H(F(),U([`asc`,`desc`])).optional(),limit:I().optional(),offset:I().optional(),timezone:F().optional().default(`UTC`)}));var Dg=U([`comment`,`field_change`,`task`,`event`,`email`,`call`,`note`,`file`,`record_create`,`record_delete`,`approval`,`sharing`,`system`]),Og=G(()=>B({type:U([`user`,`team`,`record`]).describe(`Mention target type`),id:F().describe(`Target ID`),name:F().describe(`Display name for rendering`),offset:I().int().min(0).describe(`Character offset in body text`),length:I().int().min(1).describe(`Length of mention token in body text`)})),kg=G(()=>B({field:F().describe(`Field machine name`),fieldLabel:F().optional().describe(`Field display label`),oldValue:R().optional().describe(`Previous value`),newValue:R().optional().describe(`New value`),oldDisplayValue:F().optional().describe(`Human-readable old value`),newDisplayValue:F().optional().describe(`Human-readable new value`)})),Ag=G(()=>B({emoji:F().describe(`Emoji character or shortcode (e.g., "👍", ":thumbsup:")`),userIds:z(F()).describe(`Users who reacted`),count:I().int().min(1).describe(`Total reaction count`)})),jg=G(()=>B({type:U([`user`,`system`,`service`,`automation`]).describe(`Actor type`),id:F().describe(`Actor ID`),name:F().optional().describe(`Actor display name`),avatarUrl:F().url().optional().describe(`Actor avatar URL`),source:F().optional().describe(`Source application (e.g., "Omni", "API", "Studio")`)})),Mg=U([`public`,`internal`,`private`]);G(()=>B({id:F().describe(`Feed item ID`),type:Dg.describe(`Activity type`),object:F().describe(`Object name (e.g., "account")`),recordId:F().describe(`Record ID this feed item belongs to`),actor:jg.describe(`Who performed this action`),body:F().optional().describe(`Rich text body (Markdown supported)`),mentions:z(Og).optional().describe(`Mentioned users/teams/records`),changes:z(kg).optional().describe(`Field-level changes`),reactions:z(Ag).optional().describe(`Emoji reactions on this item`),parentId:F().optional().describe(`Parent feed item ID for threaded replies`),replyCount:I().int().min(0).default(0).describe(`Number of replies`),pinned:L().default(!1).describe(`Whether the feed item is pinned to the top of the timeline`),pinnedAt:F().datetime().optional().describe(`Timestamp when the item was pinned`),pinnedBy:F().optional().describe(`User ID who pinned the item`),starred:L().default(!1).describe(`Whether the feed item is starred/bookmarked by the current user`),starredAt:F().datetime().optional().describe(`Timestamp when the item was starred`),visibility:Mg.default(`public`).describe(`Visibility: public (all users), internal (team only), private (author + mentioned)`),createdAt:F().datetime().describe(`Creation timestamp`),updatedAt:F().datetime().optional().describe(`Last update timestamp`),editedAt:F().datetime().optional().describe(`When comment was last edited`),isEdited:L().default(!1).describe(`Whether comment has been edited`)})),U([`all`,`comments_only`,`changes_only`,`tasks_only`]);var Ng=U([`comment`,`mention`,`field_change`,`task`,`approval`,`all`]),Pg=U([`in_app`,`email`,`push`,`slack`]);G(()=>B({object:F().describe(`Object name`),recordId:F().describe(`Record ID`),userId:F().describe(`Subscribing user ID`),events:z(Ng).default([`all`]).describe(`Event types to receive notifications for`),channels:z(Pg).default([`in_app`]).describe(`Notification delivery channels`),active:L().default(!0).describe(`Whether the subscription is active`),createdAt:F().datetime().describe(`Subscription creation timestamp`)}));var Fg=G(()=>U([`header`,`subdomain`,`path`,`token`,`lookup`]).describe(`Strategy for resolving tenant identity from request context`)),Ig=G(()=>B({name:F().min(1).describe(`Turso database group name`),primaryLocation:F().min(2).describe(`Primary Turso region code (e.g., iad, lhr, nrt)`),replicaLocations:z(F().min(2)).default([]).describe(`Additional replica region codes`),schemaDatabase:F().optional().describe(`Schema database name for multi-db schemas`)}).describe(`Turso database group configuration`)),Lg=G(()=>B({onTenantCreate:B({autoCreate:L().default(!0).describe(`Auto-create database on tenant registration`),group:F().optional().describe(`Turso group for the new database`),applyGroupSchema:L().default(!0).describe(`Apply shared schema from group`),seedData:L().default(!1).describe(`Populate seed data on creation`)}).describe(`Tenant creation hook`),onTenantDelete:B({immediate:L().default(!1).describe(`Destroy database immediately`),gracePeriodHours:I().int().min(0).default(72).describe(`Grace period before permanent deletion`),createBackup:L().default(!0).describe(`Create backup before deletion`)}).describe(`Tenant deletion hook`),onTenantSuspend:B({revokeTokens:L().default(!0).describe(`Revoke auth tokens on suspension`),readOnly:L().default(!0).describe(`Set database to read-only on suspension`)}).describe(`Tenant suspension hook`)}).describe(`Tenant database lifecycle hooks`));G(()=>B({organizationSlug:F().min(1).describe(`Turso organization slug`),urlTemplate:F().min(1).describe(`URL template with {tenant_id} placeholder`),groupAuthToken:F().min(1).describe(`Group-level auth token for platform operations`),tenantResolverStrategy:Fg.default(`token`),group:Ig.optional().describe(`Database group configuration`),lifecycle:Lg.optional().describe(`Lifecycle hooks`),maxCachedConnections:I().int().min(1).default(100).describe(`Max cached tenant connections (LRU)`),connectionCacheTTL:I().int().min(0).default(300).describe(`Connection cache TTL in seconds`)}).describe(`Turso multi-tenant router configuration`));var Rg=(e=>l===void 0?typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(l===void 0?e:l)[t]}):e:l)(function(e){if(l!==void 0)return l.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)}),zg={debug:0,info:1,warn:2,error:3,fatal:4,silent:5},Bg={debug:`\x1B[36m`,info:`\x1B[32m`,warn:`\x1B[33m`,error:`\x1B[31m`,fatal:`\x1B[35m`,silent:``},Vg=`\x1B[0m`,Hg=class e{constructor(e={},t={}){this.config={name:e.name,level:e.level??`info`,format:e.format??`pretty`,redact:e.redact??[`password`,`token`,`secret`,`key`],sourceLocation:e.sourceLocation??!1,file:e.file,rotation:e.rotation??{maxSize:`10m`,maxFiles:5}},this.bindings=t,this.config.file&&typeof process<`u`&&this.openFileStream(this.config.file)}openFileStream(e){try{let t=Rg(`fs`),n=Rg(`path`).dirname(e);t.mkdirSync(n,{recursive:!0}),this.fileStream=t.createWriteStream(e,{flags:`a`})}catch{}}isEnabled(e){return zg[e]>=zg[this.config.level]}redactSensitive(e){if(!e||typeof e!=`object`)return e;let t=Array.isArray(e)?[...e]:{...e};for(let e in t){let n=e.toLowerCase();this.config.redact.some(e=>n.includes(e.toLowerCase()))?t[e]=`***REDACTED***`:typeof t[e]==`object`&&t[e]!==null&&(t[e]=this.redactSensitive(t[e]))}return t}write(e,t,n,r){if(!this.isEnabled(e))return;let i=this.redactSensitive({...this.bindings,...n,...r?{error:{message:r.message,stack:r.stack}}:{}}),a=Object.keys(i).length>0,o=new Date().toISOString(),s;if(this.config.format===`json`)s=JSON.stringify({time:o,level:e,...this.config.name?{name:this.config.name}:{},msg:t,...i});else if(this.config.format===`text`){let n=[o,e.toUpperCase(),t];a&&n.push(JSON.stringify(i)),s=n.join(` | `)}else{let n=Bg[e]||``,r=this.config.name?`[${this.config.name}] `:``;s=`${n}${o} ${e.toUpperCase()}${Vg} ${r}${t}`,a&&(s+=` ${JSON.stringify(i)}`)}let c=s+`
103
103
  `;typeof process<`u`&&process.stderr?e===`error`||e===`fatal`?process.stderr.write(c):process.stdout?.write(c):typeof console<`u`&&(e===`error`||e===`fatal`?console.error:e===`warn`?console.warn:e===`debug`?console.debug:console.log)(s),this.fileStream&&this.fileStream.write(c)}debug(e,t){this.write(`debug`,e,t)}info(e,t){this.write(`info`,e,t)}warn(e,t){this.write(`warn`,e,t)}error(e,t,n){t instanceof Error?this.write(`error`,e,n,t):this.write(`error`,e,t)}fatal(e,t,n){t instanceof Error?this.write(`fatal`,e,n,t):this.write(`fatal`,e,t)}log(e,...t){this.info(e,t.length>0?{args:t}:void 0)}child(t){let n=new e(this.config,{...this.bindings,...t});return n.fileStream=this.fileStream,n}withTrace(e,t){return this.child({traceId:e,spanId:t})}async destroy(){this.fileStream&&=(await new Promise(e=>this.fileStream.end(e)),void 0)}};function Ug(e){return new Hg(e)}var Wg=class{constructor(e,t){this.subscriptions=new Map,this.eventBuffer=[],this._baseUrl=e,this._token=t}subscribeMetadata(e,t,n){let r=`metadata-${e}-${Date.now()}`;return this.subscriptions.set(r,{filter:{type:e,packageId:n?.packageId,eventTypes:[`metadata.${e}.created`,`metadata.${e}.updated`,`metadata.${e}.deleted`]},handler:e=>{e.type.startsWith(`metadata.`)&&t(e)}}),this.startPolling(),()=>{this.subscriptions.delete(r),this.subscriptions.size===0&&this.stopPolling()}}subscribeData(e,t,n){let r=`data-${e}-${Date.now()}`;return this.subscriptions.set(r,{filter:{type:e,recordId:n?.recordId,eventTypes:[`data.record.created`,`data.record.updated`,`data.record.deleted`]},handler:r=>{r.type.startsWith(`data.`)&&r.object===e&&(!n?.recordId||r.payload?.recordId===n.recordId)&&t(r)}}),this.startPolling(),()=>{this.subscriptions.delete(r),this.subscriptions.size===0&&this.stopPolling()}}emitEvent(e){for(let t of this.subscriptions.values()){let n=!t.filter.type||e.type.includes(t.filter.type)||e.object===t.filter.type,r=!t.filter.eventTypes?.length||t.filter.eventTypes.includes(e.type),i=!t.filter.packageId||e.payload?.packageId===t.filter.packageId;if(n&&r&&i)try{t.handler(e)}catch(e){console.error(`Error in realtime event handler:`,e)}}}startPolling(){this.pollInterval||=setInterval(()=>{for(;this.eventBuffer.length>0;){let e=this.eventBuffer.shift();e&&this.emitEvent(e)}},2e3)}stopPolling(){this.pollInterval&&=(clearInterval(this.pollInterval),void 0)}_bufferEvent(e){this.eventBuffer.push(e)}disconnect(){this.stopPolling(),this.subscriptions.clear(),this.eventBuffer=[]}},Gg=class{constructor(e){this.meta={getTypes:async()=>{let e=this.getRoute(`metadata`),t=await this.fetch(`${this.baseUrl}${e}`);return this.unwrapResponse(t)},getItems:async(e,t)=>{let n=this.getRoute(`metadata`),r=new URLSearchParams;t?.packageId&&r.set(`package`,t.packageId);let i=r.toString(),a=`${this.baseUrl}${n}/${e}${i?`?${i}`:``}`,o=await this.fetch(a);return this.unwrapResponse(o)},getItem:async(e,t,n)=>{let r=this.getRoute(`metadata`),i=new URLSearchParams;n?.packageId&&i.set(`package`,n.packageId);let a=i.toString(),o=`${this.baseUrl}${r}/${e}/${t}${a?`?${a}`:``}`,s=await this.fetch(o);return this.unwrapResponse(s)},saveItem:async(e,t,n)=>{let r=this.getRoute(`metadata`),i=await this.fetch(`${this.baseUrl}${r}/${e}/${t}`,{method:`PUT`,body:JSON.stringify(n)});return this.unwrapResponse(i)},deleteItem:async(e,t)=>{let n=this.getRoute(`metadata`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(r)},getHistory:async(e,t,n)=>{let r=this.getRoute(`metadata`),i=new URLSearchParams;n?.sinceSeq!==void 0&&i.set(`sinceSeq`,String(n.sinceSeq)),n?.limit!==void 0&&i.set(`limit`,String(n.limit));let a=i.toString(),o=`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/history${a?`?${a}`:``}`,s=await this.fetch(o);return this.unwrapResponse(s)},getCached:async(e,t)=>{let n=this.getRoute(`metadata`),r={};t?.ifNoneMatch&&(r[`If-None-Match`]=t.ifNoneMatch),t?.ifModifiedSince&&(r[`If-Modified-Since`]=t.ifModifiedSince);let i=await this.fetch(`${this.baseUrl}${n}/object/${e}`,{headers:r});if(i.status===304)return{notModified:!0,etag:t?.ifNoneMatch?{value:t.ifNoneMatch.replace(/^W\/|"/g,``),weak:t.ifNoneMatch.startsWith(`W/`)}:void 0};let a=await i.json(),o=i.headers.get(`ETag`),s=i.headers.get(`Last-Modified`);return{data:a,etag:o?{value:o.replace(/^W\/|"/g,``),weak:o.startsWith(`W/`)}:void 0,lastModified:s||void 0,notModified:!1}},getView:async(e,t=`list`)=>{let n=this.getRoute(`ui`),r=await this.fetch(`${this.baseUrl}${n}/view/${e}?type=${t}`);return this.unwrapResponse(r)}},this.analytics={query:async e=>{let t=this.getRoute(`analytics`);return(await this.fetch(`${this.baseUrl}${t}/query`,{method:`POST`,body:JSON.stringify(e)})).json()},meta:async e=>{let t=this.getRoute(`analytics`);return(await this.fetch(`${this.baseUrl}${t}/meta/${e}`)).json()},explain:async e=>{let t=this.getRoute(`analytics`);return(await this.fetch(`${this.baseUrl}${t}/explain`,{method:`POST`,body:JSON.stringify(e)})).json()}},this.packages={list:async e=>{let t=this.getRoute(`packages`),n=new URLSearchParams;e?.status&&n.set(`status`,e.status),e?.type&&n.set(`type`,e.type),e?.enabled!==void 0&&n.set(`enabled`,String(e.enabled));let r=n.toString(),i=`${this.baseUrl}${t}${r?`?`+r:``}`,a=await this.fetch(i);return this.unwrapResponse(a)},get:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}`);return this.unwrapResponse(n)},install:async(e,t)=>{let n=this.getRoute(`packages`),r=await this.fetch(`${this.baseUrl}${n}`,{method:`POST`,body:JSON.stringify({manifest:e,settings:t?.settings,enableOnInstall:t?.enableOnInstall})});return this.unwrapResponse(r)},uninstall:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}`,{method:`DELETE`});return this.unwrapResponse(n)},enable:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}/enable`,{method:`PATCH`});return this.unwrapResponse(n)},disable:async e=>{let t=this.getRoute(`packages`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}/disable`,{method:`PATCH`});return this.unwrapResponse(n)}},this.projects={list:async e=>{let t=new URLSearchParams;e?.organization_id&&t.set(`organizationId`,e.organization_id),e?.env_type&&t.set(`envType`,e.env_type),e?.status&&t.set(`status`,e.status);let n=t.toString(),r=`${this.baseUrl}/api/v1/cloud/environments${n?`?`+n:``}`,i=await this.fetch(r);return this.unwrapResponse(i)},get:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}`);return this.unwrapResponse(t)},create:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(t)},update:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify(t)});return this.unwrapResponse(n)},delete:async(e,t)=>{let n=t?.force?`?force=1`:``,r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}${n}`,{method:`DELETE`});return this.unwrapResponse(r)},activate:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/activate`,{method:`POST`});return this.unwrapResponse(t)},rotateCredential:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/credentials/rotate`,{method:`POST`,body:JSON.stringify({plaintext:t})});return this.unwrapResponse(n)},updateHostname:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/hostname`,{method:`POST`,body:JSON.stringify({hostname:t})});return this.unwrapResponse(n)},updateVisibility:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}`,{method:`PATCH`,body:JSON.stringify({visibility:t})});return this.unwrapResponse(n)},listRevisions:async(e,t)=>{let n=new URLSearchParams;t?.limit&&n.set(`limit`,String(t.limit)),t?.cursor&&n.set(`cursor`,t.cursor),t?.branch&&n.set(`branch`,t.branch);let r=n.toString(),i=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/revisions${r?`?${r}`:``}`);return this.unwrapResponse(i)},listBranches:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/branches`);return this.unwrapResponse(t)},renameBranch:async(e,t,n)=>{let r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/branches/${encodeURIComponent(t)}/rename`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({newName:n})});return this.unwrapResponse(r)},deleteBranch:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/branches/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(n)},activateRevision:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/revisions/${encodeURIComponent(t)}/activate`,{method:`POST`});return this.unwrapResponse(n)},retryProvisioning:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/retry`,{method:`POST`});return this.unwrapResponse(t)},listMembers:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members`);return this.unwrapResponse(t)},addMember:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)});return this.unwrapResponse(n)},updateMemberRole:async(e,t,n)=>{let r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`PATCH`,headers:{"content-type":`application/json`},body:JSON.stringify({role:n})});return this.unwrapResponse(r)},removeMember:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/members/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(n)},listDrivers:async()=>{let e=await this.fetch(`${this.baseUrl}/api/v1/cloud/drivers`);return this.unwrapResponse(e)},listTemplates:async()=>{let e=await this.fetch(`${this.baseUrl}/api/v1/cloud/templates`);return this.unwrapResponse(e)},packages:{list:async e=>{let t=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages`);return this.unwrapResponse(t)},install:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(n)},get:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}`);return this.unwrapResponse(n)},enable:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}/enable`,{method:`PATCH`});return this.unwrapResponse(n)},disable:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}/disable`,{method:`PATCH`});return this.unwrapResponse(n)},uninstall:async(e,t)=>{let n=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(n)},upgrade:async(e,t,n)=>{let r=await this.fetch(`${this.baseUrl}/api/v1/cloud/environments/${encodeURIComponent(e)}/packages/${encodeURIComponent(t)}/upgrade`,{method:`POST`,body:JSON.stringify({targetVersion:n})});return this.unwrapResponse(r)}}},this.organizations={list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/organization/list`)).json();return{organizations:Array.isArray(t)?t:t?.data??[]}},create:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/create`,{method:`POST`,body:JSON.stringify(e)})).json()},update:async(e,t)=>{let n=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${n}/organization/update`,{method:`POST`,body:JSON.stringify({organizationId:e,data:t})})).json()},setActive:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/set-active`,{method:`POST`,body:JSON.stringify({organizationId:e})})).json()},get:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/get-full-organization?organizationId=${encodeURIComponent(e)}`)).json()},listMembers:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/list-members?organizationId=${encodeURIComponent(e)}`)).json()},invite:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/invite-member`,{method:`POST`,body:JSON.stringify(e)})).json()},leave:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/leave`,{method:`POST`,body:JSON.stringify({organizationId:e})})).json()},delete:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/delete`,{method:`POST`,body:JSON.stringify({organizationId:e})})).json()},removeMember:async(e,t)=>{let n=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${n}/organization/remove-member`,{method:`POST`,body:JSON.stringify({memberIdOrEmail:t.memberIdOrEmail,organizationId:e})})).json()},updateMemberRole:async(e,t)=>{let n=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${n}/organization/update-member-role`,{method:`POST`,body:JSON.stringify({memberId:t.memberId,role:t.role,organizationId:e})})).json()},getActiveMember:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/get-active-member?organizationId=${encodeURIComponent(e)}`)).json()},invitations:{list:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/organization/list-invitations?organizationId=${encodeURIComponent(e)}`)).json();return{invitations:Array.isArray(n)?n:n?.data??n?.invitations??[]}},listMine:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/organization/list-user-invitations`)).json();return{invitations:Array.isArray(t)?t:t?.data??t?.invitations??[]}},cancel:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/cancel-invitation`,{method:`POST`,body:JSON.stringify({invitationId:e})})).json()},accept:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/accept-invitation`,{method:`POST`,body:JSON.stringify({invitationId:e})})).json()},reject:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/reject-invitation`,{method:`POST`,body:JSON.stringify({invitationId:e})})).json()},resend:async e=>{if(e.id)try{await this.organizations.invitations.cancel(e.id)}catch{}return this.organizations.invite({email:e.email,role:e.role??`member`,organizationId:e.organizationId})}},teams:{list:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/organization/list-teams?organizationId=${encodeURIComponent(e)}`)).json();return{teams:Array.isArray(n)?n:n?.data??n?.teams??[]}},create:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/create-team`,{method:`POST`,body:JSON.stringify(e)})).json()},update:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/update-team`,{method:`POST`,body:JSON.stringify(e)})).json()},delete:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/remove-team`,{method:`POST`,body:JSON.stringify(e)})).json()},listMembers:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/organization/list-team-members?teamId=${encodeURIComponent(e)}`)).json();return{members:Array.isArray(n)?n:n?.data??n?.members??[]}},addMember:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/add-team-member`,{method:`POST`,body:JSON.stringify(e)})).json()},removeMember:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/organization/remove-team-member`,{method:`POST`,body:JSON.stringify(e)})).json()}}},this.oauth={applications:{register:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/create-client`,{method:`POST`,body:JSON.stringify(e)})).json()},get:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/get-client?client_id=${encodeURIComponent(e)}`)).json()},getPublic:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/public-client?client_id=${encodeURIComponent(e)}`)).json()},list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/oauth2/get-clients`)).json();return{applications:Array.isArray(t)?t:t?.clients??t?.data??[]}},delete:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/delete-client`,{method:`POST`,body:JSON.stringify({client_id:e})})).json()}},consent:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/oauth2/consent`,{method:`POST`,body:JSON.stringify(e)})).json()}},this.auth={getConfig:async()=>{let e=this.getRoute(`auth`),t=await this.fetch(`${this.baseUrl}${e}/config`);return this.unwrapResponse(t)},login:async e=>{let t=this.getRoute(`auth`),n=await this.fetch(`${this.baseUrl}${t}/sign-in/email`,{method:`POST`,headers:{Origin:this.baseUrl},body:JSON.stringify(e)}),r=await n.json().catch(()=>({}));if(!n.ok){let e=r?.message||r?.error?.message||`Login failed (HTTP ${n.status})`,t=Error(e);throw r?.code&&(t.code=r.code),t.status=n.status,t}let i=r&&(r.data??(r.token||r.user?{token:r.token,user:r.user}:void 0)),a=i?{...r,data:i}:r;return a.data?.token&&(this.token=a.data.token),a},logout:async()=>{let e=this.getRoute(`auth`);await this.fetch(`${this.baseUrl}${e}/sign-out`,{method:`POST`,headers:{"Content-Type":`application/json`,Origin:this.baseUrl},body:`{}`}),this.token=void 0},me:async()=>{let e=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${e}/get-session`,{headers:{Origin:this.baseUrl}})).json()},register:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/sign-up/email`,{method:`POST`,headers:{Origin:this.baseUrl},body:JSON.stringify(e)})).json(),r=n&&(n.data??(n.token||n.user?{token:n.token,user:n.user}:void 0)),i=r?{...n,data:r}:n;return i.data?.token&&(this.token=i.data.token),i},signInWithProvider:async(e,t)=>{if(typeof window>`u`)throw Error(`signInWithProvider requires a browser environment`);let n=this.getRoute(`auth`),r=t?.callbackURL??window.location.origin+`/login`,i=t?.type===`oidc`,a=i?`/sign-in/oauth2`:`/sign-in/social`,o=i?{providerId:e,callbackURL:r}:{provider:e,callbackURL:r};t?.errorCallbackURL&&(o.errorCallbackURL=t.errorCallbackURL);let s=await(await this.fetch(`${this.baseUrl}${n}${a}`,{method:`POST`,body:JSON.stringify(o)})).json(),c=s?.url??s?.data?.url;if(c)window.location.assign(c);else throw Error(`signInWithProvider: no redirect URL returned for provider "${e}"`)},refreshToken:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/get-session`,{method:`GET`})).json();return n.data?.token&&(this.token=n.data.token),n},bootstrapStatus:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/bootstrap-status`)).json();return{hasOwner:!!(t?.data??t)?.hasOwner}},updateUser:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/update-user`,{method:`POST`,body:JSON.stringify(e)})).json()},changePassword:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/change-password`,{method:`POST`,body:JSON.stringify(e)})).json()},changeEmail:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/change-email`,{method:`POST`,body:JSON.stringify(e)})).json()},sendVerificationEmail:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/send-verification-email`,{method:`POST`,body:JSON.stringify(e)})).json()},verifyEmail:async e=>{let t=this.getRoute(`auth`),n=new URL(`${this.baseUrl}${t}/verify-email`);return n.searchParams.set(`token`,e.token),e.callbackURL&&n.searchParams.set(`callbackURL`,e.callbackURL),(await this.fetch(n.toString())).json()},deleteUser:async e=>{let t=this.getRoute(`auth`),n=await this.fetch(`${this.baseUrl}${t}/delete-user`,{method:`POST`,body:JSON.stringify(e)});return this.token=void 0,n.json()},sessions:{list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/list-sessions`)).json();return{sessions:Array.isArray(t)?t:t?.data??t?.sessions??[]}},revoke:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/revoke-session`,{method:`POST`,body:JSON.stringify({token:e})})).json()},revokeOthers:async()=>{let e=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${e}/revoke-other-sessions`,{method:`POST`,body:`{}`})).json()},revokeAll:async()=>{let e=this.getRoute(`auth`),t=await this.fetch(`${this.baseUrl}${e}/revoke-sessions`,{method:`POST`,body:`{}`});return this.token=void 0,t.json()}},twoFactor:{enable:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/two-factor/enable`,{method:`POST`,body:JSON.stringify(e)})).json();return n?.data??n},verifyTotp:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/two-factor/verify-totp`,{method:`POST`,body:JSON.stringify(e)})).json()},disable:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/two-factor/disable`,{method:`POST`,body:JSON.stringify(e)})).json()},generateBackupCodes:async e=>{let t=this.getRoute(`auth`),n=await(await this.fetch(`${this.baseUrl}${t}/two-factor/generate-backup-codes`,{method:`POST`,body:JSON.stringify(e)})).json();return n?.data??n},verifyBackupCode:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/two-factor/verify-backup-code`,{method:`POST`,body:JSON.stringify(e)})).json()}},accounts:{list:async()=>{let e=this.getRoute(`auth`),t=await(await this.fetch(`${this.baseUrl}${e}/list-accounts`)).json();return{accounts:Array.isArray(t)?t:t?.data??t?.accounts??[]}},unlink:async e=>{let t=this.getRoute(`auth`);return(await this.fetch(`${this.baseUrl}${t}/unlink-account`,{method:`POST`,body:JSON.stringify(e)})).json()},linkSocial:async e=>{let t=this.getRoute(`auth`),n=e.callbackURL??(typeof window<`u`?window.location.href:void 0),r=await(await this.fetch(`${this.baseUrl}${t}/link-social`,{method:`POST`,body:JSON.stringify({provider:e.provider,callbackURL:n})})).json();return r?.data??r}}},this.storage={upload:async(e,t=`user`)=>{let n={filename:e.name,mimeType:e.type,size:e.size,scope:t},r=this.getRoute(`storage`),{data:i}=await(await this.fetch(`${this.baseUrl}${r}/upload/presigned`,{method:`POST`,body:JSON.stringify(n)})).json(),a=await this.fetchImpl(i.uploadUrl,{method:i.method,headers:i.headers,body:e});if(!a.ok)throw Error(`Storage Upload Failed: ${a.statusText}`);let o={fileId:i.fileId};return(await this.fetch(`${this.baseUrl}${r}/upload/complete`,{method:`POST`,body:JSON.stringify(o)})).json()},getDownloadUrl:async e=>{let t=this.getRoute(`storage`);return(await(await this.fetch(`${this.baseUrl}${t}/files/${e}/url`)).json()).url},getPresignedUrl:async e=>{let t=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${t}/upload/presigned`,{method:`POST`,body:JSON.stringify(e)})).json()},initChunkedUpload:async e=>{let t=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${t}/upload/chunked`,{method:`POST`,body:JSON.stringify(e)})).json()},uploadPart:async(e,t,n,r)=>{let i=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${i}/upload/chunked/${e}/chunk/${t}`,{method:`PUT`,headers:{"x-resume-token":n},body:r})).json()},completeChunkedUpload:async e=>{let t=this.getRoute(`storage`);return(await this.fetch(`${this.baseUrl}${t}/upload/chunked/${e.uploadId}/complete`,{method:`POST`,body:JSON.stringify(e)})).json()},resumeUpload:async(e,t,n,r)=>{let i=this.getRoute(`storage`),{totalChunks:a,uploadedChunks:o}=(await(await this.fetch(`${this.baseUrl}${i}/upload/chunked/${e}/progress`)).json()).data,s=[],c=t instanceof ArrayBuffer?t:await t.arrayBuffer();for(let t=o;t<a;t++){let i=t*n,a=Math.min(i+n,c.byteLength),o=new Blob([c.slice(i,a)]),l=await this.storage.uploadPart(e,t,r,o);s.push({chunkIndex:t,eTag:l.data.eTag})}return this.storage.completeChunkedUpload({uploadId:e,parts:s})}},this.automation={trigger:async(e,t)=>{let n=this.getRoute(`automation`);return(await this.fetch(`${this.baseUrl}${n}/trigger/${e}`,{method:`POST`,body:JSON.stringify(t)})).json()},list:async()=>{let e=this.getRoute(`automation`),t=await this.fetch(`${this.baseUrl}${e}`);return this.unwrapResponse(t)},get:async e=>{let t=this.getRoute(`automation`),n=await this.fetch(`${this.baseUrl}${t}/${e}`);return this.unwrapResponse(n)},create:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}`,{method:`POST`,body:JSON.stringify({name:e,...t})});return this.unwrapResponse(r)},update:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${e}`,{method:`PUT`,body:JSON.stringify({definition:t})});return this.unwrapResponse(r)},delete:async e=>{let t=this.getRoute(`automation`),n=await this.fetch(`${this.baseUrl}${t}/${e}`,{method:`DELETE`});return this.unwrapResponse(n)},toggle:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${e}/toggle`,{method:`POST`,body:JSON.stringify({enabled:t})});return this.unwrapResponse(r)},runs:{list:async(e,t)=>{let n=this.getRoute(`automation`),r=new URLSearchParams;t?.limit&&r.set(`limit`,String(t.limit)),t?.cursor&&r.set(`cursor`,t.cursor);let i=r.toString(),a=await this.fetch(`${this.baseUrl}${n}/${e}/runs${i?`?${i}`:``}`);return this.unwrapResponse(a)},get:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${e}/runs/${t}`);return this.unwrapResponse(r)}},getFlow:async e=>{let t=this.getRoute(`automation`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}`);return this.unwrapResponse(n)},execute:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/trigger`,{method:`POST`,body:JSON.stringify(t??{})});return this.unwrapResponse(r)},listRuns:async(e,t)=>{let n=this.getRoute(`automation`),r=new URLSearchParams;t?.limit!=null&&r.set(`limit`,String(t.limit)),t?.cursor&&r.set(`cursor`,t.cursor);let i=r.toString(),a=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/runs${i?`?${i}`:``}`);return this.unwrapResponse(a)},getRun:async(e,t)=>{let n=this.getRoute(`automation`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}`);return this.unwrapResponse(r)}},this.permissions={check:async e=>{let t=this.getRoute(`permissions`),n=new URLSearchParams({object:e.object,action:e.action});e.recordId!==void 0&&n.set(`recordId`,e.recordId),e.field!==void 0&&n.set(`field`,e.field);let r=await this.fetch(`${this.baseUrl}${t}/check?${n.toString()}`);return this.unwrapResponse(r)},getObjectPermissions:async e=>{let t=this.getRoute(`permissions`),n=await this.fetch(`${this.baseUrl}${t}/objects/${encodeURIComponent(e)}`);return this.unwrapResponse(n)},getEffectivePermissions:async()=>{let e=this.getRoute(`permissions`),t=await this.fetch(`${this.baseUrl}${e}/effective`);return this.unwrapResponse(t)}},this.realtime={connect:async e=>{let t=this.getRoute(`realtime`),n=await this.fetch(`${this.baseUrl}${t}/connect`,{method:`POST`,body:JSON.stringify(e||{})});return this.unwrapResponse(n)},disconnect:async()=>{let e=this.getRoute(`realtime`);await this.fetch(`${this.baseUrl}${e}/disconnect`,{method:`POST`})},subscribe:async e=>{let t=this.getRoute(`realtime`),n=await this.fetch(`${this.baseUrl}${t}/subscribe`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},unsubscribe:async e=>{let t=this.getRoute(`realtime`);await this.fetch(`${this.baseUrl}${t}/unsubscribe`,{method:`POST`,body:JSON.stringify({subscriptionId:e})})},setPresence:async(e,t)=>{let n=this.getRoute(`realtime`);await this.fetch(`${this.baseUrl}${n}/presence`,{method:`PUT`,body:JSON.stringify({channel:e,state:t})})},getPresence:async e=>{let t=this.getRoute(`realtime`),n=await this.fetch(`${this.baseUrl}${t}/presence/${encodeURIComponent(e)}`);return this.unwrapResponse(n)}},this.workflow={getConfig:async e=>{let t=this.getRoute(`workflow`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e)}/config`);return this.unwrapResponse(n)},getState:async(e,t)=>{let n=this.getRoute(`workflow`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/state`);return this.unwrapResponse(r)},transition:async e=>{let t=this.getRoute(`workflow`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e.object)}/${encodeURIComponent(e.recordId)}/transition`,{method:`POST`,body:JSON.stringify({transition:e.transition,comment:e.comment,data:e.data})});return this.unwrapResponse(n)},approve:async e=>{let t=this.getRoute(`workflow`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e.object)}/${encodeURIComponent(e.recordId)}/approve`,{method:`POST`,body:JSON.stringify({comment:e.comment,data:e.data})});return this.unwrapResponse(n)},reject:async e=>{let t=this.getRoute(`workflow`),n=await this.fetch(`${this.baseUrl}${t}/${encodeURIComponent(e.object)}/${encodeURIComponent(e.recordId)}/reject`,{method:`POST`,body:JSON.stringify({reason:e.reason,comment:e.comment})});return this.unwrapResponse(n)}},this.views={list:async(e,t)=>{let n=this.getRoute(`views`),r=new URLSearchParams;t&&r.set(`type`,t);let i=r.toString(),a=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}${i?`?${i}`:``}`);return this.unwrapResponse(a)},get:async(e,t)=>{let n=this.getRoute(`views`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`);return this.unwrapResponse(r)},create:async(e,t)=>{let n=this.getRoute(`views`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}`,{method:`POST`,body:JSON.stringify({object:e,data:t})});return this.unwrapResponse(r)},update:async(e,t,n)=>{let r=this.getRoute(`views`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`PUT`,body:JSON.stringify({object:e,viewId:t,data:n})});return this.unwrapResponse(i)},delete:async(e,t)=>{let n=this.getRoute(`views`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}`,{method:`DELETE`});return this.unwrapResponse(r)}},this.notifications={registerDevice:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/devices`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},unregisterDevice:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/devices/${encodeURIComponent(e)}`,{method:`DELETE`});return this.unwrapResponse(n)},getPreferences:async()=>{let e=this.getRoute(`notifications`),t=await this.fetch(`${this.baseUrl}${e}/preferences`);return this.unwrapResponse(t)},updatePreferences:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/preferences`,{method:`PUT`,body:JSON.stringify({preferences:e})});return this.unwrapResponse(n)},list:async e=>{let t=this.getRoute(`notifications`),n=new URLSearchParams;e?.read!==void 0&&n.set(`read`,String(e.read)),e?.type&&n.set(`type`,e.type),e?.limit&&n.set(`limit`,String(e.limit)),e?.cursor&&n.set(`cursor`,e.cursor);let r=n.toString(),i=await this.fetch(`${this.baseUrl}${t}${r?`?${r}`:``}`);return this.unwrapResponse(i)},markRead:async e=>{let t=this.getRoute(`notifications`),n=await this.fetch(`${this.baseUrl}${t}/read`,{method:`POST`,body:JSON.stringify({ids:e})});return this.unwrapResponse(n)},markAllRead:async()=>{let e=this.getRoute(`notifications`),t=await this.fetch(`${this.baseUrl}${e}/read/all`,{method:`POST`});return this.unwrapResponse(t)}},this.ai={nlq:async e=>{let t=this.getRoute(`ai`),n=await this.fetch(`${this.baseUrl}${t}/nlq`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},suggest:async e=>{let t=this.getRoute(`ai`),n=await this.fetch(`${this.baseUrl}${t}/suggest`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)},insights:async e=>{let t=this.getRoute(`ai`),n=await this.fetch(`${this.baseUrl}${t}/insights`,{method:`POST`,body:JSON.stringify(e)});return this.unwrapResponse(n)}},this.i18n={getLocales:async()=>{let e=this.getRoute(`i18n`),t=await this.fetch(`${this.baseUrl}${e}/locales`);return this.unwrapResponse(t)},getTranslations:async(e,t)=>{let n=this.getRoute(`i18n`),r=new URLSearchParams;r.set(`locale`,e),t?.namespace&&r.set(`namespace`,t.namespace),t?.keys&&r.set(`keys`,t.keys.join(`,`));let i=await this.fetch(`${this.baseUrl}${n}/translations?${r.toString()}`);return this.unwrapResponse(i)},getFieldLabels:async(e,t)=>{let n=this.getRoute(`i18n`),r=await this.fetch(`${this.baseUrl}${n}/labels/${encodeURIComponent(e)}?locale=${encodeURIComponent(t)}`);return this.unwrapResponse(r)}},this.feed={list:async(e,t,n)=>{let r=this.getRoute(`data`),i=new URLSearchParams;n?.type&&i.set(`type`,n.type),n?.limit&&i.set(`limit`,String(n.limit)),n?.cursor&&i.set(`cursor`,n.cursor);let a=i.toString(),o=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed${a?`?${a}`:``}`);return this.unwrapResponse(o)},create:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed`,{method:`POST`,body:JSON.stringify(n)});return this.unwrapResponse(i)},update:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}`,{method:`PUT`,body:JSON.stringify(r)});return this.unwrapResponse(a)},delete:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}`,{method:`DELETE`});return this.unwrapResponse(i)},addReaction:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/reactions`,{method:`POST`,body:JSON.stringify({emoji:r})});return this.unwrapResponse(a)},removeReaction:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/reactions/${encodeURIComponent(r)}`,{method:`DELETE`});return this.unwrapResponse(a)},pin:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/pin`,{method:`POST`});return this.unwrapResponse(i)},unpin:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/pin`,{method:`DELETE`});return this.unwrapResponse(i)},star:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/star`,{method:`POST`});return this.unwrapResponse(i)},unstar:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/${encodeURIComponent(n)}/star`,{method:`DELETE`});return this.unwrapResponse(i)},search:async(e,t,n,r)=>{let i=this.getRoute(`data`),a=new URLSearchParams;a.set(`query`,n),r?.type&&a.set(`type`,r.type),r?.actorId&&a.set(`actorId`,r.actorId),r?.dateFrom&&a.set(`dateFrom`,r.dateFrom),r?.dateTo&&a.set(`dateTo`,r.dateTo),r?.limit&&a.set(`limit`,String(r.limit)),r?.cursor&&a.set(`cursor`,r.cursor);let o=await this.fetch(`${this.baseUrl}${i}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/feed/search?${a.toString()}`);return this.unwrapResponse(o)},getChangelog:async(e,t,n)=>{let r=this.getRoute(`data`),i=new URLSearchParams;n?.field&&i.set(`field`,n.field),n?.actorId&&i.set(`actorId`,n.actorId),n?.dateFrom&&i.set(`dateFrom`,n.dateFrom),n?.dateTo&&i.set(`dateTo`,n.dateTo),n?.limit&&i.set(`limit`,String(n.limit)),n?.cursor&&i.set(`cursor`,n.cursor);let a=i.toString(),o=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/changelog${a?`?${a}`:``}`);return this.unwrapResponse(o)},subscribe:async(e,t,n)=>{let r=this.getRoute(`data`),i=await this.fetch(`${this.baseUrl}${r}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/subscribe`,{method:`POST`,body:JSON.stringify(n||{})});return this.unwrapResponse(i)},unsubscribe:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${encodeURIComponent(e)}/${encodeURIComponent(t)}/subscribe`,{method:`DELETE`});return this.unwrapResponse(r)}},this.data={query:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/query`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},find:async(e,t={})=>{let n=this.getRoute(`data`),r=new URLSearchParams,i=t,a={};if(`where`in t||`fields`in t||`orderBy`in t||`offset`in t?(i.where&&(a.filter=i.where),i.fields&&(a.select=i.fields),i.orderBy&&(a.sort=i.orderBy),i.limit!=null&&(a.top=i.limit),i.offset!=null&&(a.skip=i.offset),i.aggregations&&(a.aggregations=i.aggregations),i.groupBy&&(a.groupBy=i.groupBy)):Object.assign(a,t),a.top&&r.set(`top`,a.top.toString()),a.skip&&r.set(`skip`,a.skip.toString()),a.sort)if(Array.isArray(a.sort)&&typeof a.sort[0]==`object`)r.set(`sort`,JSON.stringify(a.sort));else{let e=Array.isArray(a.sort)?a.sort.join(`,`):a.sort;r.set(`sort`,e)}a.select&&r.set(`select`,a.select.join(`,`));let o=a.filter??a.filters;o&&(this.isFilterAST(o)||Array.isArray(o)?r.set(`filter`,JSON.stringify(o)):typeof o==`object`&&o&&Object.entries(o).forEach(([e,t])=>{t!=null&&r.append(e,String(t))})),a.aggregations&&r.set(`aggregations`,JSON.stringify(a.aggregations)),a.groupBy&&r.set(`groupBy`,a.groupBy.join(`,`));let s=await this.fetch(`${this.baseUrl}${n}/${e}?${r.toString()}`);return this.unwrapResponse(s)},get:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/${t}`);return this.unwrapResponse(r)},create:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},createMany:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/createMany`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},update:async(e,t,n,r)=>{let i=this.getRoute(`data`),a={};r?.ifMatch&&(a[`If-Match`]=String(r.ifMatch));let o=await this.fetch(`${this.baseUrl}${i}/${e}/${t}`,{method:`PATCH`,body:JSON.stringify(n),...Object.keys(a).length?{headers:a}:{}});return this.unwrapResponse(o)},batch:async(e,t)=>{let n=this.getRoute(`data`),r=await this.fetch(`${this.baseUrl}${n}/${e}/batch`,{method:`POST`,body:JSON.stringify(t)});return this.unwrapResponse(r)},updateMany:async(e,t,n)=>{let r=this.getRoute(`data`),i={records:t,options:n},a=await this.fetch(`${this.baseUrl}${r}/${e}/updateMany`,{method:`POST`,body:JSON.stringify(i)});return this.unwrapResponse(a)},delete:async(e,t,n)=>{let r=this.getRoute(`data`),i={};n?.ifMatch&&(i[`If-Match`]=String(n.ifMatch));let a=await this.fetch(`${this.baseUrl}${r}/${e}/${t}`,{method:`DELETE`,...Object.keys(i).length?{headers:i}:{}});return this.unwrapResponse(a)},deleteMany:async(e,t,n)=>{let r=this.getRoute(`data`),i={ids:t,options:n},a=await this.fetch(`${this.baseUrl}${r}/${e}/deleteMany`,{method:`POST`,body:JSON.stringify(i)});return this.unwrapResponse(a)}},this.baseUrl=e.baseUrl.replace(/\/$/,``),this.token=e.token,this.environmentId=e.environmentId,this.fetchImpl=e.fetch||globalThis.fetch.bind(globalThis),this.logger=e.logger||Ug({level:e.debug?`debug`:`info`,format:`pretty`}),this.realtimeAPI=new Wg(this.baseUrl,this.token),this.logger.debug(`ObjectStack client created`,{baseUrl:this.baseUrl})}async connect(){this.logger.debug(`Connecting to ObjectStack server`,{baseUrl:this.baseUrl});try{let e;try{let t=`${this.baseUrl}/api/v1/discovery`;this.logger.debug(`Probing protocol-standard discovery endpoint`,{url:t});let n=await this.fetchImpl(t);if(n.ok){let t=await n.json();e=t.data||t,this.logger.debug(`Discovered via /api/v1/discovery`)}}catch(e){this.logger.debug(`Protocol-standard discovery probe failed`,{error:e.message})}if(!e){let t;try{t=`${new URL(this.baseUrl).origin}/.well-known/objectstack`}catch{t=`/.well-known/objectstack`}this.logger.debug(`Falling back to .well-known discovery`,{url:t});let n=await this.fetchImpl(t);if(!n.ok)throw Error(`Failed to connect to ${t}: ${n.statusText}`);let r=await n.json();e=r.data||r}if(!e)throw Error(`Connection failed: No discovery data returned`);return this.discoveryInfo=e,this.logger.info(`Connected to ObjectStack server`,{version:e.version,apiName:e.apiName,services:e.services}),e}catch(e){throw this.logger.error(`Failed to connect to ObjectStack server`,e,{baseUrl:this.baseUrl}),e}}get capabilities(){let e=this.discoveryInfo?.capabilities;if(!e)return;let t={};for(let[n,r]of Object.entries(e))t[n]=typeof r==`object`&&r?!!r.enabled:!!r;return t}project(e){if(!e)throw Error(`[ObjectStack] project(id): environmentId is required`);return new Kg(this,e)}_baseUrl(){return this.baseUrl}_fetch(e,t){return this.fetch(e,t)}_unwrap(e){return this.unwrapResponse(e)}_isFilterAST(e){return this.isFilterAST(e)}setProjectId(e){this.environmentId=e,this.logger.debug(`Active project changed`,{environmentId:e})}getProjectId(){return this.environmentId}get events(){return this.realtimeAPI}isFilterAST(e){return ep(e)}async unwrapResponse(e){let t=await e.json();return t&&typeof t.success==`boolean`&&`data`in t?t.data:t}async fetch(e,t={}){this.logger.debug(`HTTP request`,{method:t.method||`GET`,url:e,hasBody:!!t.body});let n={"Content-Type":`application/json`,...t.headers||{}};this.token&&(n.Authorization=`Bearer ${this.token}`),this.environmentId&&(n[`X-Environment-Id`]=this.environmentId);let r=await this.fetchImpl(e,{...t,headers:n});if(this.logger.debug(`HTTP response`,{method:t.method||`GET`,url:e,status:r.status,ok:r.ok}),!r.ok){let n;try{n=await r.json()}catch{n={message:r.statusText}}this.logger.error(`HTTP request failed`,void 0,{method:t.method||`GET`,url:e,status:r.status,error:n});let i=n?.message??n?.error?.message??(typeof n?.error==`string`?n.error:void 0)??r.statusText,a=n?.code||n?.error?.code,o=Error(`[ObjectStack] ${a?`${a}: `:``}${i}`);throw o.code=a,o.category=n?.category,o.httpStatus=r.status,o.retryable=n?.retryable,o.details=n?.details||n,o}return r}getRoute(e){let t=this.discoveryInfo?.routes;if(t){let n=t[e];if(n)return n}return{data:`/api/v1/data`,metadata:`/api/v1/meta`,discovery:`/api/v1/discovery`,ui:`/api/v1/ui`,auth:`/api/v1/auth`,analytics:`/api/v1/analytics`,storage:`/api/v1/storage`,automation:`/api/v1/automation`,packages:`/api/v1/packages`,permissions:`/api/v1/permissions`,realtime:`/api/v1/realtime`,workflow:`/api/v1/workflow`,views:`/api/v1/ui/views`,notifications:`/api/v1/notifications`,ai:`/api/v1/ai`,i18n:`/api/v1/i18n`,feed:`/api/v1/feed`,graphql:`/graphql`}[e]||`/api/v1/${e}`}},Kg=class{constructor(e,t){this.meta={getTypes:async()=>{let e=await this.parent._fetch(this.url(`/meta`));return this.parent._unwrap(e)},getItems:async(e,t)=>{let n=new URLSearchParams;t?.packageId&&n.set(`package`,t.packageId);let r=n.toString(),i=await this.parent._fetch(this.url(`/meta/${e}${r?`?${r}`:``}`));return this.parent._unwrap(i)},getItem:async(e,t,n)=>{let r=new URLSearchParams;n?.packageId&&r.set(`package`,n.packageId);let i=r.toString(),a=await this.parent._fetch(this.url(`/meta/${e}/${t}${i?`?${i}`:``}`));return this.parent._unwrap(a)},saveItem:async(e,t,n)=>{let r=await this.parent._fetch(this.url(`/meta/${e}/${t}`),{method:`PUT`,body:JSON.stringify(n)});return this.parent._unwrap(r)},deleteItem:async(e,t)=>{let n=await this.parent._fetch(this.url(`/meta/${encodeURIComponent(e)}/${encodeURIComponent(t)}`),{method:`DELETE`});return this.parent._unwrap(n)},getHistory:async(e,t,n)=>{let r=new URLSearchParams;n?.sinceSeq!==void 0&&r.set(`sinceSeq`,String(n.sinceSeq)),n?.limit!==void 0&&r.set(`limit`,String(n.limit));let i=r.toString(),a=await this.parent._fetch(this.url(`/meta/${encodeURIComponent(e)}/${encodeURIComponent(t)}/history${i?`?${i}`:``}`));return this.parent._unwrap(a)}},this.data={query:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/query`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},find:async(e,t={})=>{let n=new URLSearchParams,r=t,i={};if(`where`in t||`fields`in t||`orderBy`in t||`offset`in t?(r.where&&(i.filter=r.where),r.fields&&(i.select=r.fields),r.orderBy&&(i.sort=r.orderBy),r.limit!=null&&(i.top=r.limit),r.offset!=null&&(i.skip=r.offset),r.aggregations&&(i.aggregations=r.aggregations),r.groupBy&&(i.groupBy=r.groupBy)):Object.assign(i,t),i.top&&n.set(`top`,i.top.toString()),i.skip&&n.set(`skip`,i.skip.toString()),i.sort)if(Array.isArray(i.sort)&&typeof i.sort[0]==`object`)n.set(`sort`,JSON.stringify(i.sort));else{let e=Array.isArray(i.sort)?i.sort.join(`,`):i.sort;n.set(`sort`,e)}i.select&&n.set(`select`,i.select.join(`,`));let a=i.filter??i.filters;a&&(this.parent._isFilterAST(a)||Array.isArray(a)?n.set(`filter`,JSON.stringify(a)):typeof a==`object`&&a&&Object.entries(a).forEach(([e,t])=>{t!=null&&n.append(e,String(t))})),i.aggregations&&n.set(`aggregations`,JSON.stringify(i.aggregations)),i.groupBy&&n.set(`groupBy`,i.groupBy.join(`,`));let o=n.toString(),s=await this.parent._fetch(this.url(`/data/${e}${o?`?${o}`:``}`));return this.parent._unwrap(s)},get:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/${t}`));return this.parent._unwrap(n)},create:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},createMany:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/createMany`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},update:async(e,t,n)=>{let r=await this.parent._fetch(this.url(`/data/${e}/${t}`),{method:`PATCH`,body:JSON.stringify(n)});return this.parent._unwrap(r)},batch:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/batch`),{method:`POST`,body:JSON.stringify(t)});return this.parent._unwrap(n)},updateMany:async(e,t,n)=>{let r={records:t,options:n},i=await this.parent._fetch(this.url(`/data/${e}/updateMany`),{method:`POST`,body:JSON.stringify(r)});return this.parent._unwrap(i)},delete:async(e,t)=>{let n=await this.parent._fetch(this.url(`/data/${e}/${t}`),{method:`DELETE`});return this.parent._unwrap(n)},deleteMany:async(e,t,n)=>{let r={ids:t,options:n},i=await this.parent._fetch(this.url(`/data/${e}/deleteMany`),{method:`POST`,body:JSON.stringify(r)});return this.parent._unwrap(i)}},this.packages={list:async()=>{let e=await this.parent._fetch(this.url(`/packages`));return this.parent._unwrap(e)},get:async(e,t)=>{let n=t?`?version=${encodeURIComponent(t)}`:``,r=await this.parent._fetch(this.url(`/packages/${encodeURIComponent(e)}${n}`));return this.parent._unwrap(r)}},this.automation={getFlow:async e=>{let t=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}`));return this.parent._unwrap(t)},execute:async(e,t)=>{let n=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}/trigger`),{method:`POST`,body:JSON.stringify(t??{})});return this.parent._unwrap(n)},listRuns:async(e,t)=>{let n=new URLSearchParams;t?.limit!=null&&n.set(`limit`,String(t.limit)),t?.cursor&&n.set(`cursor`,t.cursor);let r=n.toString(),i=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}/runs${r?`?${r}`:``}`));return this.parent._unwrap(i)},getRun:async(e,t)=>{let n=await this.parent._fetch(this.url(`/automation/${encodeURIComponent(e)}/runs/${encodeURIComponent(t)}`));return this.parent._unwrap(n)}},this.parent=e,this.environmentId=t}getProjectId(){return this.environmentId}scope(){return`/api/v1/environments/${encodeURIComponent(this.environmentId)}`}url(e){return`${this.parent._baseUrl()}${this.scope()}${e}`}},qg=(0,j.createContext)(null);function Jg({client:e,children:t}){return j.createElement(qg.Provider,{value:e},t)}function Yg(){let e=(0,j.useContext)(qg);if(!e)throw Error(`useClient must be used within an ObjectStackProvider. Make sure your component is wrapped with <ObjectStackProvider client={...}>.`);return e}var Xg=1,Zg=1e6,Qg=0;function $g(){return Qg=(Qg+1)%(2**53-1),Qg.toString()}var e_=new Map,t_=e=>{if(e_.has(e))return;let t=setTimeout(()=>{e_.delete(e),a_({type:`REMOVE_TOAST`,toastId:e})},Zg);e_.set(e,t)},n_=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,Xg)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?t_(n):e.toasts.forEach(e=>{t_(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},r_=[],i_={toasts:[]};function a_(e){i_=n_(i_,e),r_.forEach(e=>{e(i_)})}function K({...e}){let t=$g(),n=e=>a_({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>a_({type:`DISMISS_TOAST`,toastId:t});return a_({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}}function o_(){let[e,t]=j.useState(i_);return j.useEffect(()=>(r_.push(t),()=>{let e=r_.indexOf(t);e>-1&&r_.splice(e,1)}),[e]),{...e,toast:K,dismiss:e=>a_({type:`DISMISS_TOAST`,toastId:e})}}typeof window<`u`&&window.document&&window.document.createElement;function q(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function s_(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function c_(...e){return t=>{let n=!1,r=e.map(e=>{let r=s_(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():s_(e[t],null)}}}}function l_(...e){return j.useCallback(c_(...e),e)}function u_(e,t){let n=j.createContext(t),r=e=>{let{children:t,...r}=e,i=j.useMemo(()=>r,Object.values(r));return(0,M.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=j.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function d_(e,t=[]){let n=[];function r(t,r){let i=j.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=j.useMemo(()=>o,Object.values(o));return(0,M.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=j.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>j.createContext(e));return function(n){let r=n?.[e]||t;return j.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,f_(i,...t)]}function f_(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return j.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}function p_(e){let t=m_(e),n=j.forwardRef((e,n)=>{let{children:r,...i}=e,a=j.Children.toArray(r),o=a.find(__);if(o){let e=o.props.children,r=a.map(t=>t===o?j.Children.count(e)>1?j.Children.only(null):j.isValidElement(e)?e.props.children:null:t);return(0,M.jsx)(t,{...i,ref:n,children:j.isValidElement(e)?j.cloneElement(e,void 0,r):null})}return(0,M.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function m_(e){let t=j.forwardRef((e,t)=>{let{children:n,...r}=e;if(j.isValidElement(n)){let e=y_(n),i=v_(r,n.props);return n.type!==j.Fragment&&(i.ref=t?c_(t,e):e),j.cloneElement(n,i)}return j.Children.count(n)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var h_=Symbol(`radix.slottable`);function g_(e){let t=({children:e})=>(0,M.jsx)(M.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=h_,t}function __(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===h_}function v_(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function y_(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function b_(e){let t=e+`CollectionProvider`,[n,r]=d_(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=j.useRef(null),a=j.useRef(new Map).current;return(0,M.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=p_(s),l=j.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,M.jsx)(c,{ref:l_(t,a(s,n).collectionRef),children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=p_(u),p=j.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=j.useRef(null),s=l_(t,o),c=a(u,n);return j.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,M.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return j.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:l,ItemSlot:p},m,r]}var x_=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=p_(`Primitive.${t}`),r=j.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function S_(e,t){e&&Gi.flushSync(()=>e.dispatchEvent(t))}function C_(e){let t=j.useRef(e);return j.useEffect(()=>{t.current=e}),j.useMemo(()=>(...e)=>t.current?.(...e),[])}function w_(e,t=globalThis?.document){let n=C_(e);j.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var T_=`DismissableLayer`,E_=`dismissableLayer.update`,D_=`dismissableLayer.pointerDownOutside`,O_=`dismissableLayer.focusOutside`,k_,A_=j.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),j_=j.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=j.useContext(A_),[u,d]=j.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=j.useState({}),m=l_(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,b=v>=_,x=P_(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!b||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),S=F_(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return w_(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),j.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(k_=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),I_(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=k_)}},[u,f,n,l]),j.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),I_())},[u,l]),j.useEffect(()=>{let e=()=>p({});return document.addEventListener(E_,e),()=>document.removeEventListener(E_,e)},[]),(0,M.jsx)(x_.div,{...c,ref:m,style:{pointerEvents:y?b?`auto`:`none`:void 0,...e.style},onFocusCapture:q(e.onFocusCapture,S.onFocusCapture),onBlurCapture:q(e.onBlurCapture,S.onBlurCapture),onPointerDownCapture:q(e.onPointerDownCapture,x.onPointerDownCapture)})});j_.displayName=T_;var M_=`DismissableLayerBranch`,N_=j.forwardRef((e,t)=>{let n=j.useContext(A_),r=j.useRef(null),i=l_(t,r);return j.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,M.jsx)(x_.div,{...e,ref:i})});N_.displayName=M_;function P_(e,t=globalThis?.document){let n=C_(e),r=j.useRef(!1),i=j.useRef(()=>{});return j.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){L_(D_,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function F_(e,t=globalThis?.document){let n=C_(e),r=j.useRef(!1);return j.useEffect(()=>{let e=e=>{e.target&&!r.current&&L_(O_,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function I_(){let e=new CustomEvent(E_);document.dispatchEvent(e)}function L_(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?S_(i,a):i.dispatchEvent(a)}var R_=j_,z_=N_,B_=globalThis?.document?j.useLayoutEffect:()=>{},V_=`Portal`,H_=j.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=j.useState(!1);B_(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Gi.createPortal((0,M.jsx)(x_.div,{...r,ref:t}),o):null});H_.displayName=V_;function U_(e,t){return j.useReducer((e,n)=>t[e][n]??e,e)}var W_=e=>{let{present:t,children:n}=e,r=G_(t),i=typeof n==`function`?n({present:r.isPresent}):j.Children.only(n),a=l_(r.ref,q_(i));return typeof n==`function`||r.isPresent?j.cloneElement(i,{ref:a}):null};W_.displayName=`Presence`;function G_(e){let[t,n]=j.useState(),r=j.useRef(null),i=j.useRef(e),a=j.useRef(`none`),[o,s]=U_(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return j.useEffect(()=>{let e=K_(r.current);a.current=o===`mounted`?e:`none`},[o]),B_(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=K_(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),B_(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=K_(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=K_(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:j.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function K_(e){return e?.animationName||`none`}function q_(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var J_=j.useInsertionEffect||B_;function Y_({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=X_({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=j.useRef(e!==void 0);j.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,j.useCallback(t=>{if(s){let n=Z_(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function X_({defaultProp:e,onChange:t}){let[n,r]=j.useState(e),i=j.useRef(n),a=j.useRef(t);return J_(()=>{a.current=t},[t]),j.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function Z_(e){return typeof e==`function`}var Q_=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),$_=`VisuallyHidden`,ev=j.forwardRef((e,t)=>(0,M.jsx)(x_.span,{...e,ref:t,style:{...Q_,...e.style}}));ev.displayName=$_;var tv=ev,nv=`ToastProvider`,[rv,iv,av]=b_(`Toast`),[ov,sv]=d_(`Toast`,[av]),[cv,lv]=ov(nv),uv=e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,children:o}=e,[s,c]=j.useState(null),[l,u]=j.useState(0),d=j.useRef(!1),f=j.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${nv}\`. Expected non-empty \`string\`.`),(0,M.jsx)(rv.Provider,{scope:t,children:(0,M.jsx)(cv,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:l,viewport:s,onViewportChange:c,onToastAdd:j.useCallback(()=>u(e=>e+1),[]),onToastRemove:j.useCallback(()=>u(e=>e-1),[]),isFocusedToastEscapeKeyDownRef:d,isClosePausedRef:f,children:o})})};uv.displayName=nv;var dv=`ToastViewport`,fv=[`F8`],pv=`toast.viewportPause`,mv=`toast.viewportResume`,hv=j.forwardRef((e,t)=>{let{__scopeToast:n,hotkey:r=fv,label:i=`Notifications ({hotkey})`,...a}=e,o=lv(dv,n),s=iv(n),c=j.useRef(null),l=j.useRef(null),u=j.useRef(null),d=j.useRef(null),f=l_(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;j.useEffect(()=>{let e=e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),j.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(pv);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},r=()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(mv);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},i=t=>{e.contains(t.relatedTarget)||r()},a=()=>{e.contains(document.activeElement)||r()};return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=j.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...Hv(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return j.useEffect(()=>{let e=d.current;if(e){let t=t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Uv(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}};return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,M.jsxs)(z_,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,M.jsx)(_v,{ref:l,onFocusFromOutsideViewport:()=>{Uv(h({tabbingDirection:`forwards`}))}}),(0,M.jsx)(rv.Slot,{scope:n,children:(0,M.jsx)(x_.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,M.jsx)(_v,{ref:u,onFocusFromOutsideViewport:()=>{Uv(h({tabbingDirection:`backwards`}))}})]})});hv.displayName=dv;var gv=`ToastFocusProxy`,_v=j.forwardRef((e,t)=>{let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=lv(gv,n);return(0,M.jsx)(ev,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})});_v.displayName=gv;var vv=`Toast`,yv=`toast.swipeStart`,bv=`toast.swipeMove`,xv=`toast.swipeCancel`,Sv=`toast.swipeEnd`,Cv=j.forwardRef((e,t)=>{let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Y_({prop:r,defaultProp:i??!0,onChange:a,caller:vv});return(0,M.jsx)(W_,{present:n||s,children:(0,M.jsx)(Ev,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:C_(e.onPause),onResume:C_(e.onResume),onSwipeStart:q(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:q(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:q(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:q(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})});Cv.displayName=vv;var[wv,Tv]=ov(vv,{onClose(){}}),Ev=j.forwardRef((e,t)=>{let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=lv(vv,n),[g,_]=j.useState(null),v=l_(t,e=>_(e)),y=j.useRef(null),b=j.useRef(null),x=i||h.duration,S=j.useRef(0),C=j.useRef(x),w=j.useRef(0),{onToastAdd:T,onToastRemove:E}=h,D=C_(()=>{g?.contains(document.activeElement)&&h.viewport?.focus(),o()}),O=j.useCallback(e=>{!e||e===1/0||(window.clearTimeout(w.current),S.current=new Date().getTime(),w.current=window.setTimeout(D,e))},[D]);j.useEffect(()=>{let e=h.viewport;if(e){let t=()=>{O(C.current),l?.()},n=()=>{let e=new Date().getTime()-S.current;C.current-=e,window.clearTimeout(w.current),c?.()};return e.addEventListener(pv,n),e.addEventListener(mv,t),()=>{e.removeEventListener(pv,n),e.removeEventListener(mv,t)}}},[h.viewport,x,c,l,O]),j.useEffect(()=>{a&&!h.isClosePausedRef.current&&O(x)},[a,x,h.isClosePausedRef,O]),j.useEffect(()=>(T(),()=>E()),[T,E]);let ee=j.useMemo(()=>g?Lv(g):null,[g]);return h.viewport?(0,M.jsxs)(M.Fragment,{children:[ee&&(0,M.jsx)(Dv,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:ee}),(0,M.jsx)(wv,{scope:n,onClose:D,children:Gi.createPortal((0,M.jsx)(rv.ItemSlot,{scope:n,children:(0,M.jsx)(R_,{asChild:!0,onEscapeKeyDown:q(s,()=>{h.isFocusedToastEscapeKeyDownRef.current||D(),h.isFocusedToastEscapeKeyDownRef.current=!1}),children:(0,M.jsx)(x_.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:v,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:q(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||(h.isFocusedToastEscapeKeyDownRef.current=!0,D()))}),onPointerDown:q(e.onPointerDown,e=>{e.button===0&&(y.current={x:e.clientX,y:e.clientY})}),onPointerMove:q(e.onPointerMove,e=>{if(!y.current)return;let t=e.clientX-y.current.x,n=e.clientY-y.current.y,r=!!b.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(b.current=l,Rv(bv,d,f,{discrete:!1})):zv(l,h.swipeDirection,c)?(b.current=l,Rv(yv,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(y.current=null)}),onPointerUp:q(e.onPointerUp,e=>{let t=b.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),b.current=null,y.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};zv(t,h.swipeDirection,h.swipeThreshold)?Rv(Sv,p,r,{discrete:!0}):Rv(xv,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null}),Dv=e=>{let{__scopeToast:t,children:n,...r}=e,i=lv(vv,t),[a,o]=j.useState(!1),[s,c]=j.useState(!1);return Bv(()=>o(!0)),j.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,M.jsx)(H_,{asChild:!0,children:(0,M.jsx)(ev,{...r,children:a&&(0,M.jsxs)(M.Fragment,{children:[i.label,` `,n]})})})},Ov=`ToastTitle`,kv=j.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,M.jsx)(x_.div,{...r,ref:t})});kv.displayName=Ov;var Av=`ToastDescription`,jv=j.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e;return(0,M.jsx)(x_.div,{...r,ref:t})});jv.displayName=Av;var Mv=`ToastAction`,Nv=j.forwardRef((e,t)=>{let{altText:n,...r}=e;return n.trim()?(0,M.jsx)(Iv,{altText:n,asChild:!0,children:(0,M.jsx)(Fv,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Mv}\`. Expected non-empty \`string\`.`),null)});Nv.displayName=Mv;var Pv=`ToastClose`,Fv=j.forwardRef((e,t)=>{let{__scopeToast:n,...r}=e,i=Tv(Pv,n);return(0,M.jsx)(Iv,{asChild:!0,children:(0,M.jsx)(x_.button,{type:`button`,...r,ref:t,onClick:q(e.onClick,i.onClose)})})});Fv.displayName=Pv;var Iv=j.forwardRef((e,t)=>{let{__scopeToast:n,altText:r,...i}=e;return(0,M.jsx)(x_.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})});function Lv(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Vv(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n)if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Lv(e))}}),t}function Rv(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?S_(i,a):i.dispatchEvent(a)}var zv=(e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n};function Bv(e=()=>{}){let t=C_(e);B_(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}function Vv(e){return e.nodeType===e.ELEMENT_NODE}function Hv(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Uv(e){let t=document.activeElement;return e.some(e=>e===t?!0:(e.focus(),document.activeElement!==t))}var Wv=uv,Gv=hv,Kv=Cv,qv=kv,Jv=jv,Yv=Nv,Xv=Fv;function Zv(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`)if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Zv(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n);return r}function Qv(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Zv(e))&&(r&&(r+=` `),r+=t);return r}var $v=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ey=Qv,ty=(e,t)=>n=>{if(t?.variants==null)return ey(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=$v(t)||$v(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ey(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},ny=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ry=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),iy=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),ay=e=>{let t=iy(e);return t.charAt(0).toUpperCase()+t.slice(1)},oy={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},sy=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},cy=(0,j.createContext)({}),ly=()=>(0,j.useContext)(cy),uy=(0,j.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=ly()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,j.createElement)(`svg`,{ref:c,...oy,width:t??l??oy.width,height:t??l??oy.height,stroke:e??f,strokeWidth:m,className:ny(`lucide`,p,i),...!a&&!sy(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,j.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),J=(e,t)=>{let n=(0,j.forwardRef)(({className:n,...r},i)=>(0,j.createElement)(uy,{ref:i,iconNode:t,className:ny(`lucide-${ry(ay(e))}`,`lucide-${e}`,n),...r}));return n.displayName=ay(e),n},dy=J(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),fy=J(`building-2`,[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]]),py=J(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),my=J(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),hy=J(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),gy=J(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),_y=J(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),vy=J(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),yy=J(`circle-user-round`,[[`path`,{d:`M17.925 20.056a6 6 0 0 0-11.851.001`,key:`z69sun`}],[`circle`,{cx:`12`,cy:`11`,r:`4`,key:`1gt34v`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),by=J(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),xy=J(`circle`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Sy=J(`clock`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 6v6l4 2`,key:`mmk7yg`}]]),Cy=J(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),wy=J(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Ty=J(`gallery-vertical-end`,[[`path`,{d:`M7 2h10`,key:`nczekb`}],[`path`,{d:`M5 6h14`,key:`u2x4p`}],[`rect`,{width:`18`,height:`12`,x:`3`,y:`10`,rx:`2`,key:`l0tzu3`}]]),Ey=J(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),Dy=J(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),Oy=J(`inbox`,[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]),ky=J(`key-round`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),Ay=J(`languages`,[[`path`,{d:`m5 8 6 6`,key:`1wu5hv`}],[`path`,{d:`m4 14 6-6 2-3`,key:`1k1g8d`}],[`path`,{d:`M2 5h12`,key:`or177f`}],[`path`,{d:`M7 2h1`,key:`1t2jsx`}],[`path`,{d:`m22 22-5-10-5 10`,key:`don7ne`}],[`path`,{d:`M14 18h6`,key:`1m8k6r`}]]),jy=J(`link-2-off`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7`,key:`10o201`}],[`path`,{d:`M15 7h2a5 5 0 0 1 4 8`,key:`1d3206`}],[`line`,{x1:`8`,x2:`12`,y1:`12`,y2:`12`,key:`rvw6j4`}],[`line`,{x1:`2`,x2:`22`,y1:`2`,y2:`22`,key:`a6p6uj`}]]),My=J(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),Ny=J(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Py=J(`mail-check`,[[`path`,{d:`M22 13V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v12c0 1.1.9 2 2 2h8`,key:`12jkf8`}],[`path`,{d:`m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7`,key:`1ocrg3`}],[`path`,{d:`m16 19 2 2 4-4`,key:`1b14m6`}]]),Fy=J(`mail`,[[`path`,{d:`m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7`,key:`132q7q`}],[`rect`,{x:`2`,y:`4`,width:`20`,height:`16`,rx:`2`,key:`izxlao`}]]),Iy=J(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),Ly=J(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),Ry=J(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),zy=J(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),By=J(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Vy=J(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),Hy=J(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),Uy=J(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Wy=J(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]),Gy=J(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]),Ky=J(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),qy=J(`tablet`,[[`rect`,{width:`16`,height:`20`,x:`4`,y:`2`,rx:`2`,ry:`2`,key:`76otgf`}],[`line`,{x1:`12`,x2:`12.01`,y1:`18`,y2:`18`,key:`1dp563`}]]),Jy=J(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Yy=J(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),Xy=J(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),Zy=J(`user-minus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),Qy=J(`user-plus`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`19`,x2:`19`,y1:`8`,y2:`14`,key:`1bvyxn`}],[`line`,{x1:`22`,x2:`16`,y1:`11`,y2:`11`,key:`1shjgl`}]]),$y=J(`user`,[[`path`,{d:`M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2`,key:`975kel`}],[`circle`,{cx:`12`,cy:`7`,r:`4`,key:`17ys0d`}]]),eb=J(`users-round`,[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]]),tb=J(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),nb=J(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),rb=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t<e.length;t++)n[t]=e[t];for(let r=0;r<t.length;r++)n[e.length+r]=t[r];return n},ib=(e,t)=>({classGroupId:e,validator:t}),ab=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ob=`-`,sb=[],cb=`arbitrary..`,lb=e=>{let t=fb(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return db(e);let n=e.split(ob);return ub(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?rb(i,t):t:i||sb}return n[e]||sb}}},ub=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=ub(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(ob):e.slice(t).join(ob),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},db=e=>e.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?cb+r:void 0})(),fb=e=>{let{theme:t,classGroups:n}=e;return pb(n,t)},pb=(e,t)=>{let n=ab();for(let r in e){let i=e[r];mb(i,n,r,t)}return n},mb=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];hb(i,t,n,r)}},hb=(e,t,n,r)=>{if(typeof e==`string`){gb(e,t,n);return}if(typeof e==`function`){_b(e,t,n,r);return}vb(e,t,n,r)},gb=(e,t,n)=>{let r=e===``?t:yb(t,e);r.classGroupId=n},_b=(e,t,n,r)=>{if(bb(e)){mb(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(ib(n,e))},vb=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];mb(o,yb(t,a),n,r)}},yb=(e,t)=>{let n=e,r=t.split(ob),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=ab(),n.nextPart.set(t,i)),n=i}return n},bb=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,xb=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Sb=`!`,Cb=`:`,wb=[],Tb=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Eb=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e[s];if(n===0&&r===0){if(o===Cb){t.push(e.slice(i,s)),i=s+1;continue}if(o===`/`){a=s;continue}}o===`[`?n++:o===`]`?n--:o===`(`?r++:o===`)`&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1;s.endsWith(Sb)?(c=s.slice(0,-1),l=!0):s.startsWith(Sb)&&(c=s.slice(1),l=!0);let u=a&&a>i?a-i:void 0;return Tb(t,l,c,u)};if(t){let e=t+Cb,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Tb(wb,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Db=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);o||s?(r.length>0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Ob=e=>({cache:xb(e.cacheSize),parseClassName:Eb(e),sortModifiers:Db(e),postfixLookupClassGroupIds:kb(e),...lb(e)}),kb=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},Ab=/\s+/,jb=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(Ab),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Sb:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e<b.length;++e){let t=b[e];s.push(v+t)}l=t+(l.length>0?` `+l:l)}return l},Mb=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=Nb(n))&&(i&&(i+=` `),i+=r);return i},Nb=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=Nb(e[r]))&&(n&&(n+=` `),n+=t);return n},Pb=(e,...t)=>{let n,r,i,a,o=o=>(n=Ob(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=jb(e,n);return i(e,a),a};return a=o,(...e)=>a(Mb(...e))},Fb=[],Ib=e=>{let t=t=>t[e]||Fb;return t.isThemeGetter=!0,t},Lb=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Rb=/^\((?:(\w[\w-]*):)?(.+)\)$/i,zb=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Bb=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Vb=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Hb=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Ub=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Wb=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gb=e=>zb.test(e),Kb=e=>!!e&&!Number.isNaN(Number(e)),qb=e=>!!e&&Number.isInteger(Number(e)),Jb=e=>e.endsWith(`%`)&&Kb(e.slice(0,-1)),Yb=e=>Bb.test(e),Xb=()=>!0,Zb=e=>Vb.test(e)&&!Hb.test(e),Qb=()=>!1,$b=e=>Ub.test(e),ex=e=>Wb.test(e),tx=e=>!Y(e)&&!X(e),nx=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),rx=e=>vx(e,Sx,Qb),Y=e=>Lb.test(e),ix=e=>vx(e,Cx,Zb),ax=e=>vx(e,wx,Kb),ox=e=>vx(e,Ex,Xb),sx=e=>vx(e,Tx,Qb),cx=e=>vx(e,bx,Qb),lx=e=>vx(e,xx,ex),ux=e=>vx(e,Dx,$b),X=e=>Rb.test(e),dx=e=>yx(e,Cx),fx=e=>yx(e,Tx),px=e=>yx(e,bx),mx=e=>yx(e,Sx),hx=e=>yx(e,xx),gx=e=>yx(e,Dx,!0),_x=e=>yx(e,Ex,!0),vx=(e,t,n)=>{let r=Lb.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},yx=(e,t,n=!1)=>{let r=Rb.exec(e);return r?r[1]?t(r[1]):n:!1},bx=e=>e===`position`||e===`percentage`,xx=e=>e===`image`||e===`url`,Sx=e=>e===`length`||e===`size`||e===`bg-size`,Cx=e=>e===`length`,wx=e=>e===`number`,Tx=e=>e===`family-name`,Ex=e=>e===`number`||e===`weight`,Dx=e=>e===`shadow`,Ox=Pb(()=>{let e=Ib(`color`),t=Ib(`font`),n=Ib(`text`),r=Ib(`font-weight`),i=Ib(`tracking`),a=Ib(`leading`),o=Ib(`breakpoint`),s=Ib(`container`),c=Ib(`spacing`),l=Ib(`radius`),u=Ib(`shadow`),d=Ib(`inset-shadow`),f=Ib(`text-shadow`),p=Ib(`drop-shadow`),m=Ib(`blur`),h=Ib(`perspective`),g=Ib(`aspect`),_=Ib(`ease`),v=Ib(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),X,Y],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[X,Y,c],T=()=>[Gb,`full`,`auto`,...w()],E=()=>[qb,`none`,`subgrid`,X,Y],D=()=>[`auto`,{span:[`full`,qb,X,Y]},qb,X,Y],O=()=>[qb,`auto`,X,Y],ee=()=>[`auto`,`min`,`max`,`fr`,X,Y],te=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ne=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],re=()=>[`auto`,...w()],ie=()=>[Gb,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],ae=()=>[Gb,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],oe=()=>[Gb,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],k=()=>[e,X,Y],se=()=>[...b(),px,cx,{position:[X,Y]}],ce=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],le=()=>[`auto`,`cover`,`contain`,mx,rx,{size:[X,Y]}],ue=()=>[Jb,dx,ix],A=()=>[``,`none`,`full`,l,X,Y],de=()=>[``,Kb,dx,ix],fe=()=>[`solid`,`dashed`,`dotted`,`double`],pe=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],me=()=>[Kb,Jb,px,cx],he=()=>[``,`none`,m,X,Y],ge=()=>[`none`,Kb,X,Y],_e=()=>[`none`,Kb,X,Y],ve=()=>[Kb,X,Y],ye=()=>[Gb,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[Yb],breakpoint:[Yb],color:[Xb],container:[Yb],"drop-shadow":[Yb],ease:[`in`,`out`,`in-out`],font:[tx],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[Yb],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[Yb],shadow:[Yb],spacing:[`px`,Kb],text:[Yb],"text-shadow":[Yb],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,Gb,Y,X,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,X,Y]}],"container-named":[nx],columns:[{columns:[Kb,Y,X,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[qb,`auto`,X,Y]}],basis:[{basis:[Gb,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[Kb,Gb,`auto`,`initial`,`none`,Y]}],grow:[{grow:[``,Kb,X,Y]}],shrink:[{shrink:[``,Kb,X,Y]}],order:[{order:[qb,`first`,`last`,`none`,X,Y]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":ee()}],"auto-rows":[{"auto-rows":ee()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...te(),`normal`]}],"justify-items":[{"justify-items":[...ne(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ne()]}],"align-content":[{content:[`normal`,...te()]}],"align-items":[{items:[...ne(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ne(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":te()}],"place-items":[{"place-items":[...ne(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ne()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:re()}],mx:[{mx:re()}],my:[{my:re()}],ms:[{ms:re()}],me:[{me:re()}],mbs:[{mbs:re()}],mbe:[{mbe:re()}],mt:[{mt:re()}],mr:[{mr:re()}],mb:[{mb:re()}],ml:[{ml:re()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:ie()}],"inline-size":[{inline:[`auto`,...ae()]}],"min-inline-size":[{"min-inline":[`auto`,...ae()]}],"max-inline-size":[{"max-inline":[`none`,...ae()]}],"block-size":[{block:[`auto`,...oe()]}],"min-block-size":[{"min-block":[`auto`,...oe()]}],"max-block-size":[{"max-block":[`none`,...oe()]}],w:[{w:[s,`screen`,...ie()]}],"min-w":[{"min-w":[s,`screen`,`none`,...ie()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...ie()]}],h:[{h:[`screen`,`lh`,...ie()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...ie()]}],"max-h":[{"max-h":[`screen`,`lh`,...ie()]}],"font-size":[{text:[`base`,n,dx,ix]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,_x,ox]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,Jb,Y]}],"font-family":[{font:[fx,sx,t]}],"font-features":[{"font-features":[Y]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,X,Y]}],"line-clamp":[{"line-clamp":[Kb,`none`,X,ax]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,X,Y]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,X,Y]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:k()}],"text-color":[{text:k()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...fe(),`wavy`]}],"text-decoration-thickness":[{decoration:[Kb,`from-font`,`auto`,X,ix]}],"text-decoration-color":[{decoration:k()}],"underline-offset":[{"underline-offset":[Kb,`auto`,X,Y]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[qb,X,Y]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,X,Y]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,X,Y]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:se()}],"bg-repeat":[{bg:ce()}],"bg-size":[{bg:le()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},qb,X,Y],radial:[``,X,Y],conic:[qb,X,Y]},hx,lx]}],"bg-color":[{bg:k()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:k()}],"gradient-via":[{via:k()}],"gradient-to":[{to:k()}],rounded:[{rounded:A()}],"rounded-s":[{"rounded-s":A()}],"rounded-e":[{"rounded-e":A()}],"rounded-t":[{"rounded-t":A()}],"rounded-r":[{"rounded-r":A()}],"rounded-b":[{"rounded-b":A()}],"rounded-l":[{"rounded-l":A()}],"rounded-ss":[{"rounded-ss":A()}],"rounded-se":[{"rounded-se":A()}],"rounded-ee":[{"rounded-ee":A()}],"rounded-es":[{"rounded-es":A()}],"rounded-tl":[{"rounded-tl":A()}],"rounded-tr":[{"rounded-tr":A()}],"rounded-br":[{"rounded-br":A()}],"rounded-bl":[{"rounded-bl":A()}],"border-w":[{border:de()}],"border-w-x":[{"border-x":de()}],"border-w-y":[{"border-y":de()}],"border-w-s":[{"border-s":de()}],"border-w-e":[{"border-e":de()}],"border-w-bs":[{"border-bs":de()}],"border-w-be":[{"border-be":de()}],"border-w-t":[{"border-t":de()}],"border-w-r":[{"border-r":de()}],"border-w-b":[{"border-b":de()}],"border-w-l":[{"border-l":de()}],"divide-x":[{"divide-x":de()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":de()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...fe(),`hidden`,`none`]}],"divide-style":[{divide:[...fe(),`hidden`,`none`]}],"border-color":[{border:k()}],"border-color-x":[{"border-x":k()}],"border-color-y":[{"border-y":k()}],"border-color-s":[{"border-s":k()}],"border-color-e":[{"border-e":k()}],"border-color-bs":[{"border-bs":k()}],"border-color-be":[{"border-be":k()}],"border-color-t":[{"border-t":k()}],"border-color-r":[{"border-r":k()}],"border-color-b":[{"border-b":k()}],"border-color-l":[{"border-l":k()}],"divide-color":[{divide:k()}],"outline-style":[{outline:[...fe(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[Kb,X,Y]}],"outline-w":[{outline:[``,Kb,dx,ix]}],"outline-color":[{outline:k()}],shadow:[{shadow:[``,`none`,u,gx,ux]}],"shadow-color":[{shadow:k()}],"inset-shadow":[{"inset-shadow":[`none`,d,gx,ux]}],"inset-shadow-color":[{"inset-shadow":k()}],"ring-w":[{ring:de()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:k()}],"ring-offset-w":[{"ring-offset":[Kb,ix]}],"ring-offset-color":[{"ring-offset":k()}],"inset-ring-w":[{"inset-ring":de()}],"inset-ring-color":[{"inset-ring":k()}],"text-shadow":[{"text-shadow":[`none`,f,gx,ux]}],"text-shadow-color":[{"text-shadow":k()}],opacity:[{opacity:[Kb,X,Y]}],"mix-blend":[{"mix-blend":[...pe(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":pe()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[Kb]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":k()}],"mask-image-linear-to-color":[{"mask-linear-to":k()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":k()}],"mask-image-t-to-color":[{"mask-t-to":k()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":k()}],"mask-image-r-to-color":[{"mask-r-to":k()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":k()}],"mask-image-b-to-color":[{"mask-b-to":k()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":k()}],"mask-image-l-to-color":[{"mask-l-to":k()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":k()}],"mask-image-x-to-color":[{"mask-x-to":k()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":k()}],"mask-image-y-to-color":[{"mask-y-to":k()}],"mask-image-radial":[{"mask-radial":[X,Y]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":k()}],"mask-image-radial-to-color":[{"mask-radial-to":k()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[Kb]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":k()}],"mask-image-conic-to-color":[{"mask-conic-to":k()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:se()}],"mask-repeat":[{mask:ce()}],"mask-size":[{mask:le()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,X,Y]}],filter:[{filter:[``,`none`,X,Y]}],blur:[{blur:he()}],brightness:[{brightness:[Kb,X,Y]}],contrast:[{contrast:[Kb,X,Y]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,gx,ux]}],"drop-shadow-color":[{"drop-shadow":k()}],grayscale:[{grayscale:[``,Kb,X,Y]}],"hue-rotate":[{"hue-rotate":[Kb,X,Y]}],invert:[{invert:[``,Kb,X,Y]}],saturate:[{saturate:[Kb,X,Y]}],sepia:[{sepia:[``,Kb,X,Y]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,X,Y]}],"backdrop-blur":[{"backdrop-blur":he()}],"backdrop-brightness":[{"backdrop-brightness":[Kb,X,Y]}],"backdrop-contrast":[{"backdrop-contrast":[Kb,X,Y]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,Kb,X,Y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Kb,X,Y]}],"backdrop-invert":[{"backdrop-invert":[``,Kb,X,Y]}],"backdrop-opacity":[{"backdrop-opacity":[Kb,X,Y]}],"backdrop-saturate":[{"backdrop-saturate":[Kb,X,Y]}],"backdrop-sepia":[{"backdrop-sepia":[``,Kb,X,Y]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,X,Y]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[Kb,`initial`,X,Y]}],ease:[{ease:[`linear`,`initial`,_,X,Y]}],delay:[{delay:[Kb,X,Y]}],animate:[{animate:[`none`,v,X,Y]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,X,Y]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ge()}],"rotate-x":[{"rotate-x":ge()}],"rotate-y":[{"rotate-y":ge()}],"rotate-z":[{"rotate-z":ge()}],scale:[{scale:_e()}],"scale-x":[{"scale-x":_e()}],"scale-y":[{"scale-y":_e()}],"scale-z":[{"scale-z":_e()}],"scale-3d":[`scale-3d`],skew:[{skew:ve()}],"skew-x":[{"skew-x":ve()}],"skew-y":[{"skew-y":ve()}],transform:[{transform:[X,Y,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:ye()}],"translate-x":[{"translate-x":ye()}],"translate-y":[{"translate-y":ye()}],"translate-z":[{"translate-z":ye()}],"translate-none":[`translate-none`],zoom:[{zoom:[qb,X,Y]}],accent:[{accent:k()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:k()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,X,Y]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":k()}],"scrollbar-track-color":[{"scrollbar-track":k()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,X,Y]}],fill:[{fill:[`none`,...k()]}],"stroke-w":[{stroke:[Kb,dx,ix,ax]}],stroke:[{stroke:[`none`,...k()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function Z(...e){return Ox(Qv(e))}var kx=Wv,Ax=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Gv,{ref:n,className:Z(`fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]`,e),...t}));Ax.displayName=Gv.displayName;var jx=ty(`group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full`,{variants:{variant:{default:`border bg-background text-foreground`,destructive:`destructive group border-destructive bg-destructive text-destructive-foreground`}},defaultVariants:{variant:`default`}}),Mx=j.forwardRef(({className:e,variant:t,...n},r)=>(0,M.jsx)(Kv,{ref:r,className:Z(jx({variant:t}),e),...n}));Mx.displayName=Kv.displayName;var Nx=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Yv,{ref:n,className:Z(`inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive`,e),...t}));Nx.displayName=Yv.displayName;var Px=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Xv,{ref:n,className:Z(`absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600`,e),"toast-close":``,...t,children:(0,M.jsx)(nb,{className:`h-4 w-4`})}));Px.displayName=Xv.displayName;var Fx=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(qv,{ref:n,className:Z(`text-sm font-semibold`,e),...t}));Fx.displayName=qv.displayName;var Ix=j.forwardRef(({className:e,...t},n)=>(0,M.jsx)(Jv,{ref:n,className:Z(`text-sm opacity-90`,e),...t}));Ix.displayName=Jv.displayName;function Lx(){let{toasts:e}=o_();return(0,M.jsxs)(kx,{children:[e.map(function({id:e,title:t,description:n,action:r,...i}){return(0,M.jsxs)(Mx,{...i,children:[(0,M.jsxs)(`div`,{className:`grid gap-1`,children:[t&&(0,M.jsx)(Fx,{children:t}),n&&(0,M.jsx)(Ix,{children:n})]}),r,(0,M.jsx)(Px,{})]},e)}),(0,M.jsx)(Ax,{})]})}var Rx=Symbol.for(`react.lazy`),zx=j.use;function Bx(e){return typeof e==`object`&&!!e&&`then`in e}function Vx(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Rx&&`_payload`in e&&Bx(e._payload)}function Hx(e){let t=Wx(e),n=j.forwardRef((e,n)=>{let{children:r,...i}=e;Vx(r)&&typeof zx==`function`&&(r=zx(r._payload));let a=j.Children.toArray(r),o=a.find(Kx);if(o){let e=o.props.children,r=a.map(t=>t===o?j.Children.count(e)>1?j.Children.only(null):j.isValidElement(e)?e.props.children:null:t);return(0,M.jsx)(t,{...i,ref:n,children:j.isValidElement(e)?j.cloneElement(e,void 0,r):null})}return(0,M.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}var Ux=Hx(`Slot`);function Wx(e){let t=j.forwardRef((e,t)=>{let{children:n,...r}=e;if(Vx(n)&&typeof zx==`function`&&(n=zx(n._payload)),j.isValidElement(n)){let e=Jx(n),i=qx(r,n.props);return n.type!==j.Fragment&&(i.ref=t?c_(t,e):e),j.cloneElement(n,i)}return j.Children.count(n)>1?j.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Gx=Symbol(`radix.slottable`);function Kx(e){return j.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Gx}function qx(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Jx(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Yx=768;function Xx(){let[e,t]=j.useState(void 0);return j.useEffect(()=>{let e=window.matchMedia(`(max-width: ${Yx-1}px)`),n=()=>{t(window.innerWidth<Yx)};return e.addEventListener(`change`,n),t(window.innerWidth<Yx),()=>e.removeEventListener(`change`,n)},[]),!!e}var Zx=ty(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`,outline:`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),Q=j.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,M.jsx)(r?Ux:`button`,{className:Z(Zx({variant:t,size:n,className:e})),ref:a,...i}));Q.displayName=`Button`;var Qx=j.forwardRef(({className:e,type:t,...n},r)=>(0,M.jsx)(`input`,{type:t,className:Z(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50`,e),ref:r,...n}));Qx.displayName=`Input`;var $x=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Hx(`Primitive.${t}`),r=j.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,M.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),eS=`Separator`,tS=`horizontal`,nS=[`horizontal`,`vertical`],rS=j.forwardRef((e,t)=>{let{decorative:n,orientation:r=tS,...i}=e,a=iS(r)?r:tS,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,M.jsx)($x.div,{"data-orientation":a,...o,...i,ref:t})});rS.displayName=eS;function iS(e){return nS.includes(e)}var aS=rS,oS=j.forwardRef(({className:e,orientation:t=`horizontal`,decorative:n=!0,...r},i)=>(0,M.jsx)(aS,{ref:i,decorative:n,orientation:t,className:Z(`shrink-0 bg-border`,t===`horizontal`?`h-[1px] w-full`:`h-full w-[1px]`,e),...r}));oS.displayName=aS.displayName;var sS=j.useId||(()=>void 0),cS=0;function lS(e){let[t,n]=j.useState(sS());return B_(()=>{e||n(e=>e??String(cS++))},[e]),e||(t?`radix-${t}`:``)}var uS=`focusScope.autoFocusOnMount`,dS=`focusScope.autoFocusOnUnmount`,fS={bubbles:!1,cancelable:!0},pS=`FocusScope`,mS=j.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=j.useState(null),l=C_(i),u=C_(a),d=j.useRef(null),f=l_(t,e=>c(e)),p=j.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;j.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:xS(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||xS(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xS(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),j.useEffect(()=>{if(s){SS.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(uS,fS);s.addEventListener(uS,l),s.dispatchEvent(t),t.defaultPrevented||(hS(TS(_S(s)),{select:!0}),document.activeElement===e&&xS(s))}return()=>{s.removeEventListener(uS,l),setTimeout(()=>{let t=new CustomEvent(dS,fS);s.addEventListener(dS,u),s.dispatchEvent(t),t.defaultPrevented||xS(e??document.body,{select:!0}),s.removeEventListener(dS,u),SS.remove(p)},0)}}},[s,l,u,p]);let m=j.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=gS(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xS(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xS(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,M.jsx)(x_.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});mS.displayName=pS;function hS(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xS(r,{select:t}),document.activeElement!==n)return}function gS(e){let t=_S(e);return[vS(t,e),vS(t.reverse(),e)]}function _S(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function vS(e,t){for(let n of e)if(!yS(n,{upTo:t}))return n}function yS(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function bS(e){return e instanceof HTMLInputElement&&`select`in e}function xS(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bS(e)&&t&&e.select()}}var SS=CS();function CS(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wS(e,t),e.unshift(t)},remove(t){e=wS(e,t),e[0]?.resume()}}}function wS(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function TS(e){return e.filter(e=>e.tagName!==`A`)}var ES=0;function DS(){j.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??OS()),document.body.insertAdjacentElement(`beforeend`,e[1]??OS()),ES++,()=>{ES===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),ES--}},[])}function OS(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var kS=function(){return kS=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},kS.apply(this,arguments)};function AS(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function jS(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))}var MS=`right-scroll-bar-position`,NS=`width-before-scroll-bar`,PS=`with-scroll-bars-hidden`,FS=`--removed-body-scroll-bar-size`;function IS(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function LS(e,t){var n=(0,j.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var RS=typeof window<`u`?j.useLayoutEffect:j.useEffect,zS=new WeakMap;function BS(e,t){var n=LS(t||null,function(t){return e.forEach(function(e){return IS(e,t)})});return RS(function(){var t=zS.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||IS(e,null)}),i.forEach(function(e){r.has(e)||IS(e,a)})}zS.set(n,e)},[e]),n}function VS(e){return e}function HS(e,t){t===void 0&&(t=VS);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function US(e){e===void 0&&(e={});var t=HS(null);return t.options=kS({async:!0,ssr:!1},e),t}var WS=function(e){var t=e.sideCar,n=AS(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return j.createElement(r,kS({},n))};WS.isSideCarExport=!0;function GS(e,t){return e.useMedium(t),WS}var KS=US(),qS=function(){},JS=j.forwardRef(function(e,t){var n=j.useRef(null),r=j.useState({onScrollCapture:qS,onWheelCapture:qS,onTouchMoveCapture:qS}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=AS(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=BS([n,t]),C=kS(kS({},b),i);return j.createElement(j.Fragment,null,u&&j.createElement(x,{sideCar:KS,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?j.cloneElement(j.Children.only(s),kS(kS({},C),{ref:S})):j.createElement(v,kS({},C,{className:c,ref:S}),s))});JS.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},JS.classNames={fullWidth:NS,zeroRight:MS};var YS,XS=function(){if(YS)return YS;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function ZS(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=XS();return t&&e.setAttribute(`nonce`,t),e}function QS(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function $S(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var eC=function(){var e=0,t=null;return{add:function(n){e==0&&(t=ZS())&&(QS(t,n),$S(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tC=function(){var e=eC();return function(t,n){j.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},nC=function(){var e=tC();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},rC={left:0,top:0,right:0,gap:0},iC=function(e){return parseInt(e||``,10)||0},aC=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[iC(n),iC(r),iC(i)]},oC=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return rC;var t=aC(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},sC=nC(),cC=`data-scroll-locked`,lC=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
104
104
  .${PS} {
105
105
  overflow: hidden ${r};
package/dist/index.html CHANGED
@@ -50,7 +50,7 @@
50
50
  }
51
51
  @keyframes boot-skeleton-spin { to { transform: rotate(360deg); } }
52
52
  </style>
53
- <script type="module" crossorigin src="/_account/assets/index-x2zW7Lwk.js"></script>
53
+ <script type="module" crossorigin src="/_account/assets/index-DLB2vHx6.js"></script>
54
54
  <link rel="stylesheet" crossorigin href="/_account/assets/index-DEF2FCrM.css">
55
55
  </head>
56
56
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@objectstack/account",
3
- "version": "6.8.1",
3
+ "version": "6.9.0",
4
4
  "description": "ObjectStack Account - End-user account & organization self-service portal",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -11,7 +11,7 @@
11
11
  "access": "public"
12
12
  },
13
13
  "devDependencies": {
14
- "@object-ui/i18n": "^6.2.1",
14
+ "@object-ui/i18n": "^6.2.2",
15
15
  "@radix-ui/react-avatar": "^1.1.11",
16
16
  "@radix-ui/react-checkbox": "^1.3.3",
17
17
  "@radix-ui/react-collapsible": "^1.1.12",
@@ -50,9 +50,9 @@
50
50
  "typescript": "^6.0.3",
51
51
  "vite": "^8.0.14",
52
52
  "vitest": "^4.1.7",
53
- "@objectstack/client": "6.8.1",
54
- "@objectstack/client-react": "6.8.1",
55
- "@objectstack/spec": "6.8.1"
53
+ "@objectstack/client": "6.9.0",
54
+ "@objectstack/client-react": "6.9.0",
55
+ "@objectstack/spec": "6.9.0"
56
56
  },
57
57
  "scripts": {
58
58
  "dev": "vite",