@proofkit/cli 2.0.0-beta.5 → 2.0.0-beta.6

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.
Files changed (2) hide show
  1. package/dist/index.js +2 -2
  2. package/package.json +4 -3
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node --no-warnings
2
- import*as e from"@clack/prompts";import{cancel as t,isCancel as n}from"@clack/prompts";import r from"chalk";import{Command as i,Option as a}from"commander";import o from"path";import{execa as s}from"execa";import c from"fs-extra";import{fileURLToPath as l}from"url";import u,{readFileSync as d,writeFileSync as f}from"fs";import{glob as p}from"glob";import m from"ora";import{Node as h,Project as g,StructureKind as ee,SyntaxKind as _}from"ts-morph";import te from"sort-package-json";import{execSync as ne}from"child_process";import{format as re,getFileInfo as ie}from"prettier";import ae,{config as oe}from"dotenv";import se,{OttoAdapter as ce}from"@proofkit/fmdapi";import{generateTypedClients as le}from"@proofkit/typegen";import{applyEdits as ue,modify as de,parse as fe}from"jsonc-parser";import pe from"os";import*as me from"semver";import he,{SemVer as ge}from"semver";import _e,{AxiosError as ve}from"axios";import ye from"open";import be from"randomstring";import xe from"https";import Se from"gradient-string";import{capitalize as Ce,groupBy as we,uniq as Te}from"es-toolkit";import{registryItemSchema as Ee}from"shadcn/registry";import"jiti";import"fast-glob";import{createFetch as De,createSchema as Oe}from"@better-fetch/fetch";import ke from"handlebars";var Ae=Object.defineProperty,je=(e,t)=>{let n={};for(var r in e)Ae(n,r,{get:e[r],enumerable:!0});return t&&Ae(n,Symbol.toStringTag,{value:`Module`}),n};const Me=()=>{let e=o.join(v,`package.json`);return c.readJSONSync(e).version??`1.0.0`},Ne=()=>__FMDAPI_VERSION__,Pe=()=>{try{return process.versions.node.split(`.`)[0]??`22`}catch{return`22`}},Fe=()=>__BETTER_AUTH_VERSION__,Ie=l(import.meta.url),Le=o.dirname(Ie),v=o.join(Le,`../`),Re=`@proofkit/cli`,ze=`https://proofkit.dev`,Be=Me(),Ve=Be.length,He=`
2
+ import*as e from"@clack/prompts";import{cancel as t,isCancel as n}from"@clack/prompts";import r from"chalk";import{Command as i,Option as a}from"commander";import o from"path";import{execa as s}from"execa";import c from"fs-extra";import{fileURLToPath as l}from"url";import u,{readFileSync as d,writeFileSync as f}from"fs";import{glob as p}from"glob";import m from"ora";import{Node as h,Project as g,StructureKind as ee,SyntaxKind as _}from"ts-morph";import te from"sort-package-json";import{execSync as ne}from"child_process";import{format as re,getFileInfo as ie}from"prettier";import ae,{config as oe}from"dotenv";import se,{OttoAdapter as ce}from"@proofkit/fmdapi";import{generateTypedClients as le}from"@proofkit/typegen";import{applyEdits as ue,modify as de,parse as fe}from"jsonc-parser";import pe from"os";import*as me from"semver";import he,{SemVer as ge}from"semver";import _e,{AxiosError as ve}from"axios";import ye from"open";import be from"randomstring";import xe from"https";import Se from"gradient-string";import{capitalize as Ce,groupBy as we,uniq as Te}from"es-toolkit";import{registryItemSchema as Ee}from"shadcn/registry";import"jiti";import"fast-glob";import{createFetch as De,createSchema as Oe}from"@better-fetch/fetch";import ke from"handlebars";var Ae=Object.defineProperty,je=(e,t)=>{let n={};for(var r in e)Ae(n,r,{get:e[r],enumerable:!0});return t&&Ae(n,Symbol.toStringTag,{value:`Module`}),n};const Me=()=>{let e=o.join(v,`package.json`);return c.readJSONSync(e).version??`1.0.0`},Ne=()=>`5.0.3-beta.0`,Pe=()=>{try{return process.versions.node.split(`.`)[0]??`22`}catch{return`22`}},Fe=()=>`0.3.0`,Ie=l(import.meta.url),Le=o.dirname(Ie),v=o.join(Le,`../`),Re=`@proofkit/cli`,ze=`https://proofkit.dev`,Be=Me(),Ve=Be.length,He=`
3
3
  _______ ___ ___ ____ _ _
