corequery 0.29.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/server/dist/server/api/create-api-router.js +3 -1
- package/server/dist/server/api/create-api-router.js.map +1 -1
- package/server/dist/server/api/handlers/about-page/v1/index.d.ts +2 -2
- package/server/dist/server/api/handlers/about-page/v1/index.js.map +1 -1
- package/server/dist/server/api/handlers/departures/v0/index.d.ts +2 -2
- package/server/dist/server/api/handlers/departures/v0/index.js +16 -13
- package/server/dist/server/api/handlers/departures/v0/index.js.map +1 -1
- package/server/dist/server/api/handlers/foda-synced-handler.d.ts +5 -0
- package/server/dist/server/api/handlers/foda-synced-handler.js +6 -0
- package/server/dist/server/api/handlers/foda-synced-handler.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-foda.d.ts +11 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-foda.js +107 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-foda.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-entry-foda.d.ts +10 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-entry-foda.js +35 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-entry-foda.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-foda.d.ts +10 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-foda.js +23 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-diagram-foda.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-foda.d.ts +10 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-foda.js +30 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-line-foda.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.d.ts +10 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.js +33 -0
- package/server/dist/server/api/handlers/foundational-data/multiversional/multiversional-stop-foda.js.map +1 -0
- package/server/dist/server/api/handlers/foundational-data/v1/index.d.ts +2 -2
- package/server/dist/server/api/handlers/foundational-data/v1/index.js +6 -4
- package/server/dist/server/api/handlers/foundational-data/v1/index.js.map +1 -1
- package/server/dist/server/api/handlers/service/v0/index.d.ts +2 -2
- package/server/dist/server/api/handlers/service/v0/index.js +18 -15
- package/server/dist/server/api/handlers/service/v0/index.js.map +1 -1
- package/server/dist/server/api/handlers/version-check/v1/index.d.ts +2 -2
- package/server/dist/server/api/handlers/version-check/v1/index.js.map +1 -1
- package/server/dist/server/api/handlers/versions/v1/index.d.ts +2 -2
- package/server/dist/server/api/handlers/versions/v1/index.js +1 -3
- package/server/dist/server/api/handlers/versions/v1/index.js.map +1 -1
- package/server/dist/server/api/types.d.ts +8 -1
- package/server/dist/server/corequery.d.ts +2 -0
- package/server/dist/server/corequery.js +12 -0
- package/server/dist/server/corequery.js.map +1 -1
- package/server/dist/server/data/line-diagram-entry.d.ts +0 -3
- package/server/dist/server/data/line-diagram-entry.js +1 -18
- package/server/dist/server/data/line-diagram-entry.js.map +1 -1
- package/server/dist/server/data/line-diagram.d.ts +0 -3
- package/server/dist/server/data/line-diagram.js +0 -6
- package/server/dist/server/data/line-diagram.js.map +1 -1
- package/server/dist/server/data/line.d.ts +0 -3
- package/server/dist/server/data/line.js +1 -10
- package/server/dist/server/data/line.js.map +1 -1
- package/server/dist/server/data/location.d.ts +0 -3
- package/server/dist/server/data/location.js +0 -6
- package/server/dist/server/data/location.js.map +1 -1
- package/server/dist/server/data/stop.d.ts +0 -3
- package/server/dist/server/data/stop.js +0 -9
- package/server/dist/server/data/stop.js.map +1 -1
- package/server/dist/shared/apis/departures/v0/index.d.ts +20 -17
- package/server/dist/shared/apis/departures/v0/index.js +3 -47
- package/server/dist/shared/apis/departures/v0/index.js.map +1 -1
- package/server/dist/shared/apis/foda-synced-result.d.ts +5 -0
- package/server/dist/shared/apis/foda-synced-result.js +8 -0
- package/server/dist/shared/apis/foda-synced-result.js.map +1 -0
- package/server/dist/shared/apis/foundational-data/v1/foundational-data.d.ts +2 -5
- package/server/dist/shared/apis/foundational-data/v1/foundational-data.js +3 -7
- package/server/dist/shared/apis/foundational-data/v1/foundational-data.js.map +1 -1
- package/server/dist/shared/apis/foundational-data/v1/index.d.ts +1 -0
- package/server/dist/shared/apis/service/v0/index.d.ts +21 -18
- package/server/dist/shared/apis/service/v0/index.js +3 -4
- package/server/dist/shared/apis/service/v0/index.js.map +1 -1
- package/server/dist/shared/apis/types.d.ts +1 -3
- package/server/dist/shared/apis/types.js +1 -1
- package/server/dist/shared/apis/types.js.map +1 -1
- package/web/dist/assets/About-DGmg1TM-.js +1 -0
- package/web/dist/assets/{AdminControls-BRkz2H1D.js → AdminControls-T05hoDB-.js} +1 -1
- package/web/dist/assets/Alert-DfpdtaOB.js +1 -0
- package/web/dist/assets/Debug-Q4Vy4lZ_.js +1 -0
- package/web/dist/assets/{Home-Bimr0Ebg.js → Home-C6T20k8G.js} +1 -1
- package/web/dist/assets/Line-6nd7KD0E.js +1 -0
- package/web/dist/assets/NotFound-BozS7u6u.js +1 -0
- package/web/dist/assets/NotFoundPage-UhXr10a9.js +1 -0
- package/web/dist/assets/{Picker-B59cZ5e5.js → Picker-D-TjVZAI.js} +1 -1
- package/web/dist/assets/Service-CkHxNopv.js +1 -0
- package/web/dist/assets/{Settings-CcUztzue.js → Settings-Ccrmh7u8.js} +1 -1
- package/web/dist/assets/{SimpleMobileHeaderContent-9gskaqRe.js → SimpleMobileHeaderContent-Ja68XAJd.js} +1 -1
- package/web/dist/assets/{Status-Brsavasr.js → Status-CO5w5a1E.js} +1 -1
- package/web/dist/assets/Stop-BWZOcpvU.js +1 -0
- package/web/dist/assets/{ZenMode-D8bVmCaS.js → ZenMode-C3S7FmYt.js} +1 -1
- package/web/dist/assets/index-CrhwkQ9k.js +2 -0
- package/web/dist/assets/{index-BQNbqGv2.css → index-DJPX60jz.css} +1 -1
- package/web/dist/assets/linear-CtNhjlrM.js +1 -0
- package/web/dist/assets/use-api-BJomuYg6.js +55 -0
- package/web/dist/assets/use-foda-synced-query-BM-OPAql.js +1 -0
- package/web/dist/assets/{use-simple-headers-CovxFlVs.js → use-simple-headers-Cbv0t_De.js} +1 -1
- package/web/dist/index.html +3 -3
- package/web/dist/reset.html +8 -4
- package/web/dist/sw.js +1 -1
- package/server/dist/server/api/handlers/foundational-data/v1/builder.d.ts +0 -11
- package/server/dist/server/api/handlers/foundational-data/v1/builder.js +0 -44
- package/server/dist/server/api/handlers/foundational-data/v1/builder.js.map +0 -1
- package/web/dist/assets/About-BFYcBory.js +0 -1
- package/web/dist/assets/Alert-D41vPACK.js +0 -1
- package/web/dist/assets/Debug-CdyB6z1N.js +0 -1
- package/web/dist/assets/Line-DG7fDqpF.js +0 -1
- package/web/dist/assets/NotFound-DS9pNgRR.js +0 -1
- package/web/dist/assets/NotFoundPage-rHyFGsin.js +0 -1
- package/web/dist/assets/Service-CscfW4h8.js +0 -1
- package/web/dist/assets/Stop-mET1TOC2.js +0 -1
- package/web/dist/assets/index-DapCozyq.js +0 -2
- package/web/dist/assets/linear-eK93gfBn.js +0 -1
- package/web/dist/assets/use-query-BRsiAaVY.js +0 -55
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import{g as e,h as t}from"./use-nav-exemptions-QtGbfEPT.js";function n(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 r(e,t=`|`){return e.map(e=>ce(e)).join(t)}function i(e,t){return typeof t==`bigint`?t.toString():t}var a=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function o(e){return new a(e)}function s(e){return e==null}function c(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function l(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function u(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function d(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function f(e){return d(e._zod.def)??e._zod.def.shape}function p(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return u(this,t,e),e},enumerable:!0,configurable:!0})}function m(e,t,n){t in e?u(e,t,n):e[t]=n}function h(e,t,n,r){let i=f(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?p(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):m(e,a,r?r(n.value,a):n.value))}}function ee(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?p(e,n,()=>t[n]):m(e,n,r.value))}}function g(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function te(e){return JSON.stringify(e)}function ne(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var re=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ie(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ae=o(()=>{if(k.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function _(e){if(ie(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ie(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function oe(e){return _(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var se=new Set([`string`,`number`,`symbol`]);function v(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function y(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function b(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 ce(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function le(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var ue={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},de={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function fe(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return h(i,e,pe(e,t)),y(e,g(n,{shape:i,checks:[]}))}function pe(e,t){let n=f(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function me(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(pe(e,t)),a={};return h(a,e,Reflect.ownKeys(f(e)).filter(e=>!i.has(e))),y(e,g(n,{shape:a,checks:[]}))}function he(e,t){if(!_(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=f(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return y(e,g(e._zod.def,{shape:ge(e,t)}))}function ge(e,t){let n={};return h(n,e,Reflect.ownKeys(f(e))),ee(n,t),n}function _e(e,t){if(!_(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return y(e,g(e._zod.def,{shape:ge(e,t)}))}function ve(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return h(n,e,Reflect.ownKeys(f(e))),h(n,t,Reflect.ownKeys(f(t))),y(e,g(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function ye(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(pe(t,n)):void 0,o={};return h(o,t,Reflect.ownKeys(f(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),y(t,g(t._zod.def,{shape:o,checks:[]}))}function be(e,t,n){let r=n?new Set(pe(t,n)):void 0,i={};return h(i,t,Reflect.ownKeys(f(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),y(t,g(t._zod.def,{shape:i}))}function x(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 xe(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Se(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function S(e){return typeof e==`string`?e:e?.message}function Ce(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function we(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function C(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:S(e.inst?._zod.def?.error?.(e))??S(a?.(e))??S(t?.error?.(e))??S(n.customError?.(e))??S(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var Te=/[\uD800-\uDBFF]/;function Ee(e){let t=e.length;if(!Te.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function De(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Oe(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function ke(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Ae(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Ne(e,n,r.value)}}function w(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function je(e,t,n){return w(e,t,n,!1)}function Me(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return w(this,n,r(this))},set(e){w(this,n,e)}})}return t}function Ne(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:w(this,t,n.bind(this))},set(e){w(this,t,e)}})}function Pe(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Fe,T=!1,Ie={configurable:!0,get(){T=!0}};function E(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Fe!==e._zod?Fe=void 0:(Fe=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Ie);let e=T;T=!1;try{let r=n(this);return T?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),T||=e,r}catch(n){throw delete this[t],T||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function Le(e,t,n,r){let i=Pe(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Re=`~constantCatch`;function ze(e){let t=()=>e;return t[Re]=!0,t}var Be,Ve={value:void 0,enumerable:!1},He=`captureStackTrace`in Error?Error:null;function Ue(e){let t=He;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return He=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function D(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Ve.value=new a(r);try{Object.defineProperty(n,"_zod",Ve)}finally{Ve.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Ae(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Ue(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var O=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},We=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Be=globalThis).__zod_globalConfig??(Be.__zod_globalConfig={});var k=globalThis.__zod_globalConfig;function A(e){return e&&Object.assign(k,e),k}function Ge(){let e=this._zod;return e.message??=JSON.stringify(e.def,i,2),e.message}function Ke(e){this._zod.message=e}var qe={get:Ge,set:Ke,enumerable:!0,configurable:!0},Je={value:void 0,enumerable:!1},Ye=new WeakSet([Object.prototype,Error.prototype]),Xe=D(`$ZodError`,(e,t)=>{e.name=`$ZodError`,Je.value=t,Object.defineProperty(e,"issues",Je),Je.value=void 0,Object.defineProperty(e,"message",qe);let n=Object.getPrototypeOf(e);Ye.has(n)||(Ye.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))});function Ze(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Qe(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Ze(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function $e(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function et(e,t){return{callee:t?.callee??e,Err:t?.Err}}var tt=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new O;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>C(e,o,A())));throw re(n,a?.callee??t),n}return s.value};return t},nt=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>C(e,o,A())));throw re(n,a?.callee??t),n}return s.value};return t},rt=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 O;return a.issues.length?it(e,a.issues,i):{success:!0,data:a.value}};function it(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>C(e,n,A()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var at=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?it(e,a.issues,i):{success:!0,data:a.value}},ot=Symbol.for(`zod.compile.invalid`),st=Symbol.for(`zod.compile.fallback`),ct=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==ot)return!0;if(r.definite===!0&&n===void 0)return!1}return lt(e,t,n)});function lt(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[st]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new O;return a.issues.length===0}var ut=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},dt=e=>{let t=tt(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,et(n,a))};return n},ft=e=>{let t=tt(e),n=(e,r,i,a)=>t(e,r,i,et(n,a));return n},pt=e=>{let t=nt(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,et(n,a))};return n},mt=e=>{let t=nt(e),n=async(e,r,i,a)=>await t(e,r,i,et(n,a));return n},ht=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return rt(e)(t,n,i)},gt=e=>(t,n,r)=>rt(e)(t,n,r),_t=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return at(e)(t,n,i)},vt=e=>async(t,n,r)=>at(e)(t,n,r),yt=/^[cC][0-9a-z]{6,}$/,bt=/^[0-9a-z]+$/,xt=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,St=/^[0-9a-vA-V]{20}$/,Ct=/^[A-Za-z0-9]{27}$/,wt=/^[a-zA-Z0-9_-]{21}$/;function Tt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Et=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Dt=/^([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})$/,Ot=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|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,kt=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,At=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function jt(){return new RegExp(At,`u`)}var Mt=/^(?:(?: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])$/,Nt=/^(([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}|:))$/,Pt=/^((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])$/,Ft=/^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,It=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Lt=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Rt=/^https?$/,zt=/^\+[1-9]\d{6,14}$/,Bt=`(?:(?:\\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])))`;function Vt(e){return RegExp(`^${e}$`)}var Ht=Vt(Bt);function Ut(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}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Wt(e){return RegExp(`^${Ut(e)}$`)}function Gt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Ut({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Ut({precision:e.precision})}`:n;return RegExp(`^${Bt}T(?:${r})$`)}var Kt=/^[\s\S]{0,}$/,qt=/^-?\d+(?:\.\d+)?$/,Jt=/^(?:true|false)$/i,Yt=/^[^A-Z]*$/,Xt=/^[^a-z]*$/,j=D(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Zt=e=>{let t=e.value;return!s(t)&&t.length!==void 0},Qt={number:`number`,bigint:`bigint`,object:`date`},$t=D(`$ZodCheckLessThan`,(e,t)=>{j.init(e,t);let n=Qt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:Qt[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),en=D(`$ZodCheckGreaterThan`,(e,t)=>{j.init(e,t);let n=Qt[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:Qt[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),tn=D(`$ZodCheckMultipleOf`,(e,t)=>{j.init(e,t),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`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):l(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})}}),nn=D(`$ZodCheckNumberFormat`,(e,t)=>{j.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ue[t.format];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`,continue:!1,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,inclusive:!0,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,inclusive:!0,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,inclusive:!0,inst:e,continue:!t.abort})}}),rn=D(`$ZodCheckMaxLength`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Ee(r):i)<=t.maximum)return;let a=De(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),an=D(`$ZodCheckMinLength`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Ee(r):i)>=t.minimum)return;let a=De(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),on=D(`$ZodCheckLengthEquals`,(e,t)=>{var n;j.init(e,t),(n=e._zod.def).when??(n.when=Zt),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Ee(r):i;if(a===t.length)return;let o=De(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),sn=D(`$ZodCheckStringFormat`,(e,t)=>{var n,r;j.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{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})}):(r=e._zod).check??(r.check=()=>{})}),cn=D(`$ZodCheckRegex`,(e,t)=>{sn.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})}}),ln=D(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Yt,sn.init(e,t)}),un=D(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Xt,sn.init(e,t)}),dn=D(`$ZodCheckIncludes`,(e,t)=>{j.init(e,t);let n=v(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),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})}}),fn=D(`$ZodCheckStartsWith`,(e,t)=>{j.init(e,t);let n=RegExp(`^${v(t.prefix)}.*`);t.pattern??=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})}}),pn=D(`$ZodCheckEndsWith`,(e,t)=>{j.init(e,t);let n=RegExp(`.*${v(t.suffix)}$`);t.pattern??=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})}}),mn=D(`$ZodCheckOverwrite`,(e,t)=>{j.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),hn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
+
`).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?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
3
|
+
`)}\n};`)(...Object.values(this.closed))}},gn={major:4,minor:6,patch:7},M=D(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gn;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=x(t),a;for(let o of n){if(o._zod.def.when){if(xe(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new O;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(we(t.issues,n,e),i||=x(t,n))});else{if(t.issues.length===n)continue;we(t.issues,n,e),i||=x(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(x(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new O;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new O;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return je(this,`~standard`,yn(this))},set"~standard"(e){w(this,`~standard`,e)}}),_n=(e,t)=>e.issues.length?{issues:e.issues.map(e=>C(e,t,A()))}:{value:e.value};async function vn(e,t){let n={async:!0};return _n(await e._zod.run({value:t,issues:[]},n),n)}function yn(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return _n(r,n)}catch{}return vn(e,t)},vendor:`zod`,version:1}}var bn=D(`$ZodString`,(e,t)=>{M.init(e,t),e._zod.pattern=t.pattern??Kt,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}}),N=D(`$ZodStringFormat`,(e,t)=>{sn.init(e,t),bn.init(e,t)}),xn=D(`$ZodGUID`,(e,t)=>{t.pattern??=Dt,N.init(e,t)}),Sn=D(`$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??=Ot(e)}else t.pattern??=Ot();N.init(e,t)}),Cn=D(`$ZodEmail`,(e,t)=>{t.pattern??=kt,N.init(e,t)});function wn(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Tn(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?wn(e)||2:En(e,t)}function En(e,t){if(!t.normalize&&t.protocol?.source===Rt.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Dn=/[\t\n\r]/g;function On(e){return e.replace(Dn,``)}function kn(e,t){return t.lastIndex=0,t.test(e.hostname)}function An(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var jn=D(`$ZodURL`,(e,t)=>{N.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Tn(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=On(r);return}t.hostname&&!kn(i,t.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&&!An(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:On(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Mn=D(`$ZodEmoji`,(e,t)=>{t.pattern??=jt(),N.init(e,t)}),Nn=D(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?wt:Tt(t.length),N.init(e,t)}),Pn=D(`$ZodCUID`,(e,t)=>{t.pattern??=yt,N.init(e,t)}),Fn=D(`$ZodCUID2`,(e,t)=>{t.pattern??=bt,N.init(e,t)}),In=D(`$ZodULID`,(e,t)=>{t.pattern??=xt,N.init(e,t)}),Ln=D(`$ZodXID`,(e,t)=>{t.pattern??=St,N.init(e,t)}),Rn=D(`$ZodKSUID`,(e,t)=>{t.pattern??=Ct,N.init(e,t)}),zn=D(`$ZodISODateTime`,(e,t)=>{t.pattern??=Gt(t),N.init(e,t)}),Bn=D(`$ZodISODate`,(e,t)=>{t.pattern??=Ht,N.init(e,t)}),Vn=D(`$ZodISOTime`,(e,t)=>{t.pattern??=Wt(t),N.init(e,t)}),Hn=D(`$ZodISODuration`,(e,t)=>{t.pattern??=Et,N.init(e,t)}),Un=D(`$ZodIPv4`,(e,t)=>{t.pattern??=Mt,N.init(e,t)}),Wn=/^[0-9a-fA-F:.]+$/;function Gn(e){return Wn.test(e)?wn(`http://[${e}]`):!1}var Kn=D(`$ZodIPv6`,(e,t)=>{t.pattern??=Nt,N.init(e,t),e._zod.check=n=>{Gn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),qn=D(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Pt,N.init(e,t)});function Jn(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Gn(n)}var Yn=D(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ft,N.init(e,t),e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function Xn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Zn=/^[0-9a-zA-Z+/]*={0,2}$/,Qn=D(`$ZodBase64`,(e,t)=>{t.pattern??=Zn,N.init(e,t),e._zod.check=n=>{Xn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),$n=/^[A-Za-z0-9_-]*$/;function er(e){if(!$n.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Xn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var tr=D(`$ZodBase64URL`,(e,t)=>{t.pattern??=$n,N.init(e,t),e._zod.check=n=>{er(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),nr=D(`$ZodE164`,(e,t)=>{t.pattern??=zt,N.init(e,t)});function rr(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var ir=D(`$ZodJWT`,(e,t)=>{N.init(e,t),e._zod.check=n=>{rr(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),ar=D(`$ZodNumber`,(e,t)=>{M.init(e,t),e._zod.pattern=qt,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:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),or=D(`$ZodNumberFormat`,(e,t)=>{nn.init(e,t),ar.init(e,t)}),sr=D(`$ZodBoolean`,(e,t)=>{M.init(e,t),e._zod.pattern=Jt,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}}),cr=D(`$ZodUnknown`,(e,t)=>{M.init(e,t),e._zod.parse=e=>e}),lr=D(`$ZodNever`,(e,t)=>{M.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ur(e,t){let n=Ce(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of Ce(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,we(n.issues,t,e),n}}return i(n,a)}}var dr=e=>Array.isArray(e)?e.length:-1;function fr(e,t,n){e.issues.length&&t.issues.push(...Se(n,e.issues)),t.value[n]=e.value}var pr=D(`$ZodArray`,(e,t)=>{M.init(e,t);let n=k.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>fr(t,r,e)));else if(fr(c,r,e),s&&c.issues.length!==0&&x(c))break}return o.length?Promise.all(o).then(()=>r):r},ur(e,dr)});function mr(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Se(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var hr=[];function gr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:hr,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=le(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function _r(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(x(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>mr(e,n,i,t,d,f))):mr(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var vr=D(`$ZodObject`,(e,t)=>{M.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=o(()=>gr(t));E(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||u(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=ie,s=t.catchall,c,l=k.memoizer;l?.attach(e),e._zod.parse=(t,n)=>{c??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=l?l.alloc(e,t,{},n):{};let o=[],u=c.shape,d=n?.abortEarly,f=t.issues.length;for(let e of c.allKeys){if(d&&t.issues.length!==f){if(x(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,s=i._zod.optout,c=i._zod.run({value:r[e],issues:[]},n);c instanceof Promise?o.push(c.then(n=>mr(n,t,e,r,a,s))):mr(c,t,e,r,a,s)}return s?_r(o,r,t,n,i.value,e,d===!0):o.length?Promise.all(o).then(()=>t):t}}),yr=D(`$ZodObjectJIT`,(e,t)=>{vr.init(e,t);let n=e._zod.parse,r=o(()=>gr(t)),i=k.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new hn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
4
|
+
let ${e}_ab = false;
|
|
5
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
6
|
+
const iss = ${e}.issues[i];
|
|
7
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
8
|
+
payload.issues.push(iss);
|
|
9
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
10
|
+
}
|
|
11
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
12
|
+
payload.value = newResult;
|
|
13
|
+
return payload;
|
|
14
|
+
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:te(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
15
|
+
const ${n}_present = ${i};
|
|
16
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
17
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (${e}) {
|
|
21
|
+
newResult[${r}] = ${n}.value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
`)}else f?(o.write(`
|
|
26
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
27
|
+
}
|
|
28
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
29
|
+
if (${n}.value !== undefined || ${i}) {
|
|
30
|
+
newResult[${r}] = ${n}.value;
|
|
31
|
+
}
|
|
32
|
+
`)):o.write(`
|
|
33
|
+
const ${n}_present = ${i};
|
|
34
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
35
|
+
}
|
|
36
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
37
|
+
payload.issues.push({
|
|
38
|
+
code: "invalid_type",
|
|
39
|
+
expected: "nonoptional",
|
|
40
|
+
input: undefined,
|
|
41
|
+
path: [${r}]
|
|
42
|
+
});
|
|
43
|
+
if (ctx && ctx.abortEarly) {
|
|
44
|
+
payload.value = newResult;
|
|
45
|
+
return payload;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (${n}_present) {
|
|
50
|
+
newResult[${r}] = ${n}.value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},s,c=ie,l=!k.jitless,u=l&&ae.value,d=t.catchall,f;e._zod.parse=(i,o)=>{f??=r.value;let p=i.value;return c(p)?l&&u&&o?.async===!1&&o.jitless!==!0?(s||=a(t.shape),i=s(i,o),d?_r([],p,i,o,f,e,o?.abortEarly===!0):i):n(i,o):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function br(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!x(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>C(e,r,A())))}),t)}var xr=D(`$ZodUnion`,(e,t)=>{M.init(e,t),E(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),E(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),E(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),E(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>c(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>br(t,r,e,i)):br(o,r,e,i)}}),Sr=D(`$ZodIntersection`,(e,t)=>{M.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>wr(e,t,n)):wr(e,i,a)}});function Cr(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(_(e)&&_(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Cr(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Cr(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function wr(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Cr(t.value,n.value);if(!c.valid){if(x(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Tr=D(`$ZodEnum`,(e,t)=>{M.init(e,t);let r=n(t.entries),i=new Set(r);e._zod.values=i,E(e,`pattern`,e=>{let t=n(e.def.entries).filter(e=>se.has(typeof e));return RegExp(t.length?`^(${t.map(e=>v(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,n)=>{let a=t.value;return i.has(a)||t.issues.push({code:`invalid_value`,values:r,input:a,inst:e}),t}}),Er=D(`$ZodLiteral`,(e,t)=>{M.init(e,t);let n=new Set(t.values);e._zod.values=n,E(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?v(e):e?v(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Dr=D(`$ZodTransform`,(e,t)=>{M.init(e,t),e._zod.optin=`optional`,k.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new We(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new O;return n.value=i,n}});function Or(e,t){return e.value=t.issues.length?void 0:t.value,e}var kr=D(`$ZodOptional`,(e,t)=>{M.init(e,t),E(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,E(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),E(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${c(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Or(e,t)):Or(e,r)}return t.innerType._zod.run(e,n)}}),Ar=D(`$ZodExactOptional`,(e,t)=>{kr.init(e,t),E(e,`values`,e=>e.def.innerType._zod.values),E(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),jr=D(`$ZodNullable`,(e,t)=>{M.init(e,t),E(e,`optin`,e=>e.def.innerType._zod.optin),E(e,`optout`,e=>e.def.innerType._zod.optout),E(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${c(t.source)}|null)$`):void 0}),E(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Mr=D(`$ZodDefault`,(e,t)=>{M.init(e,t),e._zod.optin=`defaulted`,E(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Nr(e,t)):Nr(r,t)}});function Nr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Pr=D(`$ZodPrefault`,(e,t)=>{M.init(e,t),e._zod.optin=`defaulted`,E(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Fr=D(`$ZodNonOptional`,(e,t)=>{M.init(e,t),E(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ir(t,e)):Ir(i,e)}});function Ir(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Lr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>C(e,r,A()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Rr=D(`$ZodCatch`,(e,t)=>{M.init(e,t),E(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),E(e,`optout`,e=>e.def.innerType._zod.optout),E(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Lr(e,r,t,n)):Lr(e,r,t,n)}}),zr=D(`$ZodPipe`,(e,t)=>{M.init(e,t),E(e,`values`,e=>e.def.in._zod.values),E(e,`optin`,e=>e.def.in._zod.optin),E(e,`optout`,e=>e.def.out._zod.optout),E(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Br(e,t.in,n)):Br(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Br(e,t.out,n)):Br(r,t.out,n)}});function Br(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Vr=D(`$ZodReadonly`,(e,t)=>{M.init(e,t),E(e,`propValues`,e=>e.def.innerType._zod.propValues),E(e,`values`,e=>e.def.innerType._zod.values),E(e,`optin`,e=>e.def.innerType?._zod?.optin),E(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Hr):Hr(r)}});function Hr(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Ur=D(`$ZodCustom`,(e,t)=>{j.init(e,t),M.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Wr(t,n,r,e));Wr(i,n,r,e)}});function Wr(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ke(e))}}var Gr=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Kr=`~memo`,qr=[];function Jr(e){return typeof e==`object`&&!!e}function Yr(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Xr=new WeakMap,P=0,Zr=1,F=2;function Qr(e,t,n){let r=Xr.get(e);if(r!==void 0)return r?F:P;if(t.has(e))return F;t.add(e);let i=P,a=e=>{if(i!==F&&e?._zod){let r=Qr(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=P;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?Zr:o.value?._zod?Qr(o.value,t,n):P;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=d(c);s(e?o(e,!0):Zr),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?Qr(r,t,!1):Zr);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),$r(e,i)}function $r(e,t){return t!==Zr&&Xr.set(e,t===F),t}function ei(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var ti,ni=[],ri={alloc(e,t,n){let r=ti;if(!r)return n;ti=void 0;let i={value:n,issues:null};return r.set(t.value,i),ni.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&ai(n,e.value))throw new Gr;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=Qr(e,new Set,!1);if(i===P)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===F||r?n=!0:r=!0}let l=s.value;if(!Jr(l))return t(s,c);let u=c[Kr];u||(u={buckets:new WeakMap,backEdges:void 0},c[Kr]=u);let d;i===c?d=a:(d=ei(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...Yr(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;ti=d;let p=ni.length,m=t(s,c);ti=void 0;let h=ni.length>p?ni.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?Yr(e.issues):qr),e)):(h&&(h.issues=m.issues.length?Yr(m.issues):qr),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function ii(){return ri}function ai(e,t){let n=e[Kr]?.backEdges;return n!==void 0&&Jr(t)&&n.has(t)}var oi=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},i={nan:`NaN`};function a(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):i[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${a(e.expected)}, received ${a(Oe(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${ce(e.values[0])}`:`Invalid option: expected one of ${r(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${r(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function si(){return{localeError:oi()}}var ci,li=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function ui(){return new li}(ci=globalThis).__zod_globalRegistry??(ci.__zod_globalRegistry=ui());var I=globalThis.__zod_globalRegistry;function di(e){return e.checks&&=[...e.checks],e}function fi(e,t){return new e(di({type:`string`,...b(t)}))}function pi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...b(t)})}function mi(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...b(t)})}function hi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...b(t)})}function gi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...b(t)})}function _i(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...b(t)})}function vi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...b(t)})}function yi(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...b(t)})}function bi(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...b(t)})}function xi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...b(t)})}function Si(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...b(t)})}function Ci(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...b(t)})}function wi(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...b(t)})}function Ti(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...b(t)})}function Ei(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...b(t)})}function Di(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...b(t)})}function Oi(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...b(t)})}function ki(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...b(t)})}function Ai(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...b(t)})}function ji(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...b(t)})}function Mi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...b(t)})}function Ni(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...b(t)})}function Pi(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...b(t)})}function Fi(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...b(t)})}function Ii(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...b(t)})}function Li(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...b(t)})}function Ri(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...b(t)})}function zi(e,t){return new e(di({type:`number`,checks:[],...b(t)}))}function Bi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...b(t)})}function Vi(e,t){return new e({type:`boolean`,...b(t)})}function Hi(e){return new e({type:`unknown`})}function Ui(e,t){return new e({type:`never`,...b(t)})}function Wi(e,t){return new $t({check:`less_than`,...b(t),value:e,inclusive:!1})}function Gi(e,t){return new $t({check:`less_than`,...b(t),value:e,inclusive:!0})}function Ki(e,t){return new en({check:`greater_than`,...b(t),value:e,inclusive:!1})}function qi(e,t){return new en({check:`greater_than`,...b(t),value:e,inclusive:!0})}function Ji(e,t){return new tn({check:`multiple_of`,...b(t),value:e})}function Yi(e,t){return new rn({check:`max_length`,...b(t),maximum:e})}function Xi(e,t){return new an({check:`min_length`,...b(t),minimum:e})}function Zi(e,t){return new on({check:`length_equals`,...b(t),length:e})}function Qi(e,t){return new cn({check:`string_format`,format:`regex`,...b(t),pattern:e})}function $i(e){return new ln({check:`string_format`,format:`lowercase`,...b(e)})}function ea(e){return new un({check:`string_format`,format:`uppercase`,...b(e)})}function ta(e,t){return new dn({check:`string_format`,format:`includes`,...b(t),includes:e})}function na(e,t){return new fn({check:`string_format`,format:`starts_with`,...b(t),prefix:e})}function ra(e,t){return new pn({check:`string_format`,format:`ends_with`,...b(t),suffix:e})}function L(e){return new mn({check:`overwrite`,tx:e})}function ia(e){return L(t=>t.normalize(e))}function aa(){return L(e=>e.trim())}function oa(){return L(e=>e.toLowerCase())}function sa(){return L(e=>e.toUpperCase())}function ca(){return L(e=>ne(e))}function la(e,t,n){return new e({type:`array`,element:t,...b(n)})}function ua(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...b(n)})}function da(e,t){let n=fa(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ke(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ke(r))}},e(t.value,t)),t);return n}function fa(e,t){let n=new j({check:`custom`,...b(t)});return n._zod.check=e,n}function pa(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&u(e,t,n[t]);return e}function ma(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??I,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function R(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function z(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,z(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&pa(o.schema,c),t.io===`input`&&B(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ha(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function ga(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${ha(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+ha(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
54
|
+
|
|
55
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0])a(n);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function _a(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;_a(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var va=new Set([`type`,`properties`,`required`,`additionalProperties`]),ya=[`oneOf`,`anyOf`];function ba(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function xa(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!va.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??ba(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}u(n,r,e.length===1?e[0]:xa(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=ba(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Sa(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of va)if(t in e)return;let n=t.filter(e=>ya.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=xa(t);else{let e=n[0],i=ya.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>xa([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,pa(e,r))}function Ca(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):pa(i,s),pa(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())_a(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Sa(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}pa(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,u(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Ta(t,`input`,e.processors),output:Ta(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function B(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return B(r.element,n);if(r.type===`set`)return B(r.valueType,n);if(r.type===`lazy`)return B(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return B(r.innerType,n);if(r.type===`intersection`)return B(r.left,n)||B(r.right,n);if(r.type===`record`||r.type===`map`)return B(r.keyType,n)||B(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:B(r.in,n)||B(r.out,n);if(r.type===`object`){for(let e in r.shape)if(B(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(B(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(B(e,n))return!0;return!!(r.rest&&B(r.rest,n))}return!1}var wa=(e,t={})=>n=>{let r=ma({...n,processors:t});return z(e,r),ga(r,e),Ca(r,e)},Ta=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ma({...i??{},target:a,io:t,processors:n});return z(e,o),ga(o,e),Ca(o,e)},V=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},H=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},Ea=(e,t)=>{V(e,`minimum`,t),H(e,`maximum`,t)},Da=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Oa=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},ka=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Aa=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},ja=(e,t)=>V(e,`minimum`,t.minimum),Ma=(e,t)=>H(e,`maximum`,t.maximum),Na=e=>(t,n)=>{Aa(t,n.format);let[r,i]=e[n.format];V(t,`minimum`,r),H(t,`maximum`,i)},Pa={greater_than:(e,t)=>V(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>H(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Da(e,t.value),number_format:Na(ue),bigint_format:Na(de),min_length:ja,max_length:Ma,length_equals:(e,t)=>Ea(e,t.length),min_size:ja,max_size:Ma,size_equals:(e,t)=>Ea(e,t.size),string_format:(e,t)=>{Aa(e,t.format),t.pattern&&Oa(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>ka(e,t.mime)};function U(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)Pa[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&V(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&V(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&H(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&H(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Da(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&ka(t,i.mime);for(let e of i.patterns??[])Oa(t,e);return t}var Fa={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ia=new Map([[Zn,It],[$n,Lt]]),La=e=>Ia.get(e)??e,Ra=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=U(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Fa[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(La);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},za=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=U(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):R(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},Ba=(e,t,n,r)=>{n.type=`boolean`},Va=(e,t,n,r)=>{n.not={}},Ha=(e,t,r,i)=>{let a=e._zod.def,o=n(a.entries);o.length===0?r.not={}:(o.every(e=>typeof e==`number`)&&(r.type=`number`),o.every(e=>typeof e==`string`)&&(r.type=`string`),r.enum=o)},Ua=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(R(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(R(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Wa=(e,t,n,r)=>{R(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Ga=(e,t,n,r)=>{R(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ka=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=U(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=z(a.element,t,{...r,path:[...r.path,`items`]})};function qa(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?qa(t.out):t.type===`catch`?qa(t.innerType):e._zod.optin}var Ja=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&R(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)u(i.properties,e,z(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?qa(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=z(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ya=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>z(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Xa=(e,t,n,r)=>{let i=e._zod.def,a=z(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=z(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Za=(e,t,n,r)=>{let i=e._zod.def,a=z(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Qa=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},$a=Symbol();function eo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(R(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),$a):JSON.parse(o)}var to=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=eo(i.defaultValue,e,t,n,r);o!==$a&&(n.default=o)},no=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=eo(i.defaultValue,e,t,n,r);o!==$a&&(n._prefault=o)},ro=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{R(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},io=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;z(o,t,r);let s=t.seen.get(e);s.ref=o},ao=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},oo=(e,t,n,r)=>{let i=e._zod.def;z(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},so=new WeakSet([Object.prototype,Error.prototype]);function co(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var W=D(`ZodError`,(e,t)=>{Xe.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);so.has(n)||(so.add(n),co(n,`format`,e=>t=>$e(e,t)),co(n,`flatten`,e=>t=>Qe(e,t)),co(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,i,2)}),co(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,i,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),lo=tt(W),uo=nt(W),fo=rt(W),po=at(W),mo=dt(W),ho=ft(W),go=pt(W),_o=mt(W),vo=ht(W),yo=gt(W),bo=_t(W),xo=vt(W);function So(){k.localeError||A(si())}function Co(){k.memoizer||A({memoizer:ii()})}var G=D(`ZodType`,(e,t)=>(So(),M.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(g(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return y(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ns(e,t))},superRefine(e,t){return this.check(Ps(e,t))},overwrite(e){return this.check(L(e))},optional(){return hs(this)},exactOptional(){return _s(this)},nullable(){return ys(this)},nullish(){return hs(ys(this))},nonoptional(e){return Ts(this,e)},array(){return as(this)},or(e){return X([this,e])},and(e){return ls(this,e)},transform(e){return ks(this,ps(e))},default(e){return xs(this,e)},prefault(e){return Cs(this,e)},catch(e){return Ds(this,e)},pipe(e){return ks(this,e)},readonly(){return js(this)},describe(e){let t=this.clone();return I.add(t,{description:e}),t},meta(...e){if(e.length===0)return I.get(this);let t=this.clone();return I.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return je(this,`~standard`,{...yn(this),jsonSchema:{input:Ta(this,`input`),output:Ta(this,`output`)}})},set"~standard"(e){w(this,`~standard`,e)},parse:function e(t,n){return lo(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await uo(this,t,n,{callee:e})},safeParse(e,t){return fo(this,e,t)},async safeParseAsync(e,t){return po(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){w(this,`spa`,e)},validate(e,t){return ct(this,e,t)},validateAsync(e,t){return ut(this,e,t)},encode:function e(t,n){return mo(this,t,n,{callee:e})},decode:function e(t,n){return ho(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await go(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await _o(this,t,n,{callee:e})},safeEncode(e,t){return vo(this,e,t)},safeDecode(e,t){return yo(this,e,t)},async safeEncodeAsync(e,t){return bo(this,e,t)},async safeDecodeAsync(e,t){return xo(this,e,t)},toJSONSchema(e){return wa(this,{})(e)},get description(){return I.get(this)?.description},get _def(){return this._zod.def}}),wo=D(`_ZodString`,(e,t)=>{bn.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ra(e,t,n,r)},Me({format:e=>U(e).format??null,minLength:e=>U(e).minimum??null,maxLength:e=>U(e).maximum??null},{regex(...e){return this.check(Qi(...e))},includes(...e){return this.check(ta(...e))},startsWith(...e){return this.check(na(...e))},endsWith(...e){return this.check(ra(...e))},min(...e){return this.check(Xi(...e))},max(...e){return this.check(Yi(...e))},length(...e){return this.check(Zi(...e))},nonempty(...e){return this.check(Xi(1,...e))},lowercase(e){return this.check($i(e))},uppercase(e){return this.check(ea(e))},trim(){return this.check(aa())},normalize(...e){return this.check(ia(...e))},toLowerCase(){return this.check(oa())},toUpperCase(){return this.check(sa())},slugify(){return this.check(ca())}})),To=D(`ZodString`,(e,t)=>{bn.init(e,t),wo.init(e,t)},{email(e){return this.check(pi(Ao,e))},url(e){return this.check(yi(No,e))},jwt(e){return this.check(Pi(Jo,e))},emoji(e){return this.check(bi(Po,e))},guid(e){return this.check(mi(jo,e))},uuid(e){return this.check(hi(Mo,e))},uuidv4(e){return this.check(gi(Mo,e))},uuidv6(e){return this.check(_i(Mo,e))},uuidv7(e){return this.check(vi(Mo,e))},nanoid(e){return this.check(xi(Fo,e))},cuid(e){return this.check(Si(Io,e))},cuid2(e){return this.check(Ci(Lo,e))},ulid(e){return this.check(wi(Ro,e))},base64(e){return this.check(ji(Go,e))},base64url(e){return this.check(Mi(Ko,e))},xid(e){return this.check(Ti(zo,e))},ksuid(e){return this.check(Ei(Bo,e))},ipv4(e){return this.check(Di(Vo,e))},ipv6(e){return this.check(Oi(Ho,e))},cidrv4(e){return this.check(ki(Uo,e))},cidrv6(e){return this.check(Ai(Wo,e))},e164(e){return this.check(Ni(qo,e))},datetime(e){return this.check(Fi(Eo,e))},date(e){return this.check(Ii(Do,e))},time(e){return this.check(Li(Oo,e))},duration(e){return this.check(Ri(ko,e))}});function K(e){return fi(To,e)}var q=D(`ZodStringFormat`,(e,t)=>{N.init(e,t),wo.init(e,t)}),Eo=D(`ZodISODateTime`,(e,t)=>{zn.init(e,t),q.init(e,t)}),Do=D(`ZodISODate`,(e,t)=>{Bn.init(e,t),q.init(e,t)}),Oo=D(`ZodISOTime`,(e,t)=>{Vn.init(e,t),q.init(e,t)}),ko=D(`ZodISODuration`,(e,t)=>{Hn.init(e,t),q.init(e,t)}),Ao=D(`ZodEmail`,(e,t)=>{Cn.init(e,t),q.init(e,t)}),jo=D(`ZodGUID`,(e,t)=>{xn.init(e,t),q.init(e,t)}),Mo=D(`ZodUUID`,(e,t)=>{Sn.init(e,t),q.init(e,t)}),No=D(`ZodURL`,(e,t)=>{jn.init(e,t),q.init(e,t)}),Po=D(`ZodEmoji`,(e,t)=>{Mn.init(e,t),q.init(e,t)}),Fo=D(`ZodNanoID`,(e,t)=>{Nn.init(e,t),q.init(e,t)}),Io=D(`ZodCUID`,(e,t)=>{Pn.init(e,t),q.init(e,t)}),Lo=D(`ZodCUID2`,(e,t)=>{Fn.init(e,t),q.init(e,t)}),Ro=D(`ZodULID`,(e,t)=>{In.init(e,t),q.init(e,t)}),zo=D(`ZodXID`,(e,t)=>{Ln.init(e,t),q.init(e,t)}),Bo=D(`ZodKSUID`,(e,t)=>{Rn.init(e,t),q.init(e,t)}),Vo=D(`ZodIPv4`,(e,t)=>{Un.init(e,t),q.init(e,t)}),Ho=D(`ZodIPv6`,(e,t)=>{Kn.init(e,t),q.init(e,t)}),Uo=D(`ZodCIDRv4`,(e,t)=>{qn.init(e,t),q.init(e,t)}),Wo=D(`ZodCIDRv6`,(e,t)=>{Yn.init(e,t),q.init(e,t)}),Go=D(`ZodBase64`,(e,t)=>{Qn.init(e,t),q.init(e,t)}),Ko=D(`ZodBase64URL`,(e,t)=>{tr.init(e,t),q.init(e,t)}),qo=D(`ZodE164`,(e,t)=>{nr.init(e,t),q.init(e,t)}),Jo=D(`ZodJWT`,(e,t)=>{ir.init(e,t),q.init(e,t)}),Yo=D(`ZodNumber`,(e,t)=>{ar.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r),e.isFinite=!0},Me({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=U(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=U(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=U(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>U(e).format??null},{gt(e,t){return this.check(Ki(e,t))},gte(e,t){return this.check(qi(e,t))},min(e,t){return this.check(qi(e,t))},lt(e,t){return this.check(Wi(e,t))},lte(e,t){return this.check(Gi(e,t))},max(e,t){return this.check(Gi(e,t))},int(e){return this.check(Zo(e))},safe(e){return this.check(Zo(e))},positive(e){return this.check(Ki(0,e))},nonnegative(e){return this.check(qi(0,e))},negative(e){return this.check(Wi(0,e))},nonpositive(e){return this.check(Gi(0,e))},multipleOf(e,t){return this.check(Ji(e,t))},step(e,t){return this.check(Ji(e,t))},finite(){return this}}));function J(e){return zi(Yo,e)}var Xo=D(`ZodNumberFormat`,(e,t)=>{or.init(e,t),Yo.init(e,t)});function Zo(e){return Bi(Xo,e)}var Qo=D(`ZodBoolean`,(e,t)=>{sr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ba(e,t,n,r)});function $o(e){return Vi(Qo,e)}var es=D(`ZodUnknown`,(e,t)=>{cr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function ts(){return Hi(es)}var ns=D(`ZodNever`,(e,t)=>{lr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Va(e,t,n,r)});function rs(e){return Ui(ns,e)}var is=D(`ZodArray`,(e,t)=>{Co(),pr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Xi(e,t))},nonempty(e){return this.check(Xi(1,e))},max(e,t){return this.check(Yi(e,t))},length(e,t){return this.check(Zi(e,t))},unwrap(){return this.element}});function as(e,t){return la(is,e,t)}var os=D(`ZodObject`,(e,t)=>{Co(),yr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r),Le(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Z(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(g(this._zod.def,{catchall:e}))},passthrough(){return this.clone(g(this._zod.def,{catchall:ts()}))},loose(){return this.clone(g(this._zod.def,{catchall:ts()}))},strict(){return this.clone(g(this._zod.def,{catchall:rs()}))},strip(){return this.clone(g(this._zod.def,{catchall:void 0}))},extend(e){return he(this,e)},safeExtend(e){return _e(this,e)},merge(e){return ve(this,e)},pick(e){return fe(this,e)},omit(e){return me(this,e)},partial(...e){return ye(ms,this,e[0])},exactPartial(...e){return ye(gs,this,e[0],`exactPartial`)},required(...e){return be(ws,this,e[0])}});function Y(e,t){return new os({type:`object`,shape:e??{},...b(t)})}var ss=D(`ZodUnion`,(e,t)=>{xr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ya(e,t,n,r),e.options=t.options});function X(e,t){return new ss({type:`union`,options:e,...b(t)})}var cs=D(`ZodIntersection`,(e,t)=>{Sr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r)});function ls(e,t){return new cs({type:`intersection`,left:e,right:t})}var us=D(`ZodEnum`,(e,t)=>{Tr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ha(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new us({...t,checks:[],...b(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new us({...t,checks:[],...b(r),entries:i})}});function Z(e,t){return new us({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...b(t)})}var ds=D(`ZodLiteral`,(e,t)=>{Er.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function Q(e,t){return new ds({type:`literal`,values:Array.isArray(e)?e:[e],...b(t)})}var fs=D(`ZodTransform`,(e,t)=>{Co(),Dr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new We(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ke(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(ke(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function ps(e){return new fs({type:`transform`,transform:e})}var ms=D(`ZodOptional`,(e,t)=>{kr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function hs(e){return new ms({type:`optional`,innerType:e})}var gs=D(`ZodExactOptional`,(e,t)=>{Ar.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _s(e){return new gs({type:`optional`,innerType:e})}var vs=D(`ZodNullable`,(e,t)=>{jr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ys(e){return new vs({type:`nullable`,innerType:e})}var bs=D(`ZodDefault`,(e,t)=>{Mr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>to(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xs(e,t){return new bs({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():oe(t)}})}var Ss=D(`ZodPrefault`,(e,t)=>{Pr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cs(e,t){return new Ss({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():oe(t)}})}var ws=D(`ZodNonOptional`,(e,t)=>{Fr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ts(e,t){return new ws({type:`nonoptional`,innerType:e,...b(t)})}var Es=D(`ZodCatch`,(e,t)=>{Rr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Ds(e,t){return new Es({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:ze(t)})}var Os=D(`ZodPipe`,(e,t)=>{zr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r),e.in=t.in,e.out=t.out});function ks(e,t){return new Os({type:`pipe`,in:e,out:t})}var As=D(`ZodReadonly`,(e,t)=>{Vr.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ao(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e){return new As({type:`readonly`,innerType:e})}var Ms=D(`ZodCustom`,(e,t)=>{Ur.init(e,t),G.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r)});function Ns(e,t={}){return ua(Ms,e,t)}function Ps(e,t){return da(e,t)}var Fs={path:`/about-page/v1`,argsSchema:Y({}),resultSchema:Y({primaryMarkdown:K()})};function Is(e){return Y({foundationalDataHash:K(),innerResult:e})}var Ls={path:`/departures/v0`,argsSchema:Y({stopId:J(),count:J()}),resultSchema:Is(Y({departures:Y({sourceId:K(),intrasourceId:K(),primaryDestinationText:K(),secondaryDestinationText:K().nullable(),lineIds:J().array().readonly(),color:Y({lightModeHexCode:K(),darkModeHexCode:K()}).nullable(),isCancelled:$o(),movement:Y({index:J(),positionId:J().nullable(),time:K(),formerTime:K().nullable()})}).array()}))},Rs=Y({latitude:J(),longitude:J()}),zs=Y({lightModeHexCode:K(),darkModeHexCode:K()}),Bs=Y({id:J(),name:K(),urlPath:K(),canonicalLinesServingStop:J().array().readonly(),location:Rs.nullable()}),$=Y({stopId:J(),type:Z([`regular`,`always-express`])}),Vs=X([Y({type:Q(`linear`),name:K().nullable(),color:zs.nullable(),stops:$.array().readonly()}),Y({type:Q(`branch`),name:K().nullable(),color:zs.nullable(),commonStops:$.array().readonly(),branchAStops:$.array().readonly(),branchBStops:$.array().readonly()}),Y({type:Q(`loop`),name:K().nullable(),color:zs.nullable(),loopLeftStops:$.array().readonly(),loopRightStops:$.array().readonly(),mainStops:$.array().readonly()})]),Hs={linear:!0,branch:!0,loop:!0};function Us(e){return e in Hs}var Ws=Y({entries:X([Vs,Y({type:K().refine(e=>!Us(e))})]).array().readonly(),fallbackStopList:J().array().readonly()}),Gs=Y({id:J(),name:K(),urlPath:K(),color:zs.nullable(),diagram:Ws}),Ks=Y({stop:Z([`stop`,`station`]),line:Z([`line`,`route`]),service:Z([`service`,`trip`,`train`,`tram`,`bus`])}),qs=Y({primaryMarkdown:K()}),Js=Y({primaryMarkdown:K()}),Ys=Y({metadata:Y({hash:K(),fodaApiVersion:Q(`1`),serverVersion:K()}),stops:Bs.array().readonly(),lines:Gs.array().readonly(),terminology:Ks,landingPage:qs,footer:Js}),Xs={path:`/foundational-data/v1`,argsSchema:Y({hash:K().nullable()}),resultSchema:X([Y({result:Q(`outdated`),foundationalData:Ys}),Y({result:Q(`up-to-date`)})])},Zs={path:`/service/v0`,argsSchema:Y({sourceId:K(),intrasourceId:K()}),resultSchema:Is(Y({service:Y({sourceId:K(),intrasourceId:K(),primaryDestinationText:K(),lineIds:J().array().readonly(),color:Y({lightModeHexCode:K(),darkModeHexCode:K()}).nullable(),isCancelled:$o(),movements:Y({stopId:J(),positionId:J().nullable(),arrivalTime:K().nullable(),formerArrivalTime:K().nullable(),departureTime:K().nullable(),formerDepartureTime:K().nullable()}).array().readonly()}).nullable()}))},Qs={path:`/version-check/v1`,argsSchema:Y({frontendVersion:K(),corequeryPackageVersion:K()}),resultSchema:Y({isForceUpdateOfServiceWorkerRequired:$o()})},$s={path:`/versions/v1`,argsSchema:Y({}),resultSchema:Y({serverVersion:K(),frontendVersion:K(),corequeryPackageVersion:K(),foundationalDataHash:K(),version:K().meta({deprecated:!0})})};function ec(e,t){if(e===t)return!0;if(e==null||t==null)return e===t;if(typeof e!=typeof t)return!1;if(typeof e!=`object`)return e===t;if(Array.isArray(e)!==Array.isArray(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ec(e[n],t[n]))return!1;return!0}let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let i of n)if(!r.includes(i)||!ec(e[i],t[i]))return!1;return!0}Object.freeze({status:`aborted`});function tc(e,n){let r=nc(n);t(e,r)}function nc(t){let n=e(void 0);return ec(t,n.current)||(n.current=t),n.current}function rc(){return{callApi:ic}}async function ic(e,t,n={}){let{timeout:r,debugDelay:i,debugError:a}=n;if(i!=null&&await new Promise(e=>setTimeout(e,i)),a??!1)throw Error(`Simulated API error`);let o=await fetch(`/api${e.path}`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t),signal:r==null?void 0:AbortSignal.timeout(r)});if(!o.ok){let t=await o.text();throw Error(`Error ${o.status} calling /api${e.path}: ${t}`)}return e.resultSchema.parse(await o.json())}export{Qs as a,Ys as c,Fs as d,Z as f,ts as g,X as h,$s as i,Us as l,Y as m,tc as n,Zs as o,Q as p,ec as r,Xs as s,rc as t,Ls as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{v as e}from"./use-nav-exemptions-QtGbfEPT.js";import{n as t,t as n}from"./use-api-BJomuYg6.js";import{n as r}from"./use-foundational-data-BEVQRFj9.js";function i(i,a,o={}){let{callApi:s}=n(),{foda:c,forceFodaUpdate:l}=r(),[u,d]=e(null),[f,p]=e(!0),[m,h]=e(null);return t(()=>{let e=!1;async function t(){try{p(!0),h(null);let t=await s(i,a,o);if(e)return;let n=c.hash;if(t.foundationalDataHash!==n&&(n=await l(),e))return;if(t.foundationalDataHash!==n)throw Error(`Foundational data hash still mismatches after forced update.`);d(t.innerResult)}catch(t){if(e)return;console.warn(t),h(t)}finally{e||p(!1)}}return t(),()=>{e=!0}},[i,a,o]),{data:u,loading:f,error:m}}export{i as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e,i as t,l as n,n as r,r as i}from"./use-nav-exemptions-QtGbfEPT.js";import{
|
|
1
|
+
import{c as e,i as t,l as n,n as r,r as i}from"./use-nav-exemptions-QtGbfEPT.js";import{f as a}from"./index-CrhwkQ9k.js";import{n as o,t as s}from"./SimpleMobileHeaderContent-Ja68XAJd.js";function c(c){return{mobileHeader:n(s,{title:c.title,backHref:c.back?.href??null}),desktopHeader:n(r,{children:n(i,{class:e(`mx-4 py-4 gap-8 border-b border-soft-border`,{"pt-8":c.back==null,"pt-6":c.back!=null}),children:[c.back!=null&&n(a,{text:c.back.text,href:c.back.href,icon:o,class:`self-start`,layout:`narrow-icon`}),n(t,{style:`megatitle`,children:c.title})]})})}}export{c as t};
|
package/web/dist/index.html
CHANGED
|
@@ -15,13 +15,13 @@
|
|
|
15
15
|
<link rel="mask-icon" href="/favicon.svg" color="#FFFFFF" />
|
|
16
16
|
<meta name="theme-color" content="#242933" />
|
|
17
17
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
18
|
-
<script type="module" crossorigin src="/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/assets/index-CrhwkQ9k.js"></script>
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/use-nav-exemptions-QtGbfEPT.js">
|
|
20
|
-
<link rel="modulepreload" crossorigin href="/assets/use-
|
|
20
|
+
<link rel="modulepreload" crossorigin href="/assets/use-api-BJomuYg6.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/assets/use-foundational-data-BEVQRFj9.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/scope-B-e4l8Dr.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/LinkText-sdmJpshg.js">
|
|
24
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
24
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DJPX60jz.css">
|
|
25
25
|
<link rel="manifest" href="/manifest.webmanifest"></head>
|
|
26
26
|
<body>
|
|
27
27
|
<script>
|
package/web/dist/reset.html
CHANGED
|
@@ -146,8 +146,9 @@
|
|
|
146
146
|
<div class="gap-2">
|
|
147
147
|
<p>When you click "Factory reset", it will:</p>
|
|
148
148
|
<ol class="gap-2">
|
|
149
|
-
<li>Unregister all service workers for this web app</li>
|
|
150
149
|
<li>Clear all local storage entries for this web app</li>
|
|
150
|
+
<li>Unregister all service workers for this web app</li>
|
|
151
|
+
<li>Clear all caches for this web app</li>
|
|
151
152
|
<li>Then, navigate you back to the homepage</li>
|
|
152
153
|
</ol>
|
|
153
154
|
</div>
|
|
@@ -167,13 +168,14 @@
|
|
|
167
168
|
</section>
|
|
168
169
|
<script>
|
|
169
170
|
const resetButton = document.getElementById("reset-button");
|
|
171
|
+
|
|
170
172
|
resetButton.addEventListener("click", async () => {
|
|
171
173
|
let anyFailures = false;
|
|
172
174
|
|
|
173
175
|
try {
|
|
174
176
|
localStorage.clear();
|
|
175
177
|
} catch (error) {
|
|
176
|
-
alert(
|
|
178
|
+
alert(`An error occurred while clearing local storage.\n\n${error}`);
|
|
177
179
|
anyFailures = true;
|
|
178
180
|
}
|
|
179
181
|
|
|
@@ -184,7 +186,9 @@
|
|
|
184
186
|
await registration.unregister();
|
|
185
187
|
}
|
|
186
188
|
} catch (error) {
|
|
187
|
-
alert(
|
|
189
|
+
alert(
|
|
190
|
+
`An error occurred while unregistering the service worker.\n\n${error}`,
|
|
191
|
+
);
|
|
188
192
|
anyFailures = true;
|
|
189
193
|
}
|
|
190
194
|
|
|
@@ -193,7 +197,7 @@
|
|
|
193
197
|
await window.caches.delete(cacheName);
|
|
194
198
|
}
|
|
195
199
|
} catch (error) {
|
|
196
|
-
alert(
|
|
200
|
+
alert(`An error occurred while clearing caches.\n\n${error}`);
|
|
197
201
|
anyFailures = true;
|
|
198
202
|
}
|
|
199
203
|
|
package/web/dist/sw.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
if(!self.define){let s,e={};const l=(l,n)=>(l=new URL(l+".js",n).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(n,i)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const o=s=>l(s,r),a={module:{uri:r},exports:u,require:o};e[r]=Promise.all(n.map(s=>a[s]||o(s))).then(s=>(i(...s),u))}}define(["./workbox-2fbc6a65"],function(s){"use strict";self.addEventListener("message",s=>{s.data&&"SKIP_WAITING"===s.data.type&&self.skipWaiting()}),s.precacheAndRoute([{url:"pwa-maskable-512x512.png",revision:"9e859d049e78f70ddb5872a3bce2622b"},{url:"pwa-maskable-192x192.png",revision:"f1e5f837a116221b26c9cb9447db5e92"},{url:"pwa-512x512.png",revision:"e5560dba9f85e2959637abbb546643cd"},{url:"pwa-192x192.png",revision:"8b590313fc6296f57d609982dc21f302"},{url:"mona-sans.woff2",revision:"b96cc834af467cf02885a067356abae7"},{url:"index.html",revision:"
|
|
1
|
+
if(!self.define){let s,e={};const l=(l,n)=>(l=new URL(l+".js",n).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(n,i)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const o=s=>l(s,r),a={module:{uri:r},exports:u,require:o};e[r]=Promise.all(n.map(s=>a[s]||o(s))).then(s=>(i(...s),u))}}define(["./workbox-2fbc6a65"],function(s){"use strict";self.addEventListener("message",s=>{s.data&&"SKIP_WAITING"===s.data.type&&self.skipWaiting()}),s.precacheAndRoute([{url:"pwa-maskable-512x512.png",revision:"9e859d049e78f70ddb5872a3bce2622b"},{url:"pwa-maskable-192x192.png",revision:"f1e5f837a116221b26c9cb9447db5e92"},{url:"pwa-512x512.png",revision:"e5560dba9f85e2959637abbb546643cd"},{url:"pwa-192x192.png",revision:"8b590313fc6296f57d609982dc21f302"},{url:"mona-sans.woff2",revision:"b96cc834af467cf02885a067356abae7"},{url:"index.html",revision:"84b50db4bfa19b3e82c26ab3bd2857ab"},{url:"favicon.svg",revision:"570c2a249bbd511b386a843cd96545e7"},{url:"apple-touch-icon.png",revision:"d5d6ea39bc40ffd5b045b9593da0c890"},{url:"assets/workbox-window.prod.es5-Bd17z0YL.js",revision:null},{url:"assets/use-simple-headers-Cbv0t_De.js",revision:null},{url:"assets/use-nav-exemptions-QtGbfEPT.js",revision:null},{url:"assets/use-foundational-data-BEVQRFj9.js",revision:null},{url:"assets/use-foda-synced-query-BM-OPAql.js",revision:null},{url:"assets/use-api-BJomuYg6.js",revision:null},{url:"assets/scope-B-e4l8Dr.js",revision:null},{url:"assets/linear-CtNhjlrM.js",revision:null},{url:"assets/index-DJPX60jz.css",revision:null},{url:"assets/index-CrhwkQ9k.js",revision:null},{url:"assets/ZenMode-C3S7FmYt.js",revision:null},{url:"assets/Strong-C0VDYprE.js",revision:null},{url:"assets/Stop-BWZOcpvU.js",revision:null},{url:"assets/Status-CO5w5a1E.js",revision:null},{url:"assets/SimpleMobileHeaderContent-Ja68XAJd.js",revision:null},{url:"assets/Settings-Ccrmh7u8.js",revision:null},{url:"assets/Service-CkHxNopv.js",revision:null},{url:"assets/Placeholder-BRnxNmKm.js",revision:null},{url:"assets/Picker-D-TjVZAI.js",revision:null},{url:"assets/Page-BMcxP_9m.js",revision:null},{url:"assets/NotFoundPage-UhXr10a9.js",revision:null},{url:"assets/NotFound-BozS7u6u.js",revision:null},{url:"assets/Nearby-BNDxZx1J.js",revision:null},{url:"assets/MingcuteAlertLine-CdthHQmK.js",revision:null},{url:"assets/Markdown-D5fQv556.js",revision:null},{url:"assets/LinkText-sdmJpshg.js",revision:null},{url:"assets/Line-6nd7KD0E.js",revision:null},{url:"assets/Home-C6T20k8G.js",revision:null},{url:"assets/ErrorMessage-CCAB4vXB.js",revision:null},{url:"assets/Divider-lz6Cf6K8.js",revision:null},{url:"assets/Debug-Q4Vy4lZ_.js",revision:null},{url:"assets/Alert-DfpdtaOB.js",revision:null},{url:"assets/AdminControls-T05hoDB-.js",revision:null},{url:"assets/About-DGmg1TM-.js",revision:null},{url:"pwa-192x192.png",revision:"8b590313fc6296f57d609982dc21f302"},{url:"pwa-512x512.png",revision:"e5560dba9f85e2959637abbb546643cd"},{url:"pwa-maskable-192x192.png",revision:"f1e5f837a116221b26c9cb9447db5e92"},{url:"pwa-maskable-512x512.png",revision:"9e859d049e78f70ddb5872a3bce2622b"},{url:"manifest.webmanifest",revision:"a39f5f893f233a6eed74e0ab828a668b"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html"),{denylist:[/^\/reset\/?$/]}))});
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Corequery } from "../../../../corequery.js";
|
|
2
|
-
import type { fodaSchema } from "../../../../../shared/apis/foundational-data/v1/foundational-data.js";
|
|
3
|
-
import type z from "zod";
|
|
4
|
-
type Result = z.input<typeof fodaSchema>;
|
|
5
|
-
export declare class FoundationalDataV1Builder {
|
|
6
|
-
private readonly _app;
|
|
7
|
-
constructor(_app: Corequery);
|
|
8
|
-
build(): Result;
|
|
9
|
-
private _buildWithoutMetadata;
|
|
10
|
-
}
|
|
11
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import crypto from "crypto";
|
|
2
|
-
export class FoundationalDataV1Builder {
|
|
3
|
-
_app;
|
|
4
|
-
constructor(_app) {
|
|
5
|
-
this._app = _app;
|
|
6
|
-
}
|
|
7
|
-
build() {
|
|
8
|
-
const resultWithoutMetadata = this._buildWithoutMetadata();
|
|
9
|
-
// At the time of writing, this._app.version would be an effective hash (at
|
|
10
|
-
// least in prod) because no part of the foundational data is dynamic, so
|
|
11
|
-
// would only change due to a commit. But this hash mechanism exists to
|
|
12
|
-
// future-proof against dynamic foundational data (and also make the dev
|
|
13
|
-
// environment work, since in dev this._app.version won't be set).
|
|
14
|
-
const hash = crypto
|
|
15
|
-
.createHash("sha256")
|
|
16
|
-
.update(this._app.serverVersion + JSON.stringify(resultWithoutMetadata))
|
|
17
|
-
.digest("hex");
|
|
18
|
-
return {
|
|
19
|
-
...resultWithoutMetadata,
|
|
20
|
-
metadata: {
|
|
21
|
-
hash: hash,
|
|
22
|
-
serverVersion: this._app.serverVersion,
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
_buildWithoutMetadata() {
|
|
27
|
-
return {
|
|
28
|
-
stops: this._app.stops.map((s) => s.toFoda()),
|
|
29
|
-
lines: this._app.lines.map((l) => l.toFoda()),
|
|
30
|
-
landingPage: {
|
|
31
|
-
primaryMarkdown: this._app.landingPageConfig.primaryMarkdown,
|
|
32
|
-
},
|
|
33
|
-
footer: {
|
|
34
|
-
primaryMarkdown: this._app.footerConfig.primaryMarkdown,
|
|
35
|
-
},
|
|
36
|
-
terminology: {
|
|
37
|
-
stop: this._app.terminologyConfig.stop,
|
|
38
|
-
line: this._app.terminologyConfig.line,
|
|
39
|
-
service: this._app.terminologyConfig.service,
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=builder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../../../../api/handlers/foundational-data/v1/builder.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAQ5B,MAAM,OAAO,yBAAyB;IACP;IAA7B,YAA6B,IAAe;QAAf,SAAI,GAAJ,IAAI,CAAW;IAAG,CAAC;IAEhD,KAAK;QACH,MAAM,qBAAqB,GAAG,IAAI,CAAC,qBAAqB,EAAE,CAAC;QAE3D,2EAA2E;QAC3E,yEAAyE;QACzE,uEAAuE;QACvE,wEAAwE;QACxE,kEAAkE;QAClE,MAAM,IAAI,GAAG,MAAM;aAChB,UAAU,CAAC,QAAQ,CAAC;aACpB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,qBAAqB,CAAC,CAAC;aACvE,MAAM,CAAC,KAAK,CAAC,CAAC;QAEjB,OAAO;YACL,GAAG,qBAAqB;YACxB,QAAQ,EAAE;gBACR,IAAI,EAAE,IAAI;gBACV,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,aAAa;aACvC;SACF,CAAC;IACJ,CAAC;IAEO,qBAAqB;QAC3B,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;YAC7C,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;YAC7C,WAAW,EAAE;gBACX,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,eAAe;aAC7D;YACD,MAAM,EAAE;gBACN,eAAe,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,eAAe;aACxD;YACD,WAAW,EAAE;gBACX,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI;gBACtC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI;gBACtC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,iBAAiB,CAAC,OAAO;aAC7C;SACF,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,l as t,r as n}from"./use-nav-exemptions-QtGbfEPT.js";import{d as r,t as i}from"./use-query-BRsiAaVY.js";import{n as a}from"./use-foundational-data-BEVQRFj9.js";import{v as o}from"./index-DapCozyq.js";import{t as s}from"./Placeholder-BRnxNmKm.js";import{n as c,t as l}from"./Markdown-D5fQv556.js";import{t as u}from"./Page-BMcxP_9m.js";import{t as d}from"./use-simple-headers-CovxFlVs.js";import{t as f}from"./Divider-lz6Cf6K8.js";import{t as p}from"./Alert-D41vPACK.js";function m(){let{appName:m}=o(),{foda:h}=a(),{data:g,loading:_,error:v}=i(r,{}),y=d({title:`About ${m}`});return _?t(u,{...y,children:t(n,{class:`px-4 py-8`,children:[t(s,{class:`w-[30%] text-xl`}),t(`div`,{class:`h-8`}),t(s,{class:`w-full text-md`}),t(`div`,{class:`h-3`}),t(s,{class:`w-full text-md`}),t(`div`,{class:`h-3`}),t(s,{class:`w-[60%] text-md`}),t(`div`,{class:`h-12`}),t(s,{class:`w-[40%] text-lg`}),t(`div`,{class:`h-8`}),t(s,{class:`w-full text-md`}),t(`div`,{class:`h-3`}),t(s,{class:`w-full text-md`}),t(`div`,{class:`h-3`}),t(s,{class:`w-[20%] text-md`}),t(`div`,{class:`h-12`}),t(s,{class:`w-[50%] text-lg`}),t(`div`,{class:`h-8`}),t(s,{class:`w-full text-md`}),t(`div`,{class:`h-3`}),t(s,{class:`w-[80%] text-md`})]})}):v!=null||g==null?t(u,{...y,children:t(n,{class:`px-4 py-8`,children:t(p,{type:`error`,children:t(e,{children:`Unable to load the about page.`})})})}):t(u,{...y,children:t(n,{class:`px-4 py-8 gap-12`,children:[t(l,{markdown:g.primaryMarkdown}),t(n,{class:`gap-8`,children:[t(f,{}),t(e,{as:`p`,style:`small-weak`,children:t(c,{markdown:h.footerPrimaryMarkdown})})]})]})})}export{m as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e,l as t,o as n,s as r}from"./use-nav-exemptions-QtGbfEPT.js";import{c as i,n as a,o}from"./index-DapCozyq.js";import{t as s}from"./MingcuteAlertLine-CdthHQmK.js";function c(e){return t(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:t(`g`,{fill:`none`,fillRule:`evenodd`,children:[t(`path`,{d:`m12.593 23.258l-.011.002l-.071.035l-.02.004l-.014-.004l-.071-.035q-.016-.005-.024.005l-.004.01l-.017.428l.005.02l.01.013l.104.074l.015.004l.012-.004l.104-.074l.012-.016l.004-.017l-.017-.427q-.004-.016-.017-.018m.265-.113l-.013.002l-.185.093l-.01.01l-.003.011l.018.43l.005.012l.008.007l.201.093q.019.005.029-.008l.004-.014l-.034-.614q-.005-.018-.02-.022m-.715.002a.02.02 0 0 0-.027.006l-.006.014l-.034.614q.001.018.017.024l.015-.002l.201-.093l.01-.008l.004-.011l.017-.43l-.003-.012l-.01-.01z`}),t(`path`,{fill:`currentColor`,d:`M21.192 5.465a1 1 0 0 1 0 1.414L9.95 18.122a1.1 1.1 0 0 1-1.556 0l-5.586-5.586a1 1 0 1 1 1.415-1.415l4.95 4.95L19.777 5.465a1 1 0 0 1 1.414 0Z`})]})})}function l(l){let u={info:o,error:i,warning:s,success:c}[l.type],d=l.icon===void 0?u:l.icon,f={info:`bg-soft-accent`,error:`bg-soft-error`,warning:`bg-soft-warning`,success:`bg-soft-success`}[l.type],p={info:[`[--color-fg:var(--color-accent-text)]`,`[--color-fg-strong:var(--color-accent-text)]`,`[--color-fg-weak:var(--color-accent-text)]`],error:[`[--color-fg:var(--color-error-text)]`,`[--color-fg-strong:var(--color-error-text)]`,`[--color-fg-weak:var(--color-error-text)]`],warning:[`[--color-fg:var(--color-warning-text)]`,`[--color-fg-strong:var(--color-warning-text)]`,`[--color-fg-weak:var(--color-warning-text)]`],success:[`[--color-fg:var(--color-success-text)]`,`[--color-fg-strong:var(--color-success-text)]`,`[--color-fg-weak:var(--color-success-text)]`]}[l.type];return t(r,{class:e(l.class,f,p,`px-4 py-4.5 rounded-sm gap-2 items-start`,{"grid-cols-[auto_1fr]":d!=null}),children:[d!=null&&t(a,{heightRem:n(`text-md`),children:t(d,{class:`text-fg text-icon-lg`})}),l.children]})}export{l as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as e,b as t,c as n,i as r,l as i,o as a,r as o,s}from"./use-nav-exemptions-QtGbfEPT.js";import{i as c,t as l}from"./use-query-BRsiAaVY.js";import{n as u}from"./use-foundational-data-BEVQRFj9.js";import{a as d,d as f,g as p,h as m,n as h,p as g,t as _,v}from"./index-DapCozyq.js";import{t as y}from"./Placeholder-BRnxNmKm.js";import{t as b}from"./Page-BMcxP_9m.js";import{t as x}from"./use-simple-headers-CovxFlVs.js";import{t as S}from"./Divider-lz6Cf6K8.js";import{t as C}from"./Alert-D41vPACK.js";var w=e(null);function T(){let e=t(w);if(e==null)throw Error(`Foundational data unavailable outside provider.`);return e}function E(e){let t={info:`bg-soft-accent`,error:`bg-soft-error`,warning:`bg-soft-warning`,success:`bg-soft-success`}[e.type],a={info:`[--color-fg:var(--color-accent-text)]`,error:`[--color-fg:var(--color-error-text)]`,warning:`[--color-fg:var(--color-warning-text)]`,success:`[--color-fg:var(--color-success-text)]`}[e.type];return i(s,{class:n(e.class,t,a,`px-2 py-1.5 rounded-full`),children:i(r,{style:`small`,children:e.text})})}function D(e){return i(g,{class:n(e.class,`gap-x-2 gap-y-3`),wrap:!0,children:[i(r,{style:`strong`,children:e.header}),e.loading&&i(y,{class:`w-[20%] text-md`}),!e.loading&&e.pillContent!=null&&i(h,{heightRem:a(`text-md`),children:i(E,{type:e.pillContent.type,text:e.pillContent.text})})]})}function O(e){return i(D,{class:e.class,header:e.header,pillContent:k(e.currentValue,e.latestValue),loading:e.loading})}function k(e,t){return t==null?null:{text:e===t?`Up to date`:`Outdated`,type:e===t?`success`:`error`}}function A(e){return e.loading?i(s,{class:e.class,children:i(y,{class:`w-[40%] text-md`})}):e.value==null?null:i(r,{class:e.class,children:[e.prefix,`: `,e.value]})}function j(e){return e==null?null:e.length<32||!/^[0-9a-f]+$/.test(e)?e:e.slice(0,7)}function M(e){let{isUpdateAvailable:t,update:o}=d();return t?i(f,{theme:`accent`,text:`Refresh & update`,class:`self-start`,icon:m,onClick:()=>void o()}):i(g,{class:n(e.class,`gap-2`),children:[i(h,{heightRem:a(`text-md`),children:i(p,{})}),i(r,{class:`min-w-0 shrink`,children:`Waiting for service worker to install update...`})]})}function N(e){let{isHotReloadingEnabled:t}=_();return i(t?P:F,{...e})}function P(e){let{data:t,loading:a}=T();return i(o,{class:n(e.class,`gap-6`),children:[i(D,{header:`App version`,pillContent:{text:`Development`,type:`info`},loading:!1}),i(r,{children:`All frontend code is being served with hot-reloading enabled, not through the PWA. (The below values are meaningless.)`}),i(I,{}),i(A,{prefix:`Latest version`,value:t?.frontendVersion.slice(0,8)??null,loading:a})]})}function F(e){let{frontendVersion:t}=v(),{data:r,loading:a}=T(),s=!a&&r!=null&&r?.frontendVersion!==t;return i(o,{class:n(e.class,`gap-8`),children:i(o,{class:`gap-6`,children:[i(O,{header:`App version`,currentValue:t,latestValue:r?.frontendVersion??null,loading:a}),i(I,{}),i(A,{prefix:`Latest version`,value:j(r?.frontendVersion),loading:a}),s&&i(M,{})]})})}function I(){let{frontendVersion:e,versionsOnLastUpdate:t}=v();return i(o,{class:`gap-4`,children:[i(r,{children:[`Current version: `,j(e)]}),i(o,{class:`gap-3`,children:[i(r,{style:`small-weak`,children:[`Server version: `,j(t.serverVersion)]}),i(r,{style:`small-weak`,children:[`CoreQuery version: `,t.corequeryPackageVersion]})]})]})}function L(e){let t=l(c,{});return i(w.Provider,{value:t,children:e.children})}function R(e){let{data:t,loading:a}=T(),{foda:s}=u();return i(o,{class:n(e.class,`gap-6`),children:[i(O,{header:`Foundational data`,currentValue:s.hash,latestValue:t?.foundationalDataHash??null,loading:a}),i(o,{class:`gap-4`,children:[i(r,{children:[`Current version: `,j(s.hash)]}),i(r,{style:`small-weak`,children:[`Server version: `,j(s.serverVersion)]})]}),i(A,{prefix:`Latest version`,value:j(t?.foundationalDataHash),loading:a})]})}function z(e){let{data:t,loading:a}=T();return i(o,{class:n(e.class,`gap-8`),children:i(o,{class:`gap-6`,children:[i(r,{style:`strong`,children:`Server`}),i(B,{}),i(o,{class:`gap-4`,children:[i(A,{prefix:`Server version`,value:j(t?.serverVersion),loading:a}),i(A,{prefix:`CoreQuery version`,value:t?.corequeryPackageVersion??null,loading:a})]})]})})}function B(){let{error:e}=T();return e==null?null:i(C,{type:`error`,children:i(r,{children:`Unable to fetch the latest version info from the server.`})})}function V(){return i(b,{...x({title:`Developer info`}),children:i(L,{children:i(o,{class:`px-4 py-8 gap-8`,children:[i(H,{}),i(N,{}),i(S,{}),i(R,{}),i(S,{}),i(z,{}),i(S,{})]})})})}function H(){let{error:e}=T();return e==null?null:i(C,{type:`error`,children:i(r,{children:`Unable to fetch the latest version info from the server.`})})}export{V as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,c as t,i as n,l as r,m as i,r as a,s as o,v as s,y as c}from"./use-nav-exemptions-QtGbfEPT.js";import{l}from"./use-query-BRsiAaVY.js";import{n as u}from"./use-foundational-data-BEVQRFj9.js";import{t as d}from"./scope-B-e4l8Dr.js";import{i as f,n as p,o as m,r as h,t as g}from"./linear-eK93gfBn.js";import{t as _}from"./LinkText-sdmJpshg.js";import{i as v,u as y,v as b}from"./index-DapCozyq.js";import{t as x}from"./Page-BMcxP_9m.js";import{t as S}from"./use-simple-headers-CovxFlVs.js";import{t as C}from"./Alert-D41vPACK.js";import{t as w}from"./NotFoundPage-rHyFGsin.js";import{t as T}from"./Picker-B59cZ5e5.js";function E(e){throw Error(`Unexpected value: ${String(e)}`)}function D(i){let{foda:o}=u(),{appName:s}=b(),c=e(()=>i.fallbackStopList.map(e=>o.stops.require(e)).sort((e,t)=>e.name.localeCompare(t.name)),[o.stops,i.fallbackStopList]);return r(a,{class:t(i.class,`gap-6`),children:[r(n,{style:`subtitle`,children:`Stops`}),r(C,{type:`info`,children:r(a,{class:`gap-6`,children:[r(n,{children:[`A neat little diagram is also available for this line, but it's of a new type, and so requires a newer version of `,s,` to be able to view.`,` `]}),r(n,{style:`strong`,children:r(_,{href:`/debug`,children:`Help me update`})})]})}),r(`ul`,{class:`flex-col flex list-disc list-inside gap-4`,children:c.map(e=>r(n,{children:r(`li`,{children:r(_,{href:`/stop/${e.urlPath}`,children:e.name})})}))})]})}function O(e,t){return t.map(t=>{let i=e.stops.require(t.stopId),a=`/stop/${i.urlPath}`;if(t.type===`regular`)return{content:r(n,{style:`strong`,children:r(_,{href:a,style:`subtle`,children:i.name})})};if(t.type===`always-express`)return{content:r(n,{style:`small-weak`,children:r(_,{href:a,style:`subtle`,children:[`Skips `,i.name]})}),drawMark:!1};E(t.type)})}function k(t){let{foda:n}=u(),i=e(()=>({type:`linear`,stops:O(n,t.diagram.stops)}),[n,t.diagram.stops]);return r(g,{class:t.class,structure:i,lightThemeColorHexCode:t.diagram.color?.lightModeHexCode??null,darkThemeColorHexCode:t.diagram.color?.darkModeHexCode??null})}var A=10,j=15,M=class extends h{_onRenderStructure(){let{commonStops:e,branchAStops:t,branchBStops:n}=this.data.structure,{x:r,y:i}=this._measure();this._renderSection({stops:e,x:r.common,yLevels:i.common.all,terminatesAtTop:!0,terminatesAtBottom:!1,notchSide:`right`}),this._renderSection({stops:t,x:r.branchA,yLevels:i.branchA.all,terminatesAtTop:!1,terminatesAtBottom:!0,notchSide:`left`}),this._renderSection({stops:n,x:r.branchB,yLevels:i.branchB.all,terminatesAtTop:!1,terminatesAtBottom:!0,notchSide:`right`}),this._drawLine(e=>{e.moveTo(r.common,i.common.bottom),e.lineTo(r.common,i.common.bottom+A),e.bezierCurveTo(r.common,i.common.bottom+j+A,r.branchA,i.branches.top-j,r.branchA,i.branches.top),e.lineTo(r.branchA,i.branchA.top),e.moveTo(r.common,i.common.bottom+A),e.bezierCurveTo(r.common,i.common.bottom+j+A,r.branchB,i.branches.top-j,r.branchB,i.branches.top),e.lineTo(r.branchB,i.branchA.top)})}_measure(){let{commonStops:e,branchAStops:t,branchBStops:n}=this.data.structure,r=this._extractYLevels(e,N),i=d(r[0]),a=d(r[r.length-1]),o=this._extractYLevels(t,P),s=d(o[0]),c=d(o[o.length-1]),l=this._extractYLevels(n,F),u=d(l[0]),f=d(l[l.length-1]);return{x:{common:this.width/2,branchA:8,branchB:this.width-8},y:{common:{all:r,top:i,bottom:a},branchA:{all:o,top:s,bottom:c},branchB:{all:l,top:u,bottom:f},branches:{top:Math.min(s,u),bottom:Math.max(c,f)}}}}},N=`_diagram-common-stops`,P=`_diagram-branch-a-stops`,F=`_diagram-branch-b-stops`;function I(n){let{settings:i}=y(),s=e(()=>({structure:n.structure,lightThemeColorHexCode:n.lightThemeColorHexCode,darkThemeColorHexCode:n.darkThemeColorHexCode,colorTheme:i.theme}),[n.darkThemeColorHexCode,n.lightThemeColorHexCode,n.structure,i.theme]),l=c((e,t)=>new M(e,t),[]);return s.structure.commonStops.length<1||s.structure.branchAStops.length<1||s.structure.branchBStops.length<1?r(p,{}):r(o,{class:t(n.class,`grid-cols-[auto_auto_auto] grid-rows-[auto_auto] gap-y-8 gap-x-4`),children:[r(f,{class:`w-12 col-2 row-span-full`,createController:l,data:s}),r(a,{class:t(`gap-6 col-3 row-1 -ml-4`,N),xAlign:`left`,children:n.structure.commonStops.map(e=>r(o,{children:e.content}))}),r(a,{class:t(`gap-6 col-1 row-2`,P),xAlign:`right`,children:n.structure.branchAStops.map(e=>r(o,{children:e.content}))}),r(a,{class:t(`gap-6 col-3 row-2`,F),xAlign:`left`,children:n.structure.branchBStops.map(e=>r(o,{children:e.content}))})]})}function L(t){let{foda:n}=u(),i=e(()=>({type:`branch`,commonStops:O(n,t.diagram.commonStops),branchAStops:O(n,t.diagram.branchAStops),branchBStops:O(n,t.diagram.branchBStops)}),[n,t.diagram]);return r(I,{class:t.class,structure:i,lightThemeColorHexCode:t.diagram.color?.lightModeHexCode??null,darkThemeColorHexCode:t.diagram.color?.darkModeHexCode??null})}var R=10,z=15,B=24,V=1,H=class extends h{_onRenderStructure(){let{loopLeftStops:e,loopRightStops:t,mainStops:n}=this.data.structure,{x:r,y:i}=this._measure();if(e.length>0?this._renderSection({stops:e,x:r.loopLeft,yLevels:i.loopLeft.all,terminatesAtTop:!1,terminatesAtBottom:!1,notchSide:`left`}):this._drawLine(e=>{e.moveTo(r.loopLeft,i.loopLeft.top-V),e.lineTo(r.loopLeft,i.loopLeft.bottom+V)}),t.length>0?this._renderSection({stops:t,x:r.loopRight,yLevels:i.loopRight.all,terminatesAtTop:!1,terminatesAtBottom:!1,notchSide:`right`}):this._drawLine(e=>{e.moveTo(r.loopRight,i.loopRight.top-V),e.lineTo(r.loopRight,i.loopRight.bottom+V)}),n.length>0){let e=d(i.main.top);this._renderSection({stops:n,x:r.main,yLevels:i.main.all,terminatesAtTop:!1,terminatesAtBottom:!0,notchSide:`right`}),this._drawLine(t=>{t.moveTo(r.main,e),t.lineTo(r.main,e-R),t.bezierCurveTo(r.main,e-z-R,r.loopLeft,i.loop.bottom+z,r.loopLeft,i.loop.bottom),t.lineTo(r.loopLeft,i.loopLeft.bottom),t.moveTo(r.main,e-R),t.bezierCurveTo(r.main,e-z-R,r.loopRight,i.loop.bottom+z,r.loopRight,i.loop.bottom),t.lineTo(r.loopRight,i.loopRight.bottom)}),this.ctx.stroke()}else this._drawLine(e=>{e.moveTo(r.loopLeft,i.loopLeft.bottom),e.lineTo(r.loopLeft,i.loop.bottom),e.bezierCurveTo(r.loopLeft,i.loop.bottom+B,r.loopRight,i.loop.bottom+B,r.loopRight,i.loop.bottom),e.lineTo(r.loopRight,i.loopRight.bottom)});this._drawLine(e=>{e.moveTo(r.loopLeft,i.loopLeft.top),e.lineTo(r.loopLeft,i.loop.top),e.bezierCurveTo(r.loopLeft,i.loop.top-B,r.loopRight,i.loop.top-B,r.loopRight,i.loop.top),e.lineTo(r.loopRight,i.loopRight.top)})}_measure(){let{loopLeftStops:e,loopRightStops:t,mainStops:n}=this.data.structure,r=this._extractYLevels(e,W),i=this._extractYLevels(t,G),a=this._extractYLevels(n,U),o=r[0],s=i[0],c=r[r.length-1],l=i[i.length-1],u=d(o??s),f=d(s??o),p=d(c??l),m=d(l??c);return{x:{loopLeft:8,loopRight:this.width-8,main:this.width/2},y:{loopLeft:{all:r,top:u,bottom:p},loopRight:{all:i,top:f,bottom:m},main:{all:a,top:a[0]??null,bottom:a[a.length-1]??null},loop:{top:Math.min(u,f),bottom:Math.max(p,m)}}}}},U=`_diagram-main-stops`,W=`_diagram-loop-left-stops`,G=`_diagram-loop-right-stops`;function K(n){let{settings:i}=y(),s=e(()=>({structure:n.structure,lightThemeColorHexCode:n.lightThemeColorHexCode,darkThemeColorHexCode:n.darkThemeColorHexCode,colorTheme:i.theme}),[n.darkThemeColorHexCode,n.lightThemeColorHexCode,n.structure,i.theme]),l=c((e,t)=>new H(e,t),[]),{loopLeftStops:u,loopRightStops:d}=s.structure;return u.length+d.length<1?r(p,{}):r(o,{class:t(n.class,`grid-cols-[auto_auto_auto] grid-rows-[auto_auto] gap-x-4`),children:[r(f,{class:`w-12 col-2 row-span-full`,createController:l,data:s}),r(a,{class:t(`gap-6 col-1 row-1 py-4`,W),xAlign:`right`,yAlign:`center`,children:n.structure.loopLeftStops.map(e=>r(o,{children:e.content}))}),r(a,{class:t(`gap-6 col-3 row-1 py-4`,G),xAlign:`left`,yAlign:`center`,children:n.structure.loopRightStops.map(e=>r(o,{children:e.content}))}),r(a,{class:t(`gap-6 col-3 row-2 -ml-4`,U,{"pt-4":n.structure.mainStops.length>0}),xAlign:`left`,children:n.structure.mainStops.map(e=>r(o,{children:e.content}))})]})}function q(t){let{foda:n}=u(),i=e(()=>({type:`loop`,loopLeftStops:O(n,t.diagram.loopLeftStops),loopRightStops:O(n,t.diagram.loopRightStops),mainStops:O(n,t.diagram.mainStops)}),[n,t.diagram]);return r(K,{class:t.class,structure:i,lightThemeColorHexCode:t.diagram.color?.lightModeHexCode??null,darkThemeColorHexCode:t.diagram.color?.darkModeHexCode??null})}function J(e){return r(o,{class:t(e.class,`bg-bg-raised px-4 py-8 justify-center rounded-sm border border-soft-border`),children:r(Y,{diagram:e.diagram})})}function Y(e){if(e.diagram.type===`linear`)return r(k,{diagram:e.diagram});if(e.diagram.type===`branch`)return r(L,{diagram:e.diagram});if(e.diagram.type===`loop`)return r(q,{diagram:e.diagram});E(e.diagram)}function X(e){let i=e.diagram.entries.filter(e=>l(e.type));return i.length<e.diagram.entries.length?r(D,{fallbackStopList:e.diagram.fallbackStopList}):r(a,{class:t(e.class,`gap-6`),children:[r(n,{style:`subtitle`,children:`Diagram`}),i.length===1?r(J,{diagram:d(i[0])}):r(Z,{entries:i},i.length)]})}function Z(t){let[n,i]=s(0),o=e(()=>t.entries.map((e,t)=>({value:t.toFixed(),label:e.name??`Route ${t+1}`})),[t.entries]);return r(a,{class:`gap-4`,children:[r(T,{class:`self-start`,value:n.toFixed(),options:o,onChange:e=>{i(m(e))}}),r(J,{diagram:d(t.entries[n])})]})}function Q(){let{params:{id:t}}=i(),{foda:n}=u(),a=e(()=>n.lines.getByUrlPath(t??``),[n.lines,t]);return a==null?r(w,{afterConfirming:`foundational-data-version`}):r($,{line:a},a.id)}function $(e){let{formatLine:t}=v();return r(x,{...S({title:t(e.line.name),back:{href:`/`,text:`Home`}}),children:r(a,{class:`px-4 py-8 gap-8`,children:e.line.diagram.entries.length>0&&r(X,{diagram:e.line.diagram})})})}export{Q as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as e}from"./use-nav-exemptions-QtGbfEPT.js";import{t}from"./NotFoundPage-rHyFGsin.js";function n(){return e(t,{afterConfirming:`frontend-version`})}export{n as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{h as e,i as t,l as n,r,v as i}from"./use-nav-exemptions-QtGbfEPT.js";import{i as a,r as o,s,t as c}from"./use-query-BRsiAaVY.js";import{n as l}from"./use-foundational-data-BEVQRFj9.js";import{_ as u,a as d,d as f,g as p,s as m,t as h,v as g}from"./index-DapCozyq.js";import{t as _}from"./Page-BMcxP_9m.js";function v({afterConfirming:v}){let{isHotReloadingEnabled:y}=h(),{frontendVersion:b}=g(),{unregister:x}=d(),{foda:S,updateFoda:C}=l(),{callApi:w}=o(),{data:T,loading:E,error:D}=c(a,{}),[O,k]=i(!1),A=v===`frontend-version`&&!y&&!E&&D==null&&T!=null&&T.frontendVersion!==b,j=v===`foundational-data-version`&&!E&&D==null&&T!=null&&T.foundationalDataHash!==S.hash;return e(()=>{if(!A)return;async function e(){await x(),window.location.reload()}e()},[A,x]),e(()=>{if(!j)return;async function e(){k(!0);try{let e=await w(s,{hash:S.hash});e.result===`outdated`&&C(new u(e.foundationalData))}catch{}finally{k(!1)}}e()},[j,w,S.hash,C]),E||A||O?n(_,{mobileHeader:null,desktopHeader:null,children:n(r,{xAlign:`center`,yAlign:`center`,children:n(p,{})})}):n(_,{mobileHeader:null,desktopHeader:null,children:n(r,{class:`px-4 py-8 gap-8`,xAlign:`center`,yAlign:`center`,children:[n(t,{style:`title`,align:`center`,children:`Page not found`}),n(t,{align:`center`,children:`This page doesn't exist, at least not anymore!`}),n(f,{href:`/`,text:`Go home`,icon:m})]})})}export{v as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,c as t,i as n,l as r,m as i,r as a,s as o}from"./use-nav-exemptions-QtGbfEPT.js";import{o as s,t as c}from"./use-query-BRsiAaVY.js";import{n as l}from"./use-foundational-data-BEVQRFj9.js";import{a as u,t as d}from"./linear-eK93gfBn.js";import{t as f}from"./LinkText-sdmJpshg.js";import{d as p,g as m,p as h,s as g}from"./index-DapCozyq.js";import{t as _}from"./Page-BMcxP_9m.js";import{t as v}from"./use-simple-headers-CovxFlVs.js";function y(n){let{foda:i}=l(),a=e(()=>({type:`linear`,stops:b(i,n.service.movements)}),[i,n.service.movements]);return r(o,{class:t(n.class),children:r(d,{class:n.class,structure:a,lightThemeColorHexCode:n.service.color?.lightModeHexCode??null,darkThemeColorHexCode:n.service.color?.darkModeHexCode??null})})}function b(e,t){return t.map(t=>{let i=e.stops.require(t.stopId),a=`/stop/${i.urlPath}`,o=t.arrivalTime==null?null:new Date(Date.parse(t.arrivalTime)).toLocaleString(),s=t.departureTime==null?null:new Date(Date.parse(t.departureTime)).toLocaleString();if(o==null&&s==null)return{content:r(n,{style:`small-weak`,children:r(f,{href:a,style:`subtle`,children:[`Skips `,i.name]})}),drawMark:!1};let c=s??o;return{content:r(h,{class:`gap-2 min-w-0`,children:[r(n,{style:`strong`,children:r(f,{href:a,style:`subtle`,children:i.name})}),r(n,{children:`•`}),r(n,{class:`shrink min-w-0`,oneLine:!0,children:c})]})}})}function x(){let{params:{sourceId:e,intrasourceId:t},query:{from:n}}=i(),{data:a,loading:o,error:l}=c(s,{sourceId:e??``,intrasourceId:t??``}),d=u(n??``);return o?r(C,{}):l!=null||a==null||d==null||d<0||a.service!=null&&d>a.service.movements.length-1?r(w,{}):a.service==null?r(T,{}):r(S,{service:a.service,movementIndex:d},`${e}/${t}`)}function S(e){return r(_,{...v({title:`${e.service.primaryDestinationText} service`,back:{href:`/`,text:`Home`}}),children:r(a,{class:`px-4 py-8 gap-8`,children:[r(y,{service:e.service}),r(n,{style:`small-narrow`,children:`(Real-time data has not been provided for all stops. Times marked with * are estimates, extrapolated from the available data.)`})]})})}function C(){return r(_,{...v({title:`Loading...`,back:{href:`/`,text:`Home`}}),children:r(m,{})})}function w(){return r(_,{...v({title:`Error`,back:{href:`/`,text:`Home`}}),children:r(n,{children:`Failed to load service.`})})}function T(){return r(_,{mobileHeader:null,desktopHeader:null,children:r(a,{class:`px-4 py-8 gap-8`,xAlign:`center`,yAlign:`center`,children:[r(n,{style:`title`,align:`center`,children:`Service not found`}),r(n,{align:`center`,children:`This can happen if the service was cancelled, or the timetable changed since this link was generated. You might be able to find it again by searching for one of the stops it departed from.`}),r(p,{href:`/`,text:`Go home`,icon:g})]})})}export{x as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_ as e,c as t,i as n,l as r,m as i,n as a,o,r as s,s as c}from"./use-nav-exemptions-QtGbfEPT.js";import{t as l,u}from"./use-query-BRsiAaVY.js";import{n as d}from"./use-foundational-data-BEVQRFj9.js";import{d as f,f as p,g as m,i as h,n as g,p as _,r as v}from"./index-DapCozyq.js";import{t as y}from"./Page-BMcxP_9m.js";import{n as b,t as x}from"./SimpleMobileHeaderContent-9gskaqRe.js";import{t as S}from"./NotFoundPage-rHyFGsin.js";import{t as C}from"./ErrorMessage-CCAB4vXB.js";function w(e){return{hideMobileHeaderWhenScrolledToTop:!0,mobileHeader:r(x,{title:e.title,backHref:e.back?.href??null}),agnosticHeader:r(c,{class:`not-desktop:bg-bg-navbar not-desktop:border-b not-desktop:border-soft-border`,children:r(a,{children:r(c,{class:`not-desktop:px-4 desktop:mx-4 desktop:border-b desktop:border-soft-border`,children:r(s,{class:t(`gap-8`,{"pt-4 pb-6 desktop:pt-6":e.back!=null,"py-6 desktop:pt-8":e.back==null,"desktop:pb-4":e.additionalContent==null}),children:[e.back!=null&&r(f,{text:e.back.text,href:e.back.href,icon:b,class:`self-start`,layout:`narrow-icon`}),r(s,{class:`gap-4`,children:[r(n,{style:`megatitle`,children:e.title}),e.additionalContent]})]})})})})}}function T(e){return r(_,{class:t(e.class),children:r(n,{style:`strong`,dynamicColor:e.serviceColor,children:e.time})})}var E=3.5;function D(e){return r(s,{class:t(e.class,`h-14 min-w-0`),yAlign:`space-between`,children:[r(_,{xAlign:`space-between`,class:`gap-2 `,children:[r(_,{yAlign:`bottom`,class:`gap-1 shrink min-w-0`,children:[r(n,{style:`strong`,dynamicColor:e.departure.color,children:e.departure.primaryDestinationText}),r(n,{style:`small-narrow`,class:`shrink min-w-0`,dynamicColor:e.departure.color,oneLine:!0,children:`via Train Tracks`})]}),r(T,{time:e.departure.movement.time,formerTime:e.departure.movement.formerTime,serviceColor:e.departure.color})]}),r(_,{xAlign:`space-between`,yAlign:`bottom`,children:[r(s,{class:`gap-3 min-w-0 shrink`,children:[r(n,{style:`small-narrow`,oneLine:!0,children:`The stopping pattern goes here`}),r(_,{class:`gap-1`,children:[r(n,{style:`small-narrow-strong-success`,children:`Solid`}),r(n,{style:`small-narrow`,children:`•`}),r(n,{style:`small-narrow`,class:`shrink min-w-0`,oneLine:!0,children:`And then this row shows all sorts of stuff`})]})]}),r(s,{yAlign:`space-between`,class:`border-2 px-1.5 py-1 border-soft-border rounded-sm -mb-0.5 h-8.5`,children:[r(n,{style:`tiny-narrow`,align:`center`,children:`Platform`}),r(n,{style:`strong`,align:`center`,children:`X`})]})]})]})}function O(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9.343 6.343L15 12l-5.657 5.657`})})}var k=E+2;function A(e){return r(p,{class:t(e.class),href:j(e.departure),children:r(c,{class:`grid-cols-[1fr_auto] p-4 items-center pr-2 gap-2`,children:[r(D,{departure:e.departure}),r(O,{class:`text-icon-lg text-fg`})]})})}function j(e){return`/service/${encodeURIComponent(e.sourceId)}/${encodeURIComponent(e.intrasourceId)}?from=${encodeURIComponent(e.movement.index.toString())}`}function M(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M11 20H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v4H4m12-7v2M8 4v2m12.121 9.879L18 18m0 0l-2.121 2.121M18 18l-2.121-2.121M18 18l2.121 2.121`})})}function N(e){let{pluralServicesTerm:n}=h();return e.loading?r(P,{class:e.class,queryCount:e.queryCount,centerContent:!0,children:r(m,{})}):e.isError?r(P,{class:t(e.class,`gap-2`),queryCount:e.queryCount,centerContent:!0,children:r(C,{text:`An error occurred while retrieving departures`})}):e.departures.length===0?r(P,{class:e.class,queryCount:e.queryCount,centerContent:!0,children:r(C,{text:`No ${n} scheduled`,icon:M})}):r(P,{class:e.class,queryCount:e.queryCount,children:e.departures.map((t,n)=>r(c,{class:`relative`,children:[r(A,{departure:t}),n<e.queryCount-1&&r(`hr`,{class:`border-soft-border absolute bottom-0 left-0 right-0 mx-4`})]},F(t)))})}function P(e){let t=e.centerContent??!1;return r(s,{class:e.class,xAlign:t?`center`:`stretch`,yAlign:t?`center`:`top`,dynamicMinHeightRem:k*e.queryCount,children:e.children})}function F(e){return`${e.sourceId}/${e.intrasourceId}/${e.movement.index}`}function I(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`m4 20l5-5m0 0l3.956 3.956a1 1 0 0 0 1.626-.314l2.255-5.261a1 1 0 0 1 .548-.535l3.207-1.283a1 1 0 0 0 .336-1.635l-6.856-6.856a1 1 0 0 0-1.635.336l-1.283 3.207a1 1 0 0 1-.535.548L5.358 9.418a1 1 0 0 0-.314 1.626z`})})}function L(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M9 20H4v-5m0 5l6.5-6.5M15 4h5v5m0-5l-6.5 6.5`})})}function R(e){return r(s,{class:t(e.class,`min-w-0`),children:[r(_,{xAlign:`space-between`,yAlign:`center`,class:`gap-2 not-desktop:pl-4 not-desktop:pr-2 not-desktop:pt-6 pb-2`,children:[r(n,{style:`subtitle`,class:`shrink min-w-0`,oneLine:!0,children:e.feed.query.title}),r(_,{class:`gap-2`,children:[r(f,{theme:`hover`,icon:I}),r(f,{theme:`hover`,icon:L})]})]}),r(N,{class:`bg-bg-raised desktop:border not-desktop:border-y border-soft-border desktop:rounded-lg overflow-hidden box-content`,departures:e.feed.departures,queryCount:e.feed.query.count,loading:e.feed.loading,isError:e.feed.isError})]})}function z(e){return r(c,{class:t(e.class,`desktop:grid-cols-[1fr_1fr] desktop:gap-6 desktop:px-4 desktop:py-8`),children:e.feeds.map((e,t)=>r(R,{feed:e,class:`not-desktop:last:-mb-px`},t))})}function B(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M17.657 9.343L12 15L6.343 9.343`})})}function V(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 7v5l3 3m6-3a9 9 0 1 1-18 0a9 9 0 0 1 18 0`})})}function H(e){return r(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`1em`,height:`1em`,viewBox:`0 0 24 24`,...e,children:r(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M19.5 4h-15a.5.5 0 0 0-.5.5v2.086a1 1 0 0 0 .293.707L10 13v5.691a.5.5 0 0 0 .276.447L14 21v-8l5.707-5.707A1 1 0 0 0 20 6.586V4.5a.5.5 0 0 0-.5-.5Z`})})}function U(e){return r(c,{class:`desktop:pt-6 desktop:px-4`,children:r(c,{class:t(e.class,`grid-cols-[1fr_1fr] desktop:max-w-150 bg-bg-raised divide-x divide-soft-border desktop:border not-desktop:border-b border-soft-border desktop:rounded-lg overflow-hidden`),children:[r(p,{children:r(_,{xAlign:`space-between`,yAlign:`center`,class:`p-4`,children:[r(_,{yAlign:`center`,class:`gap-2`,children:[r(g,{heightRem:o(`text-md`),children:r(V,{class:`text-icon-lg text-fg`})}),r(n,{children:`Now`})]}),r(g,{heightRem:o(`text-md`),children:r(B,{class:`text-icon-lg text-fg`})})]})}),r(p,{children:r(_,{xAlign:`space-between`,yAlign:`center`,class:`p-4`,children:[r(_,{yAlign:`center`,class:`gap-2`,children:[r(g,{heightRem:o(`text-md`),children:r(H,{class:`text-icon-lg text-fg`})}),r(n,{children:`All trains`})]}),r(g,{heightRem:o(`text-md`),children:r(B,{class:`text-icon-lg text-fg`})})]})})]})})}function W(){let{params:{id:t}}=i(),{foda:n}=d(),a=e(()=>n.stops.getByUrlPath(t??``),[n.stops,t]);return a==null?r(S,{afterConfirming:`foundational-data-version`}):r(G,{stop:a},a.id)}function G(t){let{data:n,loading:i,error:a}=l(u,{stopId:t.stop.id,count:5}),o=e(()=>[{query:{title:`Citybound trains`,count:5},departures:n?.departures??[],loading:i,isError:a!=null},{query:{title:`Outbound trains`,count:5},departures:n?.departures??[],loading:i,isError:a!=null}],[n?.departures,i,a]);return r(y,{...w({title:t.stop.name,back:{href:`/`,text:`Home`},additionalContent:r(v,{lineIds:t.stop.canonicalLinesServingStop,withLinks:!0})}),children:r(s,{children:[r(U,{}),r(z,{feeds:o})]})})}export{W as default};
|