@object-ui/plugin-timeline 3.0.3 → 3.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +5 -5
- package/CHANGELOG.md +11 -0
- package/dist/index.js +1252 -1214
- package/dist/index.umd.cjs +21 -21
- package/dist/src/ObjectTimeline.d.ts +15 -1
- package/dist/src/ObjectTimeline.d.ts.map +1 -1
- package/dist/src/index.d.ts +13 -3
- package/dist/src/index.d.ts.map +1 -1
- package/package.json +10 -9
- package/src/ObjectTimeline.test.tsx +57 -1
- package/src/ObjectTimeline.tsx +71 -22
- package/src/__tests__/ObjectTimeline.spec-config.test.tsx +232 -0
- package/src/__tests__/timeline-variants.test.tsx +150 -0
- package/src/index.tsx +42 -19
package/dist/index.umd.cjs
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(z,C){typeof exports=="object"&&typeof module<"u"?C(exports,require("react"),require("@object-ui/components"),require("@object-ui/core"),require("@object-ui/react"),require("@object-ui/mobile")):typeof define=="function"&&define.amd?define(["exports","react","@object-ui/components","@object-ui/core","@object-ui/react","@object-ui/mobile"],C):(z=typeof globalThis<"u"?globalThis:z||self,C(z.ObjectUIPluginTimeline={},z.React,z.ObjectUIComponents,z.ObjectUICore,z.ObjectUIReact,z.ObjectUIMobile))})(this,(function(z,C,$,ie,Ce,ln){"use strict";function dn(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const x=dn(C);var ge={exports:{}},ae={};var lt;function fn(){if(lt)return ae;lt=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,a){var i=null;if(a!==void 0&&(i=""+a),o.key!==void 0&&(i=""+o.key),"key"in o){a={};for(var s in o)s!=="key"&&(a[s]=o[s])}else a=o;return o=a.ref,{$$typeof:e,type:r,key:i,ref:o!==void 0?o:null,props:a}}return ae.Fragment=t,ae.jsx=n,ae.jsxs=n,ae}var se={};var dt;function pn(){return dt||(dt=1,process.env.NODE_ENV!=="production"&&(function(){function e(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===N?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case w:return"Fragment";case X:return"Profiler";case W:return"StrictMode";case Ie:return"Suspense";case ne:return"SuspenseList";case st:return"Activity"}if(typeof l=="object")switch(typeof l.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),l.$$typeof){case b:return"Portal";case R:return l.displayName||"Context";case A:return(l._context.displayName||"Context")+".Consumer";case U:var v=l.render;return l=l.displayName,l||(l=v.displayName||v.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case de:return v=l.displayName||null,v!==null?v:e(l.type)||"Memo";case re:v=l._payload,l=l._init;try{return e(l(v))}catch{}}return null}function t(l){return""+l}function n(l){try{t(l);var v=!1}catch{v=!0}if(v){v=console;var O=v.error,P=typeof Symbol=="function"&&Symbol.toStringTag&&l[Symbol.toStringTag]||l.constructor.name||"Object";return O.call(v,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",P),t(l)}}function r(l){if(l===w)return"<>";if(typeof l=="object"&&l!==null&&l.$$typeof===re)return"<...>";try{var v=e(l);return v?"<"+v+">":"<...>"}catch{return"<...>"}}function o(){var l=S.A;return l===null?null:l.getOwner()}function a(){return Error("react-stack-top-frame")}function i(l){if(M.call(l,"key")){var v=Object.getOwnPropertyDescriptor(l,"key").get;if(v&&v.isReactWarning)return!1}return l.key!==void 0}function s(l,v){function O(){me||(me=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",v))}O.isReactWarning=!0,Object.defineProperty(l,"key",{get:O,configurable:!0})}function c(){var l=e(this.type);return he[l]||(he[l]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),l=this.props.ref,l!==void 0?l:null}function d(l,v,O,P,Ae,ct){var D=O.ref;return l={$$typeof:y,type:l,key:v,props:O,_owner:P},(D!==void 0?D:null)!==null?Object.defineProperty(l,"ref",{enumerable:!1,get:c}):Object.defineProperty(l,"ref",{enumerable:!1,value:null}),l._store={},Object.defineProperty(l._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(l,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(l,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Ae}),Object.defineProperty(l,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ct}),Object.freeze&&(Object.freeze(l.props),Object.freeze(l)),l}function f(l,v,O,P,Ae,ct){var D=v.children;if(D!==void 0)if(P)if(fe(D)){for(P=0;P<D.length;P++)_(D[P]);Object.freeze&&Object.freeze(D)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else _(D);if(M.call(v,"key")){D=e(l);var oe=Object.keys(v).filter(function(Ia){return Ia!=="key"});P=0<oe.length?"{key: someKey, "+oe.join(": ..., ")+": ...}":"{key: someKey}",un[D+P]||(oe=0<oe.length?"{"+oe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,
|
|
7
|
-
${ue(y.startDate,a)} - ${ue(y.endDate,a)}`,children:h.jsx(Xe,{children:y.title})},z)})},b))})]})})]})}return null};Ee.ComponentRegistry.register("timeline",Re,{namespace:"plugin-timeline",label:"Timeline",category:"data-display",inputs:[{name:"variant",type:"enum",enum:["vertical","horizontal","gantt"],label:"Timeline Variant",defaultValue:"vertical"},{name:"items",type:"array",label:"Timeline Items",description:"For vertical/horizontal: Array of { time, title, description, variant, icon, content }. For gantt: Array of { label, items: [{ title, startDate, endDate, variant }] }"},{name:"dateFormat",type:"enum",enum:["short","long","iso"],label:"Date Format",defaultValue:"short"},{name:"timeScale",type:"enum",enum:["day","week","month"],label:"Time Scale (Gantt only)",defaultValue:"month"},{name:"rowLabel",type:"string",label:"Row Label (Gantt only)",defaultValue:"Items"},{name:"minDate",type:"string",label:"Min Date (Gantt only)",description:"Override auto-calculated min date (YYYY-MM-DD)"},{name:"maxDate",type:"string",label:"Max Date (Gantt only)",description:"Override auto-calculated max date (YYYY-MM-DD)"},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{variant:"vertical",dateFormat:"short",items:[{time:"2024-01-15",title:"Project Started",description:"Kickoff meeting and initial planning",variant:"success",icon:"🚀"},{time:"2024-02-01",title:"First Milestone",description:"Completed initial design phase",variant:"info",icon:"🎨"},{time:"2024-03-15",title:"Beta Release",description:"Released beta version to testers",variant:"warning",icon:"⚡"},{time:"2024-04-01",title:"Launch",description:"Official product launch",variant:"success",icon:"🎉"}]},examples:{vertical:{variant:"vertical",dateFormat:"long",items:[{time:"2024-01-15",title:"Project Started",description:"Kickoff meeting and initial planning",variant:"success"},{time:"2024-02-01",title:"First Milestone",description:"Completed initial design phase",variant:"info"}]},horizontal:{variant:"horizontal",dateFormat:"short",items:[{time:"2024-01-01",title:"Q1",description:"First quarter",variant:"default"},{time:"2024-04-01",title:"Q2",description:"Second quarter",variant:"info"},{time:"2024-07-01",title:"Q3",description:"Third quarter",variant:"warning"},{time:"2024-10-01",title:"Q4",description:"Fourth quarter",variant:"success"}]},gantt:{variant:"gantt",dateFormat:"short",timeScale:"month",rowLabel:"Projects",items:[{label:"Backend Development",items:[{title:"API Design",startDate:"2024-01-01",endDate:"2024-01-31",variant:"success"},{title:"Implementation",startDate:"2024-02-01",endDate:"2024-03-31",variant:"info"}]},{label:"Frontend Development",items:[{title:"UI Design",startDate:"2024-01-15",endDate:"2024-02-15",variant:"warning"},{title:"Component Dev",startDate:"2024-02-15",endDate:"2024-04-15",variant:"default"}]},{label:"Testing",items:[{title:"QA Phase",startDate:"2024-03-01",endDate:"2024-04-30",variant:"danger"}]}]}}});function u(e,t,n){function r(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);const f=i.prototype,d=Object.keys(f);for(let _=0;_<d.length;_++){const m=d[_];m in s||(s[m]=f[m].bind(s))}}const o=n?.Parent??Object;class a extends o{}Object.defineProperty(a,"name",{value:e});function i(s){var c;const f=n?.Parent?new a:this;r(f,s),(c=f._zod).deferred??(c.deferred=[]);for(const d of f._zod.deferred)d();return f}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class X extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ct extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const ut={};function B(e){return ut}function lt(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Ne(e,t){return typeof t=="bigint"?t.toString():t}function De(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function xe(e){return e==null}function Ie(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const ft=Symbol("evaluating");function k(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==ft)return r===void 0&&(r=ft,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function K(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function V(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function dt(e){return JSON.stringify(e)}function hn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const pt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function le(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const mn=De(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function oe(e){if(le(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(le(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function ht(e){return oe(e)?{...e}:Array.isArray(e)?[...e]:e}const gn=new Set(["string","number","symbol"]);function fe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function W(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function g(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function _n(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function vn(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=V(e._zod.def,{get shape(){const i={};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(i[s]=n.shape[s])}return K(this,"shape",i),i},checks:[]});return W(e,a)}function yn(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=V(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete i[s]}return K(this,"shape",i),i},checks:[]});return W(e,a)}function bn(e,t){if(!oe(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(a,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=V(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return K(this,"shape",a),a}});return W(e,o)}function wn(e,t){if(!oe(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=V(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return K(this,"shape",r),r}});return W(e,n)}function zn(e,t){const n=V(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return K(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return W(e,n)}function kn(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=V(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(n)for(const f in n){if(!(f in s))throw new Error(`Unrecognized key: "${f}"`);n[f]&&(c[f]=e?new e({type:"optional",innerType:s[f]}):s[f])}else for(const f in s)c[f]=e?new e({type:"optional",innerType:s[f]}):s[f];return K(this,"shape",c),c},checks:[]});return W(t,i)}function $n(e,t,n){const r=V(t._zod.def,{get shape(){const o=t._zod.def.shape,a={...o};if(n)for(const i in n){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(a[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)a[i]=new e({type:"nonoptional",innerType:o[i]});return K(this,"shape",a),a}});return W(t,r)}function Q(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function mt(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function de(e){return typeof e=="string"?e:e?.message}function H(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=de(e.inst?._zod.def?.error?.(e))??de(t?.error?.(e))??de(n.customError?.(e))??de(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ae(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ie(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const gt=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ne,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},_t=u("$ZodError",gt),vt=u("$ZodError",gt,{Parent:Error});function Tn(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function jn(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(i=>r({issues:i}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let i=n,s=0;for(;s<a.path.length;){const c=a.path[s];s===a.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(a))):i[c]=i[c]||{_errors:[]},i=i[c],s++}}};return r(e),n}const Ce=e=>(t,n,r,o)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new X;if(i.issues.length){const s=new(o?.Err??e)(i.issues.map(c=>H(c,a,B())));throw pt(s,o?.callee),s}return i.value},Fe=e=>async(t,n,r,o)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const s=new(o?.Err??e)(i.issues.map(c=>H(c,a,B())));throw pt(s,o?.callee),s}return i.value},pe=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new X;return a.issues.length?{success:!1,error:new(e??_t)(a.issues.map(i=>H(i,o,B())))}:{success:!0,data:a.value}},On=pe(vt),he=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(i=>H(i,o,B())))}:{success:!0,data:a.value}},Sn=he(vt),Zn=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ce(e)(t,n,o)},En=e=>(t,n,r)=>Ce(e)(t,n,r),Pn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Fe(e)(t,n,o)},Rn=e=>async(t,n,r)=>Fe(e)(t,n,r),Nn=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pe(e)(t,n,o)},Dn=e=>(t,n,r)=>pe(e)(t,n,r),xn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return he(e)(t,n,o)},In=e=>async(t,n,r)=>he(e)(t,n,r),An=/^[cC][^\s-]{8,}$/,Cn=/^[0-9a-z]+$/,Fn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Un=/^[0-9a-vA-V]{20}$/,Ln=/^[A-Za-z0-9]{27}$/,Jn=/^[a-zA-Z0-9_-]{21}$/,Mn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Gn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,yt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Vn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Wn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Yn(){return new RegExp(Wn,"u")}const qn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Bn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Kn=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Hn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Xn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,bt=/^[A-Za-z0-9_-]*$/,Qn=/^\+[1-9]\d{6,14}$/,wt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",er=new RegExp(`^${wt}$`);function zt(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function tr(e){return new RegExp(`^${zt(e)}$`)}function nr(e){const t=zt({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${wt}T(?:${r})$`)}const rr=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},or=/^[^A-Z]*$/,ir=/^[^a-z]*$/,M=u("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),ar=u("$ZodCheckMaxLength",(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!xe(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=Ae(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),sr=u("$ZodCheckMinLength",(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!xe(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=Ae(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),cr=u("$ZodCheckLengthEquals",(e,t)=>{var n;M.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!xe(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,a=o.length;if(a===t.length)return;const i=Ae(o),s=a>t.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),me=u("$ZodCheckStringFormat",(e,t)=>{var n,r;M.init(e,t),e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),ur=u("$ZodCheckRegex",(e,t)=>{me.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),lr=u("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=or),me.init(e,t)}),fr=u("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ir),me.init(e,t)}),dr=u("$ZodCheckIncludes",(e,t)=>{M.init(e,t);const n=fe(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const a=o._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),pr=u("$ZodCheckStartsWith",(e,t)=>{M.init(e,t);const n=new RegExp(`^${fe(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),hr=u("$ZodCheckEndsWith",(e,t)=>{M.init(e,t);const n=new RegExp(`.*${fe(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),mr=u("$ZodCheckOverwrite",(e,t)=>{M.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class gr{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
6
|
+
<%s key={someKey} {...props} />`,P,D,oe,D),un[D+P]=!0)}if(D=null,O!==void 0&&(n(O),D=""+O),i(v)&&(n(v.key),D=""+v.key),"key"in v){O={};for(var ut in v)ut!=="key"&&(O[ut]=v[ut])}else O=v;return D&&s(O,typeof l=="function"?l.displayName||l.name||"Unknown":l),d(l,D,O,o(),Ae,ct)}function _(l){h(l)?l._store&&(l._store.validated=1):typeof l=="object"&&l!==null&&l.$$typeof===re&&(l._payload.status==="fulfilled"?h(l._payload.value)&&l._payload.value._store&&(l._payload.value._store.validated=1):l._store&&(l._store.validated=1))}function h(l){return typeof l=="object"&&l!==null&&l.$$typeof===y}var p=C,y=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),W=Symbol.for("react.strict_mode"),X=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),R=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),Ie=Symbol.for("react.suspense"),ne=Symbol.for("react.suspense_list"),de=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),st=Symbol.for("react.activity"),N=Symbol.for("react.client.reference"),S=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,M=Object.prototype.hasOwnProperty,fe=Array.isArray,pe=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(l){return l()}};var me,he={},V=p.react_stack_bottom_frame.bind(p,a)(),cn=pe(r(a)),un={};se.Fragment=w,se.jsx=function(l,v,O){var P=1e4>S.recentlyCreatedOwnerStacks++;return f(l,v,O,!1,P?Error("react-stack-top-frame"):V,P?pe(r(l)):cn)},se.jsxs=function(l,v,O){var P=1e4>S.recentlyCreatedOwnerStacks++;return f(l,v,O,!0,P?Error("react-stack-top-frame"):V,P?pe(r(l)):cn)}})()),se}var ft;function mn(){return ft||(ft=1,process.env.NODE_ENV==="production"?ge.exports=fn():ge.exports=pn()),ge.exports}var m=mn();const hn=10080*60*1e3;function gn(e){const t=e.flatMap(o=>(o.items||[]).flatMap(a=>[a.startDate,a.endDate])),n=Math.min(...t.map(o=>new Date(o).getTime())),r=Math.max(...t.map(o=>new Date(o).getTime()));return{minDate:new Date(n).toISOString().split("T")[0],maxDate:new Date(r).toISOString().split("T")[0]}}function _n(e,t,n,r){const o=new Date(e).getTime(),a=new Date(t).getTime(),i=new Date(n).getTime(),c=new Date(r).getTime()-i,d=o-i,f=a-o;return{start:d/c*100,width:f/c*100}}function _e(e,t){const n=new Date(e);return t==="short"?n.toLocaleDateString():t==="long"?n.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):n.toISOString().split("T")[0]}const Fe=({schema:e,className:t,...n})=>{const{variant:r="vertical",items:o=[],dateFormat:a="short",onItemClick:i}=e;if(r==="vertical")return m.jsx(Ke,{className:t,...n,children:o.map((s,c)=>m.jsxs(He,{className:$.cn(s.className,i&&"cursor-pointer"),onClick:()=>i?.(s),children:[m.jsx(Ze,{variant:s.variant||"default",children:s.icon&&m.jsx("span",{className:"text-xs",children:s.icon})}),m.jsxs(Xe,{children:[s.time&&m.jsx(Pe,{dateTime:s.time,children:_e(s.time,a)}),s.title&&m.jsx(Ee,{children:s.title}),s.description&&m.jsx(De,{className:"line-clamp-2 sm:line-clamp-none",children:s.description}),s.content&&$.renderChildren(s.content)]})]},c))});if(r==="horizontal")return m.jsx(Qe,{className:$.cn("overflow-x-auto [-webkit-overflow-scrolling:touch]",t),...n,children:o.map((s,c)=>m.jsxs(et,{className:$.cn(s.className,i&&"cursor-pointer"),onClick:()=>i?.(s),children:[m.jsxs("div",{className:"flex flex-col items-center",children:[m.jsx(Ze,{variant:s.variant||"default",children:s.icon&&m.jsx("span",{className:"text-xs",children:s.icon})}),m.jsxs("div",{className:"mt-4 text-center",children:[s.time&&m.jsx(Pe,{dateTime:s.time,children:_e(s.time,a)}),s.title&&m.jsx(Ee,{children:s.title}),s.description&&m.jsx(De,{className:"text-center line-clamp-2 sm:line-clamp-none",children:s.description}),s.content&&$.renderChildren(s.content)]})]}),c<o.length-1&&m.jsx("div",{className:"absolute left-full w-16 border-t-2 border-gray-200 top-3"})]},c))});if(r==="gantt"){const s=gn(o),c=e.minDate||s.minDate,d=e.maxDate||s.maxDate,f=e.timeScale||"month",h=(()=>{const p=[],y=new Date(c),b=new Date(d);if(f==="month"){const w=new Date(y);for(;w<=b;)p.push(w.toLocaleDateString("en-US",{month:"short",year:"numeric"})),w.setMonth(w.getMonth()+1)}else if(f==="week"){const w=new Date(y);for(;w<=b;)p.push(`Week ${Math.ceil((w.getTime()-y.getTime())/hn)+1}`),w.setDate(w.getDate()+7)}else if(f==="day"){const w=new Date(y);for(;w<=b;)p.push(w.toLocaleDateString("en-US",{month:"short",day:"numeric"})),w.setDate(w.getDate()+1)}return p})();return m.jsxs(tt,{className:$.cn("overflow-x-auto [-webkit-overflow-scrolling:touch]",t),...n,children:[m.jsxs(nt,{children:[m.jsx(Re,{className:"flex items-center px-2 sm:px-4 py-2 sm:py-3",children:m.jsx("span",{className:"font-semibold text-xs sm:text-sm",children:e.rowLabel||"Items"})}),m.jsx(Ne,{children:m.jsx("div",{className:"flex h-full",children:h.map((p,y)=>m.jsx("div",{className:"flex-1 px-1 sm:px-2 py-2 sm:py-3 border-r text-xs font-medium text-center",children:p},y))})})]}),m.jsx("div",{children:m.jsxs("div",{className:"flex",children:[m.jsx(Re,{children:o.map((p,y)=>m.jsx(xe,{children:m.jsx(rt,{title:p.label,className:"truncate",children:p.label})},y))}),m.jsx(Ne,{className:"relative",children:o.map((p,y)=>m.jsx(xe,{className:"relative",children:(p.items||[]).map((b,w)=>{const W=_n(b.startDate,b.endDate,c,d);return m.jsx(ot,{start:W.start,width:W.width,variant:b.variant||"default",onClick:()=>i?.(b,p,y,w),title:`${b.title||""}
|
|
7
|
+
${_e(b.startDate,a)} - ${_e(b.endDate,a)}`,children:m.jsx(it,{children:b.title})},w)})},y))})]})})]})}return null};ie.ComponentRegistry.register("timeline",Fe,{namespace:"plugin-timeline",label:"Timeline",category:"data-display",inputs:[{name:"variant",type:"enum",enum:["vertical","horizontal","gantt"],label:"Timeline Variant",defaultValue:"vertical"},{name:"items",type:"array",label:"Timeline Items",description:"For vertical/horizontal: Array of { time, title, description, variant, icon, content }. For gantt: Array of { label, items: [{ title, startDate, endDate, variant }] }"},{name:"dateFormat",type:"enum",enum:["short","long","iso"],label:"Date Format",defaultValue:"short"},{name:"timeScale",type:"enum",enum:["day","week","month"],label:"Time Scale (Gantt only)",defaultValue:"month"},{name:"rowLabel",type:"string",label:"Row Label (Gantt only)",defaultValue:"Items"},{name:"minDate",type:"string",label:"Min Date (Gantt only)",description:"Override auto-calculated min date (YYYY-MM-DD)"},{name:"maxDate",type:"string",label:"Max Date (Gantt only)",description:"Override auto-calculated max date (YYYY-MM-DD)"},{name:"className",type:"string",label:"CSS Class"}],defaultProps:{variant:"vertical",dateFormat:"short",items:[{time:"2024-01-15",title:"Project Started",description:"Kickoff meeting and initial planning",variant:"success",icon:"🚀"},{time:"2024-02-01",title:"First Milestone",description:"Completed initial design phase",variant:"info",icon:"🎨"},{time:"2024-03-15",title:"Beta Release",description:"Released beta version to testers",variant:"warning",icon:"⚡"},{time:"2024-04-01",title:"Launch",description:"Official product launch",variant:"success",icon:"🎉"}]},examples:{vertical:{variant:"vertical",dateFormat:"long",items:[{time:"2024-01-15",title:"Project Started",description:"Kickoff meeting and initial planning",variant:"success"},{time:"2024-02-01",title:"First Milestone",description:"Completed initial design phase",variant:"info"}]},horizontal:{variant:"horizontal",dateFormat:"short",items:[{time:"2024-01-01",title:"Q1",description:"First quarter",variant:"default"},{time:"2024-04-01",title:"Q2",description:"Second quarter",variant:"info"},{time:"2024-07-01",title:"Q3",description:"Third quarter",variant:"warning"},{time:"2024-10-01",title:"Q4",description:"Fourth quarter",variant:"success"}]},gantt:{variant:"gantt",dateFormat:"short",timeScale:"month",rowLabel:"Projects",items:[{label:"Backend Development",items:[{title:"API Design",startDate:"2024-01-01",endDate:"2024-01-31",variant:"success"},{title:"Implementation",startDate:"2024-02-01",endDate:"2024-03-31",variant:"info"}]},{label:"Frontend Development",items:[{title:"UI Design",startDate:"2024-01-15",endDate:"2024-02-15",variant:"warning"},{title:"Component Dev",startDate:"2024-02-15",endDate:"2024-04-15",variant:"default"}]},{label:"Testing",items:[{title:"QA Phase",startDate:"2024-03-01",endDate:"2024-04-30",variant:"danger"}]}]}}});function u(e,t,n){function r(s,c){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:c,constr:i,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,c);const d=i.prototype,f=Object.keys(d);for(let _=0;_<f.length;_++){const h=f[_];h in s||(s[h]=d[h].bind(s))}}const o=n?.Parent??Object;class a extends o{}Object.defineProperty(a,"name",{value:e});function i(s){var c;const d=n?.Parent?new a:this;r(d,s),(c=d._zod).deferred??(c.deferred=[]);for(const f of d._zod.deferred)f();return d}return Object.defineProperty(i,"init",{value:r}),Object.defineProperty(i,Symbol.hasInstance,{value:s=>n?.Parent&&s instanceof n.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}class Q extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class pt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const mt={};function q(e){return mt}function ht(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function Ue(e,t){return typeof t=="bigint"?t.toString():t}function Le(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Je(e){return e==null}function Me(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}const gt=Symbol("evaluating");function k(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==gt)return r===void 0&&(r=gt,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function K(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Y(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function _t(e){return JSON.stringify(e)}function vn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const vt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function ve(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const bn=Le(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function ce(e){if(ve(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(ve(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function bt(e){return ce(e)?{...e}:Array.isArray(e)?[...e]:e}const yn=new Set(["string","number","symbol"]);function be(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function B(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function g(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function wn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function zn(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const a=Y(e._zod.def,{get shape(){const i={};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(i[s]=n.shape[s])}return K(this,"shape",i),i},checks:[]});return B(e,a)}function kn(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const a=Y(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const s in t){if(!(s in n.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete i[s]}return K(this,"shape",i),i},checks:[]});return B(e,a)}function $n(e,t){if(!ce(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const a=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(a,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=Y(e._zod.def,{get shape(){const a={...e._zod.def.shape,...t};return K(this,"shape",a),a}});return B(e,o)}function Tn(e,t){if(!ce(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=Y(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return K(this,"shape",r),r}});return B(e,n)}function jn(e,t){const n=Y(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return K(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return B(e,n)}function On(e,t,n){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=Y(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(n)for(const d in n){if(!(d in s))throw new Error(`Unrecognized key: "${d}"`);n[d]&&(c[d]=e?new e({type:"optional",innerType:s[d]}):s[d])}else for(const d in s)c[d]=e?new e({type:"optional",innerType:s[d]}):s[d];return K(this,"shape",c),c},checks:[]});return B(t,i)}function Sn(e,t,n){const r=Y(t._zod.def,{get shape(){const o=t._zod.def.shape,a={...o};if(n)for(const i in n){if(!(i in a))throw new Error(`Unrecognized key: "${i}"`);n[i]&&(a[i]=new e({type:"nonoptional",innerType:o[i]}))}else for(const i in o)a[i]=new e({type:"nonoptional",innerType:o[i]});return K(this,"shape",a),a}});return B(t,r)}function ee(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function yt(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function ye(e){return typeof e=="string"?e:e?.message}function H(e,t,n){const r={...e,path:e.path??[]};if(!e.message){const o=ye(e.inst?._zod.def?.error?.(e))??ye(t?.error?.(e))??ye(n.customError?.(e))??ye(n.localeError?.(e))??"Invalid input";r.message=o}return delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ve(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ue(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const wt=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Ue,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},zt=u("$ZodError",wt),kt=u("$ZodError",wt,{Parent:Error});function Zn(e,t=n=>n.message){const n={},r=[];for(const o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function En(e,t=n=>n.message){const n={_errors:[]},r=o=>{for(const a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(i=>r({issues:i}));else if(a.code==="invalid_key")r({issues:a.issues});else if(a.code==="invalid_element")r({issues:a.issues});else if(a.path.length===0)n._errors.push(t(a));else{let i=n,s=0;for(;s<a.path.length;){const c=a.path[s];s===a.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(a))):i[c]=i[c]||{_errors:[]},i=i[c],s++}}};return r(e),n}const Ge=e=>(t,n,r,o)=>{const a=r?Object.assign(r,{async:!1}):{async:!1},i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise)throw new Q;if(i.issues.length){const s=new(o?.Err??e)(i.issues.map(c=>H(c,a,q())));throw vt(s,o?.callee),s}return i.value},We=e=>async(t,n,r,o)=>{const a=r?Object.assign(r,{async:!0}):{async:!0};let i=t._zod.run({value:n,issues:[]},a);if(i instanceof Promise&&(i=await i),i.issues.length){const s=new(o?.Err??e)(i.issues.map(c=>H(c,a,q())));throw vt(s,o?.callee),s}return i.value},we=e=>(t,n,r)=>{const o=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},o);if(a instanceof Promise)throw new Q;return a.issues.length?{success:!1,error:new(e??zt)(a.issues.map(i=>H(i,o,q())))}:{success:!0,data:a.value}},Pn=we(kt),ze=e=>async(t,n,r)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:n,issues:[]},o);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(i=>H(i,o,q())))}:{success:!0,data:a.value}},Dn=ze(kt),Rn=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Ge(e)(t,n,o)},Nn=e=>(t,n,r)=>Ge(e)(t,n,r),xn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return We(e)(t,n,o)},In=e=>async(t,n,r)=>We(e)(t,n,r),An=e=>(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return we(e)(t,n,o)},Cn=e=>(t,n,r)=>we(e)(t,n,r),Fn=e=>async(t,n,r)=>{const o=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ze(e)(t,n,o)},Un=e=>async(t,n,r)=>ze(e)(t,n,r),Ln=/^[cC][^\s-]{8,}$/,Jn=/^[0-9a-z]+$/,Mn=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Vn=/^[0-9a-vA-V]{20}$/,Gn=/^[A-Za-z0-9]{27}$/,Wn=/^[a-zA-Z0-9_-]{21}$/,Yn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Bn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,$t=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,qn=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Kn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Hn(){return new RegExp(Kn,"u")}const Xn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Qn=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,er=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,tr=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Tt=/^[A-Za-z0-9_-]*$/,rr=/^\+[1-9]\d{6,14}$/,jt="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",or=new RegExp(`^${jt}$`);function Ot(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ir(e){return new RegExp(`^${Ot(e)}$`)}function ar(e){const t=Ot({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${jt}T(?:${r})$`)}const sr=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},cr=/^[^A-Z]*$/,ur=/^[^a-z]*$/,G=u("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),lr=u("$ZodCheckMaxLength",(e,t)=>{var n;G.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Je(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const o=r.value;if(o.length<=t.maximum)return;const i=Ve(o);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),dr=u("$ZodCheckMinLength",(e,t)=>{var n;G.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Je(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const o=r.value;if(o.length>=t.minimum)return;const i=Ve(o);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),fr=u("$ZodCheckLengthEquals",(e,t)=>{var n;G.init(e,t),(n=e._zod.def).when??(n.when=r=>{const o=r.value;return!Je(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{const o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{const o=r.value,a=o.length;if(a===t.length)return;const i=Ve(o),s=a>t.length;r.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),ke=u("$ZodCheckStringFormat",(e,t)=>{var n,r;G.init(e,t),e._zod.onattach.push(o=>{const a=o._zod.bag;a.format=t.format,t.pattern&&(a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),pr=u("$ZodCheckRegex",(e,t)=>{ke.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),mr=u("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=cr),ke.init(e,t)}),hr=u("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ur),ke.init(e,t)}),gr=u("$ZodCheckIncludes",(e,t)=>{G.init(e,t);const n=be(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{const a=o._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),_r=u("$ZodCheckStartsWith",(e,t)=>{G.init(e,t);const n=new RegExp(`^${be(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),vr=u("$ZodCheckEndsWith",(e,t)=>{G.init(e,t);const n=new RegExp(`.*${be(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),br=u("$ZodCheckOverwrite",(e,t)=>{G.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class yr{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
|
|
8
8
|
`).filter(i=>i),o=Math.min(...r.map(i=>i.length-i.trimStart().length)),a=r.map(i=>i.slice(o)).map(i=>" ".repeat(this.indent*2)+i);for(const i of a)this.content.push(i)}compile(){const t=Function,n=this?.args,o=[...(this?.content??[""]).map(a=>` ${a}`)];return new t(...n,o.join(`
|
|
9
|
-
`))}}const
|
|
10
|
-
if (${
|
|
11
|
-
if (${
|
|
12
|
-
payload.issues = payload.issues.concat(${
|
|
9
|
+
`))}}const wr={major:4,minor:3,patch:6},Z=u("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wr;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const o of r)for(const a of o._zod.onattach)a(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,s,c)=>{let d=ee(i),f;for(const _ of s){if(_._zod.def.when){if(!_._zod.def.when(i))continue}else if(d)continue;const h=i.issues.length,p=_._zod.check(i);if(p instanceof Promise&&c?.async===!1)throw new Q;if(f||p instanceof Promise)f=(f??Promise.resolve()).then(async()=>{await p,i.issues.length!==h&&(d||(d=ee(i,h)))});else{if(i.issues.length===h)continue;d||(d=ee(i,h))}}return f?f.then(()=>i):i},a=(i,s,c)=>{if(ee(i))return i.aborted=!0,i;const d=o(s,r,c);if(d instanceof Promise){if(c.async===!1)throw new Q;return d.then(f=>e._zod.parse(f,c))}return e._zod.parse(d,c)};e._zod.run=(i,s)=>{if(s.skipChecks)return e._zod.parse(i,s);if(s.direction==="backward"){const d=e._zod.parse({value:i.value,issues:[]},{...s,skipChecks:!0});return d instanceof Promise?d.then(f=>a(f,i,s)):a(d,i,s)}const c=e._zod.parse(i,s);if(c instanceof Promise){if(s.async===!1)throw new Q;return c.then(d=>o(d,r,s))}return o(c,r,s)}}k(e,"~standard",()=>({validate:o=>{try{const a=Pn(e,o);return a.success?{value:a.data}:{issues:a.error?.issues}}catch{return Dn(e,o).then(i=>i.success?{value:i.data}:{issues:i.error?.issues})}},vendor:"zod",version:1}))}),Ye=u("$ZodString",(e,t)=>{Z.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??sr(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),T=u("$ZodStringFormat",(e,t)=>{ke.init(e,t),Ye.init(e,t)}),zr=u("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Bn),T.init(e,t)}),kr=u("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=$t(r))}else t.pattern??(t.pattern=$t());T.init(e,t)}),$r=u("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=qn),T.init(e,t)}),Tr=u("$ZodURL",(e,t)=>{T.init(e,t),e._zod.check=n=>{try{const r=n.value.trim(),o=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=o.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),jr=u("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Hn()),T.init(e,t)}),Or=u("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Wn),T.init(e,t)}),Sr=u("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ln),T.init(e,t)}),Zr=u("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Jn),T.init(e,t)}),Er=u("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Mn),T.init(e,t)}),Pr=u("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Vn),T.init(e,t)}),Dr=u("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Gn),T.init(e,t)}),Rr=u("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ar(t)),T.init(e,t)}),Nr=u("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=or),T.init(e,t)}),xr=u("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ir(t)),T.init(e,t)}),Ir=u("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Yn),T.init(e,t)}),Ar=u("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Xn),T.init(e,t),e._zod.bag.format="ipv4"}),Cr=u("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Qn),T.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),Fr=u("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=er),T.init(e,t)}),Ur=u("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=tr),T.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[o,a]=r;if(!a)throw new Error;const i=Number(a);if(`${i}`!==a)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${o}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function St(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Lr=u("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=nr),T.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{St(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function Jr(e){if(!Tt.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return St(n)}const Mr=u("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Tt),T.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{Jr(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),Vr=u("$ZodE164",(e,t)=>{t.pattern??(t.pattern=rr),T.init(e,t)});function Gr(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const o=JSON.parse(atob(r));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Wr=u("$ZodJWT",(e,t)=>{T.init(e,t),e._zod.check=n=>{Gr(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Yr=u("$ZodUnknown",(e,t)=>{Z.init(e,t),e._zod.parse=n=>n}),Br=u("$ZodNever",(e,t)=>{Z.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function Zt(e,t,n){e.issues.length&&t.issues.push(...yt(n,e.issues)),t.value[n]=e.value}const qr=u("$ZodArray",(e,t)=>{Z.init(e,t),e._zod.parse=(n,r)=>{const o=n.value;if(!Array.isArray(o))return n.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),n;n.value=Array(o.length);const a=[];for(let i=0;i<o.length;i++){const s=o[i],c=t.element._zod.run({value:s,issues:[]},r);c instanceof Promise?a.push(c.then(d=>Zt(d,n,i))):Zt(c,n,i)}return a.length?Promise.all(a).then(()=>n):n}});function $e(e,t,n,r,o){if(e.issues.length){if(o&&!(n in r))return;t.issues.push(...yt(n,e.issues))}e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}function Et(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=wn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Pt(e,t,n,r,o,a){const i=[],s=o.keySet,c=o.catchall._zod,d=c.def.type,f=c.optout==="optional";for(const _ in t){if(s.has(_))continue;if(d==="never"){i.push(_);continue}const h=c.run({value:t[_],issues:[]},r);h instanceof Promise?e.push(h.then(p=>$e(p,n,_,t,f))):$e(h,n,_,t,f)}return i.length&&n.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}const Kr=u("$ZodObject",(e,t)=>{if(Z.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Le(()=>Et(t));k(e._zod,"propValues",()=>{const s=t.shape,c={};for(const d in s){const f=s[d]._zod;if(f.values){c[d]??(c[d]=new Set);for(const _ of f.values)c[d].add(_)}}return c});const o=ve,a=t.catchall;let i;e._zod.parse=(s,c)=>{i??(i=r.value);const d=s.value;if(!o(d))return s.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),s;s.value={};const f=[],_=i.shape;for(const h of i.keys){const p=_[h],y=p._zod.optout==="optional",b=p._zod.run({value:d[h],issues:[]},c);b instanceof Promise?f.push(b.then(w=>$e(w,s,h,d,y))):$e(b,s,h,d,y)}return a?Pt(f,d,s,c,r.value,e):f.length?Promise.all(f).then(()=>s):s}}),Hr=u("$ZodObjectJIT",(e,t)=>{Kr.init(e,t);const n=e._zod.parse,r=Le(()=>Et(t)),o=h=>{const p=new yr(["shape","payload","ctx"]),y=r.value,b=A=>{const R=_t(A);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};p.write("const input = payload.value;");const w=Object.create(null);let W=0;for(const A of y.keys)w[A]=`key_${W++}`;p.write("const newResult = {};");for(const A of y.keys){const R=w[A],U=_t(A),ne=h[A]?._zod?.optout==="optional";p.write(`const ${R} = ${b(A)};`),ne?p.write(`
|
|
10
|
+
if (${R}.issues.length) {
|
|
11
|
+
if (${U} in input) {
|
|
12
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
13
13
|
...iss,
|
|
14
|
-
path: iss.path ? [${
|
|
14
|
+
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
15
15
|
})));
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
if (${
|
|
20
|
-
if (${
|
|
21
|
-
newResult[${
|
|
19
|
+
if (${R}.value === undefined) {
|
|
20
|
+
if (${U} in input) {
|
|
21
|
+
newResult[${U}] = undefined;
|
|
22
22
|
}
|
|
23
23
|
} else {
|
|
24
|
-
newResult[${
|
|
24
|
+
newResult[${U}] = ${R}.value;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
`):p.write(`
|
|
28
|
-
if (${
|
|
29
|
-
payload.issues = payload.issues.concat(${
|
|
28
|
+
if (${R}.issues.length) {
|
|
29
|
+
payload.issues = payload.issues.concat(${R}.issues.map(iss => ({
|
|
30
30
|
...iss,
|
|
31
|
-
path: iss.path ? [${
|
|
31
|
+
path: iss.path ? [${U}, ...iss.path] : [${U}]
|
|
32
32
|
})));
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
if (${
|
|
36
|
-
if (${
|
|
37
|
-
newResult[${
|
|
35
|
+
if (${R}.value === undefined) {
|
|
36
|
+
if (${U} in input) {
|
|
37
|
+
newResult[${U}] = undefined;
|
|
38
38
|
}
|
|
39
39
|
} else {
|
|
40
|
-
newResult[${
|
|
40
|
+
newResult[${U}] = ${R}.value;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
`)}p.write("payload.value = newResult;"),p.write("return payload;");const se=p.compile();return(F,P)=>se(m,F,P)};let a;const i=le,s=!ut.jitless,f=s&&mn.value,d=t.catchall;let _;e._zod.parse=(m,p)=>{_??(_=r.value);const b=m.value;return i(b)?s&&f&&p?.async===!1&&p.jitless!==!0?(a||(a=o(t.shape)),m=a(m,p),d?jt([],b,m,p,_,e):m):n(m,p):(m.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),m)}});function Ot(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const o=e.filter(a=>!Q(a));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(i=>H(i,r,B())))}),t)}const qr=u("$ZodUnion",(e,t)=>{Z.init(e,t),k(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),k(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),k(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),k(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${o.map(a=>Ie(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,a)=>{if(n)return r(o,a);let i=!1;const s=[];for(const c of t.options){const f=c._zod.run({value:o.value,issues:[]},a);if(f instanceof Promise)s.push(f),i=!0;else{if(f.issues.length===0)return f;s.push(f)}}return i?Promise.all(s).then(c=>Ot(c,o,e,a)):Ot(s,o,e,a)}}),Br=u("$ZodIntersection",(e,t)=>{Z.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,a=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([c,f])=>St(n,c,f)):St(n,a,i)}});function Le(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(oe(e)&&oe(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),o={...e,...t};for(const a of r){const i=Le(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};o[a]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],a=t[r],i=Le(o,a);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function St(e,t,n){const r=new Map;let o;for(const s of t.issues)if(s.code==="unrecognized_keys"){o??(o=s);for(const c of s.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(s);for(const s of n.issues)if(s.code==="unrecognized_keys")for(const c of s.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(s);const a=[...r].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(a.length&&o&&e.issues.push({...o,keys:a}),Q(e))return e;const i=Le(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Kr=u("$ZodEnum",(e,t)=>{Z.init(e,t);const n=lt(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>gn.has(typeof o)).map(o=>typeof o=="string"?fe(o):o.toString()).join("|")})$`),e._zod.parse=(o,a)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),Hr=u("$ZodTransform",(e,t)=>{Z.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ct(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n));if(o instanceof Promise)throw new X;return n.value=o,n}});function Zt(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const Et=u("$ZodOptional",(e,t)=>{Z.init(e,t),e._zod.optin="optional",e._zod.optout="optional",k(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),k(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ie(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>Zt(a,n.value)):Zt(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),Xr=u("$ZodExactOptional",(e,t)=>{Et.init(e,t),k(e._zod,"values",()=>t.innerType._zod.values),k(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),Qr=u("$ZodNullable",(e,t)=>{Z.init(e,t),k(e._zod,"optin",()=>t.innerType._zod.optin),k(e._zod,"optout",()=>t.innerType._zod.optout),k(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Ie(n.source)}|null)$`):void 0}),k(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),eo=u("$ZodDefault",(e,t)=>{Z.init(e,t),e._zod.optin="optional",k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>Pt(a,t)):Pt(o,t)}});function Pt(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const to=u("$ZodPrefault",(e,t)=>{Z.init(e,t),e._zod.optin="optional",k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),no=u("$ZodNonOptional",(e,t)=>{Z.init(e,t),k(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>Rt(a,e)):Rt(o,e)}});function Rt(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const ro=u("$ZodCatch",(e,t)=>{Z.init(e,t),k(e._zod,"optin",()=>t.innerType._zod.optin),k(e._zod,"optout",()=>t.innerType._zod.optout),k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(i=>H(i,r,B()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(a=>H(a,r,B()))},input:n.value}),n.issues=[]),n)}}),oo=u("$ZodPipe",(e,t)=>{Z.init(e,t),k(e._zod,"values",()=>t.in._zod.values),k(e._zod,"optin",()=>t.in._zod.optin),k(e._zod,"optout",()=>t.out._zod.optout),k(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(i=>_e(i,t.in,r)):_e(a,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(a=>_e(a,t.out,r)):_e(o,t.out,r)}});function _e(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const io=u("$ZodReadonly",(e,t)=>{Z.init(e,t),k(e._zod,"propValues",()=>t.innerType._zod.propValues),k(e._zod,"values",()=>t.innerType._zod.values),k(e._zod,"optin",()=>t.innerType?._zod?.optin),k(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Nt):Nt(o)}});function Nt(e){return e.value=Object.freeze(e.value),e}const ao=u("$ZodCustom",(e,t)=>{M.init(e,t),Z.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(a=>Dt(a,n,r,e));Dt(o,n,r,e)}});function Dt(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(ie(o))}}var xt;class so{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function co(){return new so}(xt=globalThis).__zod_globalRegistry??(xt.__zod_globalRegistry=co());const ae=globalThis.__zod_globalRegistry;function uo(e,t){return new e({type:"string",...g(t)})}function lo(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function It(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function fo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function po(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function ho(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function mo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function go(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function _o(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function vo(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function yo(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function bo(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function wo(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function zo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function ko(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function $o(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function To(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function jo(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function Oo(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function So(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function Zo(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function Eo(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function Po(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function Ro(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function No(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function Do(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function xo(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function Io(e){return new e({type:"unknown"})}function Ao(e,t){return new e({type:"never",...g(t)})}function At(e,t){return new ar({check:"max_length",...g(t),maximum:e})}function ve(e,t){return new sr({check:"min_length",...g(t),minimum:e})}function Ct(e,t){return new cr({check:"length_equals",...g(t),length:e})}function Co(e,t){return new ur({check:"string_format",format:"regex",...g(t),pattern:e})}function Fo(e){return new lr({check:"string_format",format:"lowercase",...g(e)})}function Uo(e){return new fr({check:"string_format",format:"uppercase",...g(e)})}function Lo(e,t){return new dr({check:"string_format",format:"includes",...g(t),includes:e})}function Jo(e,t){return new pr({check:"string_format",format:"starts_with",...g(t),prefix:e})}function Mo(e,t){return new hr({check:"string_format",format:"ends_with",...g(t),suffix:e})}function ee(e){return new mr({check:"overwrite",tx:e})}function Go(e){return ee(t=>t.normalize(e))}function Vo(){return ee(e=>e.trim())}function Wo(){return ee(e=>e.toLowerCase())}function Yo(){return ee(e=>e.toUpperCase())}function qo(){return ee(e=>hn(e))}function Bo(e,t,n){return new e({type:"array",element:t,...g(n)})}function Ko(e,t,n){return new e({type:"custom",check:"custom",fn:t,...g(n)})}function Ho(e){const t=Xo(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(ie(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(ie(o))}},e(n.value,n)));return t}function Xo(e,t){const n=new M({check:"custom",...g(t)});return n._zod.check=e,n}function Ft(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??ae,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 x(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const s=e._zod.toJSONSchema?.();if(s)i.schema=s;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,d);else{const m=i.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,m,d)}const _=e._zod.parent;_&&(i.ref||(i.ref=_),x(_,t,d),t.seen.get(_).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&C(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Ut(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const s=e.metadataRegistry.get(i[0])?.id;if(s){const c=r.get(s);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(s,i[0])}}const o=i=>{const s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const _=e.external.registry.get(i[0])?.id,m=e.external.uri??(b=>b);if(_)return{ref:m(_)};const p=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=p,{defId:p,ref:`${m("__shared")}#/${s}/${p}`}}if(i[1]===n)return{ref:"#"};const f=`#/${s}/`,d=i[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:f+d}},a=i=>{if(i[1].schema.$ref)return;const s=i[1],{ref:c,defId:f}=o(i);s.def={...s.schema},f&&(s.defId=f);const d=s.schema;for(const _ in d)delete d[_];d.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const s=i[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
43
|
+
`)}p.write("payload.value = newResult;"),p.write("return payload;");const X=p.compile();return(A,R)=>X(h,A,R)};let a;const i=ve,s=!mt.jitless,d=s&&bn.value,f=t.catchall;let _;e._zod.parse=(h,p)=>{_??(_=r.value);const y=h.value;return i(y)?s&&d&&p?.async===!1&&p.jitless!==!0?(a||(a=o(t.shape)),h=a(h,p),f?Pt([],y,h,p,_,e):h):n(h,p):(h.issues.push({expected:"object",code:"invalid_type",input:y,inst:e}),h)}});function Dt(e,t,n,r){for(const a of e)if(a.issues.length===0)return t.value=a.value,t;const o=e.filter(a=>!ee(a));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(a=>a.issues.map(i=>H(i,r,q())))}),t)}const Xr=u("$ZodUnion",(e,t)=>{Z.init(e,t),k(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),k(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),k(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),k(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(a=>a._zod.pattern);return new RegExp(`^(${o.map(a=>Me(a.source)).join("|")})$`)}});const n=t.options.length===1,r=t.options[0]._zod.run;e._zod.parse=(o,a)=>{if(n)return r(o,a);let i=!1;const s=[];for(const c of t.options){const d=c._zod.run({value:o.value,issues:[]},a);if(d instanceof Promise)s.push(d),i=!0;else{if(d.issues.length===0)return d;s.push(d)}}return i?Promise.all(s).then(c=>Dt(c,o,e,a)):Dt(s,o,e,a)}}),Qr=u("$ZodIntersection",(e,t)=>{Z.init(e,t),e._zod.parse=(n,r)=>{const o=n.value,a=t.left._zod.run({value:o,issues:[]},r),i=t.right._zod.run({value:o,issues:[]},r);return a instanceof Promise||i instanceof Promise?Promise.all([a,i]).then(([c,d])=>Rt(n,c,d)):Rt(n,a,i)}});function Be(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(ce(e)&&ce(t)){const n=Object.keys(t),r=Object.keys(e).filter(a=>n.indexOf(a)!==-1),o={...e,...t};for(const a of r){const i=Be(e[a],t[a]);if(!i.valid)return{valid:!1,mergeErrorPath:[a,...i.mergeErrorPath]};o[a]=i.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const o=e[r],a=t[r],i=Be(o,a);if(!i.valid)return{valid:!1,mergeErrorPath:[r,...i.mergeErrorPath]};n.push(i.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Rt(e,t,n){const r=new Map;let o;for(const s of t.issues)if(s.code==="unrecognized_keys"){o??(o=s);for(const c of s.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(s);for(const s of n.issues)if(s.code==="unrecognized_keys")for(const c of s.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(s);const a=[...r].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(a.length&&o&&e.issues.push({...o,keys:a}),ee(e))return e;const i=Be(t.value,n.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const eo=u("$ZodEnum",(e,t)=>{Z.init(e,t);const n=ht(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(o=>yn.has(typeof o)).map(o=>typeof o=="string"?be(o):o.toString()).join("|")})$`),e._zod.parse=(o,a)=>{const i=o.value;return r.has(i)||o.issues.push({code:"invalid_value",values:n,input:i,inst:e}),o}}),to=u("$ZodTransform",(e,t)=>{Z.init(e,t),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new pt(e.constructor.name);const o=t.transform(n.value,n);if(r.async)return(o instanceof Promise?o:Promise.resolve(o)).then(i=>(n.value=i,n));if(o instanceof Promise)throw new Q;return n.value=o,n}});function Nt(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const xt=u("$ZodOptional",(e,t)=>{Z.init(e,t),e._zod.optin="optional",e._zod.optout="optional",k(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),k(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Me(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>Nt(a,n.value)):Nt(o,n.value)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),no=u("$ZodExactOptional",(e,t)=>{xt.init(e,t),k(e._zod,"values",()=>t.innerType._zod.values),k(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),ro=u("$ZodNullable",(e,t)=>{Z.init(e,t),k(e._zod,"optin",()=>t.innerType._zod.optin),k(e._zod,"optout",()=>t.innerType._zod.optout),k(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${Me(n.source)}|null)$`):void 0}),k(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),oo=u("$ZodDefault",(e,t)=>{Z.init(e,t),e._zod.optin="optional",k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>It(a,t)):It(o,t)}});function It(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const io=u("$ZodPrefault",(e,t)=>{Z.init(e,t),e._zod.optin="optional",k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),ao=u("$ZodNonOptional",(e,t)=>{Z.init(e,t),k(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>At(a,e)):At(o,e)}});function At(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const so=u("$ZodCatch",(e,t)=>{Z.init(e,t),k(e._zod,"optin",()=>t.innerType._zod.optin),k(e._zod,"optout",()=>t.innerType._zod.optout),k(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(a=>(n.value=a.value,a.issues.length&&(n.value=t.catchValue({...n,error:{issues:a.issues.map(i=>H(i,r,q()))},input:n.value}),n.issues=[]),n)):(n.value=o.value,o.issues.length&&(n.value=t.catchValue({...n,error:{issues:o.issues.map(a=>H(a,r,q()))},input:n.value}),n.issues=[]),n)}}),co=u("$ZodPipe",(e,t)=>{Z.init(e,t),k(e._zod,"values",()=>t.in._zod.values),k(e._zod,"optin",()=>t.in._zod.optin),k(e._zod,"optout",()=>t.out._zod.optout),k(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const a=t.out._zod.run(n,r);return a instanceof Promise?a.then(i=>Te(i,t.in,r)):Te(a,t.in,r)}const o=t.in._zod.run(n,r);return o instanceof Promise?o.then(a=>Te(a,t.out,r)):Te(o,t.out,r)}});function Te(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}const uo=u("$ZodReadonly",(e,t)=>{Z.init(e,t),k(e._zod,"propValues",()=>t.innerType._zod.propValues),k(e._zod,"values",()=>t.innerType._zod.values),k(e._zod,"optin",()=>t.innerType?._zod?.optin),k(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const o=t.innerType._zod.run(n,r);return o instanceof Promise?o.then(Ct):Ct(o)}});function Ct(e){return e.value=Object.freeze(e.value),e}const lo=u("$ZodCustom",(e,t)=>{G.init(e,t),Z.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,o=t.fn(r);if(o instanceof Promise)return o.then(a=>Ft(a,n,r,e));Ft(o,n,r,e)}});function Ft(e,t,n,r){if(!e){const o={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(o.params=r._zod.def.params),t.issues.push(ue(o))}}var Ut;class fo{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const o={...r,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function po(){return new fo}(Ut=globalThis).__zod_globalRegistry??(Ut.__zod_globalRegistry=po());const le=globalThis.__zod_globalRegistry;function mo(e,t){return new e({type:"string",...g(t)})}function ho(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...g(t)})}function Lt(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...g(t)})}function go(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...g(t)})}function _o(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...g(t)})}function vo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...g(t)})}function bo(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...g(t)})}function yo(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...g(t)})}function wo(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...g(t)})}function zo(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...g(t)})}function ko(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...g(t)})}function $o(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...g(t)})}function To(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...g(t)})}function jo(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...g(t)})}function Oo(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...g(t)})}function So(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...g(t)})}function Zo(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...g(t)})}function Eo(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...g(t)})}function Po(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...g(t)})}function Do(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...g(t)})}function Ro(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...g(t)})}function No(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...g(t)})}function xo(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...g(t)})}function Io(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...g(t)})}function Ao(e,t){return new e({type:"string",format:"date",check:"string_format",...g(t)})}function Co(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...g(t)})}function Fo(e,t){return new e({type:"string",format:"duration",check:"string_format",...g(t)})}function Uo(e){return new e({type:"unknown"})}function Lo(e,t){return new e({type:"never",...g(t)})}function Jt(e,t){return new lr({check:"max_length",...g(t),maximum:e})}function je(e,t){return new dr({check:"min_length",...g(t),minimum:e})}function Mt(e,t){return new fr({check:"length_equals",...g(t),length:e})}function Jo(e,t){return new pr({check:"string_format",format:"regex",...g(t),pattern:e})}function Mo(e){return new mr({check:"string_format",format:"lowercase",...g(e)})}function Vo(e){return new hr({check:"string_format",format:"uppercase",...g(e)})}function Go(e,t){return new gr({check:"string_format",format:"includes",...g(t),includes:e})}function Wo(e,t){return new _r({check:"string_format",format:"starts_with",...g(t),prefix:e})}function Yo(e,t){return new vr({check:"string_format",format:"ends_with",...g(t),suffix:e})}function te(e){return new br({check:"overwrite",tx:e})}function Bo(e){return te(t=>t.normalize(e))}function qo(){return te(e=>e.trim())}function Ko(){return te(e=>e.toLowerCase())}function Ho(){return te(e=>e.toUpperCase())}function Xo(){return te(e=>vn(e))}function Qo(e,t,n){return new e({type:"array",element:t,...g(n)})}function ei(e,t,n){return new e({type:"custom",check:"custom",fn:t,...g(n)})}function ti(e){const t=ni(n=>(n.addIssue=r=>{if(typeof r=="string")n.issues.push(ue(r,n.value,t._zod.def));else{const o=r;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),n.issues.push(ue(o))}},e(n.value,n)));return t}function ni(e,t){const n=new G({check:"custom",...g(t)});return n._zod.check=e,n}function Vt(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??le,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 I(e,t,n={path:[],schemaPath:[]}){var r;const o=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;const i={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,i);const s=e._zod.toJSONSchema?.();if(s)i.schema=s;else{const f={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const h=i.schema,p=t.processors[o.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);p(e,t,h,f)}const _=e._zod.parent;_&&(i.ref||(i.ref=_),I(_,t,f),t.seen.get(_).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&F(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((r=i.schema).default??(r.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Gt(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const i of e.seen.entries()){const s=e.metadataRegistry.get(i[0])?.id;if(s){const c=r.get(s);if(c&&c!==i[0])throw new Error(`Duplicate schema id "${s}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(s,i[0])}}const o=i=>{const s=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const _=e.external.registry.get(i[0])?.id,h=e.external.uri??(y=>y);if(_)return{ref:h(_)};const p=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=p,{defId:p,ref:`${h("__shared")}#/${s}/${p}`}}if(i[1]===n)return{ref:"#"};const d=`#/${s}/`,f=i[1].schema.id??`__schema${e.counter++}`;return{defId:f,ref:d+f}},a=i=>{if(i[1].schema.$ref)return;const s=i[1],{ref:c,defId:d}=o(i);s.def={...s.schema},d&&(s.defId=d);const f=s.schema;for(const _ in f)delete f[_];f.$ref=c};if(e.cycles==="throw")for(const i of e.seen.entries()){const s=i[1];if(s.cycle)throw new Error(`Cycle detected: #/${s.cycle?.join("/")}/<root>
|
|
44
44
|
|
|
45
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const s=i[1];if(t===i[0]){a(i);continue}if(e.external){const f=e.external.registry.get(i[0])?.id;if(t!==i[0]&&f){a(i);continue}}if(e.metadataRegistry.get(i[0])?.id){a(i);continue}if(s.cycle){a(i);continue}if(s.count>1&&e.reused==="ref"){a(i);continue}}}function Lt(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=i=>{const s=e.seen.get(i);if(s.ref===null)return;const c=s.def??s.schema,f={...c},d=s.ref;if(s.ref=null,d){r(d);const m=e.seen.get(d),p=m.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(p)):Object.assign(c,p),Object.assign(c,f),i._zod.parent===d)for(const y in c)y==="$ref"||y==="allOf"||y in f||delete c[y];if(p.$ref&&m.def)for(const y in c)y==="$ref"||y==="allOf"||y in m.def&&JSON.stringify(c[y])===JSON.stringify(m.def[y])&&delete c[y]}const _=i._zod.parent;if(_&&_!==d){r(_);const m=e.seen.get(_);if(m?.schema.$ref&&(c.$ref=m.schema.$ref,m.def))for(const p in c)p==="$ref"||p==="allOf"||p in m.def&&JSON.stringify(c[p])===JSON.stringify(m.def[p])&&delete c[p]}e.override({zodSchema:i,jsonSchema:c,path:s.path??[]})};for(const i of[...e.seen.entries()].reverse())r(i[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(i)}Object.assign(o,n.def??n.schema);const a=e.external?.defs??{};for(const i of e.seen.entries()){const s=i[1];s.def&&s.defId&&(a[s.defId]=s.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?o.$defs=a:o.definitions=a);try{const i=JSON.parse(JSON.stringify(o));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:ye(t,"input",e.processors),output:ye(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function C(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return C(r.element,n);if(r.type==="set")return C(r.valueType,n);if(r.type==="lazy")return C(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 C(r.innerType,n);if(r.type==="intersection")return C(r.left,n)||C(r.right,n);if(r.type==="record"||r.type==="map")return C(r.keyType,n)||C(r.valueType,n);if(r.type==="pipe")return C(r.in,n)||C(r.out,n);if(r.type==="object"){for(const o in r.shape)if(C(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(C(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(C(o,n))return!0;return!!(r.rest&&C(r.rest,n))}return!1}const Qo=(e,t={})=>n=>{const r=Ft({...n,processors:t});return x(e,r),Ut(r,e),Lt(r,e)},ye=(e,t,n={})=>r=>{const{libraryOptions:o,target:a}=r??{},i=Ft({...o??{},target:a,io:t,processors:n});return x(e,i),Ut(i,e),Lt(i,e)},ei={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ti=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:a,maximum:i,format:s,patterns:c,contentEncoding:f}=e._zod.bag;if(typeof a=="number"&&(o.minLength=a),typeof i=="number"&&(o.maxLength=i),s&&(o.format=ei[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),f&&(o.contentEncoding=f),c&&c.size>0){const d=[...c];d.length===1?o.pattern=d[0].source:d.length>1&&(o.allOf=[...d.map(_=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:_.source}))])}},ni=(e,t,n,r)=>{n.not={}},ri=(e,t,n,r)=>{},oi=(e,t,n,r)=>{const o=e._zod.def,a=lt(o.entries);a.every(i=>typeof i=="number")&&(n.type="number"),a.every(i=>typeof i=="string")&&(n.type="string"),n.enum=a},ii=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ai=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},si=(e,t,n,r)=>{const o=n,a=e._zod.def,{minimum:i,maximum:s}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=x(a.element,t,{...r,path:[...r.path,"items"]})},ci=(e,t,n,r)=>{const o=n,a=e._zod.def;o.type="object",o.properties={};const i=a.shape;for(const f in i)o.properties[f]=x(i[f],t,{...r,path:[...r.path,"properties",f]});const s=new Set(Object.keys(i)),c=new Set([...s].filter(f=>{const d=a.shape[f]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(o.required=Array.from(c)),a.catchall?._zod.def.type==="never"?o.additionalProperties=!1:a.catchall?a.catchall&&(o.additionalProperties=x(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},ui=(e,t,n,r)=>{const o=e._zod.def,a=o.inclusive===!1,i=o.options.map((s,c)=>x(s,t,{...r,path:[...r.path,a?"oneOf":"anyOf",c]}));a?n.oneOf=i:n.anyOf=i},li=(e,t,n,r)=>{const o=e._zod.def,a=x(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=x(o.right,t,{...r,path:[...r.path,"allOf",1]}),s=f=>"allOf"in f&&Object.keys(f).length===1,c=[...s(a)?a.allOf:[a],...s(i)?i.allOf:[i]];n.allOf=c},fi=(e,t,n,r)=>{const o=e._zod.def,a=x(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},di=(e,t,n,r)=>{const o=e._zod.def;x(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType},pi=(e,t,n,r)=>{const o=e._zod.def;x(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},hi=(e,t,n,r)=>{const o=e._zod.def;x(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},mi=(e,t,n,r)=>{const o=e._zod.def;x(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},gi=(e,t,n,r)=>{const o=e._zod.def,a=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;x(a,t,r);const i=t.seen.get(e);i.ref=a},_i=(e,t,n,r)=>{const o=e._zod.def;x(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType,n.readOnly=!0},Jt=(e,t,n,r)=>{const o=e._zod.def;x(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType},vi=u("ZodISODateTime",(e,t)=>{Zr.init(e,t),j.init(e,t)});function yi(e){return Ro(vi,e)}const bi=u("ZodISODate",(e,t)=>{Er.init(e,t),j.init(e,t)});function wi(e){return No(bi,e)}const zi=u("ZodISOTime",(e,t)=>{Pr.init(e,t),j.init(e,t)});function ki(e){return Do(zi,e)}const $i=u("ZodISODuration",(e,t)=>{Rr.init(e,t),j.init(e,t)});function Ti(e){return xo($i,e)}const L=u("ZodError",(e,t)=>{_t.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>jn(e,n)},flatten:{value:n=>Tn(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ne,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ne,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),ji=Ce(L),Oi=Fe(L),Si=pe(L),Zi=he(L),Ei=Zn(L),Pi=En(L),Ri=Pn(L),Ni=Rn(L),Di=Nn(L),xi=Dn(L),Ii=xn(L),Ai=In(L),E=u("ZodType",(e,t)=>(Z.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ye(e,"input"),output:ye(e,"output")}}),e.toJSONSchema=Qo(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(V(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>W(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>ji(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Si(e,n,r),e.parseAsync=async(n,r)=>Oi(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Zi(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Ei(e,n,r),e.decode=(n,r)=>Pi(e,n,r),e.encodeAsync=async(n,r)=>Ri(e,n,r),e.decodeAsync=async(n,r)=>Ni(e,n,r),e.safeEncode=(n,r)=>Di(e,n,r),e.safeDecode=(n,r)=>xi(e,n,r),e.safeEncodeAsync=async(n,r)=>Ii(e,n,r),e.safeDecodeAsync=async(n,r)=>Ai(e,n,r),e.refine=(n,r)=>e.check(Za(n,r)),e.superRefine=n=>e.check(Ea(n)),e.overwrite=n=>e.check(ee(n)),e.optional=()=>qt(e),e.exactOptional=()=>ga(e),e.nullable=()=>Bt(e),e.nullish=()=>qt(Bt(e)),e.nonoptional=n=>za(e,n),e.array=()=>aa(e),e.or=n=>ua([e,n]),e.and=n=>fa(e,n),e.transform=n=>Ht(e,ha(n)),e.default=n=>ya(e,n),e.prefault=n=>wa(e,n),e.catch=n=>$a(e,n),e.pipe=n=>Ht(e,n),e.readonly=()=>Oa(e),e.describe=n=>{const r=e.clone();return ae.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return ae.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return ae.get(e);const r=e.clone();return ae.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Mt=u("_ZodString",(e,t)=>{Ue.init(e,t),E.init(e,t),e._zod.processJSONSchema=(r,o,a)=>ti(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Co(...r)),e.includes=(...r)=>e.check(Lo(...r)),e.startsWith=(...r)=>e.check(Jo(...r)),e.endsWith=(...r)=>e.check(Mo(...r)),e.min=(...r)=>e.check(ve(...r)),e.max=(...r)=>e.check(At(...r)),e.length=(...r)=>e.check(Ct(...r)),e.nonempty=(...r)=>e.check(ve(1,...r)),e.lowercase=r=>e.check(Fo(r)),e.uppercase=r=>e.check(Uo(r)),e.trim=()=>e.check(Vo()),e.normalize=(...r)=>e.check(Go(...r)),e.toLowerCase=()=>e.check(Wo()),e.toUpperCase=()=>e.check(Yo()),e.slugify=()=>e.check(qo())}),Ci=u("ZodString",(e,t)=>{Ue.init(e,t),Mt.init(e,t),e.email=n=>e.check(lo(Fi,n)),e.url=n=>e.check(go(Ui,n)),e.jwt=n=>e.check(Po(ta,n)),e.emoji=n=>e.check(_o(Li,n)),e.guid=n=>e.check(It(Gt,n)),e.uuid=n=>e.check(fo(be,n)),e.uuidv4=n=>e.check(po(be,n)),e.uuidv6=n=>e.check(ho(be,n)),e.uuidv7=n=>e.check(mo(be,n)),e.nanoid=n=>e.check(vo(Ji,n)),e.guid=n=>e.check(It(Gt,n)),e.cuid=n=>e.check(yo(Mi,n)),e.cuid2=n=>e.check(bo(Gi,n)),e.ulid=n=>e.check(wo(Vi,n)),e.base64=n=>e.check(So(Xi,n)),e.base64url=n=>e.check(Zo(Qi,n)),e.xid=n=>e.check(zo(Wi,n)),e.ksuid=n=>e.check(ko(Yi,n)),e.ipv4=n=>e.check($o(qi,n)),e.ipv6=n=>e.check(To(Bi,n)),e.cidrv4=n=>e.check(jo(Ki,n)),e.cidrv6=n=>e.check(Oo(Hi,n)),e.e164=n=>e.check(Eo(ea,n)),e.datetime=n=>e.check(yi(n)),e.date=n=>e.check(wi(n)),e.time=n=>e.check(ki(n)),e.duration=n=>e.check(Ti(n))});function Y(e){return uo(Ci,e)}const j=u("ZodStringFormat",(e,t)=>{$.init(e,t),Mt.init(e,t)}),Fi=u("ZodEmail",(e,t)=>{br.init(e,t),j.init(e,t)}),Gt=u("ZodGUID",(e,t)=>{vr.init(e,t),j.init(e,t)}),be=u("ZodUUID",(e,t)=>{yr.init(e,t),j.init(e,t)}),Ui=u("ZodURL",(e,t)=>{wr.init(e,t),j.init(e,t)}),Li=u("ZodEmoji",(e,t)=>{zr.init(e,t),j.init(e,t)}),Ji=u("ZodNanoID",(e,t)=>{kr.init(e,t),j.init(e,t)}),Mi=u("ZodCUID",(e,t)=>{$r.init(e,t),j.init(e,t)}),Gi=u("ZodCUID2",(e,t)=>{Tr.init(e,t),j.init(e,t)}),Vi=u("ZodULID",(e,t)=>{jr.init(e,t),j.init(e,t)}),Wi=u("ZodXID",(e,t)=>{Or.init(e,t),j.init(e,t)}),Yi=u("ZodKSUID",(e,t)=>{Sr.init(e,t),j.init(e,t)}),qi=u("ZodIPv4",(e,t)=>{Nr.init(e,t),j.init(e,t)}),Bi=u("ZodIPv6",(e,t)=>{Dr.init(e,t),j.init(e,t)}),Ki=u("ZodCIDRv4",(e,t)=>{xr.init(e,t),j.init(e,t)}),Hi=u("ZodCIDRv6",(e,t)=>{Ir.init(e,t),j.init(e,t)}),Xi=u("ZodBase64",(e,t)=>{Ar.init(e,t),j.init(e,t)}),Qi=u("ZodBase64URL",(e,t)=>{Fr.init(e,t),j.init(e,t)}),ea=u("ZodE164",(e,t)=>{Ur.init(e,t),j.init(e,t)}),ta=u("ZodJWT",(e,t)=>{Jr.init(e,t),j.init(e,t)}),na=u("ZodUnknown",(e,t)=>{Mr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ri()});function Vt(){return Io(na)}const ra=u("ZodNever",(e,t)=>{Gr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ni(e,n,r)});function oa(e){return Ao(ra,e)}const ia=u("ZodArray",(e,t)=>{Vr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>si(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(ve(n,r)),e.nonempty=n=>e.check(ve(1,n)),e.max=(n,r)=>e.check(At(n,r)),e.length=(n,r)=>e.check(Ct(n,r)),e.unwrap=()=>e.element});function aa(e,t){return Bo(ia,e,t)}const sa=u("ZodObject",(e,t)=>{Yr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ci(e,n,r,o),k(e,"shape",()=>t.shape),e.keyof=()=>da(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Vt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Vt()}),e.strict=()=>e.clone({...e._zod.def,catchall:oa()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>bn(e,n),e.safeExtend=n=>wn(e,n),e.merge=n=>zn(e,n),e.pick=n=>vn(e,n),e.omit=n=>yn(e,n),e.partial=(...n)=>kn(Yt,e,n[0]),e.required=(...n)=>$n(Kt,e,n[0])});function Wt(e,t){const n={type:"object",shape:e??{},...g(t)};return new sa(n)}const ca=u("ZodUnion",(e,t)=>{qr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ui(e,n,r,o),e.options=t.options});function ua(e,t){return new ca({type:"union",options:e,...g(t)})}const la=u("ZodIntersection",(e,t)=>{Br.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>li(e,n,r,o)});function fa(e,t){return new la({type:"intersection",left:e,right:t})}const Je=u("ZodEnum",(e,t)=>{Kr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(r,o,a)=>oi(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const a={};for(const i of r)if(n.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new Je({...t,checks:[],...g(o),entries:a})},e.exclude=(r,o)=>{const a={...t.entries};for(const i of r)if(n.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new Je({...t,checks:[],...g(o),entries:a})}});function da(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new Je({type:"enum",entries:n,...g(t)})}const pa=u("ZodTransform",(e,t)=>{Hr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ai(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ct(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(ie(a,n.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(ie(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(a=>(n.value=a,n)):(n.value=o,n)}});function ha(e){return new pa({type:"transform",transform:e})}const Yt=u("ZodOptional",(e,t)=>{Et.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Jt(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function qt(e){return new Yt({type:"optional",innerType:e})}const ma=u("ZodExactOptional",(e,t)=>{Xr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Jt(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ga(e){return new ma({type:"optional",innerType:e})}const _a=u("ZodNullable",(e,t)=>{Qr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Bt(e){return new _a({type:"nullable",innerType:e})}const va=u("ZodDefault",(e,t)=>{eo.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ya(e,t){return new va({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():ht(t)}})}const ba=u("ZodPrefault",(e,t)=>{to.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function wa(e,t){return new ba({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():ht(t)}})}const Kt=u("ZodNonOptional",(e,t)=>{no.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>di(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function za(e,t){return new Kt({type:"nonoptional",innerType:e,...g(t)})}const ka=u("ZodCatch",(e,t)=>{ro.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function $a(e,t){return new ka({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Ta=u("ZodPipe",(e,t)=>{oo.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gi(e,n,r,o),e.in=t.in,e.out=t.out});function Ht(e,t){return new Ta({type:"pipe",in:e,out:t})}const ja=u("ZodReadonly",(e,t)=>{io.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_i(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Oa(e){return new ja({type:"readonly",innerType:e})}const Sa=u("ZodCustom",(e,t)=>{ao.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ii(e,n)});function Za(e,t={}){return Ko(Sa,e,t)}function Ea(e){return Ho(e)}const Pa=Wt({title:Y().optional(),date:Y().optional(),description:Y().optional(),variant:Y().optional()}),Ra=Wt({mapping:Pa.optional(),objectName:Y().optional(),titleField:Y().optional(),dateField:Y().optional(),descriptionField:Y().optional()}),Xt=({schema:e,dataSource:t,className:n,onRowClick:r,onItemClick:o,...a})=>{const[i,s]=U.useState([]),[c,f]=U.useState(!1),[d,_]=U.useState(null),[m,p]=U.useState(0);U.useEffect(()=>{const A=Ra.safeParse(e);A.success||console.warn("[ObjectTimeline] Invalid timeline configuration:",A.error.format())},[e]);const b=Pe.useDataScope(e.bind);U.useEffect(()=>{const A=async()=>{if(!(!t||!e.objectName)){f(!0);try{const S=await t.find(e.objectName,{options:{$top:100}});let J=S;S.records?J=S.records:S.data&&(J=S.data),Array.isArray(J)&&s(J)}catch(S){console.error(S),_(S)}finally{f(!1)}}};e.objectName&&!b&&!e.items&&!a.data&&A()},[e.objectName,t,b,e.items,a.data,m]);const y=a.data||b||i;let z=e.items;if(!z&&y&&Array.isArray(y)){const A=e.mapping?.title||e.titleField||"name",S=e.mapping?.date||e.dateField||"date",J=e.mapping?.description||e.descriptionField||"description",et=e.mapping?.variant||"variant";z=y.map(G=>({title:G[A],time:G[S],startDate:G[S],endDate:G[S],description:G[J],variant:G[et]||"default",_data:G}))}const q=U.useCallback(async()=>{p(A=>A+1)},[]),{ref:se,isRefreshing:F,pullDistance:P}=an.usePullToRefresh({onRefresh:q,enabled:!!e.objectName&&!!t}),I=Pe.useNavigationOverlay({navigation:e.navigation,objectName:e.objectName,onRowClick:r??o}),Se={...e,items:z||[],className:n||e.className,onItemClick:A=>{const S=A._data||A;I.handleClick(S),o?.(S)}};return d?h.jsxs("div",{className:"p-4 text-red-500",children:["Error loading timeline: ",d.message]}):h.jsxs("div",{ref:se,className:"relative overflow-auto h-full",children:[P>0&&h.jsx("div",{className:"flex items-center justify-center text-xs text-muted-foreground",style:{height:P},children:F?"Refreshing…":"Pull to refresh"}),h.jsx(Re,{schema:Se}),I.isOverlay&&h.jsx(T.NavigationOverlay,{...I,title:"Timeline Item",children:A=>h.jsx("div",{className:"space-y-3",children:Object.entries(A).map(([S,J])=>h.jsxs("div",{className:"flex flex-col",children:[h.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:S.replace(/_/g," ")}),h.jsx("span",{className:"text-sm",children:String(J??"—")})]},S))})})]})},Me=D.forwardRef(({className:e,...t},n)=>h.jsx("ol",{ref:n,className:T.cn("relative border-l border-gray-200",e),...t}));Me.displayName="Timeline";const Ge=D.forwardRef(({className:e,...t},n)=>h.jsx("li",{ref:n,className:T.cn("mb-10 ml-6",e),...t}));Ge.displayName="TimelineItem";const we=D.forwardRef(({className:e,variant:t="default",...n},r)=>{const o={default:"bg-gray-200 border-gray-300",success:"bg-green-200 border-green-500",warning:"bg-yellow-200 border-yellow-500",danger:"bg-red-200 border-red-500",info:"bg-blue-200 border-blue-500"};return h.jsx("div",{ref:r,className:T.cn("absolute -left-3 w-6 h-6 rounded-full border-2 flex items-center justify-center",o[t],e),...n})});we.displayName="TimelineMarker";const Ve=D.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:e,...t}));Ve.displayName="TimelineContent";const ze=D.forwardRef(({className:e,...t},n)=>h.jsx("h3",{ref:n,className:T.cn("font-semibold text-lg mb-1",e),...t}));ze.displayName="TimelineTitle";const ke=D.forwardRef(({className:e,...t},n)=>h.jsx("time",{ref:n,className:T.cn("text-sm font-normal text-gray-500 mb-2 block",e),...t}));ke.displayName="TimelineTime";const $e=D.forwardRef(({className:e,...t},n)=>h.jsx("p",{ref:n,className:T.cn("text-base text-gray-700",e),...t}));$e.displayName="TimelineDescription";const We=D.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:T.cn("relative flex overflow-x-auto py-8",e),...t}));We.displayName="TimelineHorizontal";const Ye=D.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:T.cn("flex-shrink-0 w-64 relative",e),...t}));Ye.displayName="TimelineHorizontalItem";const qe=D.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:T.cn("relative w-full border rounded-lg overflow-hidden",e),...t}));qe.displayName="TimelineGantt";const Be=D.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:T.cn("flex border-b bg-gray-50",e),...t}));Be.displayName="TimelineGanttHeader";const Te=D.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:T.cn("w-48 border-r bg-white",e),...t}));Te.displayName="TimelineGanttRowLabels";const je=D.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:T.cn("flex-1 overflow-x-auto",e),...t}));je.displayName="TimelineGanttGrid";const Oe=D.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:T.cn("flex items-center border-b min-h-12",e),...t}));Oe.displayName="TimelineGanttRow";const Ke=D.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:T.cn("px-4 py-2 font-medium text-sm truncate",e),...t}));Ke.displayName="TimelineGanttLabel";const He=D.forwardRef(({className:e,start:t=0,width:n=100,variant:r="default",...o},a)=>{const i={default:"bg-blue-500 hover:bg-blue-600",success:"bg-green-500 hover:bg-green-600",warning:"bg-yellow-500 hover:bg-yellow-600",danger:"bg-red-500 hover:bg-red-600",info:"bg-purple-500 hover:bg-purple-600"};return h.jsx("div",{ref:a,className:T.cn("absolute h-8 rounded-md transition-colors cursor-pointer",i[r],e),style:{left:`${t}%`,width:`${n}%`},...o})});He.displayName="TimelineGanttBar";const Xe=D.forwardRef(({className:e,...t},n)=>h.jsx("div",{ref:n,className:T.cn("px-2 py-1 text-white text-xs font-medium truncate",e),...t}));Xe.displayName="TimelineGanttBarContent";const Qe=({schema:e,...t})=>{const{dataSource:n}=Pe.useSchemaContext();return h.jsx(Xt,{schema:e,dataSource:n,...t})};Ee.ComponentRegistry.register("object-timeline",Qe,{namespace:"plugin-timeline",label:"Object Timeline",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"variant",type:"enum",enum:["vertical","horizontal","gantt"],defaultValue:"vertical"}]}),Ee.ComponentRegistry.register("timeline",Qe,{namespace:"view",label:"Timeline View",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"variant",type:"enum",enum:["vertical","horizontal","gantt"],defaultValue:"vertical"}]}),w.ObjectTimeline=Xt,w.ObjectTimelineRenderer=Qe,w.Timeline=Me,w.TimelineContent=Ve,w.TimelineDescription=$e,w.TimelineGantt=qe,w.TimelineGanttBar=He,w.TimelineGanttBarContent=Xe,w.TimelineGanttGrid=je,w.TimelineGanttHeader=Be,w.TimelineGanttLabel=Ke,w.TimelineGanttRow=Oe,w.TimelineGanttRowLabels=Te,w.TimelineHorizontal=We,w.TimelineHorizontalItem=Ye,w.TimelineItem=Ge,w.TimelineMarker=we,w.TimelineRenderer=Re,w.TimelineTime=ke,w.TimelineTitle=ze,Object.defineProperty(w,Symbol.toStringTag,{value:"Module"})}));
|
|
45
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const i of e.seen.entries()){const s=i[1];if(t===i[0]){a(i);continue}if(e.external){const d=e.external.registry.get(i[0])?.id;if(t!==i[0]&&d){a(i);continue}}if(e.metadataRegistry.get(i[0])?.id){a(i);continue}if(s.cycle){a(i);continue}if(s.count>1&&e.reused==="ref"){a(i);continue}}}function Wt(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=i=>{const s=e.seen.get(i);if(s.ref===null)return;const c=s.def??s.schema,d={...c},f=s.ref;if(s.ref=null,f){r(f);const h=e.seen.get(f),p=h.schema;if(p.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(c.allOf=c.allOf??[],c.allOf.push(p)):Object.assign(c,p),Object.assign(c,d),i._zod.parent===f)for(const b in c)b==="$ref"||b==="allOf"||b in d||delete c[b];if(p.$ref&&h.def)for(const b in c)b==="$ref"||b==="allOf"||b in h.def&&JSON.stringify(c[b])===JSON.stringify(h.def[b])&&delete c[b]}const _=i._zod.parent;if(_&&_!==f){r(_);const h=e.seen.get(_);if(h?.schema.$ref&&(c.$ref=h.schema.$ref,h.def))for(const p in c)p==="$ref"||p==="allOf"||p in h.def&&JSON.stringify(c[p])===JSON.stringify(h.def[p])&&delete c[p]}e.override({zodSchema:i,jsonSchema:c,path:s.path??[]})};for(const i of[...e.seen.entries()].reverse())r(i[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const i=e.external.registry.get(t)?.id;if(!i)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(i)}Object.assign(o,n.def??n.schema);const a=e.external?.defs??{};for(const i of e.seen.entries()){const s=i[1];s.def&&s.defId&&(a[s.defId]=s.def)}e.external||Object.keys(a).length>0&&(e.target==="draft-2020-12"?o.$defs=a:o.definitions=a);try{const i=JSON.parse(JSON.stringify(o));return Object.defineProperty(i,"~standard",{value:{...t["~standard"],jsonSchema:{input:Oe(t,"input",e.processors),output:Oe(t,"output",e.processors)}},enumerable:!1,writable:!1}),i}catch{throw new Error("Error converting schema to JSON.")}}function F(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return F(r.element,n);if(r.type==="set")return F(r.valueType,n);if(r.type==="lazy")return F(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 F(r.innerType,n);if(r.type==="intersection")return F(r.left,n)||F(r.right,n);if(r.type==="record"||r.type==="map")return F(r.keyType,n)||F(r.valueType,n);if(r.type==="pipe")return F(r.in,n)||F(r.out,n);if(r.type==="object"){for(const o in r.shape)if(F(r.shape[o],n))return!0;return!1}if(r.type==="union"){for(const o of r.options)if(F(o,n))return!0;return!1}if(r.type==="tuple"){for(const o of r.items)if(F(o,n))return!0;return!!(r.rest&&F(r.rest,n))}return!1}const ri=(e,t={})=>n=>{const r=Vt({...n,processors:t});return I(e,r),Gt(r,e),Wt(r,e)},Oe=(e,t,n={})=>r=>{const{libraryOptions:o,target:a}=r??{},i=Vt({...o??{},target:a,io:t,processors:n});return I(e,i),Gt(i,e),Wt(i,e)},oi={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ii=(e,t,n,r)=>{const o=n;o.type="string";const{minimum:a,maximum:i,format:s,patterns:c,contentEncoding:d}=e._zod.bag;if(typeof a=="number"&&(o.minLength=a),typeof i=="number"&&(o.maxLength=i),s&&(o.format=oi[s]??s,o.format===""&&delete o.format,s==="time"&&delete o.format),d&&(o.contentEncoding=d),c&&c.size>0){const f=[...c];f.length===1?o.pattern=f[0].source:f.length>1&&(o.allOf=[...f.map(_=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:_.source}))])}},ai=(e,t,n,r)=>{n.not={}},si=(e,t,n,r)=>{},ci=(e,t,n,r)=>{const o=e._zod.def,a=ht(o.entries);a.every(i=>typeof i=="number")&&(n.type="number"),a.every(i=>typeof i=="string")&&(n.type="string"),n.enum=a},ui=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},li=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},di=(e,t,n,r)=>{const o=n,a=e._zod.def,{minimum:i,maximum:s}=e._zod.bag;typeof i=="number"&&(o.minItems=i),typeof s=="number"&&(o.maxItems=s),o.type="array",o.items=I(a.element,t,{...r,path:[...r.path,"items"]})},fi=(e,t,n,r)=>{const o=n,a=e._zod.def;o.type="object",o.properties={};const i=a.shape;for(const d in i)o.properties[d]=I(i[d],t,{...r,path:[...r.path,"properties",d]});const s=new Set(Object.keys(i)),c=new Set([...s].filter(d=>{const f=a.shape[d]._zod;return t.io==="input"?f.optin===void 0:f.optout===void 0}));c.size>0&&(o.required=Array.from(c)),a.catchall?._zod.def.type==="never"?o.additionalProperties=!1:a.catchall?a.catchall&&(o.additionalProperties=I(a.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},pi=(e,t,n,r)=>{const o=e._zod.def,a=o.inclusive===!1,i=o.options.map((s,c)=>I(s,t,{...r,path:[...r.path,a?"oneOf":"anyOf",c]}));a?n.oneOf=i:n.anyOf=i},mi=(e,t,n,r)=>{const o=e._zod.def,a=I(o.left,t,{...r,path:[...r.path,"allOf",0]}),i=I(o.right,t,{...r,path:[...r.path,"allOf",1]}),s=d=>"allOf"in d&&Object.keys(d).length===1,c=[...s(a)?a.allOf:[a],...s(i)?i.allOf:[i]];n.allOf=c},hi=(e,t,n,r)=>{const o=e._zod.def,a=I(o.innerType,t,r),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=o.innerType,n.nullable=!0):n.anyOf=[a,{type:"null"}]},gi=(e,t,n,r)=>{const o=e._zod.def;I(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType},_i=(e,t,n,r)=>{const o=e._zod.def;I(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType,n.default=JSON.parse(JSON.stringify(o.defaultValue))},vi=(e,t,n,r)=>{const o=e._zod.def;I(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},bi=(e,t,n,r)=>{const o=e._zod.def;I(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType;let i;try{i=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=i},yi=(e,t,n,r)=>{const o=e._zod.def,a=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;I(a,t,r);const i=t.seen.get(e);i.ref=a},wi=(e,t,n,r)=>{const o=e._zod.def;I(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType,n.readOnly=!0},Yt=(e,t,n,r)=>{const o=e._zod.def;I(o.innerType,t,r);const a=t.seen.get(e);a.ref=o.innerType},zi=u("ZodISODateTime",(e,t)=>{Rr.init(e,t),j.init(e,t)});function ki(e){return Io(zi,e)}const $i=u("ZodISODate",(e,t)=>{Nr.init(e,t),j.init(e,t)});function Ti(e){return Ao($i,e)}const ji=u("ZodISOTime",(e,t)=>{xr.init(e,t),j.init(e,t)});function Oi(e){return Co(ji,e)}const Si=u("ZodISODuration",(e,t)=>{Ir.init(e,t),j.init(e,t)});function Zi(e){return Fo(Si,e)}const L=u("ZodError",(e,t)=>{zt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>En(e,n)},flatten:{value:n=>Zn(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,Ue,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,Ue,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Ei=Ge(L),Pi=We(L),Di=we(L),Ri=ze(L),Ni=Rn(L),xi=Nn(L),Ii=xn(L),Ai=In(L),Ci=An(L),Fi=Cn(L),Ui=Fn(L),Li=Un(L),E=u("ZodType",(e,t)=>(Z.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Oe(e,"input"),output:Oe(e,"output")}}),e.toJSONSchema=ri(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone(Y(t,{checks:[...t.checks??[],...n.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),e.with=e.check,e.clone=(n,r)=>B(e,n,r),e.brand=()=>e,e.register=((n,r)=>(n.add(e,r),e)),e.parse=(n,r)=>Ei(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>Di(e,n,r),e.parseAsync=async(n,r)=>Pi(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>Ri(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>Ni(e,n,r),e.decode=(n,r)=>xi(e,n,r),e.encodeAsync=async(n,r)=>Ii(e,n,r),e.decodeAsync=async(n,r)=>Ai(e,n,r),e.safeEncode=(n,r)=>Ci(e,n,r),e.safeDecode=(n,r)=>Fi(e,n,r),e.safeEncodeAsync=async(n,r)=>Ui(e,n,r),e.safeDecodeAsync=async(n,r)=>Li(e,n,r),e.refine=(n,r)=>e.check(Da(n,r)),e.superRefine=n=>e.check(Ra(n)),e.overwrite=n=>e.check(te(n)),e.optional=()=>en(e),e.exactOptional=()=>ba(e),e.nullable=()=>tn(e),e.nullish=()=>en(tn(e)),e.nonoptional=n=>Ta(e,n),e.array=()=>la(e),e.or=n=>pa([e,n]),e.and=n=>ha(e,n),e.transform=n=>rn(e,_a(n)),e.default=n=>za(e,n),e.prefault=n=>$a(e,n),e.catch=n=>Oa(e,n),e.pipe=n=>rn(e,n),e.readonly=()=>Ea(e),e.describe=n=>{const r=e.clone();return le.add(r,{description:n}),r},Object.defineProperty(e,"description",{get(){return le.get(e)?.description},configurable:!0}),e.meta=(...n)=>{if(n.length===0)return le.get(e);const r=e.clone();return le.add(r,n[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=n=>n(e),e)),Bt=u("_ZodString",(e,t)=>{Ye.init(e,t),E.init(e,t),e._zod.processJSONSchema=(r,o,a)=>ii(e,r,o);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,e.regex=(...r)=>e.check(Jo(...r)),e.includes=(...r)=>e.check(Go(...r)),e.startsWith=(...r)=>e.check(Wo(...r)),e.endsWith=(...r)=>e.check(Yo(...r)),e.min=(...r)=>e.check(je(...r)),e.max=(...r)=>e.check(Jt(...r)),e.length=(...r)=>e.check(Mt(...r)),e.nonempty=(...r)=>e.check(je(1,...r)),e.lowercase=r=>e.check(Mo(r)),e.uppercase=r=>e.check(Vo(r)),e.trim=()=>e.check(qo()),e.normalize=(...r)=>e.check(Bo(...r)),e.toLowerCase=()=>e.check(Ko()),e.toUpperCase=()=>e.check(Ho()),e.slugify=()=>e.check(Xo())}),Ji=u("ZodString",(e,t)=>{Ye.init(e,t),Bt.init(e,t),e.email=n=>e.check(ho(Mi,n)),e.url=n=>e.check(yo(Vi,n)),e.jwt=n=>e.check(xo(ia,n)),e.emoji=n=>e.check(wo(Gi,n)),e.guid=n=>e.check(Lt(qt,n)),e.uuid=n=>e.check(go(Se,n)),e.uuidv4=n=>e.check(_o(Se,n)),e.uuidv6=n=>e.check(vo(Se,n)),e.uuidv7=n=>e.check(bo(Se,n)),e.nanoid=n=>e.check(zo(Wi,n)),e.guid=n=>e.check(Lt(qt,n)),e.cuid=n=>e.check(ko(Yi,n)),e.cuid2=n=>e.check($o(Bi,n)),e.ulid=n=>e.check(To(qi,n)),e.base64=n=>e.check(Do(na,n)),e.base64url=n=>e.check(Ro(ra,n)),e.xid=n=>e.check(jo(Ki,n)),e.ksuid=n=>e.check(Oo(Hi,n)),e.ipv4=n=>e.check(So(Xi,n)),e.ipv6=n=>e.check(Zo(Qi,n)),e.cidrv4=n=>e.check(Eo(ea,n)),e.cidrv6=n=>e.check(Po(ta,n)),e.e164=n=>e.check(No(oa,n)),e.datetime=n=>e.check(ki(n)),e.date=n=>e.check(Ti(n)),e.time=n=>e.check(Oi(n)),e.duration=n=>e.check(Zi(n))});function J(e){return mo(Ji,e)}const j=u("ZodStringFormat",(e,t)=>{T.init(e,t),Bt.init(e,t)}),Mi=u("ZodEmail",(e,t)=>{$r.init(e,t),j.init(e,t)}),qt=u("ZodGUID",(e,t)=>{zr.init(e,t),j.init(e,t)}),Se=u("ZodUUID",(e,t)=>{kr.init(e,t),j.init(e,t)}),Vi=u("ZodURL",(e,t)=>{Tr.init(e,t),j.init(e,t)}),Gi=u("ZodEmoji",(e,t)=>{jr.init(e,t),j.init(e,t)}),Wi=u("ZodNanoID",(e,t)=>{Or.init(e,t),j.init(e,t)}),Yi=u("ZodCUID",(e,t)=>{Sr.init(e,t),j.init(e,t)}),Bi=u("ZodCUID2",(e,t)=>{Zr.init(e,t),j.init(e,t)}),qi=u("ZodULID",(e,t)=>{Er.init(e,t),j.init(e,t)}),Ki=u("ZodXID",(e,t)=>{Pr.init(e,t),j.init(e,t)}),Hi=u("ZodKSUID",(e,t)=>{Dr.init(e,t),j.init(e,t)}),Xi=u("ZodIPv4",(e,t)=>{Ar.init(e,t),j.init(e,t)}),Qi=u("ZodIPv6",(e,t)=>{Cr.init(e,t),j.init(e,t)}),ea=u("ZodCIDRv4",(e,t)=>{Fr.init(e,t),j.init(e,t)}),ta=u("ZodCIDRv6",(e,t)=>{Ur.init(e,t),j.init(e,t)}),na=u("ZodBase64",(e,t)=>{Lr.init(e,t),j.init(e,t)}),ra=u("ZodBase64URL",(e,t)=>{Mr.init(e,t),j.init(e,t)}),oa=u("ZodE164",(e,t)=>{Vr.init(e,t),j.init(e,t)}),ia=u("ZodJWT",(e,t)=>{Wr.init(e,t),j.init(e,t)}),aa=u("ZodUnknown",(e,t)=>{Yr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>si()});function Kt(){return Uo(aa)}const sa=u("ZodNever",(e,t)=>{Br.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ai(e,n,r)});function ca(e){return Lo(sa,e)}const ua=u("ZodArray",(e,t)=>{qr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>di(e,n,r,o),e.element=t.element,e.min=(n,r)=>e.check(je(n,r)),e.nonempty=n=>e.check(je(1,n)),e.max=(n,r)=>e.check(Jt(n,r)),e.length=(n,r)=>e.check(Mt(n,r)),e.unwrap=()=>e.element});function la(e,t){return Qo(ua,e,t)}const da=u("ZodObject",(e,t)=>{Hr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>fi(e,n,r,o),k(e,"shape",()=>t.shape),e.keyof=()=>Xt(Object.keys(e._zod.def.shape)),e.catchall=n=>e.clone({...e._zod.def,catchall:n}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Kt()}),e.loose=()=>e.clone({...e._zod.def,catchall:Kt()}),e.strict=()=>e.clone({...e._zod.def,catchall:ca()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=n=>$n(e,n),e.safeExtend=n=>Tn(e,n),e.merge=n=>jn(e,n),e.pick=n=>zn(e,n),e.omit=n=>kn(e,n),e.partial=(...n)=>On(Qt,e,n[0]),e.required=(...n)=>Sn(nn,e,n[0])});function Ht(e,t){const n={type:"object",shape:e??{},...g(t)};return new da(n)}const fa=u("ZodUnion",(e,t)=>{Xr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>pi(e,n,r,o),e.options=t.options});function pa(e,t){return new fa({type:"union",options:e,...g(t)})}const ma=u("ZodIntersection",(e,t)=>{Qr.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>mi(e,n,r,o)});function ha(e,t){return new ma({type:"intersection",left:e,right:t})}const qe=u("ZodEnum",(e,t)=>{eo.init(e,t),E.init(e,t),e._zod.processJSONSchema=(r,o,a)=>ci(e,r,o),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,o)=>{const a={};for(const i of r)if(n.has(i))a[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new qe({...t,checks:[],...g(o),entries:a})},e.exclude=(r,o)=>{const a={...t.entries};for(const i of r)if(n.has(i))delete a[i];else throw new Error(`Key ${i} not found in enum`);return new qe({...t,checks:[],...g(o),entries:a})}});function Xt(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new qe({type:"enum",entries:n,...g(t)})}const ga=u("ZodTransform",(e,t)=>{to.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>li(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new pt(e.constructor.name);n.addIssue=a=>{if(typeof a=="string")n.issues.push(ue(a,n.value,t));else{const i=a;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=n.value),i.inst??(i.inst=e),n.issues.push(ue(i))}};const o=t.transform(n.value,n);return o instanceof Promise?o.then(a=>(n.value=a,n)):(n.value=o,n)}});function _a(e){return new ga({type:"transform",transform:e})}const Qt=u("ZodOptional",(e,t)=>{xt.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Yt(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function en(e){return new Qt({type:"optional",innerType:e})}const va=u("ZodExactOptional",(e,t)=>{no.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>Yt(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function ba(e){return new va({type:"optional",innerType:e})}const ya=u("ZodNullable",(e,t)=>{ro.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>hi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function tn(e){return new ya({type:"nullable",innerType:e})}const wa=u("ZodDefault",(e,t)=>{oo.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>_i(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function za(e,t){return new wa({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():bt(t)}})}const ka=u("ZodPrefault",(e,t)=>{io.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>vi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function $a(e,t){return new ka({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():bt(t)}})}const nn=u("ZodNonOptional",(e,t)=>{ao.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>gi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ta(e,t){return new nn({type:"nonoptional",innerType:e,...g(t)})}const ja=u("ZodCatch",(e,t)=>{so.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>bi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Oa(e,t){return new ja({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const Sa=u("ZodPipe",(e,t)=>{co.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>yi(e,n,r,o),e.in=t.in,e.out=t.out});function rn(e,t){return new Sa({type:"pipe",in:e,out:t})}const Za=u("ZodReadonly",(e,t)=>{uo.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>wi(e,n,r,o),e.unwrap=()=>e._zod.def.innerType});function Ea(e){return new Za({type:"readonly",innerType:e})}const Pa=u("ZodCustom",(e,t)=>{lo.init(e,t),E.init(e,t),e._zod.processJSONSchema=(n,r,o)=>ui(e,n)});function Da(e,t={}){return ei(Pa,e,t)}function Ra(e){return ti(e)}const Na=Ht({title:J().optional(),date:J().optional(),description:J().optional(),variant:J().optional()}),xa=Ht({mapping:Na.optional(),objectName:J().optional(),titleField:J().optional(),dateField:J().optional(),startDateField:J().optional(),endDateField:J().optional(),descriptionField:J().optional(),groupByField:J().optional(),colorField:J().optional(),scale:Xt(["hour","day","week","month","quarter","year"]).optional()}),on=({schema:e,dataSource:t,className:n,onRowClick:r,onItemClick:o,...a})=>{const[i,s]=C.useState([]),[c,d]=C.useState(!1),[f,_]=C.useState(null),[h,p]=C.useState(0),[y,b]=C.useState(null),w=e.timeline;C.useEffect(()=>{const N=xa.safeParse(e);N.success||console.warn("[ObjectTimeline] Invalid timeline configuration:",N.error.format())},[e]);const W=Ce.useDataScope(e.bind);C.useEffect(()=>{let N=!0;return(async()=>{if(!(!t||typeof t.getObjectSchema!="function"||!e.objectName))try{const M=await t.getObjectSchema(e.objectName);N&&b(M)}catch(M){console.warn("Failed to fetch object def for ObjectTimeline",M)}})(),()=>{N=!1}},[e.objectName,t]),C.useEffect(()=>{const N=async()=>{if(!(!t||typeof t.find!="function"||!e.objectName)){d(!0);try{const S=ie.buildExpandFields(y?.fields),M=await t.find(e.objectName,{options:{$top:100},...S.length>0?{$expand:S}:{}}),fe=ie.extractRecords(M);s(fe)}catch(S){console.error(S),_(S)}finally{d(!1)}}};e.objectName&&!W&&!e.items&&!a.data&&N()},[e.objectName,t,W,e.items,a.data,h,y]);const X=a.data||W||i;let A=e.items;if(!A&&X&&Array.isArray(X)){const N=w?.titleField??e.mapping?.title??e.titleField??"name",S=w?.startDateField??e.mapping?.date??e.startDateField??e.dateField??"date",M=w?.endDateField??e.endDateField??S,fe=e.mapping?.description??e.descriptionField??"description",pe=e.mapping?.variant??"variant",me=w?.groupByField??e.groupByField,he=w?.colorField??e.colorField;A=X.map(V=>({title:V[N],time:V[S],startDate:V[S],endDate:V[M],description:V[fe],variant:V[pe]||"default",...me?{group:V[me]}:{},...he?{color:V[he]}:{},_data:V}))}const R=C.useCallback(async()=>{p(N=>N+1)},[]),{ref:U,isRefreshing:Ie,pullDistance:ne}=ln.usePullToRefresh({onRefresh:R,enabled:!!e.objectName&&!!t}),de=Ce.useNavigationOverlay({navigation:e.navigation,objectName:e.objectName,onRowClick:r??o}),re=w?.scale??e.scale,st={...e,items:A||[],className:n||e.className,...re?{timeScale:re}:{},onItemClick:N=>{const S=N._data||N;de.handleClick(S),o?.(S)}};return f?m.jsxs("div",{className:"p-4 text-red-500",children:["Error loading timeline: ",f.message]}):m.jsxs("div",{ref:U,className:"relative overflow-auto h-full min-w-0",children:[ne>0&&m.jsx("div",{className:"flex items-center justify-center text-xs text-muted-foreground",style:{height:ne},children:Ie?"Refreshing…":"Pull to refresh"}),m.jsx(Fe,{schema:st}),de.isOverlay&&m.jsx($.NavigationOverlay,{...de,title:"Timeline Item",children:N=>m.jsx("div",{className:"space-y-3",children:Object.entries(N).map(([S,M])=>m.jsxs("div",{className:"flex flex-col",children:[m.jsx("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:S.replace(/_/g," ")}),m.jsx("span",{className:"text-sm",children:String(M??"—")})]},S))})})]})},Ke=x.forwardRef(({className:e,...t},n)=>m.jsx("ol",{ref:n,className:$.cn("relative border-l border-gray-200",e),...t}));Ke.displayName="Timeline";const an=$.cva("ml-6",{variants:{density:{default:"mb-10",compact:"mb-3",comfortable:"mb-6"}},defaultVariants:{density:"default"}}),He=x.forwardRef(({className:e,density:t,...n},r)=>m.jsx("li",{ref:r,className:$.cn(an({density:t}),e),...n}));He.displayName="TimelineItem";const sn=$.cva("absolute -left-3 w-6 h-6 rounded-full border-2 flex items-center justify-center",{variants:{variant:{default:"bg-blue-200 border-blue-400",success:"bg-emerald-200 border-emerald-500",warning:"bg-amber-200 border-amber-500",danger:"bg-red-200 border-red-500",info:"bg-purple-200 border-purple-500",todo:"bg-slate-200 border-slate-400","in-progress":"bg-blue-200 border-blue-500",done:"bg-emerald-200 border-emerald-500"}},defaultVariants:{variant:"default"}}),Ze=x.forwardRef(({className:e,variant:t="default",...n},r)=>m.jsx("div",{ref:r,className:$.cn(sn({variant:t}),e),...n}));Ze.displayName="TimelineMarker";const Xe=x.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:e,...t}));Xe.displayName="TimelineContent";const Ee=x.forwardRef(({className:e,...t},n)=>m.jsx("h3",{ref:n,className:$.cn("font-semibold text-lg mb-1",e),...t}));Ee.displayName="TimelineTitle";const Pe=x.forwardRef(({className:e,...t},n)=>m.jsx("time",{ref:n,className:$.cn("text-sm font-normal text-gray-500 mb-2 block",e),...t}));Pe.displayName="TimelineTime";const De=x.forwardRef(({className:e,...t},n)=>m.jsx("p",{ref:n,className:$.cn("text-base text-gray-700",e),...t}));De.displayName="TimelineDescription";const Qe=x.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:$.cn("relative flex overflow-x-auto py-8",e),...t}));Qe.displayName="TimelineHorizontal";const et=x.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:$.cn("flex-shrink-0 w-64 relative",e),...t}));et.displayName="TimelineHorizontalItem";const tt=x.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:$.cn("relative w-full border rounded-lg overflow-hidden",e),...t}));tt.displayName="TimelineGantt";const nt=x.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:$.cn("flex border-b bg-gray-50",e),...t}));nt.displayName="TimelineGanttHeader";const Re=x.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:$.cn("w-48 border-r bg-white",e),...t}));Re.displayName="TimelineGanttRowLabels";const Ne=x.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:$.cn("flex-1 overflow-x-auto",e),...t}));Ne.displayName="TimelineGanttGrid";const xe=x.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:$.cn("flex items-center border-b min-h-12",e),...t}));xe.displayName="TimelineGanttRow";const rt=x.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:$.cn("px-4 py-2 font-medium text-sm truncate",e),...t}));rt.displayName="TimelineGanttLabel";const ot=x.forwardRef(({className:e,start:t=0,width:n=100,variant:r="default",...o},a)=>{const i={default:"bg-blue-500 hover:bg-blue-600",success:"bg-green-500 hover:bg-green-600",warning:"bg-yellow-500 hover:bg-yellow-600",danger:"bg-red-500 hover:bg-red-600",info:"bg-purple-500 hover:bg-purple-600"};return m.jsx("div",{ref:a,className:$.cn("absolute h-8 rounded-md transition-colors cursor-pointer",i[r],e),style:{left:`${t}%`,width:`${n}%`},...o})});ot.displayName="TimelineGanttBar";const it=x.forwardRef(({className:e,...t},n)=>m.jsx("div",{ref:n,className:$.cn("px-2 py-1 text-white text-xs font-medium truncate",e),...t}));it.displayName="TimelineGanttBarContent";const at=({schema:e,...t})=>{const{dataSource:n}=Ce.useSchemaContext()||{};return m.jsx(on,{schema:e,dataSource:n,...t})};ie.ComponentRegistry.register("object-timeline",at,{namespace:"plugin-timeline",label:"Object Timeline",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"variant",type:"enum",enum:["vertical","horizontal","gantt"],defaultValue:"vertical"}]}),ie.ComponentRegistry.register("timeline",at,{namespace:"view",label:"Timeline View",category:"view",inputs:[{name:"objectName",type:"string",label:"Object Name",required:!0},{name:"variant",type:"enum",enum:["vertical","horizontal","gantt"],defaultValue:"vertical"}]}),z.ObjectTimeline=on,z.ObjectTimelineRenderer=at,z.Timeline=Ke,z.TimelineContent=Xe,z.TimelineDescription=De,z.TimelineGantt=tt,z.TimelineGanttBar=ot,z.TimelineGanttBarContent=it,z.TimelineGanttGrid=Ne,z.TimelineGanttHeader=nt,z.TimelineGanttLabel=rt,z.TimelineGanttRow=xe,z.TimelineGanttRowLabels=Re,z.TimelineHorizontal=Qe,z.TimelineHorizontalItem=et,z.TimelineItem=He,z.TimelineMarker=Ze,z.TimelineRenderer=Fe,z.TimelineTime=Pe,z.TimelineTitle=Ee,z.timelineItemVariants=an,z.timelineMarkerVariants=sn,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})}));
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import { DataSource, TimelineSchema } from '../../types/src';
|
|
2
|
+
import { DataSource, TimelineSchema, TimelineConfig } from '../../types/src';
|
|
3
3
|
export interface ObjectTimelineProps {
|
|
4
4
|
schema: TimelineSchema & {
|
|
5
5
|
objectName?: string;
|
|
6
|
+
/** Spec-compliant nested timeline config */
|
|
7
|
+
timeline?: TimelineConfig;
|
|
8
|
+
/** @deprecated Use timeline.titleField instead */
|
|
6
9
|
titleField?: string;
|
|
10
|
+
/** @deprecated Use timeline.startDateField instead */
|
|
7
11
|
dateField?: string;
|
|
12
|
+
/** @deprecated Use timeline.startDateField instead */
|
|
13
|
+
startDateField?: string;
|
|
14
|
+
/** @deprecated Use timeline.endDateField instead */
|
|
15
|
+
endDateField?: string;
|
|
8
16
|
descriptionField?: string;
|
|
17
|
+
/** @deprecated Use timeline.groupByField instead */
|
|
18
|
+
groupByField?: string;
|
|
19
|
+
/** @deprecated Use timeline.colorField instead */
|
|
20
|
+
colorField?: string;
|
|
21
|
+
/** @deprecated Use timeline.scale instead */
|
|
22
|
+
scale?: 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
|
|
9
23
|
mapping?: {
|
|
10
24
|
title?: string;
|
|
11
25
|
date?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ObjectTimeline.d.ts","sourceRoot":"","sources":["../../src/ObjectTimeline.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"ObjectTimeline.d.ts","sourceRoot":"","sources":["../../src/ObjectTimeline.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAA2C,MAAM,OAAO,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AA6BnF,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,cAAc,GAAG;QACvB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,4CAA4C;QAC5C,QAAQ,CAAC,EAAE,cAAc,CAAC;QAC1B,kDAAkD;QAClD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,sDAAsD;QACtD,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,sDAAsD;QACtD,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,oDAAoD;QACpD,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,oDAAoD;QACpD,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,kDAAkD;QAClD,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,6CAA6C;QAC7C,KAAK,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;QAE/D,OAAO,CAAC,EAAE;YACR,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,IAAI,CAAC,EAAE,MAAM,CAAC;YACd,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,OAAO,CAAC,EAAE,MAAM,CAAC;SAClB,CAAA;KACF,CAAC;IACF,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;IACnC,WAAW,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,IAAI,CAAC;CACrC;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAwKxD,CAAA"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
1
2
|
/**
|
|
2
3
|
* ObjectUI
|
|
3
4
|
* Copyright (c) 2024-present ObjectStack Inc.
|
|
@@ -7,9 +8,18 @@
|
|
|
7
8
|
*/
|
|
8
9
|
import * as React from "react";
|
|
9
10
|
declare const Timeline: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLOListElement> & React.RefAttributes<HTMLOListElement>>;
|
|
10
|
-
declare const
|
|
11
|
+
declare const timelineItemVariants: (props?: ({
|
|
12
|
+
density?: "default" | "compact" | "comfortable" | null | undefined;
|
|
13
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
14
|
+
declare const TimelineItem: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLLIElement> & VariantProps<(props?: ({
|
|
15
|
+
density?: "default" | "compact" | "comfortable" | null | undefined;
|
|
16
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLLIElement>>;
|
|
17
|
+
declare const timelineMarkerVariants: (props?: ({
|
|
18
|
+
variant?: "success" | "info" | "warning" | "default" | "danger" | "todo" | "in-progress" | "done" | null | undefined;
|
|
19
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
20
|
+
type TimelineMarkerVariant = VariantProps<typeof timelineMarkerVariants>["variant"];
|
|
11
21
|
declare const TimelineMarker: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & {
|
|
12
|
-
variant?:
|
|
22
|
+
variant?: TimelineMarkerVariant;
|
|
13
23
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
14
24
|
declare const TimelineContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
15
25
|
declare const TimelineTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
|
|
@@ -29,7 +39,7 @@ declare const TimelineGanttBar: React.ForwardRefExoticComponent<React.HTMLAttrib
|
|
|
29
39
|
variant?: "default" | "success" | "warning" | "danger" | "info";
|
|
30
40
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
31
41
|
declare const TimelineGanttBarContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
32
|
-
export { Timeline, TimelineItem, TimelineMarker, TimelineContent, TimelineTitle, TimelineTime, TimelineDescription, TimelineHorizontal, TimelineHorizontalItem, TimelineGantt, TimelineGanttHeader, TimelineGanttRowLabels, TimelineGanttGrid, TimelineGanttRow, TimelineGanttLabel, TimelineGanttBar, TimelineGanttBarContent, };
|
|
42
|
+
export { Timeline, TimelineItem, timelineItemVariants, TimelineMarker, timelineMarkerVariants, TimelineContent, TimelineTitle, TimelineTime, TimelineDescription, TimelineHorizontal, TimelineHorizontalItem, TimelineGantt, TimelineGanttHeader, TimelineGanttRowLabels, TimelineGanttGrid, TimelineGanttRow, TimelineGanttLabel, TimelineGanttBar, TimelineGanttBarContent, };
|
|
33
43
|
export * from './renderer';
|
|
34
44
|
export { ObjectTimeline } from './ObjectTimeline';
|
|
35
45
|
export type { ObjectTimelineProps } from './ObjectTimeline';
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAE5D,QAAA,MAAM,QAAQ,iHASZ,CAAA;AAGF,QAAA,MAAM,oBAAoB;;8EASxB,CAAA;AAEF,QAAA,MAAM,YAAY;;qHAShB,CAAA;AAGF,QAAA,MAAM,sBAAsB;;8EAiB3B,CAAA;AAED,KAAK,qBAAqB,GAAG,YAAY,CAAC,OAAO,sBAAsB,CAAC,CAAC,SAAS,CAAC,CAAA;AAEnF,QAAA,MAAM,cAAc;cAGN,qBAAqB;wCAUjC,CAAA;AAGF,QAAA,MAAM,eAAe,6GASnB,CAAA;AAGF,QAAA,MAAM,aAAa,qHASjB,CAAA;AAGF,QAAA,MAAM,YAAY,mHAShB,CAAA;AAGF,QAAA,MAAM,mBAAmB,yHASvB,CAAA;AAIF,QAAA,MAAM,kBAAkB,6GAStB,CAAA;AAGF,QAAA,MAAM,sBAAsB,6GAS1B,CAAA;AAIF,QAAA,MAAM,aAAa,6GASjB,CAAA;AAGF,QAAA,MAAM,mBAAmB,6GASvB,CAAA;AAGF,QAAA,MAAM,sBAAsB,6GAS1B,CAAA;AAGF,QAAA,MAAM,iBAAiB,6GASrB,CAAA;AAGF,QAAA,MAAM,gBAAgB,6GASpB,CAAA;AAGF,QAAA,MAAM,kBAAkB,6GAStB,CAAA;AAGF,QAAA,MAAM,gBAAgB;YAGV,MAAM;YACN,MAAM;cACJ,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,MAAM;wCA0BjE,CAAA;AAGF,QAAA,MAAM,uBAAuB,6GAS3B,CAAA;AAGF,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,cAAc,EACd,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,EAChB,uBAAuB,GACxB,CAAA;AAGD,cAAc,YAAY,CAAC;AAG3B,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAO5D,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,GAAG,CAGhD,CAAC"}
|