@baseplate-dev/project-builder-web
Version:
Web interface for constructing project builder JSON
4 lines (3 loc) • 16 kB
JavaScript
const Le=Object.freeze({status:"aborted"});function $(e,t,r){function n(c,a){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:a,constr:i,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,a);const f=i.prototype,u=Object.keys(f);for(let p=0;p<u.length;p++){const d=u[p];d in c||(c[d]=f[d].bind(c))}}const s=r?.Parent??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function i(c){var a;const f=r?.Parent?new o:this;n(f,c),(a=f._zod).deferred??(a.deferred=[]);for(const u of f._zod.deferred)u();return f}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:c=>r?.Parent&&c instanceof r.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(i,"name",{value:e}),i}const qe=Symbol("zod_brand");class N extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Ke extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const k={};function m(e){return e&&Object.assign(k,e),k}function C(e){return e}function F(e){return e}function Z(e){}function B(e){throw new Error}function V(e){}function G(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function L(e,t="|"){return e.map(r=>x(r)).join(t)}function I(e,t){return typeof t=="bigint"?t.toString():t}function T(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function q(e){return e==null}function K(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function J(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let s=(n.split(".")[1]||"").length;if(s===0&&/\d?e-\d?/.test(n)){const a=n.match(/\d?e-(\d?)/);a?.[1]&&(s=Number.parseInt(a[1]))}const o=r>s?r:s,i=Number.parseInt(e.toFixed(o).replace(".","")),c=Number.parseInt(t.toFixed(o).replace(".",""));return i%c/10**o}const S=Symbol("evaluating");function W(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==S)return n===void 0&&(n=S,n=r()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function X(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function h(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function y(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function H(e){return y(e._zod.def)}function Q(e,t){return t?t.reduce((r,n)=>r?.[n],e):e}function Y(e){const t=Object.keys(e),r=t.map(n=>e[n]);return Promise.all(r).then(n=>{const s={};for(let o=0;o<t.length;o++)s[t[o]]=n[o];return s})}function ee(e=10){const t="abcdefghijklmnopqrstuvwxyz";let r="";for(let n=0;n<e;n++)r+=t[Math.floor(Math.random()*t.length)];return r}function te(e){return JSON.stringify(e)}function ne(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const O="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function E(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const re=T(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function w(e){if(E(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(E(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function se(e){return w(e)?{...e}:Array.isArray(e)?[...e]:e}function oe(e){let t=0;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}const ie=e=>{const t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},ae=new Set(["string","number","symbol"]),ce=new Set(["string","number","bigint","boolean","symbol","undefined"]);function ue(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function g(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function fe(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 le(e){let t;return new Proxy({},{get(r,n,s){return t??(t=e()),Reflect.get(t,n,s)},set(r,n,s,o){return t??(t=e()),Reflect.set(t,n,s,o)},has(r,n){return t??(t=e()),Reflect.has(t,n)},deleteProperty(r,n){return t??(t=e()),Reflect.deleteProperty(t,n)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,n){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,n)},defineProperty(r,n,s){return t??(t=e()),Reflect.defineProperty(t,n,s)}})}function x(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function de(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const pe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},he={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function ye(e,t){const r=e._zod.def,n=y(e._zod.def,{get shape(){const s={};for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&(s[o]=r.shape[o])}return h(this,"shape",s),s},checks:[]});return g(e,n)}function ge(e,t){const r=e._zod.def,n=y(e._zod.def,{get shape(){const s={...e._zod.def.shape};for(const o in t){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);t[o]&&delete s[o]}return h(this,"shape",s),s},checks:[]});return g(e,n)}function be(e,t){if(!w(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const s=y(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return h(this,"shape",o),o},checks:[]});return g(e,s)}function _e(e,t){if(!w(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r={...e._zod.def,get shape(){const n={...e._zod.def.shape,...t};return h(this,"shape",n),n},checks:e._zod.def.checks};return g(e,r)}function me(e,t){const r=y(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return h(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return g(e,r)}function we(e,t,r){const n=y(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(r)for(const i in r){if(!(i in s))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=e?new e({type:"optional",innerType:s[i]}):s[i])}else for(const i in s)o[i]=e?new e({type:"optional",innerType:s[i]}):s[i];return h(this,"shape",o),o},checks:[]});return g(t,n)}function Ee(e,t,r){const n=y(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(r)for(const i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:s[i]}))}else for(const i in s)o[i]=new e({type:"nonoptional",innerType:s[i]});return h(this,"shape",o),o},checks:[]});return g(t,n)}function Oe(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function je(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function b(e){return typeof e=="string"?e:e?.message}function _(e,t,r){const n={...e,path:e.path??[]};if(!e.message){const s=b(e.inst?._zod.def?.error?.(e))??b(t?.error?.(e))??b(r.customError?.(e))??b(r.localeError?.(e))??"Invalid input";n.message=s}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ze(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function Pe(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ae(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}function ke(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function R(e){const t=atob(e),r=new Uint8Array(t.length);for(let n=0;n<t.length;n++)r[n]=t.charCodeAt(n);return r}function D(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Se(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return R(t+r)}function ve(e){return D(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function $e(e){const t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");const r=new Uint8Array(t.length/2);for(let n=0;n<t.length;n+=2)r[n/2]=Number.parseInt(t.slice(n,n+2),16);return r}function Ne(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}class Ie{constructor(...t){}}const Je=Object.freeze(Object.defineProperty({__proto__:null,BIGINT_FORMAT_RANGES:he,Class:Ie,NUMBER_FORMAT_RANGES:pe,aborted:Oe,allowsEval:re,assert:V,assertEqual:C,assertIs:Z,assertNever:B,assertNotEqual:F,assignProp:h,base64ToUint8Array:R,base64urlToUint8Array:Se,cached:T,captureStackTrace:O,cleanEnum:ke,cleanRegex:K,clone:g,cloneDef:H,createTransparentProxy:le,defineLazy:W,esc:te,escapeRegex:ue,extend:be,finalizeIssue:_,floatSafeRemainder:J,getElementAtPath:Q,getEnumValues:G,getLengthableOrigin:Pe,getParsedType:ie,getSizableOrigin:ze,hexToUint8Array:$e,isObject:E,isPlainObject:w,issue:Ae,joinValues:L,jsonStringifyReplacer:I,merge:me,mergeDefs:y,normalizeParams:fe,nullish:q,numKeys:oe,objectClone:X,omit:ge,optionalKeys:de,partial:we,pick:ye,prefixIssues:je,primitiveTypes:ce,promiseAllObject:Y,propertyKeyTypes:ae,randomString:ee,required:Ee,safeExtend:_e,shallowClone:se,slugify:ne,stringifyPrimitive:x,uint8ArrayToBase64:D,uint8ArrayToBase64url:ve,uint8ArrayToHex:Ne,unwrapMessage:b},Symbol.toStringTag,{value:"Module"})),M=(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,I,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Te=$("$ZodError",M),l=$("$ZodError",M,{Parent:Error});function We(e,t=r=>r.message){const r={},n=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}function Xe(e,t=r=>r.message){const r={_errors:[]},n=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(i=>n({issues:i}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let i=r,c=0;for(;c<o.path.length;){const a=o.path[c];c===o.path.length-1?(i[a]=i[a]||{_errors:[]},i[a]._errors.push(t(o))):i[a]=i[a]||{_errors:[]},i=i[a],c++}}};return n(e),r}function He(e,t=r=>r.message){const r={errors:[]},n=(s,o=[])=>{var i,c;for(const a of s.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(f=>n({issues:f},a.path));else if(a.code==="invalid_key")n({issues:a.issues},a.path);else if(a.code==="invalid_element")n({issues:a.issues},a.path);else{const f=[...o,...a.path];if(f.length===0){r.errors.push(t(a));continue}let u=r,p=0;for(;p<f.length;){const d=f[p],U=p===f.length-1;typeof d=="string"?(u.properties??(u.properties={}),(i=u.properties)[d]??(i[d]={errors:[]}),u=u.properties[d]):(u.items??(u.items=[]),(c=u.items)[d]??(c[d]={errors:[]}),u=u.items[d]),U&&u.errors.push(t(a)),p++}}};return n(e),r}function xe(e){const t=[],r=e.map(n=>typeof n=="object"?n.key:n);for(const n of r)typeof n=="number"?t.push(`[${n}]`):typeof n=="symbol"?t.push(`[${JSON.stringify(String(n))}]`):/[^\w$]/.test(n)?t.push(`[${JSON.stringify(n)}]`):(t.length&&t.push("."),t.push(n));return t.join("")}function Qe(e){const t=[],r=[...e.issues].sort((n,s)=>(n.path??[]).length-(s.path??[]).length);for(const n of r)t.push(`✖ ${n.message}`),n.path?.length&&t.push(` → at ${xe(n.path)}`);return t.join(`
`)}const j=e=>(t,r,n,s)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new N;if(i.issues.length){const c=new(s?.Err??e)(i.issues.map(a=>_(a,o,m())));throw O(c,s?.callee),c}return i.value},Ye=j(l),z=e=>async(t,r,n,s)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const c=new(s?.Err??e)(i.issues.map(a=>_(a,o,m())));throw O(c,s?.callee),c}return i.value},et=z(l),P=e=>(t,r,n)=>{const s=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},s);if(o instanceof Promise)throw new N;return o.issues.length?{success:!1,error:new(e??Te)(o.issues.map(i=>_(i,s,m())))}:{success:!0,data:o.value}},tt=P(l),A=e=>async(t,r,n)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>_(i,s,m())))}:{success:!0,data:o.value}},nt=A(l),Re=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return j(e)(t,r,s)},rt=Re(l),De=e=>(t,r,n)=>j(e)(t,r,n),st=De(l),Me=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return z(e)(t,r,s)},ot=Me(l),Ue=e=>async(t,r,n)=>z(e)(t,r,n),it=Ue(l),Ce=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return P(e)(t,r,s)},at=Ce(l),Fe=e=>(t,r,n)=>P(e)(t,r,n),ct=Fe(l),Ze=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return A(e)(t,r,s)},ut=Ze(l),Be=e=>async(t,r,n)=>A(e)(t,r,n),ft=Be(l);var v;const lt=Symbol("ZodOutput"),dt=Symbol("ZodInput");class Ve{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];if(this._map.set(t,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,t)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Ge(){return new Ve}(v=globalThis).__zod_globalRegistry??(v.__zod_globalRegistry=Ge());const pt=globalThis.__zod_globalRegistry;export{Te as $,ce as A,he as B,de as C,Ae as D,L as E,x as F,fe as G,ne as H,se as I,pt as J,Ve as K,l as L,qe as M,pe as N,dt as O,lt as P,Le as Q,Ue as R,Re as S,Me as T,j as U,z as V,Fe as W,Be as X,Ce as Y,Ze as Z,De as _,et as a,P as a0,A as a1,g as a2,st as a3,it as a4,rt as a5,ot as a6,We as a7,Xe as a8,Qe as a9,Ge as aa,ct as ab,ft as ac,at as ad,ut as ae,xe as af,He as ag,Je as ah,I as ai,y as aj,be as ak,_e as al,me as am,ye as an,ge as ao,we as ap,Ee as aq,$ as b,Pe as c,je as d,ue as e,J as f,ze as g,N as h,nt as i,Oe as j,W as k,T as l,E as m,q as n,k as o,Ye as p,re as q,te as r,tt as s,K as t,w as u,_ as v,m as w,G as x,ae as y,Ke as z};
//# sourceMappingURL=registries-DdLT7oXj.js.map