4
4
  |_ __ \\ .' ..]|_ ||_ _| (_) / |_
5
5
  | |__) |_ .--. .--. .--. _| |_ | |_/ / __ \`| |-'
@@ -7,7 +7,7 @@ import*as e from"@clack/prompts";import{cancel as t,isCancel as n}from"@clack/pr
7
7
  _| |_ | | | \\__. || \\__. | | | _| | \\ \\_ | | | |,
8
8
  |_____| [___] '.__.' '.__.' [___] |____||____|[___]\\__/
9
9
  ${` `.repeat(61-Ve)}v${Be}
10
- `,Ue=`my-proofkit-app`,We=typeof __REGISTRY_URL__<`u`&&__REGISTRY_URL__?__REGISTRY_URL__:`https://proofkit.dev`;function y(e,t,n){function r(n,r){var i;for(let a in Object.defineProperty(n,`_zod`,{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r),o.prototype)a in n||Object.defineProperty(n,a,{value:o.prototype[a].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}const Ge=Symbol(`zod_brand`);var Ke=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};const qe={};function b(e){return e&&Object.assign(qe,e),qe}var Je=je({BIGINT_FORMAT_RANGES:()=>wt,Class:()=>zt,NUMBER_FORMAT_RANGES:()=>Ct,aborted:()=>jt,allowsEval:()=>pt,assert:()=>$e,assertEqual:()=>Ye,assertIs:()=>Ze,assertNever:()=>Qe,assertNotEqual:()=>Xe,assignProp:()=>ot,cached:()=>nt,captureStackTrace:()=>dt,cleanEnum:()=>Rt,cleanRegex:()=>it,clone:()=>bt,createTransparentProxy:()=>xt,defineLazy:()=>S,esc:()=>ut,escapeRegex:()=>yt,extend:()=>Dt,finalizeIssue:()=>Pt,floatSafeRemainder:()=>at,getElementAtPath:()=>st,getEnumValues:()=>et,getLengthableOrigin:()=>It,getParsedType:()=>gt,getSizableOrigin:()=>Ft,isObject:()=>ft,isPlainObject:()=>mt,issue:()=>Lt,joinValues:()=>x,jsonStringifyReplacer:()=>tt,merge:()=>Ot,normalizeParams:()=>C,nullish:()=>rt,numKeys:()=>ht,omit:()=>Et,optionalKeys:()=>St,partial:()=>kt,pick:()=>Tt,prefixIssues:()=>Mt,primitiveTypes:()=>vt,promiseAllObject:()=>ct,propertyKeyTypes:()=>_t,randomString:()=>lt,required:()=>At,stringifyPrimitive:()=>w,unwrapMessage:()=>Nt});function Ye(e){return e}function Xe(e){return e}function Ze(e){}function Qe(e){throw Error()}function $e(e){}function et(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function x(e,t=`|`){return e.map(e=>w(e)).join(t)}function tt(e,t){return typeof t==`bigint`?t.toString():t}function nt(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function rt(e){return e==null}function it(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function at(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}function S(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}throw Error(`cached value already set`)},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ot(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function st(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function ct(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function lt(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function ut(e){return JSON.stringify(e)}const dt=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function ft(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const pt=nt(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function mt(e){if(ft(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(ft(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ht(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const gt=e=>{let 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 Error(`Unknown data type: ${t}`)}},_t=new Set([`string`,`number`,`symbol`]),vt=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function yt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function bt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function C(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function xt(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function w(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function St(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Ct={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},wt={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Tt(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return bt(e,{...e._zod.def,shape:n,checks:[]})}function Et(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return bt(e,{...e._zod.def,shape:n,checks:[]})}function Dt(e,t){return bt(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return ot(this,`shape`,n),n},checks:[]})}function Ot(e,t){return bt(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ot(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function kt(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return bt(t,{...t._zod.def,shape:i,checks:[]})}function At(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return bt(t,{...t._zod.def,shape:i,checks:[]})}function jt(e,t=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(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Nt(e){return typeof e==`string`?e:e?.message}function Pt(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Nt(e.inst?._zod.def?.error?.(e))??Nt(t?.error?.(e))??Nt(n.customError?.(e))??Nt(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ft(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function It(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Lt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Rt(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var zt=class{constructor(...e){}};const Bt=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),Object.defineProperty(e,`message`,{get(){return JSON.stringify(t,tt,2)},enumerable:!0})},Vt=y(`$ZodError`,Bt),Ht=y(`$ZodError`,Bt,{Parent:Error});function Ut(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Wt(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i<t.path.length;){let r=t.path[i];i===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],i++}}};return i(e),r}function Gt(e,t){let n=t||function(e){return e.message},r={errors:[]},i=(e,t=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>i({issues:e},s.path));else if(s.code===`invalid_key`)i({issues:s.issues},s.path);else if(s.code===`invalid_element`)i({issues:s.issues},s.path);else{let e=[...t,...s.path];if(e.length===0){r.errors.push(n(s));continue}let i=r,c=0;for(;c<e.length;){let t=e[c],r=c===e.length-1;typeof t==`string`?(i.properties??={},(a=i.properties)[t]??(a[t]={errors:[]}),i=i.properties[t]):(i.items??=[],(o=i.items)[t]??(o[t]={errors:[]}),i=i.items[t]),r&&i.errors.push(n(s)),c++}}};return i(e),r}function Kt(e){let t=[];for(let n of e)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 qt(e){let t=[],n=[...e.issues].sort((e,t)=>e.path.length-t.path.length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Kt(e.path)}`);return t.join(`
10
+ `,Ue=`my-proofkit-app`,We=`https://proofkit.dev`;function y(e,t,n){function r(n,r){var i;for(let a in Object.defineProperty(n,`_zod`,{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r),o.prototype)a in n||Object.defineProperty(n,a,{value:o.prototype[a].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,`name`,{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,`init`,{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,`name`,{value:e}),o}const Ge=Symbol(`zod_brand`);var Ke=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}};const qe={};function b(e){return e&&Object.assign(qe,e),qe}var Je=je({BIGINT_FORMAT_RANGES:()=>wt,Class:()=>zt,NUMBER_FORMAT_RANGES:()=>Ct,aborted:()=>jt,allowsEval:()=>pt,assert:()=>$e,assertEqual:()=>Ye,assertIs:()=>Ze,assertNever:()=>Qe,assertNotEqual:()=>Xe,assignProp:()=>ot,cached:()=>nt,captureStackTrace:()=>dt,cleanEnum:()=>Rt,cleanRegex:()=>it,clone:()=>bt,createTransparentProxy:()=>xt,defineLazy:()=>S,esc:()=>ut,escapeRegex:()=>yt,extend:()=>Dt,finalizeIssue:()=>Pt,floatSafeRemainder:()=>at,getElementAtPath:()=>st,getEnumValues:()=>et,getLengthableOrigin:()=>It,getParsedType:()=>gt,getSizableOrigin:()=>Ft,isObject:()=>ft,isPlainObject:()=>mt,issue:()=>Lt,joinValues:()=>x,jsonStringifyReplacer:()=>tt,merge:()=>Ot,normalizeParams:()=>C,nullish:()=>rt,numKeys:()=>ht,omit:()=>Et,optionalKeys:()=>St,partial:()=>kt,pick:()=>Tt,prefixIssues:()=>Mt,primitiveTypes:()=>vt,promiseAllObject:()=>ct,propertyKeyTypes:()=>_t,randomString:()=>lt,required:()=>At,stringifyPrimitive:()=>w,unwrapMessage:()=>Nt});function Ye(e){return e}function Xe(e){return e}function Ze(e){}function Qe(e){throw Error()}function $e(e){}function et(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function x(e,t=`|`){return e.map(e=>w(e)).join(t)}function tt(e,t){return typeof t==`bigint`?t.toString():t}function nt(e){return{get value(){{let t=e();return Object.defineProperty(this,`value`,{value:t}),t}throw Error(`cached value already set`)}}}function rt(e){return e==null}function it(e){let t=e.startsWith(`^`)?1:0,n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function at(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}function S(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}throw Error(`cached value already set`)},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function ot(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function st(e,t){return t?t.reduce((e,t)=>e?.[t],e):e}function ct(e){let t=Object.keys(e),n=t.map(t=>e[t]);return Promise.all(n).then(e=>{let n={};for(let r=0;r<t.length;r++)n[t[r]]=e[r];return n})}function lt(e=10){let t=``;for(let n=0;n<e;n++)t+=`abcdefghijklmnopqrstuvwxyz`[Math.floor(Math.random()*26)];return t}function ut(e){return JSON.stringify(e)}const dt=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function ft(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}const pt=nt(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function mt(e){if(ft(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(ft(n)===!1||Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)===!1)}function ht(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}const gt=e=>{let 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 Error(`Unknown data type: ${t}`)}},_t=new Set([`string`,`number`,`symbol`]),vt=new Set([`string`,`number`,`bigint`,`boolean`,`symbol`,`undefined`]);function yt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function bt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function C(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function xt(e){let t;return new Proxy({},{get(n,r,i){return t??=e(),Reflect.get(t,r,i)},set(n,r,i,a){return t??=e(),Reflect.set(t,r,i,a)},has(n,r){return t??=e(),Reflect.has(t,r)},deleteProperty(n,r){return t??=e(),Reflect.deleteProperty(t,r)},ownKeys(n){return t??=e(),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??=e(),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,i){return t??=e(),Reflect.defineProperty(t,r,i)}})}function w(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function St(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}const Ct={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},wt={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Tt(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return bt(e,{...e._zod.def,shape:n,checks:[]})}function Et(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return bt(e,{...e._zod.def,shape:n,checks:[]})}function Dt(e,t){return bt(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return ot(this,`shape`,n),n},checks:[]})}function Ot(e,t){return bt(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ot(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function kt(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return bt(t,{...t._zod.def,shape:i,checks:[]})}function At(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return bt(t,{...t._zod.def,shape:i,checks:[]})}function jt(e,t=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(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Nt(e){return typeof e==`string`?e:e?.message}function Pt(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=Nt(e.inst?._zod.def?.error?.(e))??Nt(t?.error?.(e))??Nt(n.customError?.(e))??Nt(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function Ft(e){return e instanceof Set?`set`:e instanceof Map?`map`:e instanceof File?`file`:`unknown`}function It(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Lt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Rt(e){return Object.entries(e).filter(([e,t])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var zt=class{constructor(...e){}};const Bt=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,`_zod`,{value:e._zod,enumerable:!1}),Object.defineProperty(e,`issues`,{value:t,enumerable:!1}),Object.defineProperty(e,`message`,{get(){return JSON.stringify(t,tt,2)},enumerable:!0})},Vt=y(`$ZodError`,Bt),Ht=y(`$ZodError`,Bt,{Parent:Error});function Ut(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Wt(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i<t.path.length;){let r=t.path[i];i===t.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(n(t))):e[r]=e[r]||{_errors:[]},e=e[r],i++}}};return i(e),r}function Gt(e,t){let n=t||function(e){return e.message},r={errors:[]},i=(e,t=[])=>{var a,o;for(let s of e.issues)if(s.code===`invalid_union`&&s.errors.length)s.errors.map(e=>i({issues:e},s.path));else if(s.code===`invalid_key`)i({issues:s.issues},s.path);else if(s.code===`invalid_element`)i({issues:s.issues},s.path);else{let e=[...t,...s.path];if(e.length===0){r.errors.push(n(s));continue}let i=r,c=0;for(;c<e.length;){let t=e[c],r=c===e.length-1;typeof t==`string`?(i.properties??={},(a=i.properties)[t]??(a[t]={errors:[]}),i=i.properties[t]):(i.items??=[],(o=i.items)[t]??(o[t]={errors:[]}),i=i.items[t]),r&&i.errors.push(n(s)),c++}}};return i(e),r}function Kt(e){let t=[];for(let n of e)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 qt(e){let t=[],n=[...e.issues].sort((e,t)=>e.path.length-t.path.length);for(let e of n)t.push(`✖ ${e.message}`),e.path?.length&&t.push(` → at ${Kt(e.path)}`);return t.join(`
11
11
  `)}const Jt=e=>(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Ke;if(o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Pt(e,a,b())));throw dt(t,i?.callee),t}return o.value},Yt=Jt(Ht),Xt=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new(i?.Err??e)(o.issues.map(e=>Pt(e,a,b())));throw dt(t,i?.callee),t}return o.value},Zt=Xt(Ht),Qt=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Ke;return a.issues.length?{success:!1,error:new(e??Vt)(a.issues.map(e=>Pt(e,i,b())))}:{success:!0,data:a.value}},$t=Qt(Ht),en=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>Pt(e,i,b())))}:{success:!0,data:a.value}},tn=en(Ht);var nn=je({_emoji:()=>Sn,base64:()=>On,base64url:()=>kn,bigint:()=>zn,boolean:()=>Hn,browserEmail:()=>xn,cidrv4:()=>En,cidrv6:()=>Dn,cuid:()=>rn,cuid2:()=>an,date:()=>Pn,datetime:()=>Ln,domain:()=>jn,duration:()=>un,e164:()=>Mn,email:()=>_n,emoji:()=>Cn,extendedDuration:()=>dn,guid:()=>fn,hostname:()=>An,html5Email:()=>vn,integer:()=>Bn,ipv4:()=>wn,ipv6:()=>Tn,ksuid:()=>cn,lowercase:()=>Gn,nanoid:()=>ln,null:()=>Un,number:()=>Vn,rfc5322Email:()=>yn,string:()=>Rn,time:()=>In,ulid:()=>on,undefined:()=>Wn,unicodeEmail:()=>bn,uppercase:()=>Kn,uuid:()=>pn,uuid4:()=>mn,uuid6:()=>hn,uuid7:()=>gn,xid:()=>sn});const rn=/^[cC][^\s-]{8,}$/,an=/^[0-9a-z]+$/,on=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,sn=/^[0-9a-vA-V]{20}$/,cn=/^[A-Za-z0-9]{27}$/,ln=/^[a-zA-Z0-9_-]{21}$/,un=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,fn=/^([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})$/,pn=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,mn=pn(4),hn=pn(6),gn=pn(7),_n=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,vn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yn=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,bn=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,xn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Sn=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function Cn(){return new RegExp(Sn,`u`)}const wn=/^(?:(?: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])$/,Tn=/^(([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})$/,En=/^((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])$/,Dn=/^(([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])$/,On=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,kn=/^[A-Za-z0-9_-]*$/,An=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,jn=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Mn=/^\+(?:[0-9]){6,14}[0-9]$/,Nn=`(?:(?:\\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])))`,Pn=RegExp(`^${Nn}$`);function Fn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function In(e){return RegExp(`^${Fn(e)}$`)}function Ln(e){let t=Fn({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-]\\d{2}:\\d{2})`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Nn}T(?:${r})$`)}const Rn=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},zn=/^\d+n?$/,Bn=/^\d+$/,Vn=/^-?\d+(?:\.\d+)?/i,Hn=/true|false/i,Un=/null/i,Wn=/undefined/i,Gn=/^[^A-Z]*$/,Kn=/^[^a-z]*$/,T=y(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),qn={number:`number`,bigint:`bigint`,object:`date`},Jn=y(`$ZodCheckLessThan`,(e,t)=>{T.init(e,t);let n=qn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:`too_big`,maximum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Yn=y(`$ZodCheckGreaterThan`,(e,t)=>{T.init(e,t);let n=qn[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:`too_small`,minimum:t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Xn=y(`$ZodCheckMultipleOf`,(e,t)=>{T.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?n.value%t.value===BigInt(0):at(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),Zn=y(`$ZodCheckNumberFormat`,(e,t)=>{T.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=Ct[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Bn)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inst:e})}}),Qn=y(`$ZodCheckBigIntFormat`,(e,t)=>{T.init(e,t);let[n,r]=wt[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=i=>{let a=i.value;a<n&&i.issues.push({origin:`bigint`,input:a,code:`too_small`,minimum:n,inclusive:!0,inst:e,continue:!t.abort}),a>r&&i.issues.push({origin:`bigint`,input:a,code:`too_big`,maximum:r,inst:e})}}),$n=y(`$ZodCheckMaxSize`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.size!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;r.size<=t.maximum||n.issues.push({origin:Ft(r),code:`too_big`,maximum:t.maximum,input:r,inst:e,continue:!t.abort})}}),er=y(`$ZodCheckMinSize`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.size!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;r.size>=t.minimum||n.issues.push({origin:Ft(r),code:`too_small`,minimum:t.minimum,input:r,inst:e,continue:!t.abort})}}),tr=y(`$ZodCheckSizeEquals`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.size!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=n=>{let r=n.value,i=r.size;if(i===t.size)return;let a=i>t.size;n.issues.push({origin:Ft(r),...a?{code:`too_big`,maximum:t.size}:{code:`too_small`,minimum:t.size},input:n.value,inst:e,continue:!t.abort})}}),nr=y(`$ZodCheckMaxLength`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.length!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=It(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),rr=y(`$ZodCheckMinLength`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.length!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=It(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),ir=y(`$ZodCheckLengthEquals`,(e,t)=>{T.init(e,t),e._zod.when=e=>{let t=e.value;return!rt(t)&&t.length!==void 0},e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=It(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},input:n.value,inst:e,continue:!t.abort})}}),ar=y(`$ZodCheckStringFormat`,(e,t)=>{var n;T.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),(n=e._zod).check??(n.check=n=>{if(!t.pattern)throw Error(`Not implemented.`);t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})})}),or=y(`$ZodCheckRegex`,(e,t)=>{ar.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})}}),sr=y(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Gn,ar.init(e,t)}),cr=y(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Kn,ar.init(e,t)}),lr=y(`$ZodCheckIncludes`,(e,t)=>{T.init(e,t);let n=yt(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ur=y(`$ZodCheckStartsWith`,(e,t)=>{T.init(e,t);let n=RegExp(`^${yt(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),dr=y(`$ZodCheckEndsWith`,(e,t)=>{T.init(e,t);let n=RegExp(`.*${yt(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}});function fr(e,t,n){e.issues.length&&t.issues.push(...Mt(n,e.issues))}const pr=y(`$ZodCheckProperty`,(e,t)=>{T.init(e,t),e._zod.check=e=>{let n=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(n instanceof Promise)return n.then(n=>fr(n,e,t.property));fr(n,e,t.property)}}),mr=y(`$ZodCheckMimeType`,(e,t)=>{T.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:`invalid_value`,values:t.mime,input:r.value.type,inst:e})}}),hr=y(`$ZodCheckOverwrite`,(e,t)=>{T.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});var gr=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
12
12
  `).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
13
13
  `))}};const _r={major:4,minor:0,patch:0},E=y(`$ZodType`,(e,t)=>{var n;e??={},S(e._zod,`id`,()=>t.type+`_`+lt(10)),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_r;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=jt(e),i;for(let a of t){if(a._zod.when){if(!a._zod.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Ke;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=jt(e,t))});else{if(e.issues.length===t)continue;r||=jt(e,t)}}return i?i.then(()=>e):e};e._zod.run=(n,i)=>{let a=e._zod.parse(n,i);if(a instanceof Promise){if(i.async===!1)throw new Ke;return a.then(e=>t(e,r,i))}return t(a,r,i)}}e[`~standard`]={validate:t=>{try{let n=$t(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return tn(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),vr=y(`$ZodString`,(e,t)=>{E.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Rn(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}}),D=y(`$ZodStringFormat`,(e,t)=>{ar.init(e,t),vr.init(e,t)}),yr=y(`$ZodGUID`,(e,t)=>{t.pattern??=fn,D.init(e,t)}),br=y(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=pn(e)}else t.pattern??=pn();D.init(e,t)}),xr=y(`$ZodEmail`,(e,t)=>{t.pattern??=_n,D.init(e,t)}),Sr=y(`$ZodURL`,(e,t)=>{D.init(e,t),e._zod.check=n=>{try{let r=new URL(n.value);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(r.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:An.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(r.protocol.endsWith(`:`)?r.protocol.slice(0,-1):r.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}));return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Cr=y(`$ZodEmoji`,(e,t)=>{t.pattern??=Cn(),D.init(e,t)}),wr=y(`$ZodNanoID`,(e,t)=>{t.pattern??=ln,D.init(e,t)}),Tr=y(`$ZodCUID`,(e,t)=>{t.pattern??=rn,D.init(e,t)}),Er=y(`$ZodCUID2`,(e,t)=>{t.pattern??=an,D.init(e,t)}),Dr=y(`$ZodULID`,(e,t)=>{t.pattern??=on,D.init(e,t)}),Or=y(`$ZodXID`,(e,t)=>{t.pattern??=sn,D.init(e,t)}),kr=y(`$ZodKSUID`,(e,t)=>{t.pattern??=cn,D.init(e,t)}),Ar=y(`$ZodISODateTime`,(e,t)=>{t.pattern??=Ln(t),D.init(e,t),e._zod.check}),jr=y(`$ZodISODate`,(e,t)=>{t.pattern??=Pn,D.init(e,t)}),Mr=y(`$ZodISOTime`,(e,t)=>{t.pattern??=In(t),D.init(e,t),e._zod.check}),Nr=y(`$ZodISODuration`,(e,t)=>{t.pattern??=un,D.init(e,t)}),Pr=y(`$ZodIPv4`,(e,t)=>{t.pattern??=wn,D.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv4`})}),Fr=y(`$ZodIPv6`,(e,t)=>{t.pattern??=Tn,D.init(e,t),e._zod.onattach.push(e=>{let t=e._zod.bag;t.format=`ipv6`}),e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Ir=y(`$ZodCIDRv4`,(e,t)=>{t.pattern??=En,D.init(e,t)}),Lr=y(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Dn,D.init(e,t),e._zod.check=n=>{let[r,i]=n.value.split(`/`);try{if(!i)throw Error();let e=Number(i);if(`${e}`!==i||e<0||e>128)throw Error();new URL(`http://[${r}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Rr(e){if(e===``)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}const zr=y(`$ZodBase64`,(e,t)=>{t.pattern??=On,D.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64`}),e._zod.check=n=>{Rr(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function Br(e){if(!kn.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Rr(t.padEnd(Math.ceil(t.length/4)*4,`=`))}const Vr=y(`$ZodBase64URL`,(e,t)=>{t.pattern??=kn,D.init(e,t),e._zod.onattach.push(e=>{e._zod.bag.contentEncoding=`base64url`}),e._zod.check=n=>{Br(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Hr=y(`$ZodE164`,(e,t)=>{t.pattern??=Mn,D.init(e,t)});function Ur(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n,i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}const Wr=y(`$ZodJWT`,(e,t)=>{D.init(e,t),e._zod.check=n=>{Ur(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Gr=y(`$ZodNumber`,(e,t)=>{E.init(e,t),e._zod.pattern=e._zod.bag.pattern??Vn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),Kr=y(`$ZodNumber`,(e,t)=>{Zn.init(e,t),Gr.init(e,t)}),qr=y(`$ZodBoolean`,(e,t)=>{E.init(e,t),e._zod.pattern=Hn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Jr=y(`$ZodBigInt`,(e,t)=>{E.init(e,t),e._zod.pattern=zn,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=BigInt(n.value)}catch{}let{value:i}=n;return typeof i==`bigint`||n.issues.push({expected:`bigint`,code:`invalid_type`,input:i,inst:e}),n}}),Yr=y(`$ZodBigInt`,(e,t)=>{Qn.init(e,t),Jr.init(e,t)}),Xr=y(`$ZodSymbol`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>{let{value:r}=t;return typeof r==`symbol`||t.issues.push({expected:`symbol`,code:`invalid_type`,input:r,inst:e}),t}}),Zr=y(`$ZodUndefined`,(e,t)=>{E.init(e,t),e._zod.pattern=Wn,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let{value:r}=t;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Qr=y(`$ZodNull`,(e,t)=>{E.init(e,t),e._zod.pattern=Un,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let{value:r}=t;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),$r=y(`$ZodAny`,(e,t)=>{E.init(e,t),e._zod.parse=e=>e}),ei=y(`$ZodUnknown`,(e,t)=>{E.init(e,t),e._zod.parse=e=>e}),ti=y(`$ZodNever`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)}),ni=y(`$ZodVoid`,(e,t)=>{E.init(e,t),e._zod.parse=(t,n)=>{let{value:r}=t;return r===void 0||t.issues.push({expected:`void`,code:`invalid_type`,input:r,inst:e}),t}}),ri=y(`$ZodDate`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=new Date(n.value)}catch{}let i=n.value,a=i instanceof Date;return a&&!Number.isNaN(i.getTime())||n.issues.push({expected:`date`,code:`invalid_type`,input:i,...a?{received:`Invalid Date`}:{},inst:e}),n}});function ii(e,t,n){e.issues.length&&t.issues.push(...Mt(n,e.issues)),t.value[n]=e.value}const ai=y(`$ZodArray`,(e,t)=>{E.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>ii(t,n,e))):ii(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function oi(e,t,n){e.issues.length&&t.issues.push(...Mt(n,e.issues)),t.value[n]=e.value}function si(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...Mt(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}const ci=y(`$ZodObject`,(e,t)=>{E.init(e,t);let n=nt(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof E))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=St(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});S(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=e=>{let t=new gr([`shape`,`payload`,`ctx`]),{keys:r,optionalKeys:i}=n.value,a=e=>{let t=ut(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let o=Object.create(null);for(let e of r)o[e]=lt(15);t.write(`const newResult = {}`);for(let e of r)if(i.has(e)){let n=o[e];t.write(`const ${n} = ${a(e)};`);let r=ut(e);t.write(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proofkit/cli",
3
- "version": "2.0.0-beta.5",
3
+ "version": "2.0.0-beta.6",
4
4
  "description": "Create web application with the ProofKit stack",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -66,8 +66,8 @@
66
66
  "shadcn": "^2.10.0",
67
67
  "sort-package-json": "^2.10.0",
68
68
  "ts-morph": "^26.0.0",
69
- "@proofkit/fmdapi": "5.0.3-beta.0",
70
- "@proofkit/typegen": "1.0.11-beta.1"
69
+ "@proofkit/typegen": "1.0.11-beta.1",
70
+ "@proofkit/fmdapi": "5.0.3-beta.0"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@auth/drizzle-adapter": "^1.1.0",
@@ -76,6 +76,7 @@
76
76
  "@planetscale/database": "^1.18.0",
77
77
  "@prisma/adapter-planetscale": "^5.14.0",
78
78
  "@prisma/client": "^5.14.0",
79
+ "@rollup/plugin-replace": "^6.0.3",
79
80
  "@t3-oss/env-nextjs": "^0.10.1",
80
81
  "@tanstack/react-query": "^5.49.2",
81
82
  "@trpc/client": "11.0.0-rc.441",