@kaeawc/auto-mobile 0.0.92 → 0.0.93
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/dist/build-info.json +12 -12
- package/dist/schemas/test-plan.schema.json +370 -52
- package/dist/src/{chunk-jhnbfj19.js → chunk-00167wan.js} +5 -5
- package/dist/src/chunk-0jrrsnc9.js +6 -0
- package/dist/src/chunk-0n6swkwg.js +5 -0
- package/dist/src/chunk-0qsy1qsx.js +57 -0
- package/dist/src/chunk-11m8wj8j.js +237 -0
- package/dist/src/{chunk-4pfftt07.js → chunk-1p7xf5kb.js} +3 -3
- package/dist/src/chunk-23p5f095.js +4 -0
- package/dist/src/{chunk-a4k9rt7z.js → chunk-26k317v5.js} +3 -3
- package/dist/src/chunk-284ptqa4.js +7 -0
- package/dist/src/chunk-28re4xrg.js +4 -0
- package/dist/src/chunk-2f9rkmhx.js +5 -0
- package/dist/src/chunk-2fxdh48t.js +4 -0
- package/dist/src/chunk-2tbdrbt6.js +4 -0
- package/dist/src/chunk-2tqzq5qh.js +971 -0
- package/dist/src/chunk-32gvv9b4.js +21 -0
- package/dist/src/chunk-3f3t1x97.js +8 -0
- package/dist/src/chunk-3fspkbc7.js +4 -0
- package/dist/src/chunk-3qwrzxh0.js +11 -0
- package/dist/src/chunk-3sy6ahhz.js +26 -0
- package/dist/src/chunk-3vg455e6.js +4 -0
- package/dist/src/chunk-3xkpk44w.js +5 -0
- package/dist/src/chunk-3y6eykz9.js +4 -0
- package/dist/src/chunk-49bsqdx3.js +4 -0
- package/dist/src/chunk-4hw3665t.js +42 -0
- package/dist/src/chunk-58wzr3mt.js +5 -0
- package/dist/src/chunk-5d2hft6c.js +5 -0
- package/dist/src/chunk-5snsn9cf.js +4 -0
- package/dist/src/chunk-5tm9mn47.js +54 -0
- package/dist/src/chunk-5zc77a5t.js +4 -0
- package/dist/src/chunk-64j0majr.js +19 -0
- package/dist/src/chunk-65y8v4td.js +17 -0
- package/dist/src/chunk-6awz7vhq.js +5 -0
- package/dist/src/{chunk-stfzjr9y.js → chunk-6bznss4t.js} +5 -5
- package/dist/src/chunk-6ep7f5ge.js +4 -0
- package/dist/src/{chunk-0dfnyfkh.js → chunk-6wt9rgjf.js} +3 -3
- package/dist/src/chunk-6xmss8er.js +8 -0
- package/dist/src/chunk-710rxz9y.js +5 -0
- package/dist/src/chunk-7cs2da62.js +5 -0
- package/dist/src/chunk-7g103b54.js +4 -0
- package/dist/src/chunk-7j5vj4pa.js +4 -0
- package/dist/src/chunk-7rz9898k.js +5 -0
- package/dist/src/chunk-7tw8x05v.js +4 -0
- package/dist/src/chunk-7zy586cb.js +4 -0
- package/dist/src/{chunk-r0f1q783.js → chunk-8037tzzj.js} +3 -3
- package/dist/src/chunk-84nanf8s.js +5 -0
- package/dist/src/{chunk-950qcq1e.js → chunk-8g1922rp.js} +4 -4
- package/dist/src/chunk-8gvwcv2p.js +4 -0
- package/dist/src/{chunk-sz1a7p43.js → chunk-8ph29g99.js} +1 -1
- package/dist/src/chunk-8thrmfat.js +4 -0
- package/dist/src/chunk-8zgzzs7k.js +78 -0
- package/dist/src/chunk-97b1zmaq.js +4 -0
- package/dist/src/chunk-9fth9ayh.js +4 -0
- package/dist/src/chunk-9j6anhjr.js +4 -0
- package/dist/src/{chunk-w7zsh13a.js → chunk-aabchzxk.js} +4 -4
- package/dist/src/{chunk-wry6skrm.js → chunk-ayp07wbb.js} +1 -1
- package/dist/src/chunk-bfjwqk8q.js +4 -0
- package/dist/src/{chunk-jdqvcq0a.js → chunk-bfw6125s.js} +3 -3
- package/dist/src/chunk-bnhscm2n.js +4 -0
- package/dist/src/chunk-bxmsax22.js +5 -0
- package/dist/src/chunk-c1vs4g1n.js +4 -0
- package/dist/src/chunk-ct3e7yng.js +4 -0
- package/dist/src/{chunk-8en08r7q.js → chunk-cyy71ggq.js} +3 -3
- package/dist/src/chunk-ddzkz92z.js +4 -0
- package/dist/src/chunk-dgrbdpb7.js +9 -0
- package/dist/src/chunk-drdz8hee.js +5 -0
- package/dist/src/chunk-e98dqnc9.js +145 -0
- package/dist/src/chunk-eersndy7.js +5 -0
- package/dist/src/chunk-eggq53ks.js +4 -0
- package/dist/src/chunk-f2dya7cs.js +4 -0
- package/dist/src/chunk-fbakd6cw.js +4 -0
- package/dist/src/chunk-fgb98zjj.js +5 -0
- package/dist/src/chunk-fmpad823.js +5 -0
- package/dist/src/{chunk-v90es00d.js → chunk-g04bwyj3.js} +2 -2
- package/dist/src/chunk-g0xr8zw0.js +4 -0
- package/dist/src/chunk-g3rjs80x.js +4 -0
- package/dist/src/chunk-g78rtrfv.js +4 -0
- package/dist/src/{chunk-r20pe1nv.js → chunk-g7tmjbkt.js} +3 -3
- package/dist/src/chunk-gabgv3y5.js +4 -0
- package/dist/src/chunk-gmr45m8f.js +4 -0
- package/dist/src/chunk-gsyfebqj.js +4 -0
- package/dist/src/chunk-h5rpn9wr.js +247 -0
- package/dist/src/chunk-hb1x7v55.js +4 -0
- package/dist/src/chunk-hrfytkxh.js +168 -0
- package/dist/src/chunk-j4yjzbak.js +4 -0
- package/dist/src/chunk-jd6a5v6p.js +5 -0
- package/dist/src/chunk-jh6vhqzx.js +5 -0
- package/dist/src/chunk-kn5spq15.js +4 -0
- package/dist/src/{chunk-w2mwa0jk.js → chunk-m94qs0f0.js} +2 -2
- package/dist/src/chunk-mjrps0ac.js +7 -0
- package/dist/src/chunk-n03dmn5q.js +5 -0
- package/dist/src/chunk-n72qhwd9.js +4 -0
- package/dist/src/{chunk-km0dy5vc.js → chunk-ndt1ccxm.js} +9 -9
- package/dist/src/chunk-nr6y0n4y.js +5 -0
- package/dist/src/chunk-pcsen2vs.js +4 -0
- package/dist/src/chunk-ppfr0b8h.js +4 -0
- package/dist/src/chunk-q10bdnat.js +4 -0
- package/dist/src/chunk-q9xmq595.js +4 -0
- package/dist/src/{chunk-2v7tw1nj.js → chunk-qcxzr2my.js} +3 -3
- package/dist/src/chunk-qf6nynk6.js +7 -0
- package/dist/src/chunk-qyqypn28.js +5 -0
- package/dist/src/chunk-r2epb56s.js +4 -0
- package/dist/src/chunk-r5bxavdx.js +311 -0
- package/dist/src/{chunk-r14wwk37.js → chunk-r6z1eztj.js} +12 -12
- package/dist/src/{chunk-d57432wq.js → chunk-r7bpkgff.js} +2 -2
- package/dist/src/chunk-r8jf3d92.js +4 -0
- package/dist/src/{chunk-9rkfyt6q.js → chunk-rbpdk7m0.js} +3 -3
- package/dist/src/chunk-rc0dbypm.js +4 -0
- package/dist/src/chunk-rhcty4ms.js +4 -0
- package/dist/src/chunk-rpvckv3p.js +4 -0
- package/dist/src/{chunk-s1zq65ny.js → chunk-rqc9ap3x.js} +2 -2
- package/dist/src/chunk-rvvy1bte.js +7 -0
- package/dist/src/chunk-ry0mz41y.js +4 -0
- package/dist/src/{chunk-34zxqcmq.js → chunk-s3jc6cwp.js} +3 -3
- package/dist/src/chunk-sfv61xjb.js +6 -0
- package/dist/src/chunk-t6bfvfkg.js +4 -0
- package/dist/src/chunk-t6c8akcm.js +5 -0
- package/dist/src/chunk-t7w8rctc.js +4 -0
- package/dist/src/chunk-thbh3jew.js +5 -0
- package/dist/src/chunk-v2wd4n3e.js +5 -0
- package/dist/src/{chunk-zg67wjkh.js → chunk-v6pya0dm.js} +3 -3
- package/dist/src/chunk-vy3bwm1d.js +17 -0
- package/dist/src/chunk-w3vs79ex.js +27 -0
- package/dist/src/chunk-w4zga19f.js +4 -0
- package/dist/src/chunk-w5b2jwk3.js +14 -0
- package/dist/src/chunk-w7hkv422.js +5 -0
- package/dist/src/{chunk-qv2918jt.js → chunk-waqwcjyn.js} +2 -2
- package/dist/src/{chunk-b4cxdzwy.js → chunk-wbh8spm5.js} +7 -7
- package/dist/src/{chunk-ajsrz473.js → chunk-wyrkw6hw.js} +3 -3
- package/dist/src/chunk-xa73x2cx.js +5 -0
- package/dist/src/{chunk-eka89q3k.js → chunk-xgan0qqp.js} +1 -1
- package/dist/src/chunk-y2vs6jwg.js +4 -0
- package/dist/src/chunk-yattm52s.js +4 -0
- package/dist/src/{chunk-9y5bcy28.js → chunk-yb97j25b.js} +4 -4
- package/dist/src/{chunk-c9nk1r78.js → chunk-ybbtagbt.js} +3 -3
- package/dist/src/chunk-ycaj2sgf.js +9 -0
- package/dist/src/chunk-yf7ympyz.js +325 -0
- package/dist/src/chunk-yjawdzk8.js +4 -0
- package/dist/src/chunk-z637nqg8.js +11 -0
- package/dist/src/{chunk-0w1spptt.js → chunk-zgja5f3p.js} +4 -4
- package/dist/src/chunk-zs1sghs9.js +4 -0
- package/dist/src/daemon/processEntry.js +2 -2
- package/dist/src/index.js +4 -4
- package/dist/src/runtime/bunRuntimeGuard.js +2 -2
- package/dist/src/utils/workers/iosBundleExtractWorker.js +2 -2
- package/ios/CameraPosterInjection/Injection/CameraPosterInjection.m +466 -0
- package/package.json +3 -2
- package/schemas/test-plan.schema.json +370 -52
- package/dist/src/chunk-09442h7v.js +0 -4
- package/dist/src/chunk-0e4gm1kj.js +0 -5
- package/dist/src/chunk-0eb8576f.js +0 -4
- package/dist/src/chunk-0rjm4nx7.js +0 -5
- package/dist/src/chunk-1zmh2eak.js +0 -4
- package/dist/src/chunk-28k63ha3.js +0 -5
- package/dist/src/chunk-2d4wmp8b.js +0 -4
- package/dist/src/chunk-2e6s75qv.js +0 -78
- package/dist/src/chunk-32jpxz2y.js +0 -323
- package/dist/src/chunk-3jmvqygr.js +0 -238
- package/dist/src/chunk-3swvfhqt.js +0 -5
- package/dist/src/chunk-44bt78m9.js +0 -5
- package/dist/src/chunk-488vt2bp.js +0 -4
- package/dist/src/chunk-4fgdhcwx.js +0 -5
- package/dist/src/chunk-4jp2se4w.js +0 -4
- package/dist/src/chunk-4vhr9e4t.js +0 -4
- package/dist/src/chunk-4xd6zs3y.js +0 -15
- package/dist/src/chunk-51567pg8.js +0 -4
- package/dist/src/chunk-5agqsfev.js +0 -4
- package/dist/src/chunk-5d706gmr.js +0 -4
- package/dist/src/chunk-5kd4rqk7.js +0 -5
- package/dist/src/chunk-61t538bm.js +0 -4
- package/dist/src/chunk-6d3mmqxt.js +0 -54
- package/dist/src/chunk-6hyt398x.js +0 -5
- package/dist/src/chunk-6mnr8kpm.js +0 -4
- package/dist/src/chunk-79q5xsdc.js +0 -42
- package/dist/src/chunk-7bdgand3.js +0 -4
- package/dist/src/chunk-84cp9dw5.js +0 -4
- package/dist/src/chunk-86f2h5ww.js +0 -5
- package/dist/src/chunk-8cghfzb2.js +0 -19
- package/dist/src/chunk-9tf2p9y9.js +0 -5
- package/dist/src/chunk-a2sc4jm0.js +0 -5
- package/dist/src/chunk-aa5ng3d1.js +0 -4
- package/dist/src/chunk-b3h0a6ca.js +0 -4
- package/dist/src/chunk-b6a737qt.js +0 -4
- package/dist/src/chunk-bn64x5z5.js +0 -5
- package/dist/src/chunk-bvh649za.js +0 -12
- package/dist/src/chunk-c9tyfg4j.js +0 -26
- package/dist/src/chunk-cfsdfqnm.js +0 -4
- package/dist/src/chunk-cxyf04jc.js +0 -7
- package/dist/src/chunk-da08tx5v.js +0 -4
- package/dist/src/chunk-f2tc08m2.js +0 -4
- package/dist/src/chunk-f8tnk179.js +0 -5
- package/dist/src/chunk-f9s1kkhx.js +0 -5
- package/dist/src/chunk-fbp8a4rx.js +0 -4
- package/dist/src/chunk-fd2z0sze.js +0 -4
- package/dist/src/chunk-fk927f4q.js +0 -54
- package/dist/src/chunk-fxmr3a0f.js +0 -4
- package/dist/src/chunk-gaqwhd44.js +0 -4
- package/dist/src/chunk-ggtd5x5a.js +0 -5
- package/dist/src/chunk-gndcfrm7.js +0 -4
- package/dist/src/chunk-h3n4adc6.js +0 -310
- package/dist/src/chunk-h5pjbb83.js +0 -4
- package/dist/src/chunk-hgnnh302.js +0 -4
- package/dist/src/chunk-hmke8nhx.js +0 -5
- package/dist/src/chunk-j2bx12hn.js +0 -4
- package/dist/src/chunk-j70y1a2g.js +0 -4
- package/dist/src/chunk-js1jpyxp.js +0 -6
- package/dist/src/chunk-kbjq0qvb.js +0 -4
- package/dist/src/chunk-kfwx57xd.js +0 -4
- package/dist/src/chunk-kzwctna2.js +0 -4
- package/dist/src/chunk-m9ehyehy.js +0 -4
- package/dist/src/chunk-mct91p1f.js +0 -4
- package/dist/src/chunk-mf9spd4g.js +0 -5
- package/dist/src/chunk-mgrcansb.js +0 -4
- package/dist/src/chunk-mqc1d0eb.js +0 -6
- package/dist/src/chunk-n1zmpk0z.js +0 -4
- package/dist/src/chunk-ncyjf63g.js +0 -4
- package/dist/src/chunk-nr64d21q.js +0 -973
- package/dist/src/chunk-nwm2pq5v.js +0 -168
- package/dist/src/chunk-pm06b05d.js +0 -9
- package/dist/src/chunk-q50s00ry.js +0 -4
- package/dist/src/chunk-qwye1958.js +0 -14
- package/dist/src/chunk-r8z9pfve.js +0 -5
- package/dist/src/chunk-rdpgkjf6.js +0 -4
- package/dist/src/chunk-rkr0dks9.js +0 -5
- package/dist/src/chunk-rn84t3sf.js +0 -11
- package/dist/src/chunk-s123kn7n.js +0 -4
- package/dist/src/chunk-s73qn3fx.js +0 -4
- package/dist/src/chunk-sjn0nj4p.js +0 -5
- package/dist/src/chunk-sns0c35v.js +0 -7
- package/dist/src/chunk-t4dr5c8v.js +0 -8
- package/dist/src/chunk-tc8k9c1j.js +0 -4
- package/dist/src/chunk-teznhase.js +0 -4
- package/dist/src/chunk-ty9xgmz4.js +0 -4
- package/dist/src/chunk-tyazf3sk.js +0 -145
- package/dist/src/chunk-v6npjrjm.js +0 -5
- package/dist/src/chunk-vbvtzkwz.js +0 -5
- package/dist/src/chunk-vefd8qee.js +0 -8
- package/dist/src/chunk-vs9r72ta.js +0 -17
- package/dist/src/chunk-w88k0bgr.js +0 -4
- package/dist/src/chunk-wzdt0enk.js +0 -4
- package/dist/src/chunk-xhhv854c.js +0 -4
- package/dist/src/chunk-y58270hd.js +0 -4
- package/dist/src/chunk-yk0hmbex.js +0 -4
- package/dist/src/chunk-ympy4fdz.js +0 -28
- package/dist/src/chunk-yw436axy.js +0 -4
- package/dist/src/chunk-z04jrpjy.js +0 -5
- package/dist/src/chunk-z2xznczw.js +0 -4
- package/dist/src/chunk-z4xnrgps.js +0 -4
- package/dist/src/chunk-z7csyszv.js +0 -4
- package/dist/src/chunk-z8t0v07j.js +0 -11
- package/dist/src/chunk-z916af47.js +0 -228
- package/dist/src/chunk-zcr8he8q.js +0 -5
- package/dist/src/chunk-zd9vmkzn.js +0 -9
- package/dist/src/chunk-zj939v0h.js +0 -5
- package/dist/src/chunk-zkdjwtc1.js +0 -4
- package/dist/src/chunk-zkv5kzt6.js +0 -4
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
var{create:Vz,defineProperty:Vn,getOwnPropertyDescriptor:Hz,getOwnPropertyNames:Bz,getPrototypeOf:Jz}=Object,Kz=Object.prototype.hasOwnProperty,B=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Yu=(e,t)=>{let r={};for(var o in e)Vn(r,o,{get:e[o],enumerable:!0});if(t)Vn(r,Symbol.toStringTag,{value:"Module"});return r},Gz=(e,t,r,o)=>{if(t&&typeof t==="object"||typeof t==="function"){for(var n=Bz(t),s=0,i=n.length,a;s<i;s++)if(a=n[s],!Kz.call(e,a)&&a!==r)Vn(e,a,{get:((c)=>t[c]).bind(null,a),enumerable:!(o=Hz(t,a))||o.enumerable})}return e},Hn=(e,t,r)=>(r=e!=null?Vz(Jz(e)):{},Gz(t||!e||!e.__esModule?Vn(r,"default",{value:e,enumerable:!0}):r,e));var Wz=new Set(["https://json-schema.org/draft/2020-12/schema","http://json-schema.org/draft/2020-12/schema"]),Xu=new Set(["https://json-schema.org/draft/2019-09/schema","http://json-schema.org/draft/2019-09/schema"]),Yz=new Set(["https://json-schema.org/draft-07/schema","http://json-schema.org/draft-07/schema"]),Xz=new Set(["https://json-schema.org/draft-06/schema","http://json-schema.org/draft-06/schema"]);function Qu(e){return typeof e==="string"&&Xu.has(e.replace(/#$/,""))}function el(e,t){if(!("$schema"in e)||typeof e.$schema!=="string")return"2020-12";let r=e.$schema.replace(/#$/,"");if(Wz.has(r))return"2020-12";if(Xu.has(r))return"2019-09";if(Yz.has(r)||Xz.has(r))return"draft-7";throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}function Ao(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function Ai(e,t="|"){return e.map((r)=>qi(r)).join(t)}function jo(e,t){if(typeof t==="bigint")return t.toString();return t}class rl{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Mo(e){return new rl(e)}function ol(e){return e===null||e===void 0}function Bn(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function nl(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}var tl=Symbol("evaluating");function sl(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===tl)return;if(o===void 0)o=tl,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function yt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function qo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Zt(e){return qo(e._zod.def)??e._zod.def.shape}function il(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return yt(this,t,o),o},enumerable:!0,configurable:!0})}function al(e,t,r){if(t in e)yt(e,t,r);else e[t]=r}function _r(e,t,r,o){let n=Zt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);if(!i.enumerable)continue;if(i.get)il(e,s,()=>{let a=t._zod.def.shape[s];return o?o(a,s):a});else al(e,s,o?o(i.value,s):i.value)}}function Qz(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)il(e,r,()=>t[r]);else al(e,r,o.value)}}function ut(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function cl(e){return JSON.stringify(e)}function ul(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ji="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function qr(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var ll=Mo(()=>{if(rt.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function yr(e){if(qr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(qr(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function Zi(e){if(yr(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var dl=new Set(["string","number","symbol"]);function Wt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Rt(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function oe(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}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function qi(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function pl(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Kn=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),Li={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function e$(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s={};return _r(s,e,Gn(e,t)),Rt(e,ut(r,{shape:s,checks:[]}))}function Gn(e,t){let r=Zt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw Error(`Unrecognized key: "${String(n)}"`);if(t[n])o.push(n)}return o}function t$(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(Gn(e,t)),i={};return _r(i,e,Reflect.ownKeys(Zt(e)).filter((a)=>!s.has(a))),Rt(e,ut(r,{shape:i,checks:[]}))}function r$(e,t){if(!yr(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=Zt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Rt(e,ut(e._zod.def,{shape:ml(e,t)}))}function ml(e,t){let r={};return _r(r,e,Reflect.ownKeys(Zt(e))),Qz(r,t),r}function o$(e,t){if(!yr(t))throw Error("Invalid input to safeExtend: expected a plain object");return Rt(e,ut(e._zod.def,{shape:ml(e,t)}))}function n$(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 r={};_r(r,e,Reflect.ownKeys(Zt(e))),_r(r,t,Reflect.ownKeys(Zt(t)));let o=ut(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Rt(e,o)}function fl(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let a=r?new Set(Gn(t,r)):void 0,c={};return _r(c,t,Reflect.ownKeys(Zt(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),Rt(t,ut(t._zod.def,{shape:c,checks:[]}))}function s$(e,t,r){let o=r?new Set(Gn(t,r)):void 0,n={};return _r(n,t,Reflect.ownKeys(Zt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),Rt(t,ut(t._zod.def,{shape:n}))}function Et(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function hl(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Yt(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function No(e){return typeof e==="string"?e:e?.message}function Di(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;if(n>=0)t.push([n,r])}return t}function Wn(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function Tt(e,t,r){var o;let n=e.inst?._zod?.traits;if(n?.has("$ZodType"))if(n.has("$ZodCheck"))(o=e).schema??(o.schema=e.inst);else e.schema=e.inst;let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:No(e.inst?._zod.def?.error?.(e))??No(s?.(e))??No(t?.error?.(e))??No(r.customError?.(e))??No(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e)){if(c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__")continue;a[c]=e[c]}if(a.path??(a.path=[]),a.message=i,t?.reportInput)a.input=e.input;return a}var i$=/[\uD800-\uDBFF]/;function Yn(e){let t=e.length;if(!i$.test(e))return t;let r=t;for(let o=0;o<t-1;o++)if((e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320)r--,o++;return r}function Xn(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function gl(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 r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function vr(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function _l(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else a$(e,r,o.value)}}function qt(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Qn(e,t,r){return qt(e,t,r,!1)}function yl(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return qt(this,r,o(this))},set(n){qt(this,r,n)}})}return t}function a$(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:qt(this,t,r.bind(this))},set(o){qt(this,t,o)}})}function c$(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Ni,Gt=!1,u$={configurable:!0,get(){Gt=!0;return}};function Se(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&Ni!==e._zod){Ni=void 0;return}Ni=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,u$);let n=Gt;Gt=!1;try{let s=r(this);if(Gt)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s});return Gt=Gt||n,s}catch(s){throw delete this[t],Gt=Gt||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function l$(e,t,r,o){let n=c$(e,t);if(!n)return;Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var d$="~constantCatch";function vl(e){let t=()=>e;return t[d$]=!0,t}var Sl,Fi=Object.freeze({status:"aborted"}),Ui={value:void 0,enumerable:!1},bl="captureStackTrace"in Error?Error:null;function p$(e){let t=bl;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return bl=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function L(e,t,r,o){let n={};function s(m){this.def=m,this.constr=d,this.traits=new Set}s.prototype=n;let i=r,a=i&&new WeakSet;function c(m,h){if(!m._zod){Ui.value=new s(h);try{Object.defineProperty(m,"_zod",Ui)}finally{Ui.value=void 0}}else if(m._zod.traits.has(e))return;if(m._zod.traits.add(e),t(m,h),a){let v=Object.getPrototypeOf(m),y=m._zod.constr.prototype,g=v;while(g&&g!==y)g=Object.getPrototypeOf(g);let P=g??v;if(!a.has(P))a.add(P),_l(P,i)}let f=d.prototype;for(let v in f){if(!Object.prototype.hasOwnProperty.call(f,v))continue;if(!(v in m))m[v]=f[v].bind(m)}}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(m){let h=o?.Parent?p$(l):this;c(h,m);let f=h._zod.deferred;if(f){for(let y of f)y();h._zod.deferred=void 0}let v=globalThis.__zod_globalConfig?.postProcessor;if(v)v(h);return h}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:(m)=>{if(o?.Parent&&m instanceof o.Parent)return!0;return m?._zod?.traits?.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}class Ot extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Lo extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Sl=globalThis).__zod_globalConfig??(Sl.__zod_globalConfig={});var rt=globalThis.__zod_globalConfig;function ot(e){if(e)Object.assign(rt,e);return rt}function m$(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,jo,2)),e.message}function f$(e){this._zod.message=e}var h$={get:m$,set:f$,enumerable:!0,configurable:!0},Hi={value:void 0,enumerable:!1},zl=new WeakSet([Object.prototype,Error.prototype]),$l=(e,t)=>{e.name="$ZodError",Hi.value=t,Object.defineProperty(e,"issues",Hi),Hi.value=void 0,Object.defineProperty(e,"message",h$);let r=Object.getPrototypeOf(e);if(!zl.has(r))zl.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}})},Rl=L("$ZodError",$l),YT=L("$ZodError",$l,void 0,{Parent:Error});function g$(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Bi(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)g$(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Ji(e,t=(r)=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((a)=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;while(u<a.length){let l=a[u],d=u===a.length-1;if(l==="_errors"){if(d)c._errors.push(t(i));u++;continue}if(!Object.prototype.hasOwnProperty.call(c,l))Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[l];if(d)m._errors.push(t(i));c=m,u++}}}};return o(e),r}function es(e,t){return{callee:t?.callee??e,Err:t?.Err}}var ts=(e)=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)throw new Ot;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Tt(u,i,ot())));throw ji(c,s?.callee??t),c}return a.value};return t};var rs=(e)=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Tt(u,i,ot())));throw ji(c,s?.callee??t),c}return a.value};return t};var os=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new Ot;return s.issues.length?wl(e,s.issues,n):{success:!0,data:s.value}};function wl(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>Tt(n,r,ot()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var ns=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)s=await s;return s.issues.length?wl(e,s.issues,n):{success:!0,data:s.value}};var _$=Symbol.for("zod.compile.invalid"),y$=Symbol.for("zod.compile.fallback"),Gi=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==_$)return!0;if(o.definite===!0&&r===void 0)return!1}return v$(e,t,r)};function v$(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n)o[y$]=!0,s=n({value:t,issues:[]},o);else s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new Ot;return s.issues.length===0}var Wi=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);if(n instanceof Promise)n=await n;return n.issues.length===0},Pl=(e)=>{let t=ts(e),r=(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,a,es(r,i))};return r};var kl=(e)=>{let t=ts(e),r=(o,n,s,i)=>t(o,n,s,es(r,i));return r};var xl=(e)=>{let t=rs(e),r=async(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,a,es(r,i))};return r};var El=(e)=>{let t=rs(e),r=async(o,n,s,i)=>await t(o,n,s,es(r,i));return r};var Tl=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return os(e)(t,r,n)};var Ol=(e)=>(t,r,o)=>os(e)(t,r,o);var Cl=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return ns(e)(t,r,n)};var Il=(e)=>async(t,r,o)=>ns(e)(t,r,o);var Nl=/^[cC][0-9a-z]{6,}$/,Al=/^[0-9a-z]+$/,Ml=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Zl=/^[0-9a-vA-V]{20}$/,ql=/^[A-Za-z0-9]{27}$/,Ll=/^[a-zA-Z0-9_-]{21}$/;function Dl(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ul=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Fl=/^([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})$/,Xi=(e)=>{if(!e)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var Vl=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var S$="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Hl(){return new RegExp(S$,"u")}var Bl=/^(?:(?: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])$/,Jl=/^(([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}|:))$/;var Kl=/^((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])$/,Gl=/^(([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])$/,Wl=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Yl=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Xl=/^https?$/,Ql=/^\+[1-9]\d{6,14}$/;var ed="(?:(?:\\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 b$(e){return new RegExp(`^${e}$`)}var td=b$(ed);function Yi(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function rd(e){return new RegExp(`^${Yi(e)}$`)}function od(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${Yi({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${Yi({precision:e.precision})}`:r;return new RegExp(`^${ed}T(?:${o})$`)}var nd=/^[\s\S]{0,}$/;var Qi=/^-?\d+$/,Do=/^-?\d+(?:\.\d+)?$/,sd=/^(?:true|false)$/i,id=/^null$/i;var ad=/^[^A-Z]*$/,cd=/^[^a-z]*$/;var Je=L("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var ea=(e)=>{let t=e.value;return!ol(t)&&t.length!==void 0},ss={number:"number",bigint:"bigint",object:"date"},ta=L("$ZodCheckLessThan",(e,t)=>{Je.init(e,t);let r=ss[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:ss[typeof o.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ra=L("$ZodCheckGreaterThan",(e,t)=>{Je.init(e,t);let r=ss[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:ss[typeof o.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ud=L("$ZodCheckMultipleOf",(e,t)=>{Je.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):nl(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),ld=L("$ZodCheckNumberFormat",(e,t)=>{Je.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=Kn[t.format];e._zod.check=(i)=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(a<n)i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(a>s)i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var dd=L("$ZodCheckMaxLength",(e,t)=>{var r;Je.init(e,t),(r=e._zod.def).when??(r.when=ea),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>t.maximum?Yn(n):s)<=t.maximum)return;let a=Xn(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),pd=L("$ZodCheckMinLength",(e,t)=>{var r;Je.init(e,t),(r=e._zod.def).when??(r.when=ea),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>=t.minimum&&s<t.minimum*2?Yn(n):s)>=t.minimum)return;let a=Xn(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),md=L("$ZodCheckLengthEquals",(e,t)=>{var r;Je.init(e,t),(r=e._zod.def).when??(r.when=ea),e._zod.check=(o)=>{let n=o.value,s=n.length,i=typeof n==="string"&&s>=t.length&&s<=t.length*2?Yn(n):s;if(i===t.length)return;let a=Xn(n),c=i>t.length;o.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Uo=L("$ZodCheckStringFormat",(e,t)=>{var r,o;if(Je.init(e,t),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;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})});else(o=e._zod).check??(o.check=()=>{})}),fd=L("$ZodCheckRegex",(e,t)=>{Uo.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hd=L("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ad),Uo.init(e,t)}),gd=L("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=cd),Uo.init(e,t)}),_d=L("$ZodCheckIncludes",(e,t)=>{Je.init(e,t);let r=Wt(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),yd=L("$ZodCheckStartsWith",(e,t)=>{Je.init(e,t);let r=new RegExp(`^${Wt(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),vd=L("$ZodCheckEndsWith",(e,t)=>{Je.init(e,t);let r=new RegExp(`.*${Wt(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Sd=L("$ZodCheckOverwrite",(e,t)=>{Je.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class oa{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-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
3
|
-
`).filter((s)=>s),o=Math.min(...r.map((s)=>s.length-s.trimStart().length)),n=r.map((s)=>s.slice(o)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of n)this.content.push(s)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
4
|
-
${t.join(`
|
|
5
|
-
`)}
|
|
6
|
-
};`)(...Object.values(this.closed))}}var zd={major:4,minor:6,patch:7};var xe=L("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=zd;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let s of n)for(let i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(a,c,u)=>{if(a.memo)return a;let l=Et(a),d;for(let m of c){if(m._zod.def.when){if(hl(a))continue;if(!m._zod.def.when(a))continue}else if(l)continue;let h=a.issues.length,f=m._zod.check(a);if(f instanceof Promise&&u?.async===!1)throw new Ot;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await f,a.issues.length===h)return;if(Wn(a.issues,h,e),!l)l=Et(a,h)});else{if(a.issues.length===h)continue;if(Wn(a.issues,h,e),!l)l=Et(a,h)}}if(d)return d.then(()=>a);return a},i=(a,c,u)=>{if(Et(a))return a.aborted=!0,a;let l=s(c,n,u);if(l instanceof Promise){if(u.async===!1)throw new Ot;return l.then((d)=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});if(l instanceof Promise)return l.then((d)=>i(d,a,c));return i(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new Ot;return u.then((l)=>s(l,n,c))}return s(u,n,c)}}},{get "~standard"(){return Qn(this,"~standard",sa(this))},set "~standard"(e){qt(this,"~standard",e)}}),Id=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>Tt(r,t,ot()))}:{value:e.value};async function z$(e,t){let r={async:!0};return Id(await e._zod.run({value:t,issues:[]},r),r)}function sa(e){return{validate:(t)=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Id(o,r)}catch(o){}return z$(e,t)},vendor:"zod",version:1}}var us=L("$ZodString",(e,t)=>{xe.init(e,t),e._zod.pattern=t.pattern??nd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ne=L("$ZodStringFormat",(e,t)=>{Uo.init(e,t),us.init(e,t)}),Nd=L("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Fl),Ne.init(e,t)}),Ad=L("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Xi(o))}else t.pattern??(t.pattern=Xi());Ne.init(e,t)}),jd=L("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Vl),Ne.init(e,t)}),Md=1,as=2;function Zd(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function $$(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Zd(e)||as;return R$(e,t)}function R$(e,t){if(!t.normalize&&t.protocol?.source===Xl.source&&!/^https?:\/\//i.test(e))return Md;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??as}return new URL(e)}catch{return as}}var w$=/[\t\n\r]/g;function $d(e){return e.replace(w$,"")}function P$(e,t){return t.lastIndex=0,t.test(e.hostname)}function k$(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Ld=L("$ZodURL",(e,t)=>{Ne.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=$$(o,t);if(n===Md){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===as){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=$d(o);return}if(t.hostname&&!P$(n,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!k$(n,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?n.href:$d(o);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Dd=L("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Hl()),Ne.init(e,t)}),Ud=L("$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.pattern=t.length===void 0?Ll:Dl(t.length)),Ne.init(e,t)}),Fd=L("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Nl),Ne.init(e,t)}),Vd=L("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Al),Ne.init(e,t)}),Hd=L("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ml),Ne.init(e,t)}),Bd=L("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Zl),Ne.init(e,t)}),Jd=L("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ql),Ne.init(e,t)}),Kd=L("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=od(t)),Ne.init(e,t)}),Gd=L("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=td),Ne.init(e,t)}),Wd=L("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=rd(t)),Ne.init(e,t)}),Yd=L("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Ul),Ne.init(e,t)}),Xd=L("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Bl),Ne.init(e,t)}),x$=/^[0-9a-fA-F:.]+$/;function Qd(e){if(!x$.test(e))return!1;return Zd(`http://[${e}]`)}var ep=L("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Jl),Ne.init(e,t),e._zod.check=(r)=>{if(!Qd(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var tp=L("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Kl),Ne.init(e,t)});function E$(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);if(`${n}`!==o)return!1;if(n<0||n>128)return!1;return Qd(r)}var rp=L("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Gl),Ne.init(e,t),e._zod.check=(r)=>{if(!E$(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function op(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var ia=/^[0-9a-zA-Z+/]*={0,2}$/,np=L("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ia),Ne.init(e,t),e._zod.check=(r)=>{if(op(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),ls=/^[A-Za-z0-9_-]*$/;function T$(e){if(!ls.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return op(r)}var sp=L("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=ls),Ne.init(e,t),e._zod.check=(r)=>{if(T$(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),ip=L("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Ql),Ne.init(e,t)});function O$(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var ap=L("$ZodJWT",(e,t)=>{Ne.init(e,t),e._zod.check=(r)=>{if(O$(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var aa=L("$ZodNumber",(e,t)=>{xe.init(e,t),e._zod.pattern=Do,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(i){}let n=r.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?String(n):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),cp=L("$ZodNumberFormat",(e,t)=>{ld.init(e,t),aa.init(e,t)}),up=L("$ZodBoolean",(e,t)=>{xe.init(e,t),e._zod.pattern=sd,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(s){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}});var lp=L("$ZodNull",(e,t)=>{xe.init(e,t),e._zod.pattern=id,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),dp=L("$ZodAny",(e,t)=>{xe.init(e,t),e._zod.parse=(r)=>r}),pp=L("$ZodUnknown",(e,t)=>{xe.init(e,t),e._zod.parse=(r)=>r}),mp=L("$ZodNever",(e,t)=>{xe.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function C$(e,t){let r=Di(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map((s)=>s[0])),n=e._zod.parse;e._zod.parse=(s,i)=>{let a=t(s.value);if(a>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[c,u]of Di(e._zod.def.checks))if(a>c&&u._zod.def.when(s)){let l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Wn(s.issues,l,e),s}}return n(s,i)}}var I$=(e)=>Array.isArray(e)?e.length:-1;function Rd(e,t,r){if(e.issues.length)t.issues.push(...Yt(r,e.issues));t.value[r]=e.value}var fp=L("$ZodArray",(e,t)=>{xe.init(e,t);let r=rt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=r?r.alloc(e,o,Array(s.length),n):Array(s.length);let i=[],a=n?.abortEarly;for(let c=0;c<s.length;c++){let u=s[c],l=t.element._zod.run({value:u,issues:[]},n);if(l instanceof Promise)i.push(l.then((d)=>Rd(d,o,c)));else if(Rd(l,o,c),a&&l.issues.length!==0&&Et(l))break}if(i.length)return Promise.all(i).then(()=>o);return o},C$(e,I$)});function cs(e,t,r,o,n,s){let i=r in o,a=s==="optional";if(!i&&a&&n==="optional")return;if(e.issues.length){if(n!==void 0&&a&&!i)return;t.issues.push(...Yt(r,e.issues))}if(!i&&n===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(i||n==="defaulted"&&!a)t.value[r]=void 0}else t.value[r]=e.value}var N$=[];function hp(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:N$,n=o.length?[...t,...o]:t;for(let i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=pl(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function gp(e,t,r,o,n,s,i){let a=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,{optin:d,optout:m}=u,h=0;for(let f in t){if(i&&r.issues.length!==h){if(Et(r,h))break;h=r.issues.length}if(c.has(f))continue;if(f==="__proto__"){if(l==="never")a.push(f);continue}if(l==="never"){a.push(f);continue}let v=u.run({value:t[f],issues:[]},o);if(v instanceof Promise)e.push(v.then((y)=>cs(y,r,f,t,d,m)));else cs(v,r,f,t,d,m)}if(a.length)r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var A$=L("$ZodObject",(e,t)=>{xe.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let l={...o};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Mo(()=>hp(t));Se(e,"propValues",(u)=>{let l=u.def.shape,d={};for(let m in l){let h=l[m]._zod;if(h.values){if(!Object.prototype.hasOwnProperty.call(d,m))yt(d,m,new Set);for(let f of h.values)d[m].add(f);if(h.optin!==void 0)d[m].add(void 0)}}return d});let s=qr,i=t.catchall,a,c=rt.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=n.value);let d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let m=[],h=a.shape,f=l?.abortEarly,v=u.issues.length;for(let y of a.allKeys){if(f&&u.issues.length!==v){if(Et(u,v))break;v=u.issues.length}if(y==="__proto__")continue;let g=h[y],P=g._zod.optin,w=g._zod.optout,E=g._zod.run({value:d[y],issues:[]},l);if(E instanceof Promise)m.push(E.then((C)=>cs(C,u,y,d,P,w)));else cs(E,u,y,d,P,w)}if(!i)return m.length?Promise.all(m).then(()=>u):u;return gp(m,d,u,l,n.value,e,f===!0)}}),_p=L("$ZodObjectJIT",(e,t)=>{A$.init(e,t);let r=e._zod.parse,o=Mo(()=>hp(t)),n=rt.memoizer,s=(h)=>{let f=o.value,v=f.symbolKeys,y=new oa(["payload","ctx"],{shape:h,inst:e,memo:n,syms:v}),g=(C)=>`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`,P=(C,R)=>`
|
|
7
|
-
let ${C}_ab = false;
|
|
8
|
-
for (let i = 0; i < ${C}.issues.length; i++) {
|
|
9
|
-
const iss = ${C}.issues[i];
|
|
10
|
-
iss.path = iss.path ? [${R}, ...iss.path] : [${R}];
|
|
11
|
-
payload.issues.push(iss);
|
|
12
|
-
if (iss.continue !== true) ${C}_ab = true;
|
|
13
|
-
}
|
|
14
|
-
if (${C}_ab && ctx && ctx.abortEarly) {
|
|
15
|
-
payload.value = newResult;
|
|
16
|
-
return payload;
|
|
17
|
-
}`;y.write("const input = payload.value;");let w=Object.create(null),E=0;for(let C of f.allKeys)w[C]=`key_${E++}`;y.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let C of f.allKeys){if(C==="__proto__")continue;let R=w[C],S=typeof C==="symbol"?`syms[${v.indexOf(C)}]`:cl(C),T=`${S} in input`,A=h[C],H=A?._zod?.optin,j=H!==void 0,V=A?._zod?.optout==="optional";if(y.write(`const ${R} = ${g(S)};`),j&&V){let W=H==="optional"?`${R}_present`:`${R}.value !== undefined || ${R}_present`;y.write(`
|
|
18
|
-
const ${R}_present = ${T};
|
|
19
|
-
if (!${R}.issues.length || ${R}_present) {
|
|
20
|
-
if (${R}.issues.length) {${P(R,S)}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (${W}) {
|
|
24
|
-
newResult[${S}] = ${R}.value;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
`)}else if(!j)y.write(`
|
|
29
|
-
const ${R}_present = ${T};
|
|
30
|
-
if (${R}.issues.length) {${P(R,S)}
|
|
31
|
-
}
|
|
32
|
-
if (!${R}_present && !${R}.issues.length) {
|
|
33
|
-
payload.issues.push({
|
|
34
|
-
code: "invalid_type",
|
|
35
|
-
expected: "nonoptional",
|
|
36
|
-
input: undefined,
|
|
37
|
-
path: [${S}]
|
|
38
|
-
});
|
|
39
|
-
if (ctx && ctx.abortEarly) {
|
|
40
|
-
payload.value = newResult;
|
|
41
|
-
return payload;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
if (${R}_present) {
|
|
46
|
-
newResult[${S}] = ${R}.value;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
`);else if(y.write(`
|
|
50
|
-
if (${R}.issues.length) {${P(R,S)}
|
|
51
|
-
}
|
|
52
|
-
`),H==="defaulted")y.write(`newResult[${S}] = ${R}.value;`);else y.write(`
|
|
53
|
-
if (${R}.value !== undefined || ${T}) {
|
|
54
|
-
newResult[${S}] = ${R}.value;
|
|
55
|
-
}
|
|
56
|
-
`)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()},i,a=qr,c=!rt.jitless,l=c&&ll.value,d=t.catchall,m;e._zod.parse=(h,f)=>{m??(m=o.value);let v=h.value;if(!a(v))return h.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),h;if(c&&l&&f?.async===!1&&f.jitless!==!0){if(!i)i=s(t.shape);if(h=i(h,f),!d)return h;return gp([],v,h,f,m,e,f?.abortEarly===!0)}return r(h,f)}});function wd(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter((s)=>!Et(s));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((i)=>Tt(i,o,ot())))}),t}var ca=L("$ZodUnion",(e,t)=>{xe.init(e,t),Se(e,"optin",(o)=>o.def.options.some((n)=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some((n)=>n._zod.optin!==void 0)?"optional":void 0),Se(e,"optout",(o)=>o.def.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),Se(e,"values",(o)=>{if(o.def.options.every((n)=>n._zod.values))return new Set(o.def.options.flatMap((n)=>Array.from(n._zod.values)));return}),Se(e,"pattern",(o)=>{if(o.def.options.every((n)=>n._zod.pattern)){let n=o.def.options.map((s)=>s._zod.pattern);return new RegExp(`^(${n.map((s)=>Bn(s.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}if(!s)return wd(i,o,e,n);return Promise.all(i).then((a)=>wd(a,o,e,n))}});function j$(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let n of o)if(t.has(n)){if(n!==void 0)throw Error(`Duplicate discriminator value "${String(n)}"`);t.set(n,null)}else t.set(n,r)}return t}var yp=L("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,ca.init(e,t);let r=e._zod.parse;Se(e,"propValues",(n)=>{let s={},i=0;for(let a of n.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${n.def.options.indexOf(a)}"`);if(c[n.def.discriminator]?.has(void 0))i++;for(let[u,l]of Object.entries(c)){if(!Object.prototype.hasOwnProperty.call(s,u))yt(s,u,new Set);for(let d of l)s[u].add(d)}}if(!n.def.unionFallback&&i>1)s[n.def.discriminator]?.delete(void 0);return s}),t.options.forEach((n,s)=>{let i=qo(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw Error(`Invalid discriminated union option at index "${s}"`)});let o=Mo(()=>j$(t));e._zod.parse=(n,s)=>{let i=n.value;if(!qr(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let a=i?.[t.discriminator],c=o.value.get(a);if(c&&(a!==void 0||s.direction!=="backward"))return c._zod.run(n,s);if(t.unionFallback||s.direction==="backward")return r(n,s);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()).filter((u)=>o.value.get(u)!==null),input:i,path:[t.discriminator],inst:e}),n}}),vp=L("$ZodIntersection",(e,t)=>{xe.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),i=t.right._zod.run({value:n,issues:[]},o);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([c,u])=>Pd(r,c,u));return Pd(r,s,i)}});function na(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(yr(e)&&yr(t)){let r=Object.keys(t),o=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),n={...e,...t};if(Object.prototype.hasOwnProperty.call(n,"__proto__"))delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=na(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],i=na(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Pd(e,t,r){let o=new Map,n,s=new Map,i=(u,l)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let m=String(u.path[0]);if(!s.has(m))s.set(m,u);d=[m]}else return!1;for(let m of d){if(!o.has(m))o.set(m,{});o.get(m)[l]=!0}return!0};for(let u of t.issues)if(!i(u,"l"))e.issues.push(u);for(let u of r.issues)if(!i(u,"r"))e.issues.push(u);let a=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=n?a.filter((l)=>n.keys.includes(l)):[];if(u.length)e.issues.push({...n,keys:u});for(let l of a)if(!u.includes(l)&&s.has(l))e.issues.push(s.get(l))}let c=na(t.value,r.value);if(!c.valid){if(Et(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Sp=L("$ZodRecord",(e,t)=>{xe.init(e,t);let r=rt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!yr(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],a=t.keyType._zod.values;if(a&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let c=new Set;for(let l of a)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){if(c.add(typeof l==="number"?l.toString():l),l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map((f)=>Tt(f,n,ot())),input:l,path:[l],inst:e});continue}let m=d.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[l],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...Yt(l,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...Yt(l,h.issues));o.value[m]=h.value}}let u;for(let l in s)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;o.value[l]=s[l]}else u=u??[],u.push(l);if(u&&u.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}else{o.value=r?r.alloc(e,o,{},n):{};let c;for(let u of Reflect.ownKeys(s)){if(u==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(s,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof u==="string"&&Do.test(u)&&l.issues.length){let f=t.keyType._zod.run({value:Number(u),issues:[]},n);if(f instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(f.issues.length===0)l=f}if(l.issues.length){if(t.mode==="loose")o.value[u]=s[u];else if(a)c=c??[],c.push(u);else o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map((f)=>Tt(f,n,ot())),input:u,path:[u],inst:e});continue}let m=l.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[u],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...Yt(u,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...Yt(u,h.issues));o.value[m]=h.value}}if(c&&c.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c,continue:!0})}if(i.length)return Promise.all(i).then(()=>o);return o}});var bp=L("$ZodEnum",(e,t)=>{xe.init(e,t);let r=Ao(t.entries),o=new Set(r);e._zod.values=o,Se(e,"pattern",(n)=>{let s=Ao(n.def.entries).filter((i)=>dl.has(typeof i));return new RegExp(s.length?`^(${s.map((i)=>Wt(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;if(o.has(i))return n;return n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),zp=L("$ZodLiteral",(e,t)=>{xe.init(e,t);let r=new Set(t.values);e._zod.values=r,Se(e,"pattern",(o)=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map((s)=>typeof s==="string"?Wt(s):s?Wt(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var $p=L("$ZodTransform",(e,t)=>{xe.init(e,t),e._zod.optin="optional",rt.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Lo(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((i)=>(r.value=i,r));if(n instanceof Promise)throw new Ot;return r.value=n,r}});function kd(e,t){return e.value=t.issues.length?void 0:t.value,e}var ua=L("$ZodOptional",(e,t)=>{xe.init(e,t),Se(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",Se(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),Se(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Bn(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((s)=>kd(r,s));return kd(r,n)}return t.innerType._zod.run(r,o)}}),Rp=L("$ZodExactOptional",(e,t)=>{ua.init(e,t),Se(e,"values",(r)=>r.def.innerType._zod.values),Se(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),wp=L("$ZodNullable",(e,t)=>{xe.init(e,t),Se(e,"optin",(r)=>r.def.innerType._zod.optin),Se(e,"optout",(r)=>r.def.innerType._zod.optout),Se(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${Bn(o.source)}|null)$`):void 0}),Se(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),Pp=L("$ZodDefault",(e,t)=>{xe.init(e,t),e._zod.optin="defaulted",Se(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>xd(s,t));return xd(n,t)}});function xd(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var kp=L("$ZodPrefault",(e,t)=>{xe.init(e,t),e._zod.optin="defaulted",Se(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),xp=L("$ZodNonOptional",(e,t)=>{xe.init(e,t),Se(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Ed(s,e));return Ed(n,e)}});function Ed(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Td(e,t,r,o){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((n)=>Tt(n,o,ot()))},input:e.value}),e}var Ep=L("$ZodCatch",(e,t)=>{xe.init(e,t),Se(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),Se(e,"optout",(r)=>r.def.innerType._zod.optout),Se(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((s)=>Td(r,s,t,o));return Td(r,n,t,o)}});var la=L("$ZodPipe",(e,t)=>{xe.init(e,t),Se(e,"values",(r)=>r.def.in._zod.values),Se(e,"optin",(r)=>r.def.in._zod.optin),Se(e,"optout",(r)=>r.def.out._zod.optout),Se(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);if(s instanceof Promise)return s.then((i)=>is(i,t.in,o));return is(s,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>is(s,t.out,o));return is(n,t.out,o)}});function is(e,t,r){if(e.issues.some((o)=>o.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Tp=L("$ZodPreprocess",(e,t)=>{la.init(e,t)}),Op=L("$ZodReadonly",(e,t)=>{xe.init(e,t),Se(e,"propValues",(r)=>r.def.innerType._zod.propValues),Se(e,"values",(r)=>r.def.innerType._zod.values),Se(e,"optin",(r)=>r.def.innerType?._zod?.optin),Se(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(Od);return Od(n)}});function Od(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Cp=L("$ZodLazy",(e,t)=>{xe.init(e,t),sl(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),Se(e,"pattern",(r)=>r.innerType?._zod?.pattern),Se(e,"propValues",(r)=>r.innerType?._zod?.propValues),Se(e,"optin",(r)=>r.innerType?._zod?.optin??void 0),Se(e,"optout",(r)=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Ip=L("$ZodCustom",(e,t)=>{Je.init(e,t),xe.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=(r)=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then((s)=>Cd(s,r,o,e));Cd(n,r,o,e);return}});function Cd(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(vr(n))}}class Ap extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var pa="~memo",Np=[];function jp(e){return e!==null&&typeof e==="object"}function da(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var Mp=new WeakMap,Fo=0,ms=1,Vo=2;function fs(e,t,r){let o=Mp.get(e);if(o!==void 0)return o?Vo:Fo;if(t.has(e))return Vo;t.add(e);let n=Fo,s=(l)=>{if(n!==Vo&&l?._zod){let d=fs(l,t,r);if(d>n)n=d}},i=(l,d)=>{let m=Fo;for(let h of Reflect.ownKeys(l)){let f=Object.getOwnPropertyDescriptor(l,h);if(d&&!f.enumerable)continue;let v=f.get?ms:f.value?._zod?fs(f.value,t,r):Fo;if(v>m)m=v}return m},a=(l)=>{if(l>n)n=l},c=e._zod.def,u=c.type;switch(u){case"object":{let l=qo(c);a(l?i(l,!0):ms),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(let l of c.items)s(l);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(let l of c.options)s(l);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?fs(l,t,!1):ms);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 l in c){let d=Object.getOwnPropertyDescriptor(c,l);if(!d||d.get)continue;let m=d.value;if(!m||typeof m!=="object")continue;if(m._zod)s(m);else if(Array.isArray(m))for(let h of m)s(h)}}return t.delete(e),M$(e,n)}function M$(e,t){if(t!==ms)Mp.set(e,t===Vo);return t}function Z$(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var ds,ps=[],q$={alloc(e,t,r){let o=ds;if(!o)return r;ds=void 0;let n={value:r,issues:null};return o.set(t.value,n),ps.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,s)=>{if(s.direction!=="backward"&&L$(s,n.value))throw new Ap;return r(n,s)};if(e._zod.parse=o,e._zod.run===r)e._zod.run=o})},attach(e){var t;let r,o=!1,n,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,a=(c,u)=>{if(r===void 0){let g=fs(e,new Set,!1);if(g===Fo){if(e._zod.parse=i,e._zod.run===a)e._zod.run=i;return i(c,u)}if(g===Vo||o)r=!0;else o=!0}let l=c.value;if(!jp(l))return i(c,u);let d=u[pa];if(!d)d={buckets:new WeakMap,backEdges:void 0},u[pa]=d;let m;if(n===u)m=s;else m=Z$(d,e),n=u,s=m;let h=m.get(l);if(h){if(c.value=h.value,h.issues){if(h.issues.length)c.issues.push(...da(h.issues))}else c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value);return c}ds=m;let f=ps.length,v=i(c,u);ds=void 0;let y=ps.length>f?ps.pop():void 0;if(v instanceof Promise)return v.then((g)=>{if(y)y.issues=g.issues.length?da(g.issues):Np;return g});if(y)y.issues=v.issues.length?da(v.issues):Np;return v};if(e._zod.parse=a,e._zod.run===i)e._zod.run=a})}};function ma(){return q$}function L$(e,t){let r=e[pa]?.backEdges;return r!==void 0&&jp(t)&&r.has(t)}var D$=()=>{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(s){return e[s]??null}let r={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"},o={nan:"NaN"};function n(s,i){if(s==="number"&&typeof i==="number"&&!Number.isFinite(i))return String(i);return o[s]??s}return(s)=>{switch(s.code){case"invalid_type":{let i=n(s.expected),a=gl(s.input),c=n(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":if(s.values.length===1)return`Invalid input: expected ${qi(s.values[0])}`;return`Invalid option: expected one of ${Ai(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);if(a)return`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);if(a)return`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`;return`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${r[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${Ai(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":if(s.options&&Array.isArray(s.options)&&s.options.length>0)return`Invalid discriminator value. Expected ${s.options.map((a)=>`'${a}'`).join(" | ")}`;if(s.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function fa(){return{localeError:D$()}}var qp;class Lp{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Dp(){return new Lp}(qp=globalThis).__zod_globalRegistry??(qp.__zod_globalRegistry=Dp());var Xt=globalThis.__zod_globalRegistry;function ha(e){if(e.checks)e.checks=[...e.checks];return e}function Up(e,t){return new e(ha({type:"string",...oe(t)}))}function Fp(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...oe(t)})}function Vp(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...oe(t)})}function Hp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...oe(t)})}function Bp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...oe(t)})}function Kp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...oe(t)})}function Gp(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...oe(t)})}function ga(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...oe(t)})}function Wp(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...oe(t)})}function tm(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...oe(t)})}function rm(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...oe(t)})}function om(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...oe(t)})}function nm(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...oe(t)})}function sm(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...oe(t)})}function im(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...oe(t)})}function am(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...oe(t)})}function cm(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...oe(t)})}function um(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...oe(t)})}function lm(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...oe(t)})}function dm(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...oe(t)})}function pm(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...oe(t)})}function mm(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...oe(t)})}function fm(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...oe(t)})}function hs(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...oe(t)})}function _a(e,t){return new e({type:"string",format:"date",check:"string_format",...oe(t)})}function ya(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...oe(t)})}function Sa(e,t){return new e({type:"string",format:"duration",check:"string_format",...oe(t)})}function hm(e,t){return new e(ha({type:"number",checks:[],...oe(t)}))}function gm(e,t){return new e(ha({type:"number",coerce:!0,checks:[],...oe(t)}))}function _m(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...oe(t)})}function ym(e,t){return new e({type:"boolean",...oe(t)})}function vm(e,t){return new e({type:"null",...oe(t)})}function Sm(e){return new e({type:"any"})}function bm(e){return new e({type:"unknown"})}function zm(e,t){return new e({type:"never",...oe(t)})}function gs(e,t){return new ta({check:"less_than",...oe(t),value:e,inclusive:!1})}function Ho(e,t){return new ta({check:"less_than",...oe(t),value:e,inclusive:!0})}function _s(e,t){return new ra({check:"greater_than",...oe(t),value:e,inclusive:!1})}function Bo(e,t){return new ra({check:"greater_than",...oe(t),value:e,inclusive:!0})}function ys(e,t){return new ud({check:"multiple_of",...oe(t),value:e})}function vs(e,t){return new dd({check:"max_length",...oe(t),maximum:e})}function Dr(e,t){return new pd({check:"min_length",...oe(t),minimum:e})}function Ss(e,t){return new md({check:"length_equals",...oe(t),length:e})}function ba(e,t){return new fd({check:"string_format",format:"regex",...oe(t),pattern:e})}function za(e){return new hd({check:"string_format",format:"lowercase",...oe(e)})}function $a(e){return new gd({check:"string_format",format:"uppercase",...oe(e)})}function Ra(e,t){return new _d({check:"string_format",format:"includes",...oe(t),includes:e})}function wa(e,t){return new yd({check:"string_format",format:"starts_with",...oe(t),prefix:e})}function Pa(e,t){return new vd({check:"string_format",format:"ends_with",...oe(t),suffix:e})}function Qt(e){return new Sd({check:"overwrite",tx:e})}function ka(e){return Qt((t)=>t.normalize(e))}function xa(){return Qt((e)=>e.trim())}function Ea(){return Qt((e)=>e.toLowerCase())}function Ta(){return Qt((e)=>e.toUpperCase())}function Oa(){return Qt((e)=>ul(e))}function $m(e,t,r){return new e({type:"array",element:t,...oe(r)})}function Rm(e,t,r){return new e({type:"custom",check:"custom",fn:t,...oe(r)})}function wm(e,t){let r=U$((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(vr(n,o.value,r._zod.def));else{let s=n;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=o.value;s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(vr(s))}},e(o.value,o)),t);return r}function U$(e,t){let r=new Je({check:"custom",...oe(t)});return r._zod.check=e,r}function Jo(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,o))yt(e,o,r[o]);return e}function Ia(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Xt,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 Lt(e,t,r,o,n){let s=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw Error(n);return Object.assign(r,s),!0}function Ue(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return s.schema}let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let m=i.schema,h=t.processors[n.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,m,l)}let d=e._zod.parent;if(d){if(!i.ref)i.ref=d;Ue(d,t,l),t.seen.get(d).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Jo(i.schema,c);if(t.io==="input"&&Qe(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&"_prefault"in i.schema)(o=i.schema).default??(o.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function Pm(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Na(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=(i)=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,m=e.external.uri??((f)=>f);if(d)return{ref:m(d)};let h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${m("__shared")}#/${a}/${Pm(h)}`}}let c="#",u=`${c}/${a}/`;if(i[1]===r&&!i[1].schema.id)return{ref:c};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+Pm(l)}},s=(i)=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);if(a.def={...a.schema},u)a.defId=u;let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
57
|
-
|
|
58
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1){if(e.reused==="ref")s(i)}}if(e.external)e.sharedDefsExtractedFor=e.external}function Em(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!=="object")return;Em(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let s=o.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!=="string")return;if(!r.includes(i))r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var Tm=new Set(["type","properties","required","additionalProperties"]),km=["oneOf","anyOf"];function xm(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function Ca(e){let t=[];for(let s of e){if(typeof s!=="object"||s.type!=="object")return null;for(let i in s)if(!Tm.has(i))return null;t.push(s)}let r={},o=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let a=[];for(let u of t){let l=u.properties?.[i]??xm(u);if(l===null||l===void 0)continue;if(!a.some((d)=>JSON.stringify(d)===JSON.stringify(l)))a.push(l)}let c=a.length===1?a[0]:Ca(a)??{allOf:a};yt(r,i,c)}for(let i of s.required??[])o.add(i)}let n={type:"object",properties:r};if(o.size)n.required=[...o];if(t.every((s)=>s.additionalProperties===!1))n.additionalProperties=!1;else{let s=[];for(let i of t){let a=xm(i);if(a&&!s.some((c)=>JSON.stringify(c)===JSON.stringify(a)))s.push(a)}if(s.length===1)n.additionalProperties=s[0];else if(s.length>1)n.additionalProperties={allOf:s}}return n}function F$(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of Tm)if(n in e)return;let r=t.filter((n)=>km.some((s)=>Array.isArray(n[s]))),o=null;if(!r.length)o=Ca(t);else{let n=r[0],s=km.find((c)=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let i=t.filter((c)=>c!==n),a=n[s].map((c)=>Ca([...i,c]));if(a.some((c)=>!c))return;o={[s]:a}}if(!o)return;delete e.allOf,Jo(e,o)}function Aa(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let h=e.seen.get(d),f=h.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(f);else Jo(u,f);if(Jo(u,l),a._zod.parent===d)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(!(y in l))delete u[y]}if(f.$ref&&h.def)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(y in h.def&&JSON.stringify(u[y])===JSON.stringify(h.def[y]))delete u[y]}}let m=a._zod.parent;if(m&&m!==d){o(m);let h=e.seen.get(m);if(h?.schema.$ref){if(u.$ref=h.schema.$ref,h.def)for(let f in u){if(f==="$ref"||f==="allOf")continue;if(f in h.def&&JSON.stringify(u[f])===JSON.stringify(h.def[f]))delete u[f]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())o(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())Em(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);if(d)d.push(u);else a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])F$(u)}}let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Jo(n,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&n.id===s)delete n.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;yt(i,c.defId,c.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")n.$defs=i;else n.definitions=i;try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Ko(t,"input",e.processors),output:Ko(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error("Error converting schema to JSON.")}}function Qe(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return Qe(o.element,r);if(o.type==="set")return Qe(o.valueType,r);if(o.type==="lazy")return Qe(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return Qe(o.innerType,r);if(o.type==="intersection")return Qe(o.left,r)||Qe(o.right,r);if(o.type==="record"||o.type==="map")return Qe(o.keyType,r)||Qe(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return Qe(o.in,r)||Qe(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(Qe(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(Qe(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(Qe(n,r))return!0;if(o.rest&&Qe(o.rest,r))return!0;return!1}return!1}var Om=(e,t={})=>(r)=>{let o=Ia({...r,processors:t});return Ue(e,o),Na(o,e),Aa(o,e)},Ko=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:s}=o??{},i=Ia({...n??{},target:s,io:t,processors:r});return Ue(e,i),Na(i,e),Aa(i,e)};var Ur=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},Fr=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},Cm=(e,t)=>{Ur(e,"minimum",t),Fr(e,"maximum",t)},jm=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Mm=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Zm=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},qm=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Im=(e,t)=>Ur(e,"minimum",t.minimum),Nm=(e,t)=>Fr(e,"maximum",t.maximum),Am=(e)=>(t,r)=>{qm(t,r.format);let[o,n]=e[r.format];Ur(t,"minimum",o),Fr(t,"maximum",n)},V$={greater_than:(e,t)=>Ur(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Fr(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>jm(e,t.value),number_format:Am(Kn),bigint_format:Am(Li),min_length:Im,max_length:Nm,length_equals:(e,t)=>Cm(e,t.length),min_size:Im,max_size:Nm,size_equals:(e,t)=>Cm(e,t.size),string_format:(e,t)=>{if(qm(e,t.format),t.pattern)Mm(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>Zm(e,t.mime)};function St(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)V$[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;if(n.minimum!==void 0)Ur(t,"minimum",n.minimum);if(n.exclusiveMinimum!==void 0)Ur(t,"exclusiveMinimum",n.exclusiveMinimum);if(n.maximum!==void 0)Fr(t,"maximum",n.maximum);if(n.exclusiveMaximum!==void 0)Fr(t,"exclusiveMaximum",n.exclusiveMaximum);if(n.multipleOf!==void 0)jm(t,n.multipleOf);if(n.format!==void 0){if(t.format??(t.format=n.format),n.format.includes("int"))t.isInt=!0}if(n.mime)Zm(t,n.mime);for(let s of n.patterns??[])Mm(t,s);return t}var H$={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},B$=new Map([[ia,Wl],[ls,Yl]]),Lm=(e)=>B$.get(e)??e,Dm=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:l}=St(e);if(typeof s==="number")n.minLength=s;if(typeof i==="number")n.maxLength=i;if(a){if(n.format=H$[a]??a,n.format==="")delete n.format;if(a==="time"||l)delete n.format}if(u)n.contentEncoding=u;if(c&&c.size>0){let d=[...c].map(Lm);if(d.length===1)n.pattern=d[0].source;else if(d.length>1)n.allOf=[...d.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},Um=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=St(e);n.type=l?"integer":"number";let d=typeof u==="number"&&u>=(s??Number.NEGATIVE_INFINITY),m=typeof c==="number"&&c<=(i??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(d)if(h)n.minimum=u,n.exclusiveMinimum=!0;else n.exclusiveMinimum=u;else if(typeof s==="number")n.minimum=s;if(m)if(h)n.maximum=c,n.exclusiveMaximum=!0;else n.exclusiveMaximum=c;else if(typeof i==="number")n.maximum=i;if(a){let f=new Set;for(let g of a)if(Number.isFinite(g)&&g!==0)f.add(Math.abs(g));else Lt(e,t,n,o,`A multipleOf divisor of ${g} cannot be represented in JSON Schema`);let[v,...y]=f;if(v!==void 0)n.multipleOf=v;if(y.length)n.allOf=[...n.allOf??[],...y.map((g)=>({multipleOf:g}))]}},Fm=(e,t,r,o)=>{r.type="boolean"};var Vm=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"};var Hm=(e,t,r,o)=>{r.not={}},Bm=(e,t,r,o)=>{},Jm=(e,t,r,o)=>{};var Km=(e,t,r,o)=>{let n=e._zod.def,s=Ao(n.entries);if(s.length===0){r.not={};return}if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";r.enum=s},Gm=(e,t,r,o)=>{let n=e._zod.def;if(n.values.length===0){r.not={};return}let s=[];for(let i of n.values)if(i===void 0){if(Lt(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i==="bigint"){if(Lt(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(i))}else s.push(i);if(s.length===0);else if(s.length===1){let i=s[0];if(r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[i];else r.const=i}else{if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";if(s.every((i)=>typeof i==="boolean"))r.type="boolean";if(s.every((i)=>i===null))r.type="null";r.enum=s}};var Wm=(e,t,r,o)=>{Lt(e,t,r,o,"Custom types cannot be represented in JSON Schema")};var Ym=(e,t,r,o)=>{Lt(e,t,r,o,"Transforms cannot be represented in JSON Schema")};var Xm=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:a}=St(e);if(typeof i==="number")n.minItems=i;if(typeof a==="number")n.maxItems=a;n.type="array",n.items=Ue(s.element,t,{...o,path:[...o.path,"items"]})};function bs(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return bs(t.out);if(t.type==="catch")return bs(t.innerType);return e._zod.optin}var Qm=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Lt(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)yt(n.properties,u,Ue(i[u],t,{...o,path:[...o.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let l=s.shape[u];if(t.io==="input"?bs(l)===void 0:l._zod.optout===void 0)c.push(u)}if(c.length>0)n.required=c;if(s.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")n.additionalProperties=!1}else if(s.catchall)n.additionalProperties=Ue(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},ef=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>Ue(a,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));if(s)r.oneOf=i;else r.anyOf=i},tf=(e,t,r,o)=>{let n=e._zod.def,s=Ue(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Ue(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=(u)=>("allOf"in u)&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c,t.intersections.push(c)};function ja(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let f=e.get(t)?.def;if(!f)return t;let v=ja(e,f,r);return v===f?t:v}for(let f of["anyOf","oneOf"]){let v=t[f];if(!Array.isArray(v))continue;let y=v.map((g)=>ja(e,g,r));if(y.some((g,P)=>g!==v[P]))t={...t,[f]:y}}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some((f)=>f==="number"||f==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some((f)=>typeof f==="number"))return t;let{minimum:i,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:m,...h}=t;if(h.enum)h.enum=h.enum.map((f)=>typeof f==="number"?String(f):f);else if(typeof h.const==="number")h.const=String(h.const);if(!n)return h;if(h.type="string",!s)h.pattern=(o.includes("number")?Do:Qi).source;return h}var Ma=new WeakMap;function J$(e){let t=new Map;for(let o of e.seen.values())if(o.def&&!t.has(o.schema))t.set(o.schema,o);let r=new Map;for(let o of Ma.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=ja(t,s,new Set);if(i!==s)r.set(s,i)}if(!r.size)return;for(let o of e.seen.values())for(let n of[o.schema,o.def]){let s=n&&r.get(n.propertyNames);if(s)n.propertyNames=s}}var rf=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,a=St(i).patterns;if(s.mode==="loose"&&a&&a.size>0){let l=Ue(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of a)yt(n.patternProperties,Lm(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=Ue(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let l=Ma.get(t);if(!l)l=[],Ma.set(t,l),t.deferred.push(()=>J$(t));l.push(e)}n.additionalProperties=Ue(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let c=i._zod.values,u=t.io==="input"&&bs(s.valueType)!==void 0;if(c&&!s.partial&&!u){let l=[...c].filter((d)=>typeof d==="string"||typeof d==="number");if(l.length>0)n.required=l.map(String)}},of=(e,t,r,o)=>{let n=e._zod.def,s=Ue(n.innerType,t,o),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=n.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},nf=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},Za=Symbol();function sf(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(a,c)=>{if(typeof c!=="bigint")return c;return s=!0,null});if(!s)return JSON.parse(i);return Lt(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),Za}var af=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=sf(n.defaultValue,e,t,r,o);if(i!==Za)r.default=i},cf=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=sf(n.defaultValue,e,t,r,o);if(i!==Za)r._prefault=i},uf=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{Lt(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},lf=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;Ue(i,t,o);let a=t.seen.get(e);a.ref=i},df=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0};var qa=(e,t,r,o)=>{let n=e._zod.def;Ue(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},pf=(e,t,r,o)=>{let n=e._zod.innerType;Ue(n,t,o);let s=t.seen.get(e);s.ref=n};var mf=new WeakSet([Object.prototype,Error.prototype]);function zs(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var r0=(e,t)=>{Rl.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(mf.has(r))return;mf.add(r),zs(r,"format",(o)=>(n)=>Ji(o,n)),zs(r,"flatten",(o)=>(n)=>Bi(o,n)),zs(r,"addIssue",(o)=>(n)=>{o.issues.push(n),o.message=JSON.stringify(o.issues,jo,2)}),zs(r,"addIssues",(o)=>(n)=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,jo,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var dt=L("ZodError",r0,void 0,{Parent:Error});var ff=ts(dt),hf=rs(dt),gf=os(dt),_f=ns(dt),yf=Pl(dt),vf=kl(dt),Sf=xl(dt),bf=El(dt),zf=Tl(dt),$f=Ol(dt),Rf=Cl(dt),wf=Il(dt);function n0(){if(!rt.localeError)ot(fa())}function Rs(){if(!rt.memoizer)ot({memoizer:ma()})}var Te=L("ZodType",(e,t)=>(n0(),xe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(ut(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Rt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(zR(e,t))},superRefine(e,t){return this.check($R(e,t))},overwrite(e){return this.check(Qt(e))},optional(){return Me(this)},exactOptional(){return cR(this)},nullable(){return xf(this)},nullish(){return Me(xf(this))},nonoptional(e){return fR(this,e)},array(){return ve(this)},or(e){return Fn([this,e])},and(e){return Ps(this,e)},transform(e){return Ef(this,Df(e))},default(e){return dR(this,e)},prefault(e){return mR(this,e)},catch(e){return gR(this,e)},pipe(e){return Ef(this,e)},readonly(){return vR(this)},describe(e){let t=this.clone();return Xt.add(t,{description:e}),t},meta(...e){if(e.length===0)return Xt.get(this);let t=this.clone();return Xt.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 Qn(this,"~standard",{...sa(this),jsonSchema:{input:Ko(this,"input"),output:Ko(this,"output")}})},set "~standard"(e){qt(this,"~standard",e)},parse:function e(t,r){return ff(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await hf(this,t,r,{callee:e})},safeParse(e,t){return gf(this,e,t)},async safeParseAsync(e,t){return _f(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){qt(this,"spa",e)},validate(e,t){return Gi(this,e,t)},validateAsync(e,t){return Wi(this,e,t)},encode:function e(t,r){return yf(this,t,r,{callee:e})},decode:function e(t,r){return vf(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await Sf(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await bf(this,t,r,{callee:e})},safeEncode(e,t){return zf(this,e,t)},safeDecode(e,t){return $f(this,e,t)},async safeEncodeAsync(e,t){return Rf(this,e,t)},async safeDecodeAsync(e,t){return wf(this,e,t)},toJSONSchema(e){return Om(this,{})(e)},get description(){return Xt.get(this)?.description},get _def(){return this._zod.def}}),Tf=L("_ZodString",(e,t)=>{us.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Dm(e,r,o,n)},yl({format:(e)=>St(e).format??null,minLength:(e)=>St(e).minimum??null,maxLength:(e)=>St(e).maximum??null},{regex(...e){return this.check(ba(...e))},includes(...e){return this.check(Ra(...e))},startsWith(...e){return this.check(wa(...e))},endsWith(...e){return this.check(Pa(...e))},min(...e){return this.check(Dr(...e))},max(...e){return this.check(vs(...e))},length(...e){return this.check(Ss(...e))},nonempty(...e){return this.check(Dr(1,...e))},lowercase(e){return this.check(za(e))},uppercase(e){return this.check($a(e))},trim(){return this.check(xa())},normalize(...e){return this.check(ka(...e))},toLowerCase(){return this.check(Ea())},toUpperCase(){return this.check(Ta())},slugify(){return this.check(Oa())}})),Of=L("ZodString",(e,t)=>{us.init(e,t),Tf.init(e,t)},{email(e){return this.check(Fp(s0,e))},url(e){return this.check(ga(Af,e))},jwt(e){return this.check(fm(J0,e))},emoji(e){return this.check(Wp(a0,e))},guid(e){return this.check(Vp(i0,e))},uuid(e){return this.check(Hp($s,e))},uuidv4(e){return this.check(Bp($s,e))},uuidv6(e){return this.check(Kp($s,e))},uuidv7(e){return this.check(Gp($s,e))},nanoid(e){return this.check(tm(c0,e))},cuid(e){return this.check(rm(u0,e))},cuid2(e){return this.check(om(l0,e))},ulid(e){return this.check(nm(d0,e))},base64(e){return this.check(dm(v0,e))},base64url(e){return this.check(pm(b0,e))},xid(e){return this.check(sm(p0,e))},ksuid(e){return this.check(im(m0,e))},ipv4(e){return this.check(am(f0,e))},ipv6(e){return this.check(cm(h0,e))},cidrv4(e){return this.check(um(g0,e))},cidrv6(e){return this.check(lm(y0,e))},e164(e){return this.check(mm(Z0,e))},datetime(e){return this.check(hs(Da,e))},date(e){return this.check(_a(Cf,e))},time(e){return this.check(ya(If,e))},duration(e){return this.check(Sa(Nf,e))}});function x(e){return Up(Of,e)}var qe=L("ZodStringFormat",(e,t)=>{Ne.init(e,t),Tf.init(e,t)}),Da=L("ZodISODateTime",(e,t)=>{Kd.init(e,t),qe.init(e,t)}),Cf=L("ZodISODate",(e,t)=>{Gd.init(e,t),qe.init(e,t)}),If=L("ZodISOTime",(e,t)=>{Wd.init(e,t),qe.init(e,t)}),Nf=L("ZodISODuration",(e,t)=>{Yd.init(e,t),qe.init(e,t)}),s0=L("ZodEmail",(e,t)=>{jd.init(e,t),qe.init(e,t)});var i0=L("ZodGUID",(e,t)=>{Nd.init(e,t),qe.init(e,t)});var $s=L("ZodUUID",(e,t)=>{Ad.init(e,t),qe.init(e,t)});var Af=L("ZodURL",(e,t)=>{Ld.init(e,t),qe.init(e,t)});function jf(e){return ga(Af,e)}var a0=L("ZodEmoji",(e,t)=>{Dd.init(e,t),qe.init(e,t)});var c0=L("ZodNanoID",(e,t)=>{Ud.init(e,t),qe.init(e,t)});var u0=L("ZodCUID",(e,t)=>{Fd.init(e,t),qe.init(e,t)});var l0=L("ZodCUID2",(e,t)=>{Vd.init(e,t),qe.init(e,t)});var d0=L("ZodULID",(e,t)=>{Hd.init(e,t),qe.init(e,t)});var p0=L("ZodXID",(e,t)=>{Bd.init(e,t),qe.init(e,t)});var m0=L("ZodKSUID",(e,t)=>{Jd.init(e,t),qe.init(e,t)});var f0=L("ZodIPv4",(e,t)=>{Xd.init(e,t),qe.init(e,t)});var h0=L("ZodIPv6",(e,t)=>{ep.init(e,t),qe.init(e,t)});var g0=L("ZodCIDRv4",(e,t)=>{tp.init(e,t),qe.init(e,t)});var y0=L("ZodCIDRv6",(e,t)=>{rp.init(e,t),qe.init(e,t)});var v0=L("ZodBase64",(e,t)=>{np.init(e,t),qe.init(e,t)});var b0=L("ZodBase64URL",(e,t)=>{sp.init(e,t),qe.init(e,t)});var Z0=L("ZodE164",(e,t)=>{ip.init(e,t),qe.init(e,t)});var J0=L("ZodJWT",(e,t)=>{ap.init(e,t),qe.init(e,t)});var ws=L("ZodNumber",(e,t)=>{aa.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Um(e,r,o,n),e.isFinite=!0},yl({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=St(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=St(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=St(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>St(e).format??null},{gt(e,t){return this.check(_s(e,t))},gte(e,t){return this.check(Bo(e,t))},min(e,t){return this.check(Bo(e,t))},lt(e,t){return this.check(gs(e,t))},lte(e,t){return this.check(Ho(e,t))},max(e,t){return this.check(Ho(e,t))},int(e){return this.check(Pf(e))},safe(e){return this.check(Pf(e))},positive(e){return this.check(_s(0,e))},nonnegative(e){return this.check(Bo(0,e))},negative(e){return this.check(gs(0,e))},nonpositive(e){return this.check(Ho(0,e))},multipleOf(e,t){return this.check(ys(e,t))},step(e,t){return this.check(ys(e,t))},finite(){return this}}));function lr(e){return hm(ws,e)}var Y0=L("ZodNumberFormat",(e,t)=>{cp.init(e,t),ws.init(e,t)});function Pf(e){return _m(Y0,e)}var Mf=L("ZodBoolean",(e,t)=>{up.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fm(e,r,o,n)});function Pr(e){return ym(Mf,e)}var X0=L("ZodNull",(e,t)=>{lp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vm(e,r,o,n)});function Ua(e){return vm(X0,e)}var Q0=L("ZodAny",(e,t)=>{dp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bm(e,r,o,n)});function Zf(){return Sm(Q0)}var eR=L("ZodUnknown",(e,t)=>{pp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jm(e,r,o,n)});function Pi(){return bm(eR)}var tR=L("ZodNever",(e,t)=>{mp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hm(e,r,o,n)});function rR(e){return zm(tR,e)}var oR=L("ZodArray",(e,t)=>{Rs(),fp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xm(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Dr(e,t))},nonempty(e){return this.check(Dr(1,e))},max(e,t){return this.check(vs(e,t))},length(e,t){return this.check(Ss(e,t))},unwrap(){return this.element}});function ve(e,t){return $m(oR,e,t)}var qf=L("ZodObject",(e,t)=>{Rs(),_p.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qm(e,r,o,n),l$(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return ic(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(ut(this._zod.def,{catchall:e}))},passthrough(){return this.clone(ut(this._zod.def,{catchall:Pi()}))},loose(){return this.clone(ut(this._zod.def,{catchall:Pi()}))},strict(){return this.clone(ut(this._zod.def,{catchall:rR()}))},strip(){return this.clone(ut(this._zod.def,{catchall:void 0}))},extend(e){return r$(this,e)},safeExtend(e){return o$(this,e)},merge(e){return n$(this,e)},pick(e){return e$(this,e)},omit(e){return t$(this,e)},partial(...e){return fl(Uf,this,e[0])},exactPartial(...e){return fl(Ff,this,e[0],"exactPartial")},required(...e){return s$(Vf,this,e[0])}});function X(e,t){let r={type:"object",shape:e??{},...oe(t)};return new qf(r)}function un(e,t){return new qf({type:"object",shape:e,catchall:Pi(),...oe(t)})}var Lf=L("ZodUnion",(e,t)=>{ca.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ef(e,r,o,n),e.options=t.options});function Fn(e,t){return new Lf({type:"union",options:e,...oe(t)})}var nR=L("ZodDiscriminatedUnion",(e,t)=>{Lf.init(e,t),yp.init(e,t)});function Fa(e,t,r){return new nR({type:"union",options:t,discriminator:e,...oe(r)})}var sR=L("ZodIntersection",(e,t)=>{vp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tf(e,r,o,n)});function Ps(e,t){return new sR({type:"intersection",left:e,right:t})}var kf=L("ZodRecord",(e,t)=>{Rs(),Sp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rf(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function mi(e,t,r){if(!t||!t._zod)return new kf({type:"record",keyType:x(),valueType:e,...oe(t)});return new kf({type:"record",keyType:e,valueType:t,...oe(r)})}var La=L("ZodEnum",(e,t)=>{bp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Km(e,o,n,s),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new La({...t,checks:[],...oe(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw Error(`Key ${i} not found in enum`);return new La({...t,checks:[],...oe(n),entries:s})}});function ic(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new La({type:"enum",entries:r,...oe(t)})}var iR=L("ZodLiteral",(e,t)=>{zp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gm(e,r,o,n),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 We(e,t){return new iR({type:"literal",values:Array.isArray(e)?e:[e],...oe(t)})}var aR=L("ZodTransform",(e,t)=>{Rs(),$p.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Ym(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Lo(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(vr(s,r.value,t));else{let i=s;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=r.value;i.inst??(i.inst=e),r.issues.push(vr(i))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((s)=>(r.value=s,r));return r.value=n,r}});function Df(e){return new aR({type:"transform",transform:e})}var Uf=L("ZodOptional",(e,t)=>{ua.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qa(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function Me(e){return new Uf({type:"optional",innerType:e})}var Ff=L("ZodExactOptional",(e,t)=>{Rp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>qa(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function cR(e){return new Ff({type:"optional",innerType:e})}var uR=L("ZodNullable",(e,t)=>{wp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>of(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function xf(e){return new uR({type:"nullable",innerType:e})}var lR=L("ZodDefault",(e,t)=>{Pp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>af(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dR(e,t){return new lR({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Zi(t)}})}var pR=L("ZodPrefault",(e,t)=>{kp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function mR(e,t){return new pR({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Zi(t)}})}var Vf=L("ZodNonOptional",(e,t)=>{xp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function fR(e,t){return new Vf({type:"nonoptional",innerType:e,...oe(t)})}var hR=L("ZodCatch",(e,t)=>{Ep.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uf(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function gR(e,t){return new hR({type:"catch",innerType:e,catchValue:typeof t==="function"?t:vl(t)})}var Hf=L("ZodPipe",(e,t)=>{la.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lf(e,r,o,n),e.in=t.in,e.out=t.out});function Ef(e,t){return new Hf({type:"pipe",in:e,out:t})}var _R=L("ZodPreprocess",(e,t)=>{Hf.init(e,t),Tp.init(e,t)}),yR=L("ZodReadonly",(e,t)=>{Op.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>df(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function vR(e){return new yR({type:"readonly",innerType:e})}var SR=L("ZodLazy",(e,t)=>{Cp.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pf(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function Bf(e){return new SR({type:"lazy",getter:e})}var bR=L("ZodCustom",(e,t)=>{Ip.init(e,t),Te.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wm(e,r,o,n)});function zR(e,t={}){return Rm(bR,e,t)}function $R(e,t){return wm(e,t)}function Va(e,t){return new _R({type:"pipe",in:Df(e),out:t})}var Kf={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};var Jf;(function(e){})(Jf||(Jf={}));function wR(e){return hs(Da,e)}function PR(e){return gm(ws,e)}var Hr="2025-11-25",yq="2025-03-26",Ly=[Hr,"2025-06-18","2025-03-26","2024-11-05","2024-10-07"],Ha="io.modelcontextprotocol/related-task",Zo="io.modelcontextprotocol/protocolVersion",jl="io.modelcontextprotocol/clientInfo",va="io.modelcontextprotocol/serverInfo",Ar="io.modelcontextprotocol/clientCapabilities",Qf="io.modelcontextprotocol/subscriptionId",Mu="io.modelcontextprotocol/logLevel",vq="traceparent",bq="tracestate",Sq="baggage",Br="2.0";var eh=Bf(()=>Fn([x(),lr(),Pr(),Ua(),mi(x(),eh),ve(eh)])),Oi=mi(x(),eh),S0=ve(eh),hA=Fn([x(),lr().int()]),gA=x(),e_=X({ttl:lr().optional()}),t_=X({taskId:x()}),yA=un({progressToken:hA.optional(),[Ha]:t_.optional()}),Ki=X({_meta:yA.optional()}),By=Ki.extend({task:e_.optional()}),Mi=X({method:x(),params:Ki.loose().optional()}),js=X({_meta:yA.optional()}),Ks=X({method:x(),params:js.loose().optional()}),vA=un({get[va](){return PS.optional().catch(void 0)}}),Jn=un({_meta:vA.optional()}),th=Fn([x(),lr().int()]),wS=X({jsonrpc:We(Br),id:th,...Mi.shape}).strict(),RS=X({jsonrpc:We(Br),...Ks.shape}).strict(),$y=X({jsonrpc:We(Br),id:th,result:Jn}).strict(),Uy=X({jsonrpc:We(Br),id:th.optional(),error:X({code:lr().int(),message:x(),data:Pi().optional()})}).strict(),Nu=Fn([wS,RS,$y,Uy]),w0=Fn([$y,Uy]),bA=Jn.strict(),r_=js.extend({requestId:th.optional(),reason:x().optional()}),SA=Ks.extend({method:We("notifications/cancelled"),params:r_}),n_=X({src:x(),mimeType:x().optional(),sizes:ve(x()).optional(),theme:ic(["light","dark"]).optional()}),rh=X({icons:ve(n_).optional()}),Yp=X({name:x(),title:x().optional()}),PS=Yp.extend({...Yp.shape,...rh.shape,version:x(),websiteUrl:x().optional(),description:x().optional()}),xR=Ps(X({applyDefaults:Pr().optional()}),Oi),ER=Va((e)=>{if(e&&typeof e==="object"&&!Array.isArray(e)&&Object.keys(e).length===0)return{form:{}};return e},Ps(X({form:xR.optional(),url:Oi.optional()}),Oi.optional())),i_=un({list:Oi.optional(),cancel:Oi.optional(),requests:un({sampling:un({createMessage:Oi.optional()}).optional(),elicitation:un({create:Oi.optional()}).optional()}).optional()}),o_=un({list:Oi.optional(),cancel:Oi.optional(),requests:un({tools:un({call:Oi.optional()}).optional()}).optional()}),s_=X({experimental:mi(x(),Oi).optional(),sampling:X({context:Oi.optional(),tools:Oi.optional()}).optional(),elicitation:ER.optional(),roots:X({listChanged:Pr().optional()}).optional(),tasks:i_.optional(),extensions:mi(x(),Oi).optional()}),a_=Ki.extend({protocolVersion:x(),capabilities:s_,clientInfo:PS}),wA=Mi.extend({method:We("initialize"),params:a_}),RA=X({experimental:mi(x(),Oi).optional(),logging:Oi.optional(),completions:Oi.optional(),prompts:X({listChanged:Pr().optional()}).optional(),resources:X({subscribe:Pr().optional(),listChanged:Pr().optional()}).optional(),tools:X({listChanged:Pr().optional()}).optional(),tasks:o_.optional(),extensions:mi(x(),Oi).optional()}),c_=Jn.extend({protocolVersion:x(),capabilities:RA,serverInfo:PS,instructions:x().optional()}),d_=Ks.extend({method:We("notifications/initialized"),params:js.optional()}),l_=Mi.extend({method:We("server/discover"),params:Ki.optional()}),Hy=Jn.extend({supportedVersions:ve(x()),capabilities:RA,instructions:x().optional()}),PA=Mi.extend({method:We("ping"),params:Ki.optional()}),u_=X({progress:lr(),total:Me(lr()),message:Me(x())}),p_=X({...js.shape,...u_.shape,progressToken:hA}),AA=Ks.extend({method:We("notifications/progress"),params:p_}),Jp=Ki.extend({cursor:gA.optional()}),nh=Mi.extend({params:Jp.optional()}),qd=Jn.extend({nextCursor:gA.optional()}),TA=X({uri:x(),mimeType:Me(x()),_meta:mi(x(),Pi()).optional()}),kA=TA.extend({text:x()}),Ba=x().refine((e)=>{try{return atob(e),!0}catch{return!1}},{message:"Invalid Base64 string"}),EA=TA.extend({blob:Ba}),ih=ic(["user","assistant"]),Xp=X({audience:ve(ih).optional(),priority:lr().min(0).max(1).optional(),lastModified:wR({offset:!0}).optional()}),oh=X({...Yp.shape,...rh.shape,uri:x(),description:Me(x()),mimeType:Me(x()),size:Me(lr()),annotations:Xp.optional(),_meta:Me(un({}))}),m_=X({...Yp.shape,...rh.shape,uriTemplate:x(),description:Me(x()),mimeType:Me(x()),annotations:Xp.optional(),_meta:Me(un({}))}),f_=nh.extend({method:We("resources/list")}),h_=qd.extend({resources:ve(oh)}),g_=nh.extend({method:We("resources/templates/list")}),y_=qd.extend({resourceTemplates:ve(m_)}),AS=Ki.extend({uri:x()}),v_=AS,b_=Mi.extend({method:We("resources/read"),params:v_}),S_=Jn.extend({contents:ve(Fn([kA,EA]))}),w_=Ks.extend({method:We("notifications/resources/list_changed"),params:js.optional()}),R_=AS,P_=Mi.extend({method:We("resources/subscribe"),params:R_}),A_=AS,T_=Mi.extend({method:We("resources/unsubscribe"),params:A_}),IA=X({toolsListChanged:Pr().optional(),promptsListChanged:Pr().optional(),resourcesListChanged:Pr().optional(),resourceSubscriptions:ve(x()).optional()}),k_=Ki.extend({notifications:IA}),E_=Mi.extend({method:We("subscriptions/listen"),params:k_}),I_=js.extend({notifications:IA}),__=Ks.extend({method:We("notifications/subscriptions/acknowledged"),params:I_}),x_=vA.extend({[Qf]:th}),C_=Jn.extend({_meta:x_}),D_=js.extend({uri:x()}),O_=Ks.extend({method:We("notifications/resources/updated"),params:D_}),M_=X({name:x(),description:Me(x()),required:Me(Pr())}),N_=X({...Yp.shape,...rh.shape,description:Me(x()),arguments:Me(ve(M_)),_meta:Me(un({}))}),F_=nh.extend({method:We("prompts/list")}),L_=qd.extend({prompts:ve(N_)}),B_=Ki.extend({name:x(),arguments:mi(x(),x()).optional()}),$_=Mi.extend({method:We("prompts/get"),params:B_}),TS=X({type:We("text"),text:x(),annotations:Xp.optional(),_meta:mi(x(),Pi()).optional()}),kS=X({type:We("image"),data:Ba,mimeType:x(),annotations:Xp.optional(),_meta:mi(x(),Pi()).optional()}),ES=X({type:We("audio"),data:Ba,mimeType:x(),annotations:Xp.optional(),_meta:mi(x(),Pi()).optional()}),U_=X({type:We("tool_use"),name:x(),id:x(),input:mi(x(),Pi()),_meta:mi(x(),Pi()).optional()}),H_=X({type:We("resource"),resource:Fn([kA,EA]),annotations:Xp.optional(),_meta:mi(x(),Pi()).optional()}),q_=oh.extend({type:We("resource_link")}),IS=Fn([TS,kS,ES,q_,H_]),V_=X({role:ih,content:IS}),W_=Jn.extend({description:x().optional(),messages:ve(V_)}),z_=Ks.extend({method:We("notifications/prompts/list_changed"),params:js.optional()}),j_=X({title:x().optional(),readOnlyHint:Pr().optional(),destructiveHint:Pr().optional(),idempotentHint:Pr().optional(),openWorldHint:Pr().optional()}),K_=X({taskSupport:ic(["required","optional","forbidden"]).optional()}),_A=X({...Yp.shape,...rh.shape,description:x().optional(),inputSchema:X({type:We("object"),properties:mi(x(),eh).optional(),required:ve(x()).optional()}).catchall(Pi()),outputSchema:un({$schema:x().optional()}).optional(),annotations:j_.optional(),execution:K_.optional(),_meta:mi(x(),Pi()).optional()}),G_=nh.extend({method:We("tools/list")}),Y_=qd.extend({tools:ve(_A)}),xA=Jn.extend({content:ve(IS).default([]),structuredContent:Pi().optional(),isError:Pr().optional()}),R0=xA.or(Jn.extend({toolResult:Pi()})),J_=By.extend({name:x(),arguments:mi(x(),Pi()).optional()}),X_=Mi.extend({method:We("tools/call"),params:J_}),Z_=Ks.extend({method:We("notifications/tools/list_changed"),params:js.optional()}),CA=X({autoRefresh:Pr().default(!0),debounceMs:lr().int().nonnegative().default(300)}),sh=ic(["debug","info","notice","warning","error","critical","alert","emergency"]),Q_=Ki.extend({level:sh}),ex=Mi.extend({method:We("logging/setLevel"),params:Q_}),tx=js.extend({level:sh,logger:x().optional(),data:Pi()}),rx=Ks.extend({method:We("notifications/message"),params:tx}),nx=X({name:x().optional()}),ix=X({hints:ve(nx).optional(),costPriority:lr().min(0).max(1).optional(),speedPriority:lr().min(0).max(1).optional(),intelligencePriority:lr().min(0).max(1).optional()}),ox=X({mode:ic(["auto","required","none"]).optional()}),sx=X({type:We("tool_result"),toolUseId:x().describe("The unique identifier for the corresponding tool call."),content:ve(IS),structuredContent:Pi().optional(),isError:Pr().optional(),_meta:mi(x(),Pi()).optional()}),ax=Fa("type",[TS,kS,ES]),qy=Fa("type",[TS,kS,ES,U_,sx]),cx=X({role:ih,content:Fn([qy,ve(qy)]),_meta:mi(x(),Pi()).optional()}),dx=By.extend({messages:ve(cx),modelPreferences:ix.optional(),systemPrompt:x().optional(),includeContext:ic(["none","thisServer","allServers"]).optional(),temperature:lr().optional(),maxTokens:lr().int(),stopSequences:ve(x()).optional(),metadata:Oi.optional(),tools:ve(_A).optional(),toolChoice:ox.optional()}),lx=Mi.extend({method:We("sampling/createMessage"),params:dx}),ux=Jn.extend({model:x(),stopReason:Me(ic(["endTurn","stopSequence","maxTokens"]).or(x())),role:ih,content:ax}),px=Jn.extend({model:x(),stopReason:Me(ic(["endTurn","stopSequence","maxTokens","toolUse"]).or(x())),role:ih,content:Fn([qy,ve(qy)])}),_S=X({type:We("boolean"),title:x().optional(),description:x().optional(),default:Pr().optional()}),ah=X({type:We("string"),title:x().optional(),description:x().optional(),minLength:lr().optional(),maxLength:lr().optional(),format:ic(["email","uri","date","date-time"]).optional(),default:x().optional()}),ch=X({type:ic(["number","integer"]),title:x().optional(),description:x().optional(),minimum:lr().optional(),maximum:lr().optional(),default:lr().optional()}),xS=X({type:We("string"),title:x().optional(),description:x().optional(),enum:ve(x()),default:x().optional()}),CS=X({type:We("string"),title:x().optional(),description:x().optional(),oneOf:ve(X({const:x(),title:x()})),default:x().optional()}),DS=X({type:We("string"),title:x().optional(),description:x().optional(),enum:ve(x()),enumNames:ve(x()).optional(),default:x().optional()}),mx=Fn([xS,CS]),OS=X({type:We("array"),title:x().optional(),description:x().optional(),minItems:lr().optional(),maxItems:lr().optional(),items:X({type:We("string"),enum:ve(x())}),default:ve(x()).optional()}),MS=X({type:We("array"),title:x().optional(),description:x().optional(),minItems:lr().optional(),maxItems:lr().optional(),items:X({anyOf:ve(X({const:x(),title:x()}))}),default:ve(x()).optional()}),fx=Fn([OS,MS]),hx=Fn([DS,mx,fx]),NS=Fn([hx,_S,ah,ch]),dh=By.extend({mode:We("form").optional(),message:x(),requestedSchema:X({type:We("object"),properties:mi(x(),NS),required:ve(x()).optional()}).catchall(Pi())}),gx=By.extend({mode:We("url"),message:x(),elicitationId:x(),url:x().url()}),yx=Fn([dh,gx]),vx=Mi.extend({method:We("elicitation/create"),params:yx}),bx=js.extend({elicitationId:x()}),Sx=Ks.extend({method:We("notifications/elicitation/complete"),params:bx}),wx=Jn.extend({action:ic(["accept","decline","cancel"]),content:Va((e)=>e===null?void 0:e,mi(x(),Fn([x(),lr(),Pr(),ve(x())])).optional())}),Rx=X({type:We("ref/resource"),uri:x()}),Px=X({type:We("ref/prompt"),name:x()}),Ax=Ki.extend({ref:Fn([Px,Rx]),argument:X({name:x(),value:x()}),context:X({arguments:mi(x(),x()).optional()}).optional()}),Tx=Mi.extend({method:We("completion/complete"),params:Ax}),kx=Jn.extend({completion:un({values:ve(x()).max(100),total:Me(lr().int()),hasMore:Me(Pr())})}),Ex=X({uri:x().startsWith("file://"),name:x().optional(),_meta:mi(x(),Pi()).optional()}),Ix=Mi.extend({method:We("roots/list"),params:Ki.optional()}),_x=Jn.extend({roots:ve(Ex)}),xx=Ks.extend({method:We("notifications/roots/list_changed"),params:js.optional()}),P0=un({ttl:lr().optional(),pollInterval:lr().optional()}),Cx=ic(["working","input_required","completed","failed","cancelled"]),lh=X({taskId:x(),status:Cx,ttl:Fn([lr(),Ua()]),createdAt:x(),lastUpdatedAt:x(),pollInterval:Me(lr()),statusMessage:Me(x())}),A0=Jn.extend({task:lh}),Dx=js.merge(lh),T0=Ks.extend({method:We("notifications/tasks/status"),params:Dx}),k0=Mi.extend({method:We("tasks/get"),params:Ki.extend({taskId:x()})}),E0=Jn.merge(lh),I0=Mi.extend({method:We("tasks/result"),params:Ki.extend({taskId:x()})}),_0=Jn.loose(),x0=nh.extend({method:We("tasks/list")}),C0=qd.extend({tasks:ve(lh)}),D0=Mi.extend({method:We("tasks/cancel"),params:Ki.extend({taskId:x()})}),O0=Jn.merge(lh),M0=Fn([PA,wA,l_,Tx,ex,$_,F_,f_,g_,b_,P_,T_,E_,X_,G_]),N0=Fn([SA,AA,d_,xx]),F0=Fn([bA,ux,px,wx,_x]),L0=Fn([PA,lx,vx,Ix]),B0=Fn([SA,AA,rx,O_,w_,Z_,z_,__,Sx]),$0=Fn([bA,c_,Hy,kx,W_,L_,h_,y_,S_,xA,Y_,C_]);var He=jf().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Kf.custom,message:"URL must be parseable",fatal:!0}),Fi}).refine((e)=>{let t=new URL(e);return t.protocol!=="javascript:"&&t.protocol!=="data:"&&t.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),Ox=un({resource:x().url(),authorization_servers:ve(He).optional(),jwks_uri:x().url().optional(),scopes_supported:ve(x()).optional(),bearer_methods_supported:ve(x()).optional(),resource_signing_alg_values_supported:ve(x()).optional(),resource_name:x().optional(),resource_documentation:x().optional(),resource_policy_uri:x().url().optional(),resource_tos_uri:x().url().optional(),tls_client_certificate_bound_access_tokens:Pr().optional(),authorization_details_types_supported:ve(x()).optional(),dpop_signing_alg_values_supported:ve(x()).optional(),dpop_bound_access_tokens_required:Pr().optional()}),DA=un({issuer:x(),authorization_endpoint:He,token_endpoint:He,registration_endpoint:He.optional(),scopes_supported:ve(x()).optional(),response_types_supported:ve(x()),response_modes_supported:ve(x()).optional(),grant_types_supported:ve(x()).optional(),token_endpoint_auth_methods_supported:ve(x()).optional(),token_endpoint_auth_signing_alg_values_supported:ve(x()).optional(),service_documentation:He.optional(),revocation_endpoint:He.optional(),revocation_endpoint_auth_methods_supported:ve(x()).optional(),revocation_endpoint_auth_signing_alg_values_supported:ve(x()).optional(),introspection_endpoint:x().optional(),introspection_endpoint_auth_methods_supported:ve(x()).optional(),introspection_endpoint_auth_signing_alg_values_supported:ve(x()).optional(),code_challenge_methods_supported:ve(x()).optional(),client_id_metadata_document_supported:Pr().optional(),authorization_response_iss_parameter_supported:Pr().optional().catch(void 0),dpop_signing_alg_values_supported:ve(x()).optional()}),Mx=un({issuer:x(),authorization_endpoint:He,token_endpoint:He,userinfo_endpoint:He.optional(),jwks_uri:He,registration_endpoint:He.optional(),scopes_supported:ve(x()).optional(),response_types_supported:ve(x()),response_modes_supported:ve(x()).optional(),grant_types_supported:ve(x()).optional(),acr_values_supported:ve(x()).optional(),subject_types_supported:ve(x()),id_token_signing_alg_values_supported:ve(x()),id_token_encryption_alg_values_supported:ve(x()).optional(),id_token_encryption_enc_values_supported:ve(x()).optional(),userinfo_signing_alg_values_supported:ve(x()).optional(),userinfo_encryption_alg_values_supported:ve(x()).optional(),userinfo_encryption_enc_values_supported:ve(x()).optional(),request_object_signing_alg_values_supported:ve(x()).optional(),request_object_encryption_alg_values_supported:ve(x()).optional(),request_object_encryption_enc_values_supported:ve(x()).optional(),token_endpoint_auth_methods_supported:ve(x()).optional(),token_endpoint_auth_signing_alg_values_supported:ve(x()).optional(),display_values_supported:ve(x()).optional(),claim_types_supported:ve(x()).optional(),claims_supported:ve(x()).optional(),service_documentation:x().optional(),claims_locales_supported:ve(x()).optional(),ui_locales_supported:ve(x()).optional(),claims_parameter_supported:Pr().optional(),request_parameter_supported:Pr().optional(),request_uri_parameter_supported:Pr().optional(),require_request_uri_registration:Pr().optional(),op_policy_uri:He.optional(),op_tos_uri:He.optional(),client_id_metadata_document_supported:Pr().optional(),authorization_response_iss_parameter_supported:Pr().optional().catch(void 0)}),Nx=X({...Mx.shape,...DA.pick({code_challenge_methods_supported:!0}).shape}),OA=X({access_token:x(),id_token:x().optional(),token_type:x(),expires_in:PR().optional(),scope:x().optional(),refresh_token:x().optional(),issuer:x().optional().catch(void 0)}).strip(),Fx=X({issued_token_type:We("urn:ietf:params:oauth:token-type:id-jag"),access_token:x(),token_type:x().optional(),expires_in:lr().optional(),scope:x().optional()}).strip(),MA=X({error:x(),error_description:x().optional(),error_uri:x().optional()}),Ja=He.optional().or(We("").transform(()=>{return})),Lx=X({redirect_uris:ve(He),token_endpoint_auth_method:x().optional(),grant_types:ve(x()).optional(),response_types:ve(x()).optional(),application_type:x().optional(),client_name:x().optional(),client_uri:He.optional(),logo_uri:Ja,scope:x().optional(),contacts:ve(x()).optional(),tos_uri:Ja,policy_uri:x().optional(),jwks_uri:He.optional(),jwks:Zf().optional(),software_id:x().optional(),software_version:x().optional(),software_statement:x().optional()}).strip(),Bx=X({client_id:x(),client_secret:x().optional(),client_id_issued_at:lr().optional(),client_secret_expires_at:lr().optional(),issuer:x().optional().catch(void 0)}).strip(),$x=Lx.merge(Bx),U0=X({error:x(),error_description:x().optional()}).strip(),H0=X({token:x(),token_type_hint:x().optional()}).strip();function Wo(e){let t=Object.values(e).filter((o)=>typeof o==="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function Ga(e,t="|"){return e.map((r)=>Xa(r)).join(t)}function Yo(e,t){if(typeof t==="bigint")return t.toString();return t}class Xf{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Xo(e){return new Xf(e)}function fh(e){return e===null||e===void 0}function ks(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function hh(e,t){let r=e/t,o=Math.round(r),n=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}var Yf=Symbol("evaluating");function gh(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===Yf)return;if(o===void 0)o=Yf,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function pt(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Qo(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Dt(e){return Qo(e._zod.def)??e._zod.def.shape}function _h(e,t,r){Object.defineProperty(e,t,{get(){let o=r();return pt(this,t,o),o},enumerable:!0,configurable:!0})}function yh(e,t,r){if(t in e)pt(e,t,r);else e[t]=r}function Sr(e,t,r,o){let n=Dt(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(n,s);if(!i.enumerable)continue;if(i.get)_h(e,s,()=>{let a=t._zod.def.shape[s];return o?o(a,s):a});else yh(e,s,o?o(i.value,s):i.value)}}function AR(e,t){for(let r of Reflect.ownKeys(t)){let o=Object.getOwnPropertyDescriptor(t,r);if(!o.enumerable)continue;if(o.get)_h(e,r,()=>t[r]);else yh(e,r,o.value)}}function mt(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function vh(e){return JSON.stringify(e)}function Sh(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var Wa="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Jr(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var bh=Xo(()=>{if(nt.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function br(e){if(Jr(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(Jr(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function Ya(e){if(br(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var zh=new Set(["string","number","symbol"]);function tr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ct(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function ne(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}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function Xa(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function $h(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var xs=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),Qa={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function jR(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let s={};return Sr(s,e,Es(e,t)),Ct(e,mt(r,{shape:s,checks:[]}))}function Es(e,t){let r=Dt(e),o=[];for(let n of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,n)?.enumerable)throw Error(`Unrecognized key: "${String(n)}"`);if(t[n])o.push(n)}return o}function MR(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let s=new Set(Es(e,t)),i={};return Sr(i,e,Reflect.ownKeys(Dt(e)).filter((a)=>!s.has(a))),Ct(e,mt(r,{shape:i,checks:[]}))}function ZR(e,t){if(!br(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let n=Dt(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,s)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ct(e,mt(e._zod.def,{shape:Rh(e,t)}))}function Rh(e,t){let r={};return Sr(r,e,Reflect.ownKeys(Dt(e))),AR(r,t),r}function qR(e,t){if(!br(t))throw Error("Invalid input to safeExtend: expected a plain object");return Ct(e,mt(e._zod.def,{shape:Rh(e,t)}))}function LR(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 r={};Sr(r,e,Reflect.ownKeys(Dt(e))),Sr(r,t,Reflect.ownKeys(Dt(t)));let o=mt(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ct(e,o)}function wh(e,t,r,o="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${o}() cannot be used on object schemas containing refinements`);let a=r?new Set(Es(t,r)):void 0,c={};return Sr(c,t,Reflect.ownKeys(Dt(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),Ct(t,mt(t._zod.def,{shape:c,checks:[]}))}function DR(e,t,r){let o=r?new Set(Es(t,r)):void 0,n={};return Sr(n,t,Reflect.ownKeys(Dt(t)),(s,i)=>o&&!o.has(i)?s:new e({type:"nonoptional",innerType:s})),Ct(t,mt(t._zod.def,{shape:n}))}function It(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ph(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function rr(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function Go(e){return typeof e==="string"?e:e?.message}function ec(e){let t=[];for(let r of e??[]){let o=r._zod.def;if(!/_(length|size)$|_equals$/.test(o.check))break;let n=o.maximum??o.length??o.size;if(n>=0)t.push([n,r])}return t}function Ts(e,t,r){var o;for(let n=t;n<e.length;n++)(o=e[n]).schema??(o.schema=r)}function Nt(e,t,r){var o;let n=e.inst?._zod?.traits;if(n?.has("$ZodType"))if(n.has("$ZodCheck"))(o=e).schema??(o.schema=e.inst);else e.schema=e.inst;let s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:Go(e.inst?._zod.def?.error?.(e))??Go(s?.(e))??Go(t?.error?.(e))??Go(r.customError?.(e))??Go(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e)){if(c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__")continue;a[c]=e[c]}if(a.path??(a.path=[]),a.message=i,t?.reportInput)a.input=e.input;return a}var UR=/[\uD800-\uDBFF]/;function Os(e){let t=e.length;if(!UR.test(e))return t;let r=t;for(let o=0;o<t-1;o++)if((e.charCodeAt(o)&64512)===55296&&(e.charCodeAt(o+1)&64512)===56320)r--,o++;return r}function Cs(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function kh(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 r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function zr(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function xh(e,t){for(let r in t){let o=Object.getOwnPropertyDescriptor(t,r);if(o.get)Object.defineProperty(e,r,{...o,enumerable:!1});else FR(e,r,o.value)}}function Ut(e,t,r,o=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:o,value:r}),r}function Is(e,t,r){return Ut(e,t,r,!1)}function Eh(e,t){for(let r in e){let o=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Ut(this,r,o(this))},set(n){Ut(this,r,n)}})}return t}function FR(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Ut(this,t,r.bind(this))},set(o){Ut(this,t,o)}})}function VR(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var Ka,er=!1,HR={configurable:!0,get(){er=!0;return}};function be(e,t,r){let o=Object.getPrototypeOf(e._zod);if(t in o&&Ka!==e._zod){Ka=void 0;return}Ka=e._zod,Object.defineProperty(o,t,{configurable:!0,get(){Object.defineProperty(this,t,HR);let n=er;er=!1;try{let s=r(this);if(er)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s});return er=er||n,s}catch(s){throw delete this[t],er=er||n,s}},set(n){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:n})}})}function BR(e,t,r,o){let n=VR(e,t);if(!n)return;Object.defineProperty(n,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:o,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:o,value:s})}})}var JR="~constantCatch";function Th(e){let t=()=>e;return t[JR]=!0,t}var Oh;var tc={value:void 0,enumerable:!1},Ch="captureStackTrace"in Error?Error:null;function KR(e){let t=Ch;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Ch=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function D(e,t,r,o){let n={};function s(m){this.def=m,this.constr=d,this.traits=new Set}s.prototype=n;let i=r,a=i&&new WeakSet;function c(m,h){if(!m._zod){tc.value=new s(h);try{Object.defineProperty(m,"_zod",tc)}finally{tc.value=void 0}}else if(m._zod.traits.has(e))return;if(m._zod.traits.add(e),t(m,h),a){let v=Object.getPrototypeOf(m),y=m._zod.constr.prototype,g=v;while(g&&g!==y)g=Object.getPrototypeOf(g);let P=g??v;if(!a.has(P))a.add(P),xh(P,i)}let f=d.prototype;for(let v in f){if(!Object.prototype.hasOwnProperty.call(f,v))continue;if(!(v in m))m[v]=f[v].bind(m)}}let u=o?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(m){let h=o?.Parent?KR(l):this;c(h,m);let f=h._zod.deferred;if(f){for(let y of f)y();h._zod.deferred=void 0}let v=globalThis.__zod_globalConfig?.postProcessor;if(v)v(h);return h}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:(m)=>{if(o?.Parent&&m instanceof o.Parent)return!0;return m?._zod?.traits?.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}class At extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class en extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Oh=globalThis).__zod_globalConfig??(Oh.__zod_globalConfig={});var nt=globalThis.__zod_globalConfig;function ft(e){if(e)Object.assign(nt,e);return nt}function GR(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Yo,2)),e.message}function WR(e){this._zod.message=e}var YR={get:GR,set:WR,enumerable:!0,configurable:!0},oc={value:void 0,enumerable:!1},Ih=new WeakSet([Object.prototype,Error.prototype]),Nh=(e,t)=>{e.name="$ZodError",oc.value=t,Object.defineProperty(e,"issues",oc),oc.value=void 0,Object.defineProperty(e,"message",YR);let r=Object.getPrototypeOf(e);if(!Ih.has(r))Ih.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let o=()=>this.message;return Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,"toString",{value:o,configurable:!0,writable:!0})}})},Ah=D("$ZodError",Nh),DI=D("$ZodError",Nh,void 0,{Parent:Error});function XR(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function jh(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)XR(r,n.path[0],()=>[]).push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Mh(e,t=(r)=>r.message){let r={_errors:[]},o=(n,s=[])=>{for(let i of n.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((a)=>o({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")o({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")o({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;while(u<a.length){let l=a[u],d=u===a.length-1;if(l==="_errors"){if(d)c._errors.push(t(i));u++;continue}if(!Object.prototype.hasOwnProperty.call(c,l))Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=c[l];if(d)m._errors.push(t(i));c=m,u++}}}};return o(e),r}function Ns(e,t){return{callee:t?.callee??e,Err:t?.Err}}var As=(e)=>{let t=(r,o,n,s)=>{let i=n?{...n,async:!1}:{async:!1},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)throw new At;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Nt(u,i,ft())));throw Wa(c,s?.callee??t),c}return a.value};return t};var Ms=(e)=>{let t=async(r,o,n,s)=>{let i=n?{...n,async:!0}:{async:!0},a=r._zod.run({value:o,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Nt(u,i,ft())));throw Wa(c,s?.callee??t),c}return a.value};return t};var Zs=(e)=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)throw new At;return s.issues.length?Zh(e,s.issues,n):{success:!0,data:s.value}};function Zh(e,t,r){let o;return{success:!1,get error(){if(!o)o=new e(t.map((n)=>Nt(n,r,ft()))),t=void 0,r=void 0;return o},set error(n){o=n,t=void 0,r=void 0}}}var qs=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},n);if(s instanceof Promise)s=await s;return s.issues.length?Zh(e,s.issues,n):{success:!0,data:s.value}};var QR=Symbol.for("zod.compile.invalid"),ew=Symbol.for("zod.compile.fallback"),nc=(e,t,r)=>{let o=e._zod.bag.validator;if(o!==void 0){if(o(t)!==QR)return!0;if(o.definite===!0&&r===void 0)return!1}return tw(e,t,r)};function tw(e,t,r){let o=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},n=e._zod.bag.fallbackRun,s;if(n)o[ew]=!0,s=n({value:t,issues:[]},o);else s=e._zod.run({value:t,issues:[]},o);if(s instanceof Promise)throw new At;return s.issues.length===0}var sc=async(e,t,r)=>{let o=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},n=e._zod.run({value:t,issues:[]},o);if(n instanceof Promise)n=await n;return n.issues.length===0},qh=(e)=>{let t=As(e),r=(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(o,n,a,Ns(r,i))};return r};var Lh=(e)=>{let t=As(e),r=(o,n,s,i)=>t(o,n,s,Ns(r,i));return r};var Dh=(e)=>{let t=Ms(e),r=async(o,n,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(o,n,a,Ns(r,i))};return r};var Uh=(e)=>{let t=Ms(e),r=async(o,n,s,i)=>await t(o,n,s,Ns(r,i));return r};var Fh=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Zs(e)(t,r,n)};var Vh=(e)=>(t,r,o)=>Zs(e)(t,r,o);var Hh=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return qs(e)(t,r,n)};var Bh=(e)=>async(t,r,o)=>qs(e)(t,r,o);var Jh=/^[cC][0-9a-z]{6,}$/,Kh=/^[0-9a-z]+$/,Gh=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Wh=/^[0-9a-vA-V]{20}$/,Yh=/^[A-Za-z0-9]{27}$/,Xh=/^[a-zA-Z0-9_-]{21}$/;function Qh(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var eg=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var tg=/^([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})$/,cc=(e)=>{if(!e)return/^([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)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var rg=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var rw="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function og(){return new RegExp(rw,"u")}var ng=/^(?:(?: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])$/,sg=/^(([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}|:))$/;var ig=/^((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])$/,ag=/^(([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])$/,cg=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ug=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var lg=/^https?$/,dg=/^\+[1-9]\d{6,14}$/;var pg="(?:(?:\\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 ow(e){return new RegExp(`^${e}$`)}var mg=ow(pg);function ac(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function fg(e){return new RegExp(`^${ac(e)}$`)}function hg(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${ac({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,o=e.local?`${r}|${ac({precision:e.precision})}`:r;return new RegExp(`^${pg}T(?:${o})$`)}var gg=/^[\s\S]{0,}$/;var uc=/^-?\d+$/,tn=/^-?\d+(?:\.\d+)?$/,_g=/^(?:true|false)$/i,yg=/^null$/i;var vg=/^[^A-Z]*$/,Sg=/^[^a-z]*$/;var Ke=D("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var lc=(e)=>{let t=e.value;return!fh(t)&&t.length!==void 0},Ls={number:"number",bigint:"bigint",object:"date"},dc=D("$ZodCheckLessThan",(e,t)=>{Ke.init(e,t);let r=Ls[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;o.issues.push({origin:Ls[typeof o.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),pc=D("$ZodCheckGreaterThan",(e,t)=>{Ke.init(e,t);let r=Ls[typeof t.value];e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;o.issues.push({origin:Ls[typeof o.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),bg=D("$ZodCheckMultipleOf",(e,t)=>{Ke.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):hh(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),zg=D("$ZodCheckNumberFormat",(e,t)=>{Ke.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,s]=xs[t.format];e._zod.check=(i)=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)i.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});else i.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}if(a<n)i.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(a>s)i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var $g=D("$ZodCheckMaxLength",(e,t)=>{var r;Ke.init(e,t),(r=e._zod.def).when??(r.when=lc),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>t.maximum?Os(n):s)<=t.maximum)return;let a=Cs(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Rg=D("$ZodCheckMinLength",(e,t)=>{var r;Ke.init(e,t),(r=e._zod.def).when??(r.when=lc),e._zod.check=(o)=>{let n=o.value,s=n.length;if((typeof n==="string"&&s>=t.minimum&&s<t.minimum*2?Os(n):s)>=t.minimum)return;let a=Cs(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),wg=D("$ZodCheckLengthEquals",(e,t)=>{var r;Ke.init(e,t),(r=e._zod.def).when??(r.when=lc),e._zod.check=(o)=>{let n=o.value,s=n.length,i=typeof n==="string"&&s>=t.length&&s<=t.length*2?Os(n):s;if(i===t.length)return;let a=Cs(n),c=i>t.length;o.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),on=D("$ZodCheckStringFormat",(e,t)=>{var r,o;if(Ke.init(e,t),t.pattern)(r=e._zod).check??(r.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;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})});else(o=e._zod).check??(o.check=()=>{})}),Pg=D("$ZodCheckRegex",(e,t)=>{on.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),kg=D("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=vg),on.init(e,t)}),xg=D("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Sg),on.init(e,t)}),Eg=D("$ZodCheckIncludes",(e,t)=>{Ke.init(e,t);let r=tr(t.includes),o=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=o,e._zod.check=(n)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Tg=D("$ZodCheckStartsWith",(e,t)=>{Ke.init(e,t);let r=new RegExp(`^${tr(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Og=D("$ZodCheckEndsWith",(e,t)=>{Ke.init(e,t);let r=new RegExp(`.*${tr(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(o)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});var Cg=D("$ZodCheckOverwrite",(e,t)=>{Ke.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class mc{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-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
59
|
-
`).filter((s)=>s),o=Math.min(...r.map((s)=>s.length-s.trimStart().length)),n=r.map((s)=>s.slice(o)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of n)this.content.push(s)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
60
|
-
${t.join(`
|
|
61
|
-
`)}
|
|
62
|
-
};`)(...Object.values(this.closed))}}var Ng={major:4,minor:6,patch:7};var Oe=D("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ng;let o=e._zod.def.checks,n=e._zod.traits.has("$ZodCheck")?[e,...o??[]]:o?.length?[...o]:[];for(let s of n)for(let i of s._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let s=(a,c,u)=>{if(a.memo)return a;let l=It(a),d;for(let m of c){if(m._zod.def.when){if(Ph(a))continue;if(!m._zod.def.when(a))continue}else if(l)continue;let h=a.issues.length,f=m._zod.check(a);if(f instanceof Promise&&u?.async===!1)throw new At;if(d||f instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await f,a.issues.length===h)return;if(Ts(a.issues,h,e),!l)l=It(a,h)});else{if(a.issues.length===h)continue;if(Ts(a.issues,h,e),!l)l=It(a,h)}}if(d)return d.then(()=>a);return a},i=(a,c,u)=>{if(It(a))return a.aborted=!0,a;let l=s(c,n,u);if(l instanceof Promise){if(u.async===!1)throw new At;return l.then((d)=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(a,c)=>{if(c.skipChecks)return e._zod.parse(a,c);if(c.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...c,skipChecks:!0});if(l instanceof Promise)return l.then((d)=>i(d,a,c));return i(l,a,c)}let u=e._zod.parse(a,c);if(u instanceof Promise){if(c.async===!1)throw new At;return u.then((l)=>s(l,n,c))}return s(u,n,c)}}},{get "~standard"(){return Is(this,"~standard",hc(this))},set "~standard"(e){Ut(this,"~standard",e)}}),Hg=(e,t)=>e.issues.length?{issues:e.issues.map((r)=>Nt(r,t,ft()))}:{value:e.value};async function nw(e,t){let r={async:!0};return Hg(await e._zod.run({value:t,issues:[]},r),r)}function hc(e){return{validate:(t)=>{let r={async:!1};try{let o=e._zod.run({value:t,issues:[]},r);if(!(o instanceof Promise))return Hg(o,r)}catch(o){}return nw(e,t)},vendor:"zod",version:1}}var Vs=D("$ZodString",(e,t)=>{Oe.init(e,t),e._zod.pattern=t.pattern??gg,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Ae=D("$ZodStringFormat",(e,t)=>{on.init(e,t),Vs.init(e,t)}),Bg=D("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=tg),Ae.init(e,t)}),Jg=D("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=cc(o))}else t.pattern??(t.pattern=cc());Ae.init(e,t)}),Kg=D("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=rg),Ae.init(e,t)}),Gg=1,Us=2;function Wg(e){try{if(typeof URL<"u"&&typeof URL.canParse==="function")return URL.canParse(e);return new URL(e),!0}catch{return!1}}function sw(e,t){if(!("normalize"in t)&&!("hostname"in t)&&!("protocol"in t))return Wg(e)||Us;return iw(e,t)}function iw(e,t){if(!t.normalize&&t.protocol?.source===lg.source&&!/^https?:\/\//i.test(e))return Gg;try{if(typeof URL<"u"){let r=URL;if(typeof r.parse==="function")return r.parse(e)??Us}return new URL(e)}catch{return Us}}var aw=/[\t\n\r]/g;function Ag(e){return e.replace(aw,"")}function cw(e,t){return t.lastIndex=0,t.test(e.hostname)}function uw(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(":")?e.protocol.slice(0,-1):e.protocol)}var Yg=D("$ZodURL",(e,t)=>{Ae.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim(),n=sw(o,t);if(n===Gg){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}if(n===Us){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort});return}if(n===!0){r.value=Ag(o);return}if(t.hostname&&!cw(n,t.hostname))r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort});if(t.protocol&&!uw(n,t.protocol))r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort});r.value=t.normalize?n.href:Ag(o);return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Xg=D("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=og()),Ae.init(e,t)}),Qg=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.pattern=t.length===void 0?Xh:Qh(t.length)),Ae.init(e,t)}),ey=D("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Jh),Ae.init(e,t)}),ty=D("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Kh),Ae.init(e,t)}),ry=D("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Gh),Ae.init(e,t)}),oy=D("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Wh),Ae.init(e,t)}),ny=D("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Yh),Ae.init(e,t)}),sy=D("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=hg(t)),Ae.init(e,t)}),iy=D("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=mg),Ae.init(e,t)}),ay=D("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=fg(t)),Ae.init(e,t)}),cy=D("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=eg),Ae.init(e,t)}),uy=D("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ng),Ae.init(e,t)}),lw=/^[0-9a-fA-F:.]+$/;function ly(e){if(!lw.test(e))return!1;return Wg(`http://[${e}]`)}var dy=D("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=sg),Ae.init(e,t),e._zod.check=(r)=>{if(!ly(r.value))r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}});var py=D("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ig),Ae.init(e,t)});function dw(e){let t=e.split("/");if(t.length!==2)return!1;let[r,o]=t;if(!o)return!1;let n=Number(o);if(`${n}`!==o)return!1;if(n<0||n>128)return!1;return ly(r)}var my=D("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ag),Ae.init(e,t),e._zod.check=(r)=>{if(!dw(r.value))r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}});function fy(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}var gc=/^[0-9a-zA-Z+/]*={0,2}$/,hy=D("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=gc),Ae.init(e,t),e._zod.check=(r)=>{if(fy(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}}),Hs=/^[A-Za-z0-9_-]*$/;function pw(e){if(!Hs.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return fy(r)}var gy=D("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Hs),Ae.init(e,t),e._zod.check=(r)=>{if(pw(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),_y=D("$ZodE164",(e,t)=>{t.pattern??(t.pattern=dg),Ae.init(e,t)});function mw(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}var yy=D("$ZodJWT",(e,t)=>{Ae.init(e,t),e._zod.check=(r)=>{if(mw(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}});var _c=D("$ZodNumber",(e,t)=>{Oe.init(e,t),e._zod.pattern=tn,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(i){}let n=r.value;if(typeof n==="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let s=typeof n==="number"?Number.isNaN(n)?"NaN":!Number.isFinite(n)?String(n):void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...s?{received:s}:{}}),r}}),vy=D("$ZodNumberFormat",(e,t)=>{zg.init(e,t),_c.init(e,t)}),Sy=D("$ZodBoolean",(e,t)=>{Oe.init(e,t),e._zod.pattern=_g,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(s){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}});var by=D("$ZodNull",(e,t)=>{Oe.init(e,t),e._zod.pattern=yg,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}});var zy=D("$ZodUnknown",(e,t)=>{Oe.init(e,t),e._zod.parse=(r)=>r}),Ry=D("$ZodNever",(e,t)=>{Oe.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function fw(e,t){let r=ec(e._zod.def.checks);if(!r.length)return;let o=Math.min(...r.map((s)=>s[0])),n=e._zod.parse;e._zod.parse=(s,i)=>{let a=t(s.value);if(a>o&&!i?.skipChecks&&i?.direction!=="backward"){for(let[c,u]of ec(e._zod.def.checks))if(a>c&&u._zod.def.when(s)){let l=s.issues.length;return u._zod.check(s),s.issues[l].continue=!1,Ts(s.issues,l,e),s}}return n(s,i)}}var hw=(e)=>Array.isArray(e)?e.length:-1;function jg(e,t,r){if(e.issues.length)t.issues.push(...rr(r,e.issues));t.value[r]=e.value}var wy=D("$ZodArray",(e,t)=>{Oe.init(e,t);let r=nt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!Array.isArray(s))return o.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),o;o.value=r?r.alloc(e,o,Array(s.length),n):Array(s.length);let i=[],a=n?.abortEarly;for(let c=0;c<s.length;c++){let u=s[c],l=t.element._zod.run({value:u,issues:[]},n);if(l instanceof Promise)i.push(l.then((d)=>jg(d,o,c)));else if(jg(l,o,c),a&&l.issues.length!==0&&It(l))break}if(i.length)return Promise.all(i).then(()=>o);return o},fw(e,hw)});function Fs(e,t,r,o,n,s){let i=r in o,a=s==="optional";if(!i&&a&&n==="optional")return;if(e.issues.length){if(n!==void 0&&a&&!i)return;t.issues.push(...rr(r,e.issues))}if(!i&&n===void 0){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(i||n==="defaulted"&&!a)t.value[r]=void 0}else t.value[r]=e.value}var gw=[];function Py(e){let t=Object.keys(e.shape),r=Object.getOwnPropertySymbols(e.shape),o=r.length?r:gw,n=o.length?[...t,...o]:t;for(let i of n)if(!e.shape?.[i]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${String(i)}": expected a Zod schema`);let s=$h(e.shape);return{...e,allKeys:n,symbolKeys:o,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(s)}}function ky(e,t,r,o,n,s,i){let a=[],c=n.keySet,u=n.catchall._zod,l=u.def.type,{optin:d,optout:m}=u,h=0;for(let f in t){if(i&&r.issues.length!==h){if(It(r,h))break;h=r.issues.length}if(c.has(f))continue;if(f==="__proto__"){if(l==="never")a.push(f);continue}if(l==="never"){a.push(f);continue}let v=u.run({value:t[f],issues:[]},o);if(v instanceof Promise)e.push(v.then((y)=>Fs(y,r,f,t,d,m)));else Fs(v,r,f,t,d,m)}if(a.length)r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s,continue:!0});if(!e.length)return r;return Promise.all(e).then(()=>r)}var _w=D("$ZodObject",(e,t)=>{Oe.init(e,t);let r=Object.getOwnPropertyDescriptor(t,"shape"),o=r?.get?r.get.raw:t.shape??{};if(o){let u=()=>{let l={...o};return Object.defineProperty(t,"shape",{value:l}),u.raw=l,l};u.raw=o,Object.defineProperty(t,"shape",{get:u})}let n=Xo(()=>Py(t));be(e,"propValues",(u)=>{let l=u.def.shape,d={};for(let m in l){let h=l[m]._zod;if(h.values){if(!Object.prototype.hasOwnProperty.call(d,m))pt(d,m,new Set);for(let f of h.values)d[m].add(f);if(h.optin!==void 0)d[m].add(void 0)}}return d});let s=Jr,i=t.catchall,a,c=nt.memoizer;c?.attach(e),e._zod.parse=(u,l)=>{a??(a=n.value);let d=u.value;if(!s(d))return u.issues.push({expected:"object",code:"invalid_type",input:d,inst:e}),u;u.value=c?c.alloc(e,u,{},l):{};let m=[],h=a.shape,f=l?.abortEarly,v=u.issues.length;for(let y of a.allKeys){if(f&&u.issues.length!==v){if(It(u,v))break;v=u.issues.length}if(y==="__proto__")continue;let g=h[y],P=g._zod.optin,w=g._zod.optout,E=g._zod.run({value:d[y],issues:[]},l);if(E instanceof Promise)m.push(E.then((C)=>Fs(C,u,y,d,P,w)));else Fs(E,u,y,d,P,w)}if(!i)return m.length?Promise.all(m).then(()=>u):u;return ky(m,d,u,l,n.value,e,f===!0)}}),xy=D("$ZodObjectJIT",(e,t)=>{_w.init(e,t);let r=e._zod.parse,o=Xo(()=>Py(t)),n=nt.memoizer,s=(h)=>{let f=o.value,v=f.symbolKeys,y=new mc(["payload","ctx"],{shape:h,inst:e,memo:n,syms:v}),g=(C)=>`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`,P=(C,R)=>`
|
|
63
|
-
let ${C}_ab = false;
|
|
64
|
-
for (let i = 0; i < ${C}.issues.length; i++) {
|
|
65
|
-
const iss = ${C}.issues[i];
|
|
66
|
-
iss.path = iss.path ? [${R}, ...iss.path] : [${R}];
|
|
67
|
-
payload.issues.push(iss);
|
|
68
|
-
if (iss.continue !== true) ${C}_ab = true;
|
|
69
|
-
}
|
|
70
|
-
if (${C}_ab && ctx && ctx.abortEarly) {
|
|
71
|
-
payload.value = newResult;
|
|
72
|
-
return payload;
|
|
73
|
-
}`;y.write("const input = payload.value;");let w=Object.create(null),E=0;for(let C of f.allKeys)w[C]=`key_${E++}`;y.write(n?"const newResult = memo.alloc(inst, payload, {}, ctx);":"const newResult = {};");for(let C of f.allKeys){if(C==="__proto__")continue;let R=w[C],S=typeof C==="symbol"?`syms[${v.indexOf(C)}]`:vh(C),T=`${S} in input`,A=h[C],H=A?._zod?.optin,j=H!==void 0,V=A?._zod?.optout==="optional";if(y.write(`const ${R} = ${g(S)};`),j&&V){let W=H==="optional"?`${R}_present`:`${R}.value !== undefined || ${R}_present`;y.write(`
|
|
74
|
-
const ${R}_present = ${T};
|
|
75
|
-
if (!${R}.issues.length || ${R}_present) {
|
|
76
|
-
if (${R}.issues.length) {${P(R,S)}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (${W}) {
|
|
80
|
-
newResult[${S}] = ${R}.value;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
`)}else if(!j)y.write(`
|
|
85
|
-
const ${R}_present = ${T};
|
|
86
|
-
if (${R}.issues.length) {${P(R,S)}
|
|
87
|
-
}
|
|
88
|
-
if (!${R}_present && !${R}.issues.length) {
|
|
89
|
-
payload.issues.push({
|
|
90
|
-
code: "invalid_type",
|
|
91
|
-
expected: "nonoptional",
|
|
92
|
-
input: undefined,
|
|
93
|
-
path: [${S}]
|
|
94
|
-
});
|
|
95
|
-
if (ctx && ctx.abortEarly) {
|
|
96
|
-
payload.value = newResult;
|
|
97
|
-
return payload;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
if (${R}_present) {
|
|
102
|
-
newResult[${S}] = ${R}.value;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
`);else if(y.write(`
|
|
106
|
-
if (${R}.issues.length) {${P(R,S)}
|
|
107
|
-
}
|
|
108
|
-
`),H==="defaulted")y.write(`newResult[${S}] = ${R}.value;`);else y.write(`
|
|
109
|
-
if (${R}.value !== undefined || ${T}) {
|
|
110
|
-
newResult[${S}] = ${R}.value;
|
|
111
|
-
}
|
|
112
|
-
`)}return y.write("payload.value = newResult;"),y.write("return payload;"),y.compile()},i,a=Jr,c=!nt.jitless,l=c&&bh.value,d=t.catchall,m;e._zod.parse=(h,f)=>{m??(m=o.value);let v=h.value;if(!a(v))return h.issues.push({expected:"object",code:"invalid_type",input:v,inst:e}),h;if(c&&l&&f?.async===!1&&f.jitless!==!0){if(!i)i=s(t.shape);if(h=i(h,f),!d)return h;return ky([],v,h,f,m,e,f?.abortEarly===!0)}return r(h,f)}});function Mg(e,t,r,o){for(let s of e)if(s.issues.length===0)return t.value=s.value,t;let n=e.filter((s)=>!It(s));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((s)=>s.issues.map((i)=>Nt(i,o,ft())))}),t}var yc=D("$ZodUnion",(e,t)=>{Oe.init(e,t),be(e,"optin",(o)=>o.def.options.some((n)=>n._zod.optin==="defaulted")?"defaulted":o.def.options.some((n)=>n._zod.optin!==void 0)?"optional":void 0),be(e,"optout",(o)=>o.def.options.some((n)=>n._zod.optout==="optional")?"optional":void 0),be(e,"values",(o)=>{if(o.def.options.every((n)=>n._zod.values))return new Set(o.def.options.flatMap((n)=>Array.from(n._zod.values)));return}),be(e,"pattern",(o)=>{if(o.def.options.every((n)=>n._zod.pattern)){let n=o.def.options.map((s)=>s._zod.pattern);return new RegExp(`^(${n.map((s)=>ks(s.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let s=!1,i=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)i.push(c),s=!0;else{if(c.issues.length===0)return c;i.push(c)}}if(!s)return Mg(i,o,e,n);return Promise.all(i).then((a)=>Mg(a,o,e,n))}});function yw(e){let t=new Map;for(let r of e.options){let o=r._zod.propValues?.[e.discriminator];if(!o||o.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(r)}"`);for(let n of o)if(t.has(n)){if(n!==void 0)throw Error(`Duplicate discriminator value "${String(n)}"`);t.set(n,null)}else t.set(n,r)}return t}var Ey=D("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,yc.init(e,t);let r=e._zod.parse;be(e,"propValues",(n)=>{let s={},i=0;for(let a of n.def.options){let c=a._zod.propValues;if(!c||Object.keys(c).length===0)throw Error(`Invalid discriminated union option at index "${n.def.options.indexOf(a)}"`);if(c[n.def.discriminator]?.has(void 0))i++;for(let[u,l]of Object.entries(c)){if(!Object.prototype.hasOwnProperty.call(s,u))pt(s,u,new Set);for(let d of l)s[u].add(d)}}if(!n.def.unionFallback&&i>1)s[n.def.discriminator]?.delete(void 0);return s}),t.options.forEach((n,s)=>{let i=Qo(n._zod.def);if(i&&!Object.prototype.hasOwnProperty.call(i,t.discriminator))throw Error(`Invalid discriminated union option at index "${s}"`)});let o=Xo(()=>yw(t));e._zod.parse=(n,s)=>{let i=n.value;if(!Jr(i))return n.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),n;let a=i?.[t.discriminator],c=o.value.get(a);if(c&&(a!==void 0||s.direction!=="backward"))return c._zod.run(n,s);if(t.unionFallback||s.direction==="backward")return r(n,s);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()).filter((u)=>o.value.get(u)!==null),input:i,path:[t.discriminator],inst:e}),n}}),Ty=D("$ZodIntersection",(e,t)=>{Oe.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,s=t.left._zod.run({value:n,issues:[]},o),i=t.right._zod.run({value:n,issues:[]},o);if(s instanceof Promise||i instanceof Promise)return Promise.all([s,i]).then(([c,u])=>Zg(r,c,u));return Zg(r,s,i)}});function fc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e===+t)return{valid:!0,data:e};if(br(e)&&br(t)){let r=Object.keys(t),o=Object.keys(e).filter((s)=>r.indexOf(s)!==-1),n={...e,...t};if(Object.prototype.hasOwnProperty.call(n,"__proto__"))delete n.__proto__;for(let s of o){if(s==="__proto__")continue;let i=fc(e[s],t[s]);if(!i.valid)return{valid:!1,mergeErrorPath:[s,...i.mergeErrorPath]};n[s]=i.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],s=t[o],i=fc(n,s);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function Zg(e,t,r){let o=new Map,n,s=new Map,i=(u,l)=>{let d;if(u.code==="unrecognized_keys"&&!u.path?.length)n??(n=u),d=u.keys;else if(u.code==="invalid_key"&&u.origin==="record"&&u.path?.length===1){let m=String(u.path[0]);if(!s.has(m))s.set(m,u);d=[m]}else return!1;for(let m of d){if(!o.has(m))o.set(m,{});o.get(m)[l]=!0}return!0};for(let u of t.issues)if(!i(u,"l"))e.issues.push(u);for(let u of r.issues)if(!i(u,"r"))e.issues.push(u);let a=[...o].filter(([,u])=>u.l&&u.r).map(([u])=>u);if(a.length){let u=n?a.filter((l)=>n.keys.includes(l)):[];if(u.length)e.issues.push({...n,keys:u});for(let l of a)if(!u.includes(l)&&s.has(l))e.issues.push(s.get(l))}let c=fc(t.value,r.value);if(!c.valid){if(It(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Oy=D("$ZodRecord",(e,t)=>{Oe.init(e,t);let r=nt.memoizer;r?.attach(e),e._zod.parse=(o,n)=>{let s=o.value;if(!br(s))return o.issues.push({expected:"record",code:"invalid_type",input:s,inst:e}),o;let i=[],a=t.keyType._zod.values;if(a&&!t.partial){o.value=r?r.alloc(e,o,{},n):{};let c=new Set;for(let l of a)if(typeof l==="string"||typeof l==="number"||typeof l==="symbol"){if(c.add(typeof l==="number"?l.toString():l),l==="__proto__")continue;let d=t.keyType._zod.run({value:l,issues:[]},n);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length){o.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map((f)=>Nt(f,n,ft())),input:l,path:[l],inst:e});continue}let m=d.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[l],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...rr(l,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...rr(l,h.issues));o.value[m]=h.value}}let u;for(let l in s)if(!c.has(l))if(t.mode==="loose"){if(l==="__proto__")continue;o.value[l]=s[l]}else u=u??[],u.push(l);if(u&&u.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:u,continue:!0})}else{o.value=r?r.alloc(e,o,{},n):{};let c;for(let u of Reflect.ownKeys(s)){if(u==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(s,u))continue;let l=t.keyType._zod.run({value:u,issues:[]},n);if(l instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof u==="string"&&tn.test(u)&&l.issues.length){let f=t.keyType._zod.run({value:Number(u),issues:[]},n);if(f instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(f.issues.length===0)l=f}if(l.issues.length){if(t.mode==="loose")o.value[u]=s[u];else if(a)c=c??[],c.push(u);else o.issues.push({code:"invalid_key",origin:"record",issues:l.issues.map((f)=>Nt(f,n,ft())),input:u,path:[u],inst:e});continue}let m=l.value;if(m==="__proto__")continue;let h=t.valueType._zod.run({value:s[u],issues:[]},n);if(h instanceof Promise)i.push(h.then((f)=>{if(f.issues.length)o.issues.push(...rr(u,f.issues));o.value[m]=f.value}));else{if(h.issues.length)o.issues.push(...rr(u,h.issues));o.value[m]=h.value}}if(c&&c.length>0)o.issues.push({code:"unrecognized_keys",input:s,inst:e,keys:c,continue:!0})}if(i.length)return Promise.all(i).then(()=>o);return o}});var Cy=D("$ZodEnum",(e,t)=>{Oe.init(e,t);let r=Wo(t.entries),o=new Set(r);e._zod.values=o,be(e,"pattern",(n)=>{let s=Wo(n.def.entries).filter((i)=>zh.has(typeof i));return new RegExp(s.length?`^(${s.map((i)=>tr(i.toString())).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(n,s)=>{let i=n.value;if(o.has(i))return n;return n.issues.push({code:"invalid_value",values:r,input:i,inst:e}),n}}),Iy=D("$ZodLiteral",(e,t)=>{Oe.init(e,t);let r=new Set(t.values);e._zod.values=r,be(e,"pattern",(o)=>{let n=o.def.values;return new RegExp(n.length?`^(${n.map((s)=>typeof s==="string"?tr(s):s?tr(s.toString()):String(s)).join("|")})$`:"^[^\\s\\S]$")}),e._zod.parse=(o,n)=>{let s=o.value;if(r.has(s))return o;return o.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),o}});var Ny=D("$ZodTransform",(e,t)=>{Oe.init(e,t),e._zod.optin="optional",nt.memoizer?.guard(e),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new en(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((i)=>(r.value=i,r));if(n instanceof Promise)throw new At;return r.value=n,r}});function qg(e,t){return e.value=t.issues.length?void 0:t.value,e}var vc=D("$ZodOptional",(e,t)=>{Oe.init(e,t),be(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),e._zod.optout="optional",be(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o,void 0]):void 0}),be(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${ks(o.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(r.value===void 0){if(t.innerType._zod.optin!=="defaulted")return r;let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((s)=>qg(r,s));return qg(r,n)}return t.innerType._zod.run(r,o)}}),Ay=D("$ZodExactOptional",(e,t)=>{vc.init(e,t),be(e,"values",(r)=>r.def.innerType._zod.values),be(e,"pattern",(r)=>r.def.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),jy=D("$ZodNullable",(e,t)=>{Oe.init(e,t),be(e,"optin",(r)=>r.def.innerType._zod.optin),be(e,"optout",(r)=>r.def.innerType._zod.optout),be(e,"pattern",(r)=>{let o=r.def.innerType._zod.pattern;return o?new RegExp(`^(${ks(o.source)}|null)$`):void 0}),be(e,"values",(r)=>r.def.innerType._zod.values?new Set([...r.def.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),My=D("$ZodDefault",(e,t)=>{Oe.init(e,t),e._zod.optin="defaulted",be(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Lg(s,t));return Lg(n,t)}});function Lg(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}var Zy=D("$ZodPrefault",(e,t)=>{Oe.init(e,t),e._zod.optin="defaulted",be(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),Dy=D("$ZodNonOptional",(e,t)=>{Oe.init(e,t),be(e,"values",(r)=>{let o=r.def.innerType._zod.values;return o?new Set([...o].filter((n)=>n!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Dg(s,e));return Dg(n,e)}});function Dg(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Ug(e,t,r,o){if(!t.issues.length){if(e.value=t.value,t.memo)e.memo=!0;return e}return e.value=r.catchValue({...t,value:e.value,error:{issues:t.issues.map((n)=>Nt(n,o,ft()))},input:e.value}),e}var Fy=D("$ZodCatch",(e,t)=>{Oe.init(e,t),be(e,"optin",(r)=>r.def.innerType._zod.optin==="defaulted"?"defaulted":"optional"),be(e,"optout",(r)=>r.def.innerType._zod.optout),be(e,"values",(r)=>r.def.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run({value:r.value,issues:[]},o);if(n instanceof Promise)return n.then((s)=>Ug(r,s,t,o));return Ug(r,n,t,o)}});var Sc=D("$ZodPipe",(e,t)=>{Oe.init(e,t),be(e,"values",(r)=>r.def.in._zod.values),be(e,"optin",(r)=>r.def.in._zod.optin),be(e,"optout",(r)=>r.def.out._zod.optout),be(e,"propValues",(r)=>r.def.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let s=t.out._zod.run(r,o);if(s instanceof Promise)return s.then((i)=>Ds(i,t.in,o));return Ds(s,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((s)=>Ds(s,t.out,o));return Ds(n,t.out,o)}});function Ds(e,t,r){if(e.issues.some((o)=>o.code!=="unrecognized_keys"))return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues},r)}var Jy=D("$ZodPreprocess",(e,t)=>{Sc.init(e,t)}),Ky=D("$ZodReadonly",(e,t)=>{Oe.init(e,t),be(e,"propValues",(r)=>r.def.innerType._zod.propValues),be(e,"values",(r)=>r.def.innerType._zod.values),be(e,"optin",(r)=>r.def.innerType?._zod?.optin),be(e,"optout",(r)=>r.def.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(Fg);return Fg(n)}});function Fg(e){if(!e.memo)e.value=Object.freeze(e.value);return e}var Gy=D("$ZodLazy",(e,t)=>{Oe.init(e,t),gh(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),be(e,"pattern",(r)=>r.innerType?._zod?.pattern),be(e,"propValues",(r)=>r.innerType?._zod?.propValues),be(e,"optin",(r)=>r.innerType?._zod?.optin??void 0),be(e,"optout",(r)=>r.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Wy=D("$ZodCustom",(e,t)=>{Ke.init(e,t),Oe.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=(r)=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then((s)=>Vg(s,r,o,e));Vg(n,r,o,e);return}});function Vg(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(zr(n))}}class Xy extends Error{constructor(){super("Cannot parse a reference cycle that closes through a transform");this.name="ZodCyclicError"}}var zc="~memo",Yy=[];function Qy(e){return e!==null&&typeof e==="object"}function bc(e){return e.map((t)=>t.path?{...t,path:t.path.slice()}:{...t})}var ev=new WeakMap,nn=0,Gs=1,sn=2;function Ws(e,t,r){let o=ev.get(e);if(o!==void 0)return o?sn:nn;if(t.has(e))return sn;t.add(e);let n=nn,s=(l)=>{if(n!==sn&&l?._zod){let d=Ws(l,t,r);if(d>n)n=d}},i=(l,d)=>{let m=nn;for(let h of Reflect.ownKeys(l)){let f=Object.getOwnPropertyDescriptor(l,h);if(d&&!f.enumerable)continue;let v=f.get?Gs:f.value?._zod?Ws(f.value,t,r):nn;if(v>m)m=v}return m},a=(l)=>{if(l>n)n=l},c=e._zod.def,u=c.type;switch(u){case"object":{let l=Qo(c);a(l?i(l,!0):Gs),s(c.catchall);break}case"array":s(c.element);break;case"tuple":for(let l of c.items)s(l);s(c.rest);break;case"record":case"map":s(c.keyType),s(c.valueType);break;case"set":s(c.valueType);break;case"union":for(let l of c.options)s(l);break;case"intersection":s(c.left),s(c.right);break;case"optional":case"nullable":case"default":case"prefault":case"catch":case"readonly":case"nonoptional":case"promise":case"success":s(c.innerType);break;case"pipe":s(c.in),s(c.out);break;case"function":s(c.input),s(c.output);break;case"lazy":{let l=c._cachedInner??(r?e._zod.innerType:void 0);a(l?Ws(l,t,!1):Gs);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 l in c){let d=Object.getOwnPropertyDescriptor(c,l);if(!d||d.get)continue;let m=d.value;if(!m||typeof m!=="object")continue;if(m._zod)s(m);else if(Array.isArray(m))for(let h of m)s(h)}}return t.delete(e),vw(e,n)}function vw(e,t){if(t!==Gs)ev.set(e,t===sn);return t}function Sw(e,t){let r=e.buckets.get(t);if(!r)r=new WeakMap,e.buckets.set(t,r);return r}var Bs,Js=[],bw={alloc(e,t,r){let o=Bs;if(!o)return r;Bs=void 0;let n={value:r,issues:null};return o.set(t.value,n),Js.push(n),r},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let r=e._zod.parse,o=(n,s)=>{if(s.direction!=="backward"&&zw(s,n.value))throw new Xy;return r(n,s)};if(e._zod.parse=o,e._zod.run===r)e._zod.run=o})},attach(e){var t;let r,o=!1,n,s;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let i=e._zod.parse,a=(c,u)=>{if(r===void 0){let g=Ws(e,new Set,!1);if(g===nn){if(e._zod.parse=i,e._zod.run===a)e._zod.run=i;return i(c,u)}if(g===sn||o)r=!0;else o=!0}let l=c.value;if(!Qy(l))return i(c,u);let d=u[zc];if(!d)d={buckets:new WeakMap,backEdges:void 0},u[zc]=d;let m;if(n===u)m=s;else m=Sw(d,e),n=u,s=m;let h=m.get(l);if(h){if(c.value=h.value,h.issues){if(h.issues.length)c.issues.push(...bc(h.issues))}else c.memo=!0,d.backEdges??(d.backEdges=new WeakSet),d.backEdges.add(h.value);return c}Bs=m;let f=Js.length,v=i(c,u);Bs=void 0;let y=Js.length>f?Js.pop():void 0;if(v instanceof Promise)return v.then((g)=>{if(y)y.issues=g.issues.length?bc(g.issues):Yy;return g});if(y)y.issues=v.issues.length?bc(v.issues):Yy;return v};if(e._zod.parse=a,e._zod.run===i)e._zod.run=a})}};function tv(){return bw}function zw(e,t){let r=e[zc]?.backEdges;return r!==void 0&&Qy(t)&&r.has(t)}var $w=()=>{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(s){return e[s]??null}let r={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"},o={nan:"NaN"};function n(s,i){if(s==="number"&&typeof i==="number"&&!Number.isFinite(i))return String(i);return o[s]??s}return(s)=>{switch(s.code){case"invalid_type":{let i=n(s.expected),a=kh(s.input),c=n(a,s.input);return`Invalid input: expected ${i}, received ${c}`}case"invalid_value":if(s.values.length===1)return`Invalid input: expected ${Xa(s.values[0])}`;return`Invalid option: expected one of ${Ga(s.values,"|")}`;case"too_big":{let i=s.exact?"exactly ":s.inclusive?"<=":"<",a=t(s.origin);if(a)return`Too big: expected ${s.origin??"value"} to have ${i}${s.maximum.toString()} ${a.unit??"elements"}`;return`Too big: expected ${s.origin??"value"} to be ${i}${s.maximum.toString()}`}case"too_small":{let i=s.exact?"exactly ":s.inclusive?">=":">",a=t(s.origin);if(a)return`Too small: expected ${s.origin} to have ${i}${s.minimum.toString()} ${a.unit}`;return`Too small: expected ${s.origin} to be ${i}${s.minimum.toString()}`}case"invalid_format":{let i=s;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${r[i.format]??s.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${s.divisor}`;case"unrecognized_keys":return`Unrecognized key${s.keys.length>1?"s":""}: ${Ga(s.keys,", ")}`;case"invalid_key":return`Invalid key in ${s.origin}`;case"invalid_union":if(s.options&&Array.isArray(s.options)&&s.options.length>0)return`Invalid discriminator value. Expected ${s.options.map((a)=>`'${a}'`).join(" | ")}`;if(s.inclusive===!1)return"Invalid input: more than one option matched";return"Invalid input";case"invalid_element":return`Invalid value in ${s.origin}`;default:return"Invalid input"}}};function $c(){return{localeError:$w()}}var rv;class ov{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Rw(){return new ov}(rv=globalThis).__zod_globalRegistry??(rv.__zod_globalRegistry=Rw());var $r=globalThis.__zod_globalRegistry;function nv(e){if(e.checks)e.checks=[...e.checks];return e}function sv(e,t){return new e(nv({type:"string",...ne(t)}))}function Rc(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ne(t)})}function iv(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ne(t)})}function av(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ne(t)})}function cv(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ne(t)})}function uv(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ne(t)})}function lv(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ne(t)})}function wc(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ne(t)})}function dv(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ne(t)})}function pv(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ne(t)})}function mv(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ne(t)})}function fv(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ne(t)})}function hv(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ne(t)})}function gv(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ne(t)})}function _v(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ne(t)})}function yv(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ne(t)})}function vv(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ne(t)})}function Sv(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ne(t)})}function bv(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ne(t)})}function zv(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ne(t)})}function $v(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ne(t)})}function Rv(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ne(t)})}function wv(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ne(t)})}function Ys(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ne(t)})}function Xs(e,t){return new e({type:"string",format:"date",check:"string_format",...ne(t)})}function Pc(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ne(t)})}function kc(e,t){return new e({type:"string",format:"duration",check:"string_format",...ne(t)})}function Pv(e,t){return new e(nv({type:"number",checks:[],...ne(t)}))}function kv(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(t)})}function xv(e,t){return new e({type:"boolean",...ne(t)})}function Ev(e,t){return new e({type:"null",...ne(t)})}function Tv(e){return new e({type:"unknown"})}function Ov(e,t){return new e({type:"never",...ne(t)})}function Qs(e,t){return new dc({check:"less_than",...ne(t),value:e,inclusive:!1})}function an(e,t){return new dc({check:"less_than",...ne(t),value:e,inclusive:!0})}function ei(e,t){return new pc({check:"greater_than",...ne(t),value:e,inclusive:!1})}function cn(e,t){return new pc({check:"greater_than",...ne(t),value:e,inclusive:!0})}function ti(e,t){return new bg({check:"multiple_of",...ne(t),value:e})}function ri(e,t){return new $g({check:"max_length",...ne(t),maximum:e})}function Kr(e,t){return new Rg({check:"min_length",...ne(t),minimum:e})}function oi(e,t){return new wg({check:"length_equals",...ne(t),length:e})}function xc(e,t){return new Pg({check:"string_format",format:"regex",...ne(t),pattern:e})}function Ec(e){return new kg({check:"string_format",format:"lowercase",...ne(e)})}function Tc(e){return new xg({check:"string_format",format:"uppercase",...ne(e)})}function Oc(e,t){return new Eg({check:"string_format",format:"includes",...ne(t),includes:e})}function Cc(e,t){return new Tg({check:"string_format",format:"starts_with",...ne(t),prefix:e})}function Ic(e,t){return new Og({check:"string_format",format:"ends_with",...ne(t),suffix:e})}function or(e){return new Cg({check:"overwrite",tx:e})}function Nc(e){return or((t)=>t.normalize(e))}function Ac(){return or((e)=>e.trim())}function jc(){return or((e)=>e.toLowerCase())}function Mc(){return or((e)=>e.toUpperCase())}function Zc(){return or((e)=>Sh(e))}function Cv(e,t,r){return new e({type:"array",element:t,...ne(r)})}function Iv(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ne(r)})}function Nv(e,t){let r=ww((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(zr(n,o.value,r._zod.def));else{let s=n;if(s.fatal)s.continue=!1;if(s.code??(s.code="custom"),!("input"in s))s.input=o.value;s.inst??(s.inst=r),s.continue??(s.continue=!r._zod.def.abort),o.issues.push(zr(s))}},e(o.value,o)),t);return r}function ww(e,t){let r=new Ke({check:"custom",...ne(t)});return r._zod.check=e,r}function ln(e,...t){for(let r of t)for(let o of Reflect.ownKeys(r))if(Object.prototype.propertyIsEnumerable.call(r,o))pt(e,o,r[o]);return e}function pn(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??$r,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 Be(e,t,r,o,n){let s=typeof t.unrepresentable==="function"?t.unrepresentable({zodSchema:e,path:o.path,message:n}):t.unrepresentable;if(s==="any")return!1;if(s===void 0||s==="throw")throw Error(n);return Object.assign(r,s),!0}function Ee(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,s=t.seen.get(e);if(s){if(s.count++,r.schemaPath.includes(e))s.cycle=r.path;return s.schema}let i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let a=e._zod.toJSONSchema?.();if(a)i.schema=a;else{let l={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,l);else{let m=i.schema,h=t.processors[n.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,m,l)}let d=e._zod.parent;if(d){if(!i.ref)i.ref=d;Ee(d,t,l),t.seen.get(d).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)ln(i.schema,c);if(t.io==="input"&&et(e))delete i.schema.examples,delete i.schema.default;if(t.io==="input"&&"_prefault"in i.schema)(o=i.schema).default??(o.default=i.schema._prefault);return delete i.schema._prefault,t.seen.get(e).schema}function Av(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function mn(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");if(e.external&&e.sharedDefsExtractedFor===e.external)return;let o=new Map;for(let i of e.seen.entries()){let a=e.metadataRegistry.get(i[0])?.id;if(a){let c=o.get(a);if(c&&c!==i[0])throw Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,i[0])}}let n=(i)=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let d=e.external.registry.get(i[0])?.id,m=e.external.uri??((f)=>f);if(d)return{ref:m(d)};let h=i[1].defId??i[1].schema.id??`schema${e.counter++}`;return i[1].defId=h,{defId:h,ref:`${m("__shared")}#/${a}/${Av(h)}`}}let c="#",u=`${c}/${a}/`;if(i[1]===r&&!i[1].schema.id)return{ref:c};let l=i[1].schema.id??`__schema${e.counter++}`;return{defId:l,ref:u+Av(l)}},s=(i)=>{if(i[1].schema.$ref)return;let a=i[1],{ref:c,defId:u}=n(i);if(a.def={...a.schema},u)a.defId=u;let l=a.schema;for(let d in l)delete l[d];l.$ref=c};if(e.cycles==="throw")for(let i of e.seen.entries()){let a=i[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
113
|
-
|
|
114
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let i of e.seen.entries()){let a=i[1];if(t===i[0]){s(i);continue}if(e.external){let u=e.external.registry.get(i[0])?.id;if(t!==i[0]&&u){s(i);continue}}if(e.metadataRegistry.get(i[0])?.id){s(i);continue}if(a.cycle){s(i);continue}if(a.count>1){if(e.reused==="ref")s(i)}}if(e.external)e.sharedDefsExtractedFor=e.external}function Zv(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let r=[];for(let o of t){if(!o||typeof o!=="object")return;Zv(o);let n=Object.keys(o);if(n.length!==1||n[0]!=="type")return;let s=o.type;for(let i of Array.isArray(s)?s:[s]){if(typeof i!=="string")return;if(!r.includes(i))r.push(i)}}delete e.anyOf,e.type=r.length===1?r[0]:r}var qv=new Set(["type","properties","required","additionalProperties"]),jv=["oneOf","anyOf"];function Mv(e){let t=e.additionalProperties;if(t===void 0||t===!1||typeof t!=="object"||t===null)return null;return Object.keys(t).length?t:null}function qc(e){let t=[];for(let s of e){if(typeof s!=="object"||s.type!=="object")return null;for(let i in s)if(!qv.has(i))return null;t.push(s)}let r={},o=new Set;for(let s of t){for(let i in s.properties){if(Object.prototype.hasOwnProperty.call(r,i))continue;let a=[];for(let u of t){let l=u.properties?.[i]??Mv(u);if(l===null||l===void 0)continue;if(!a.some((d)=>JSON.stringify(d)===JSON.stringify(l)))a.push(l)}let c=a.length===1?a[0]:qc(a)??{allOf:a};pt(r,i,c)}for(let i of s.required??[])o.add(i)}let n={type:"object",properties:r};if(o.size)n.required=[...o];if(t.every((s)=>s.additionalProperties===!1))n.additionalProperties=!1;else{let s=[];for(let i of t){let a=Mv(i);if(a&&!s.some((c)=>JSON.stringify(c)===JSON.stringify(a)))s.push(a)}if(s.length===1)n.additionalProperties=s[0];else if(s.length>1)n.additionalProperties={allOf:s}}return n}function Pw(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let n of qv)if(n in e)return;let r=t.filter((n)=>jv.some((s)=>Array.isArray(n[s]))),o=null;if(!r.length)o=qc(t);else{let n=r[0],s=jv.find((c)=>Array.isArray(n[c]));if(Object.keys(n).length!==1)return;let i=t.filter((c)=>c!==n),a=n[s].map((c)=>qc([...i,c]));if(a.some((c)=>!c))return;o={[s]:a}}if(!o)return;delete e.allOf,ln(e,o)}function fn(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,l={...u},d=c.ref;if(c.ref=null,d){o(d);let h=e.seen.get(d),f=h.schema;if(f.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(f);else ln(u,f);if(ln(u,l),a._zod.parent===d)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(!(y in l))delete u[y]}if(f.$ref&&h.def)for(let y in u){if(y==="$ref"||y==="allOf")continue;if(y in h.def&&JSON.stringify(u[y])===JSON.stringify(h.def[y]))delete u[y]}}let m=a._zod.parent;if(m&&m!==d){o(m);let h=e.seen.get(m);if(h?.schema.$ref){if(u.$ref=h.schema.$ref,h.def)for(let f in u){if(f==="$ref"||f==="allOf")continue;if(f in h.def&&JSON.stringify(u[f])===JSON.stringify(h.def[f]))delete u[f]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let a of[...e.seen.entries()].reverse())o(a[0]);if(e.target!=="openapi-3.0")for(let a of e.seen.entries())Zv(a[1].def??a[1].schema);for(let a of e.deferred)a();if(e.intersections.length){let a=new Map;for(let c of e.seen.values())for(let u of[c.schema,c.def]){let l=u?.allOf;if(!Array.isArray(l))continue;let d=a.get(l);if(d)d.push(u);else a.set(l,[u])}for(let c of e.intersections)for(let u of a.get(c)??[])Pw(u)}}let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}ln(n,r.defId?r.schema:r.def??r.schema);let s=e.metadataRegistry.get(t)?.id;if(s!==void 0&&n.id===s)delete n.id;let i=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;pt(i,c.defId,c.def)}}if(e.external)e.sharedEmitDoneFor=e.external;if(e.external);else if(Object.keys(i).length>0)if(e.target==="draft-2020-12")n.$defs=i;else n.definitions=i;try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:dn(t,"input",e.processors),output:dn(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error("Error converting schema to JSON.")}}function et(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return et(o.element,r);if(o.type==="set")return et(o.valueType,r);if(o.type==="lazy")return et(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault"||o.type==="catch")return et(o.innerType,r);if(o.type==="intersection")return et(o.left,r)||et(o.right,r);if(o.type==="record"||o.type==="map")return et(o.keyType,r)||et(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return et(o.in,r)||et(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(et(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(et(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(et(n,r))return!0;if(o.rest&&et(o.rest,r))return!0;return!1}return!1}var Lv=(e,t={})=>(r)=>{let o=pn({...r,processors:t});return Ee(e,o),mn(o,e),fn(o,e)},dn=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:s}=o??{},i=pn({...n??{},target:s,io:t,processors:r});return Ee(e,i),mn(i,e),fn(i,e)};var Gr=(e,t,r)=>{if(e[t]===void 0||r>e[t])e[t]=r},Wr=(e,t,r)=>{if(e[t]===void 0||r<e[t])e[t]=r},Dv=(e,t)=>{Gr(e,"minimum",t),Wr(e,"maximum",t)},Bv=(e,t)=>{if(e.multipleOf??(e.multipleOf=[]),!e.multipleOf.includes(t))e.multipleOf.push(t)},Jv=(e,t)=>{e.patterns??(e.patterns=new Set),e.patterns.add(t)},Kv=(e,t)=>{e.mime=e.mime?e.mime.filter((r)=>t.includes(r)):[...t]},Gv=(e,t)=>{if(e.format=t,t.includes("int"))e.isInt=!0},Uv=(e,t)=>Gr(e,"minimum",t.minimum),Fv=(e,t)=>Wr(e,"maximum",t.maximum),Vv=(e)=>(t,r)=>{Gv(t,r.format);let[o,n]=e[r.format];Gr(t,"minimum",o),Wr(t,"maximum",n)},kw={greater_than:(e,t)=>Gr(e,t.inclusive?"minimum":"exclusiveMinimum",t.value),less_than:(e,t)=>Wr(e,t.inclusive?"maximum":"exclusiveMaximum",t.value),multiple_of:(e,t)=>Bv(e,t.value),number_format:Vv(xs),bigint_format:Vv(Qa),min_length:Uv,max_length:Fv,length_equals:(e,t)=>Dv(e,t.length),min_size:Uv,max_size:Fv,size_equals:(e,t)=>Dv(e,t.size),string_format:(e,t)=>{if(Gv(e,t.format),t.pattern)Jv(e,t.pattern);if(t.format==="base64"||t.format==="base64url")e.contentEncoding=t.format;if(t.local||t.precision===-1)e.laxFormat=!0},mime_type:(e,t)=>Kv(e,t.mime)};function st(e){let t={},r=e._zod.def,o=e._zod.traits.has("$ZodCheck")?[e,...r.checks??[]]:r.checks??[];for(let s of o)kw[s._zod.def.check]?.(t,s._zod.def);let n=e._zod.bag;if(n.minimum!==void 0)Gr(t,"minimum",n.minimum);if(n.exclusiveMinimum!==void 0)Gr(t,"exclusiveMinimum",n.exclusiveMinimum);if(n.maximum!==void 0)Wr(t,"maximum",n.maximum);if(n.exclusiveMaximum!==void 0)Wr(t,"exclusiveMaximum",n.exclusiveMaximum);if(n.multipleOf!==void 0)Bv(t,n.multipleOf);if(n.format!==void 0){if(t.format??(t.format=n.format),n.format.includes("int"))t.isInt=!0}if(n.mime)Kv(t,n.mime);for(let s of n.patterns??[])Jv(t,s);return t}var xw={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ew=new Map([[gc,cg],[Hs,ug]]),Wv=(e)=>Ew.get(e)??e,Uc=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:s,maximum:i,format:a,patterns:c,contentEncoding:u,laxFormat:l}=st(e);if(typeof s==="number")n.minLength=s;if(typeof i==="number")n.maxLength=i;if(a){if(n.format=xw[a]??a,n.format==="")delete n.format;if(a==="time"||l)delete n.format}if(u)n.contentEncoding=u;if(c&&c.size>0){let d=[...c].map(Wv);if(d.length===1)n.pattern=d[0].source;else if(d.length>1)n.allOf=[...d.map((m)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))]}},Fc=(e,t,r,o)=>{let n=r,{minimum:s,maximum:i,multipleOf:a,exclusiveMaximum:c,exclusiveMinimum:u,isInt:l}=st(e);n.type=l?"integer":"number";let d=typeof u==="number"&&u>=(s??Number.NEGATIVE_INFINITY),m=typeof c==="number"&&c<=(i??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(d)if(h)n.minimum=u,n.exclusiveMinimum=!0;else n.exclusiveMinimum=u;else if(typeof s==="number")n.minimum=s;if(m)if(h)n.maximum=c,n.exclusiveMaximum=!0;else n.exclusiveMaximum=c;else if(typeof i==="number")n.maximum=i;if(a){let f=new Set;for(let g of a)if(Number.isFinite(g)&&g!==0)f.add(Math.abs(g));else Be(e,t,n,o,`A multipleOf divisor of ${g} cannot be represented in JSON Schema`);let[v,...y]=f;if(v!==void 0)n.multipleOf=v;if(y.length)n.allOf=[...n.allOf??[],...y.map((g)=>({multipleOf:g}))]}},Vc=(e,t,r,o)=>{r.type="boolean"},Yv=(e,t,r,o)=>{Be(e,t,r,o,"BigInt cannot be represented in JSON Schema")},Xv=(e,t,r,o)=>{Be(e,t,r,o,"Symbols cannot be represented in JSON Schema")},Hc=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"},Qv=(e,t,r,o)=>{Be(e,t,r,o,"Undefined cannot be represented in JSON Schema")},eS=(e,t,r,o)=>{Be(e,t,r,o,"Void cannot be represented in JSON Schema")},Bc=(e,t,r,o)=>{r.not={}},tS=(e,t,r,o)=>{},Jc=(e,t,r,o)=>{},rS=(e,t,r,o)=>{Be(e,t,r,o,"Date cannot be represented in JSON Schema")},Kc=(e,t,r,o)=>{let n=e._zod.def,s=Wo(n.entries);if(s.length===0){r.not={};return}if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";r.enum=s},Gc=(e,t,r,o)=>{let n=e._zod.def;if(n.values.length===0){r.not={};return}let s=[];for(let i of n.values)if(i===void 0){if(Be(e,t,r,o,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof i==="bigint"){if(Be(e,t,r,o,"BigInt literals cannot be represented in JSON Schema"))return;s.push(Number(i))}else s.push(i);if(s.length===0);else if(s.length===1){let i=s[0];if(r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[i];else r.const=i}else{if(s.every((i)=>typeof i==="number"))r.type="number";if(s.every((i)=>typeof i==="string"))r.type="string";if(s.every((i)=>typeof i==="boolean"))r.type="boolean";if(s.every((i)=>i===null))r.type="null";r.enum=s}},oS=(e,t,r,o)=>{Be(e,t,r,o,"NaN cannot be represented in JSON Schema")},nS=(e,t,r,o)=>{let n=r,s=e._zod.pattern;if(!s)throw Error("Pattern not found in template literal");n.type="string",n.pattern=s.source},sS=(e,t,r,o)=>{let n=r;n.type="string",n.format="binary",n.contentEncoding="binary";let{minimum:s,maximum:i,mime:a}=st(e);if(s!==void 0)n.minLength=s;if(i!==void 0)n.maxLength=i;if(!a)return;if(a.length===0)n.not={};else if(a.length===1)n.contentMediaType=a[0];else n.anyOf=a.map((c)=>({contentMediaType:c}))},iS=(e,t,r,o)=>{r.type="boolean"},Wc=(e,t,r,o)=>{Be(e,t,r,o,"Custom types cannot be represented in JSON Schema")},aS=(e,t,r,o)=>{Be(e,t,r,o,"Function types cannot be represented in JSON Schema")},Yc=(e,t,r,o)=>{Be(e,t,r,o,"Transforms cannot be represented in JSON Schema")},cS=(e,t,r,o)=>{Be(e,t,r,o,"Map cannot be represented in JSON Schema")},uS=(e,t,r,o)=>{Be(e,t,r,o,"Set cannot be represented in JSON Schema")},Xc=(e,t,r,o)=>{let n=r,s=e._zod.def,{minimum:i,maximum:a}=st(e);if(typeof i==="number")n.minItems=i;if(typeof a==="number")n.maxItems=a;n.type="array",n.items=Ee(s.element,t,{...o,path:[...o.path,"items"]})};function hn(e){let t=e._zod.def;if(t.type==="pipe"&&t.in._zod.traits.has("$ZodTransform"))return hn(t.out);if(t.type==="catch")return hn(t.innerType);return e._zod.optin}var Qc=(e,t,r,o)=>{let n=r,s=e._zod.def,i=s.shape;if(Object.getOwnPropertySymbols(i).length&&Be(e,t,n,o,"Symbol keys cannot be represented in JSON Schema"))return;n.type="object",n.properties={};for(let u in i)pt(n.properties,u,Ee(i[u],t,{...o,path:[...o.path,"properties",u]}));let c=[];for(let u of Object.keys(i)){let l=s.shape[u];if(t.io==="input"?hn(l)===void 0:l._zod.optout===void 0)c.push(u)}if(c.length>0)n.required=c;if(s.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!s.catchall){if(t.io==="output")n.additionalProperties=!1}else if(s.catchall)n.additionalProperties=Ee(s.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},eu=(e,t,r,o)=>{let n=e._zod.def,s=n.inclusive===!1,i=n.options.map((a,c)=>Ee(a,t,{...o,path:[...o.path,s?"oneOf":"anyOf",c]}));if(s)r.oneOf=i;else r.anyOf=i},tu=(e,t,r,o)=>{let n=e._zod.def,s=Ee(n.left,t,{...o,path:[...o.path,"allOf",0]}),i=Ee(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=(u)=>("allOf"in u)&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(i)?i.allOf:[i]];r.allOf=c,t.intersections.push(c)},lS=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="array";let i=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((v,y)=>Ee(v,t,{...o,path:[...o.path,i,y]})),u=s.rest?Ee(s.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null,l=s.items.length;while(l>0){let v=s.items[l-1];if(!(t.io==="input"?hn(v)!==void 0:v._zod.optout==="optional"))break;l--}let d=s.items.length,m=!s.rest;if(t.target==="draft-2020-12"){if(n.prefixItems=c,m)n.items=!1;else if(u)n.items=u;if(l>0)n.minItems=l;if(m)n.maxItems=d}else if(t.target==="openapi-3.0"){if(n.items={anyOf:c},u)n.items.anyOf.push(u);if(l>0)n.minItems=l;if(m)n.maxItems=d}else{if(n.items=c,m)n.additionalItems=!1;else if(u)n.additionalItems=u;if(l>0)n.minItems=l;if(m)n.maxItems=d}let{minimum:h,maximum:f}=st(e);if(typeof h==="number")n.minItems=h;if(typeof f==="number")n.maxItems=f};function Lc(e,t,r){if(t.$ref){if(r.has(t))return t;r.add(t);let f=e.get(t)?.def;if(!f)return t;let v=Lc(e,f,r);return v===f?t:v}for(let f of["anyOf","oneOf"]){let v=t[f];if(!Array.isArray(v))continue;let y=v.map((g)=>Lc(e,g,r));if(y.some((g,P)=>g!==v[P]))t={...t,[f]:y}}let o=Array.isArray(t.type)?t.type:[t.type],n=!o.includes("string")&&o.some((f)=>f==="number"||f==="integer"),s=t.enum??(t.const!==void 0?[t.const]:void 0);if(!n&&!s?.some((f)=>typeof f==="number"))return t;let{minimum:i,maximum:a,exclusiveMinimum:c,exclusiveMaximum:u,multipleOf:l,format:d,id:m,...h}=t;if(h.enum)h.enum=h.enum.map((f)=>typeof f==="number"?String(f):f);else if(typeof h.const==="number")h.const=String(h.const);if(!n)return h;if(h.type="string",!s)h.pattern=(o.includes("number")?tn:uc).source;return h}var Dc=new WeakMap;function Tw(e){let t=new Map;for(let o of e.seen.values())if(o.def&&!t.has(o.schema))t.set(o.schema,o);let r=new Map;for(let o of Dc.get(e)??[]){let n=e.seen.get(o),s=(n?.def??n?.schema)?.propertyNames;if(!s||s===!0||r.has(s))continue;let i=Lc(t,s,new Set);if(i!==s)r.set(s,i)}if(!r.size)return;for(let o of e.seen.values())for(let n of[o.schema,o.def]){let s=n&&r.get(n.propertyNames);if(s)n.propertyNames=s}}var ru=(e,t,r,o)=>{let n=r,s=e._zod.def;n.type="object";let i=s.keyType,a=st(i).patterns;if(s.mode==="loose"&&a&&a.size>0){let l=Ee(s.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let d of a)pt(n.patternProperties,Wv(d).source,l)}else{if(t.target==="draft-07"||t.target==="draft-2020-12"){n.propertyNames=Ee(s.keyType,t,{...o,path:[...o.path,"propertyNames"]});let l=Dc.get(t);if(!l)l=[],Dc.set(t,l),t.deferred.push(()=>Tw(t));l.push(e)}n.additionalProperties=Ee(s.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let c=i._zod.values,u=t.io==="input"&&hn(s.valueType)!==void 0;if(c&&!s.partial&&!u){let l=[...c].filter((d)=>typeof d==="string"||typeof d==="number");if(l.length>0)n.required=l.map(String)}},ou=(e,t,r,o)=>{let n=e._zod.def,s=Ee(n.innerType,t,o),i=t.seen.get(e);if(t.target==="openapi-3.0")i.ref=n.innerType,r.nullable=!0;else r.anyOf=[s,{type:"null"}]},nu=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},su=Symbol();function dS(e,t,r,o,n){let s=!1,i=JSON.stringify(e,(a,c)=>{if(typeof c!=="bigint")return c;return s=!0,null});if(!s)return JSON.parse(i);return Be(t,r,o,n,"BigInt defaults cannot be represented in JSON Schema"),su}var iu=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i=dS(n.defaultValue,e,t,r,o);if(i!==su)r.default=i},au=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);if(s.ref=n.innerType,t.io!=="input")return;let i=dS(n.defaultValue,e,t,r,o);if(i!==su)r._prefault=i},cu=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType;let i;try{i=n.catchValue(void 0)}catch{Be(e,t,r,o,"Dynamic catch values are not supported in JSON Schema");return}r.default=i},uu=(e,t,r,o)=>{let n=e._zod.def,s=n.in._zod.traits.has("$ZodTransform"),i=t.io==="input"?s?n.out:n.in:n.out;Ee(i,t,o);let a=t.seen.get(e);a.ref=i},lu=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType,r.readOnly=!0},pS=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},ni=(e,t,r,o)=>{let n=e._zod.def;Ee(n.innerType,t,o);let s=t.seen.get(e);s.ref=n.innerType},du=(e,t,r,o)=>{let n=e._zod.innerType;Ee(n,t,o);let s=t.seen.get(e);s.ref=n},Hv={string:Uc,number:Fc,boolean:Vc,bigint:Yv,symbol:Xv,null:Hc,undefined:Qv,void:eS,never:Bc,any:tS,unknown:Jc,date:rS,enum:Kc,literal:Gc,nan:oS,template_literal:nS,file:sS,success:iS,custom:Wc,function:aS,transform:Yc,map:cS,set:uS,array:Xc,object:Qc,union:eu,intersection:tu,tuple:lS,record:ru,nullable:ou,nonoptional:nu,default:iu,prefault:au,catch:cu,pipe:uu,readonly:lu,promise:pS,optional:ni,lazy:du};function si(e,t){if("_idmap"in e){let o=e,n=pn({...t,processors:Hv}),s={};for(let c of o._idmap.entries()){let[u,l]=c;Ee(l,n)}let i={},a={registry:o,uri:t?.uri,defs:s};n.external=a;for(let c of o._idmap.entries()){let[u,l]=c;mn(n,l),pt(i,u,fn(n,l))}if(Object.keys(s).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:s}}return{schemas:i}}let r=pn({...t,processors:Hv});return Ee(e,r),mn(r,e),fn(r,e)}var mS=new WeakSet([Object.prototype,Error.prototype]);function ii(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let o=r(this);return Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0}),o},set(o){Object.defineProperty(this,t,{value:o,configurable:!0,writable:!0})}})}var qw=(e,t)=>{Ah.init(e,t),e.name="ZodError";let r=Object.getPrototypeOf(e);if(mS.has(r))return;mS.add(r),ii(r,"format",(o)=>(n)=>Mh(o,n)),ii(r,"flatten",(o)=>(n)=>jh(o,n)),ii(r,"addIssue",(o)=>(n)=>{o.issues.push(n),o.message=JSON.stringify(o.issues,Yo,2)}),ii(r,"addIssues",(o)=>(n)=>{o.issues.push(...n),o.message=JSON.stringify(o.issues,Yo,2)}),Object.defineProperty(r,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}})};var ht=D("ZodError",qw,void 0,{Parent:Error});var fS=As(ht),hS=Ms(ht),ai=Zs(ht),gS=qs(ht),yS=qh(ht),vS=Lh(ht),SS=Dh(ht),bS=Uh(ht),zS=Fh(ht),$S=Vh(ht),jS=Hh(ht),ZS=Bh(ht);function Dw(){if(!nt.localeError)ft($c())}function ui(){if(!nt.memoizer)ft({memoizer:tv()})}var je=D("ZodType",(e,t)=>(Dw(),Oe.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(mt(t,{checks:[...t.checks??[],...e.map((r)=>typeof r==="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ct(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(TP(e,t))},superRefine(e,t){return this.check(OP(e,t))},overwrite(e){return this.check(or(e))},optional(){return ge(this)},exactOptional(){return gP(this)},nullable(){return US(this)},nullish(){return ge(US(this))},nonoptional(e){return zP(this,e)},array(){return Q(this)},or(e){return ce([this,e])},and(e){return Yr(this,e)},transform(e){return VS(this,tb(e))},default(e){return vP(this,e)},prefault(e){return bP(this,e)},catch(e){return RP(this,e)},pipe(e){return VS(this,e)},readonly(){return kP(this)},describe(e){let t=this.clone();return $r.add(t,{description:e}),t},meta(...e){if(e.length===0)return $r.get(this);let t=this.clone();return $r.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 Is(this,"~standard",{...hc(this),jsonSchema:{input:dn(this,"input"),output:dn(this,"output")}})},set "~standard"(e){Ut(this,"~standard",e)},parse:function e(t,r){return fS(this,t,r,{callee:e})},parseAsync:async function e(t,r){return await hS(this,t,r,{callee:e})},safeParse(e,t){return ai(this,e,t)},async safeParseAsync(e,t){return gS(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Ut(this,"spa",e)},validate(e,t){return nc(this,e,t)},validateAsync(e,t){return sc(this,e,t)},encode:function e(t,r){return yS(this,t,r,{callee:e})},decode:function e(t,r){return vS(this,t,r,{callee:e})},encodeAsync:async function e(t,r){return await SS(this,t,r,{callee:e})},decodeAsync:async function e(t,r){return await bS(this,t,r,{callee:e})},safeEncode(e,t){return zS(this,e,t)},safeDecode(e,t){return $S(this,e,t)},async safeEncodeAsync(e,t){return jS(this,e,t)},async safeDecodeAsync(e,t){return ZS(this,e,t)},toJSONSchema(e){return Lv(this,{})(e)},get description(){return $r.get(this)?.description},get _def(){return this._zod.def}}),HS=D("_ZodString",(e,t)=>{Vs.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Uc(e,r,o,n)},Eh({format:(e)=>st(e).format??null,minLength:(e)=>st(e).minimum??null,maxLength:(e)=>st(e).maximum??null},{regex(...e){return this.check(xc(...e))},includes(...e){return this.check(Oc(...e))},startsWith(...e){return this.check(Cc(...e))},endsWith(...e){return this.check(Ic(...e))},min(...e){return this.check(Kr(...e))},max(...e){return this.check(ri(...e))},length(...e){return this.check(oi(...e))},nonempty(...e){return this.check(Kr(1,...e))},lowercase(e){return this.check(Ec(e))},uppercase(e){return this.check(Tc(e))},trim(){return this.check(Ac())},normalize(...e){return this.check(Nc(...e))},toLowerCase(){return this.check(jc())},toUpperCase(){return this.check(Mc())},slugify(){return this.check(Zc())}})),Uw=D("ZodString",(e,t)=>{Vs.init(e,t),HS.init(e,t)},{email(e){return this.check(Rc(KS,e))},url(e){return this.check(wc(WS,e))},jwt(e){return this.check(wv(nP,e))},emoji(e){return this.check(dv(Vw,e))},guid(e){return this.check(iv(Fw,e))},uuid(e){return this.check(av(ci,e))},uuidv4(e){return this.check(cv(ci,e))},uuidv6(e){return this.check(uv(ci,e))},uuidv7(e){return this.check(lv(ci,e))},nanoid(e){return this.check(pv(Hw,e))},cuid(e){return this.check(mv(Bw,e))},cuid2(e){return this.check(fv(Jw,e))},ulid(e){return this.check(hv(Kw,e))},base64(e){return this.check(zv(tP,e))},base64url(e){return this.check($v(rP,e))},xid(e){return this.check(gv(Gw,e))},ksuid(e){return this.check(_v(Ww,e))},ipv4(e){return this.check(yv(Yw,e))},ipv6(e){return this.check(vv(Xw,e))},cidrv4(e){return this.check(Sv(Qw,e))},cidrv6(e){return this.check(bv(eP,e))},e164(e){return this.check(Rv(oP,e))},datetime(e){return this.check(Ys(mu,e))},date(e){return this.check(Xs(fu,e))},time(e){return this.check(Pc(BS,e))},duration(e){return this.check(kc(JS,e))}});function k(e){return sv(Uw,e)}var Le=D("ZodStringFormat",(e,t)=>{Ae.init(e,t),HS.init(e,t)}),mu=D("ZodISODateTime",(e,t)=>{sy.init(e,t),Le.init(e,t)}),fu=D("ZodISODate",(e,t)=>{iy.init(e,t),Le.init(e,t)}),BS=D("ZodISOTime",(e,t)=>{ay.init(e,t),Le.init(e,t)}),JS=D("ZodISODuration",(e,t)=>{cy.init(e,t),Le.init(e,t)}),KS=D("ZodEmail",(e,t)=>{Kg.init(e,t),Le.init(e,t)});function GS(e){return Rc(KS,e)}var Fw=D("ZodGUID",(e,t)=>{Bg.init(e,t),Le.init(e,t)});var ci=D("ZodUUID",(e,t)=>{Jg.init(e,t),Le.init(e,t)});var WS=D("ZodURL",(e,t)=>{Yg.init(e,t),Le.init(e,t)});function YS(e){return wc(WS,e)}var Vw=D("ZodEmoji",(e,t)=>{Xg.init(e,t),Le.init(e,t)});var Hw=D("ZodNanoID",(e,t)=>{Qg.init(e,t),Le.init(e,t)});var Bw=D("ZodCUID",(e,t)=>{ey.init(e,t),Le.init(e,t)});var Jw=D("ZodCUID2",(e,t)=>{ty.init(e,t),Le.init(e,t)});var Kw=D("ZodULID",(e,t)=>{ry.init(e,t),Le.init(e,t)});var Gw=D("ZodXID",(e,t)=>{oy.init(e,t),Le.init(e,t)});var Ww=D("ZodKSUID",(e,t)=>{ny.init(e,t),Le.init(e,t)});var Yw=D("ZodIPv4",(e,t)=>{uy.init(e,t),Le.init(e,t)});var Xw=D("ZodIPv6",(e,t)=>{dy.init(e,t),Le.init(e,t)});var Qw=D("ZodCIDRv4",(e,t)=>{py.init(e,t),Le.init(e,t)});var eP=D("ZodCIDRv6",(e,t)=>{my.init(e,t),Le.init(e,t)});var tP=D("ZodBase64",(e,t)=>{hy.init(e,t),Le.init(e,t)});var rP=D("ZodBase64URL",(e,t)=>{gy.init(e,t),Le.init(e,t)});var oP=D("ZodE164",(e,t)=>{_y.init(e,t),Le.init(e,t)});var nP=D("ZodJWT",(e,t)=>{yy.init(e,t),Le.init(e,t)});var XS=D("ZodNumber",(e,t)=>{_c.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Fc(e,r,o,n),e.isFinite=!0},Eh({minValue:(e)=>{let{minimum:t,exclusiveMinimum:r}=st(e);return Math.max(t??Number.NEGATIVE_INFINITY,r??Number.NEGATIVE_INFINITY)},maxValue:(e)=>{let{maximum:t,exclusiveMaximum:r}=st(e);return Math.min(t??Number.POSITIVE_INFINITY,r??Number.POSITIVE_INFINITY)},isInt:(e)=>{let{isInt:t,multipleOf:r}=st(e);return!!t||!!r?.some(Number.isSafeInteger)},format:(e)=>st(e).format??null},{gt(e,t){return this.check(ei(e,t))},gte(e,t){return this.check(cn(e,t))},min(e,t){return this.check(cn(e,t))},lt(e,t){return this.check(Qs(e,t))},lte(e,t){return this.check(an(e,t))},max(e,t){return this.check(an(e,t))},int(e){return this.check(qS(e))},safe(e){return this.check(qS(e))},positive(e){return this.check(ei(0,e))},nonnegative(e){return this.check(cn(0,e))},negative(e){return this.check(Qs(0,e))},nonpositive(e){return this.check(an(0,e))},multipleOf(e,t){return this.check(ti(e,t))},step(e,t){return this.check(ti(e,t))},finite(){return this}}));function te(e){return Pv(XS,e)}var sP=D("ZodNumberFormat",(e,t)=>{vy.init(e,t),XS.init(e,t)});function qS(e){return kv(sP,e)}var iP=D("ZodBoolean",(e,t)=>{Sy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Vc(e,r,o,n)});function fe(e){return xv(iP,e)}var aP=D("ZodNull",(e,t)=>{by.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Hc(e,r,o,n)});function li(e){return Ev(aP,e)}var cP=D("ZodUnknown",(e,t)=>{zy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Jc(e,r,o,n)});function me(){return Tv(cP)}var uP=D("ZodNever",(e,t)=>{Ry.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Bc(e,r,o,n)});function lP(e){return Ov(uP,e)}var dP=D("ZodArray",(e,t)=>{ui(),wy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Xc(e,r,o,n),e.element=t.element},{min(e,t){return this.check(Kr(e,t))},nonempty(e){return this.check(Kr(1,e))},max(e,t){return this.check(ri(e,t))},length(e,t){return this.check(oi(e,t))},unwrap(){return this.element}});function Q(e,t){return Cv(dP,e,t)}var QS=D("ZodObject",(e,t)=>{ui(),xy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Qc(e,r,o,n),BR(e,"shape",(r)=>r._zod.def.shape,!1)},{keyof(){return $e(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(mt(this._zod.def,{catchall:e}))},passthrough(){return this.clone(mt(this._zod.def,{catchall:me()}))},loose(){return this.clone(mt(this._zod.def,{catchall:me()}))},strict(){return this.clone(mt(this._zod.def,{catchall:lP()}))},strip(){return this.clone(mt(this._zod.def,{catchall:void 0}))},extend(e){return ZR(this,e)},safeExtend(e){return qR(this,e)},merge(e){return LR(this,e)},pick(e){return jR(this,e)},omit(e){return MR(this,e)},partial(...e){return wh(rb,this,e[0])},exactPartial(...e){return wh(ob,this,e[0],"exactPartial")},required(...e){return DR(nb,this,e[0])}});function Z(e,t){let r={type:"object",shape:e??{},...ne(t)};return new QS(r)}function ze(e,t){return new QS({type:"object",shape:e,catchall:me(),...ne(t)})}var eb=D("ZodUnion",(e,t)=>{yc.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>eu(e,r,o,n),e.options=t.options});function ce(e,t){return new eb({type:"union",options:e,...ne(t)})}var pP=D("ZodDiscriminatedUnion",(e,t)=>{eb.init(e,t),Ey.init(e,t)});function hu(e,t,r){return new pP({type:"union",options:t,discriminator:e,...ne(r)})}var mP=D("ZodIntersection",(e,t)=>{Ty.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tu(e,r,o,n)});function Yr(e,t){return new mP({type:"intersection",left:e,right:t})}var LS=D("ZodRecord",(e,t)=>{ui(),Oy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ru(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});function ie(e,t,r){if(!t||!t._zod)return new LS({type:"record",keyType:k(),valueType:e,...ne(t)});return new LS({type:"record",keyType:e,valueType:t,...ne(r)})}var pu=D("ZodEnum",(e,t)=>{Cy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(o,n,s)=>Kc(e,o,n,s),e.enum=t.entries,e.options=[...e._zod.values];let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let s={};for(let i of o)if(r.has(i))s[i]=t.entries[i];else throw Error(`Key ${i} not found in enum`);return new pu({...t,checks:[],...ne(n),entries:s})},e.exclude=(o,n)=>{let s={...t.entries};for(let i of o)if(r.has(i))delete s[i];else throw Error(`Key ${i} not found in enum`);return new pu({...t,checks:[],...ne(n),entries:s})}});function $e(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new pu({type:"enum",entries:r,...ne(t)})}var fP=D("ZodLiteral",(e,t)=>{Iy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Gc(e,r,o,n),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 J(e,t){return new fP({type:"literal",values:Array.isArray(e)?e:[e],...ne(t)})}var hP=D("ZodTransform",(e,t)=>{ui(),Ny.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Yc(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new en(e.constructor.name);r.addIssue=(s)=>{if(typeof s==="string")r.issues.push(zr(s,r.value,t));else{let i=s;if(i.fatal)i.continue=!1;if(i.code??(i.code="custom"),!("input"in i))i.input=r.value;i.inst??(i.inst=e),r.issues.push(zr(i))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((s)=>(r.value=s,r));return r.value=n,r}});function tb(e){return new hP({type:"transform",transform:e})}var rb=D("ZodOptional",(e,t)=>{vc.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ni(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function ge(e){return new rb({type:"optional",innerType:e})}var ob=D("ZodExactOptional",(e,t)=>{Ay.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ni(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function gP(e){return new ob({type:"optional",innerType:e})}var _P=D("ZodNullable",(e,t)=>{jy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ou(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function US(e){return new _P({type:"nullable",innerType:e})}var yP=D("ZodDefault",(e,t)=>{My.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>iu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function vP(e,t){return new yP({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():Ya(t)}})}var SP=D("ZodPrefault",(e,t)=>{Zy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>au(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function bP(e,t){return new SP({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():Ya(t)}})}var nb=D("ZodNonOptional",(e,t)=>{Dy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function zP(e,t){return new nb({type:"nonoptional",innerType:e,...ne(t)})}var $P=D("ZodCatch",(e,t)=>{Fy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function RP(e,t){return new $P({type:"catch",innerType:e,catchValue:typeof t==="function"?t:Th(t)})}var sb=D("ZodPipe",(e,t)=>{Sc.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uu(e,r,o,n),e.in=t.in,e.out=t.out});function VS(e,t){return new sb({type:"pipe",in:e,out:t})}var wP=D("ZodPreprocess",(e,t)=>{sb.init(e,t),Jy.init(e,t)}),PP=D("ZodReadonly",(e,t)=>{Ky.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lu(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});function kP(e){return new PP({type:"readonly",innerType:e})}var xP=D("ZodLazy",(e,t)=>{Gy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>du(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});function gu(e){return new xP({type:"lazy",getter:e})}var EP=D("ZodCustom",(e,t)=>{Wy.init(e,t),je.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Wc(e,r,o,n)});function TP(e,t={}){return Iv(EP,e,t)}function OP(e,t){return Nv(e,t)}function di(e,t){return new wP({type:"pipe",in:tb(e),out:t})}function _u(e){return Ys(mu,e)}function CP(e){return Xs(fu,e)}var $u=Symbol.for("mcp.sdk.errorBrands");function q0(e,t){let r=new Set,o=t;while(typeof o==="function"){let n=o.mcpBrand;if(Object.prototype.hasOwnProperty.call(o,"mcpBrand")&&typeof n==="string")r.add(n);o=Object.getPrototypeOf(o)}if(r.size===0)return;Object.defineProperty(e,$u,{value:r,enumerable:!1,configurable:!0})}function Vy(e,t){try{if(typeof t==="object"&&t!==null&&Object.prototype.hasOwnProperty.call(e,"mcpBrand")&&typeof e.mcpBrand==="string"&&Object.prototype.hasOwnProperty.call(t,$u)){let r=t[$u];if(r&&typeof r.has==="function"&&r.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var ro=function(e){return e.InvalidRequest="invalid_request",e.InvalidClient="invalid_client",e.InvalidGrant="invalid_grant",e.UnauthorizedClient="unauthorized_client",e.UnsupportedGrantType="unsupported_grant_type",e.InvalidScope="invalid_scope",e.AccessDenied="access_denied",e.ServerError="server_error",e.TemporarilyUnavailable="temporarily_unavailable",e.UnsupportedResponseType="unsupported_response_type",e.UnsupportedTokenType="unsupported_token_type",e.InvalidToken="invalid_token",e.MethodNotAllowed="method_not_allowed",e.TooManyRequests="too_many_requests",e.InvalidClientMetadata="invalid_client_metadata",e.InvalidRedirectUri="invalid_redirect_uri",e.InsufficientScope="insufficient_scope",e.InvalidTarget="invalid_target",e.InvalidDpopProof="invalid_dpop_proof",e.UseDpopNonce="use_dpop_nonce",e}({}),vi=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.OAuthError"})}static[Symbol.hasInstance](t){return Vy(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Vy(this,t)}constructor(t,r,o){super(r);this.code=t,this.errorUri=o,this.name="OAuthError",q0(this,new.target)}toResponseObject(){let t={error:this.code,error_description:this.message};if(this.errorUri)t.error_uri=this.errorUri;return t}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},lt=function(e){return e.NotConnected="NOT_CONNECTED",e.AlreadyConnected="ALREADY_CONNECTED",e.NotInitialized="NOT_INITIALIZED",e.CapabilityNotSupported="CAPABILITY_NOT_SUPPORTED",e.RequestTimeout="REQUEST_TIMEOUT",e.ConnectionClosed="CONNECTION_CLOSED",e.SendFailed="SEND_FAILED",e.InvalidResult="INVALID_RESULT",e.UnsupportedResultType="UNSUPPORTED_RESULT_TYPE",e.InputRequiredRoundsExceeded="INPUT_REQUIRED_ROUNDS_EXCEEDED",e.ListPaginationExceeded="LIST_PAGINATION_EXCEEDED",e.MethodNotSupportedByProtocolVersion="METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION",e.EraNegotiationFailed="ERA_NEGOTIATION_FAILED",e.ClientHttpNotImplemented="CLIENT_HTTP_NOT_IMPLEMENTED",e.ClientHttpAuthentication="CLIENT_HTTP_AUTHENTICATION",e.ClientHttpForbidden="CLIENT_HTTP_FORBIDDEN",e.ClientHttpUnexpectedContent="CLIENT_HTTP_UNEXPECTED_CONTENT",e.ClientHttpFailedToOpenStream="CLIENT_HTTP_FAILED_TO_OPEN_STREAM",e.ClientHttpFailedToTerminateSession="CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION",e}({}),it=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkError"})}static[Symbol.hasInstance](e){return Vy(this,e)}static isInstance(e){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Vy(this,e)}constructor(e,t,r,o){super(t,o);this.code=e,this.data=r,this.name="SdkError",q0(this,new.target)}},yj=class extends it{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.SdkHttpError"})}constructor(e,t,r,o){super(e,t,r,o);this.name="SdkHttpError"}get status(){return this.data.status}get statusText(){return this.data.statusText}};var ab={};function E7(e){return Object.hasOwn(ab,e)?ab[e]:void 0}function cb(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function IP(e,t,r){return e==="elicitation"&&t==="form"&&r.form===void 0&&r.url===void 0}function wb(e){switch(e.method){case"elicitation/create":if(e.params?.mode==="url")return{elicitation:{url:{}}};return{elicitation:{form:{}}};case"sampling/createMessage":{let t=e.params;if(t!==void 0&&(t.tools!==void 0||t.toolChoice!==void 0))return{sampling:{tools:{}}};return{sampling:{}}}case"roots/list":return{roots:{}};default:return}}function V0(e,t){let r={};for(let[o,n]of Object.entries(e)){if(n===void 0)continue;let s=t===void 0?void 0:t[o];if(s===void 0){r[o]=n;continue}if(cb(n)&&cb(s)){let i={};for(let[a,c]of Object.entries(n))if(c!==void 0&&s[a]===void 0&&!IP(o,a,s))i[a]=c;if(Object.keys(i).length>0)r[o]=i}}return Object.keys(r).length>0?r:void 0}var Pb="2026-07-28",NA=[Pb];function Zp(e){return e>=Pb}function kb(e){return e.filter((t)=>!Zp(t))}function Si(e){return e.filter((t)=>Zp(t))}function xb(e){let t=e.structuredContent;if(t===void 0)return e;if(!(typeof t!=="object"||t===null||Array.isArray(t)))return e;if(e.content?.some((r)=>r.type==="text")??!1)return e;return{...e,content:[...e.content??[],{type:"text",text:JSON.stringify(t)}]}}var Eb=["task","inputRequests","requestState"];function ku(e){if(e===null||typeof e!=="object"||Array.isArray(e)||e.content!==void 0||Eb.some((t)=>(t in e)))return e;return{...e,content:[]}}function NP(){let e=gu(()=>ce([k(),te(),fe(),li(),ie(k(),e),Q(e)])),t=ie(k(),e),r=ce([k(),te().int()]),o=k(),n=Z({ttl:te().optional()}),s=Z({taskId:k()}),i=ze({progressToken:r.optional(),"io.modelcontextprotocol/related-task":s.optional()}),a=Z({_meta:i.optional()}),c=a.extend({task:n.optional()}),u=Z({method:k(),params:a.loose().optional()}),l=Z({_meta:i.optional()}),d=Z({method:k(),params:l.loose().optional()}),m=ze({_meta:i.optional()}),h=ce([k(),te().int()]),f=m.strict(),v=l.extend({requestId:h.optional(),reason:k().optional()}),y=d.extend({method:J("notifications/cancelled"),params:v}),g=Z({src:k(),mimeType:k().optional(),sizes:Q(k()).optional(),theme:$e(["light","dark"]).optional()}),P=Z({icons:Q(g).optional()}),w=Z({name:k(),title:k().optional()}),E=w.extend({...w.shape,...P.shape,version:k(),websiteUrl:k().optional(),description:k().optional()}),C=Yr(Z({applyDefaults:fe().optional()}),t),R=di((Ye)=>{if(Ye&&typeof Ye==="object"&&!Array.isArray(Ye)&&Object.keys(Ye).length===0)return{form:{}};return Ye},Yr(Z({form:C.optional(),url:t.optional()}),t.optional())),S=ze({list:t.optional(),cancel:t.optional(),requests:ze({sampling:ze({createMessage:t.optional()}).optional(),elicitation:ze({create:t.optional()}).optional()}).optional()}),T=ze({list:t.optional(),cancel:t.optional(),requests:ze({tools:ze({call:t.optional()}).optional()}).optional()}),A=Z({experimental:ie(k(),t).optional(),sampling:Z({context:t.optional(),tools:t.optional()}).optional(),elicitation:R.optional(),roots:Z({listChanged:fe().optional()}).optional(),tasks:S.optional(),extensions:ie(k(),t).optional()}),H=a.extend({protocolVersion:k(),capabilities:A,clientInfo:E}),j=u.extend({method:J("initialize"),params:H}),V=Z({experimental:ie(k(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:Z({listChanged:fe().optional()}).optional(),resources:Z({subscribe:fe().optional(),listChanged:fe().optional()}).optional(),tools:Z({listChanged:fe().optional()}).optional(),tasks:T.optional(),extensions:ie(k(),t).optional()}),W=m.extend({protocolVersion:k(),capabilities:V,serverInfo:E,instructions:k().optional()}),Y=d.extend({method:J("notifications/initialized"),params:l.optional()}),ae=u.extend({method:J("ping"),params:a.optional()}),we=Z({progress:te(),total:ge(te()),message:ge(k())}),Re=Z({...l.shape,...we.shape,progressToken:r}),Ce=d.extend({method:J("notifications/progress"),params:Re}),pe=a.extend({cursor:o.optional()}),N=u.extend({params:pe.optional()}),M=m.extend({nextCursor:o.optional()}),b=Z({uri:k(),mimeType:ge(k()),_meta:ie(k(),me()).optional()}),p=b.extend({text:k()}),_=k().refine((Ye)=>{try{return atob(Ye),!0}catch{return!1}},{message:"Invalid Base64 string"}),z=b.extend({blob:_}),I=$e(["user","assistant"]),U=Z({audience:Q(I).optional(),priority:te().min(0).max(1).optional(),lastModified:_u({offset:!0}).optional()}),G=Z({...w.shape,...P.shape,uri:k(),description:ge(k()),mimeType:ge(k()),size:ge(te()),annotations:U.optional(),_meta:ge(ze({}))}),K=Z({...w.shape,...P.shape,uriTemplate:k(),description:ge(k()),mimeType:ge(k()),annotations:U.optional(),_meta:ge(ze({}))}),le=N.extend({method:J("resources/list")}),Pe=M.extend({resources:Q(G)}),O=N.extend({method:J("resources/templates/list")}),q=M.extend({resourceTemplates:Q(K)}),F=a.extend({uri:k()}),ee=F,re=u.extend({method:J("resources/read"),params:ee}),se=m.extend({contents:Q(ce([p,z]))}),_e=d.extend({method:J("notifications/resources/list_changed"),params:l.optional()}),Ze=F,ke=u.extend({method:J("resources/subscribe"),params:Ze}),De=F,Ie=u.extend({method:J("resources/unsubscribe"),params:De}),gt=l.extend({uri:k()}),Ve=d.extend({method:J("notifications/resources/updated"),params:gt}),jt=Z({name:k(),description:ge(k()),required:ge(fe())}),zt=Z({...w.shape,...P.shape,description:ge(k()),arguments:ge(Q(jt)),_meta:ge(ze({}))}),Mt=N.extend({method:J("prompts/list")}),Vt=M.extend({prompts:Q(zt)}),Ht=a.extend({name:k(),arguments:ie(k(),k()).optional()}),ir=u.extend({method:J("prompts/get"),params:Ht}),ar=Z({type:J("text"),text:k(),annotations:U.optional(),_meta:ie(k(),me()).optional()}),cr=Z({type:J("image"),data:_,mimeType:k(),annotations:U.optional(),_meta:ie(k(),me()).optional()}),ur=Z({type:J("audio"),data:_,mimeType:k(),annotations:U.optional(),_meta:ie(k(),me()).optional()}),so=Z({type:J("tool_use"),name:k(),id:k(),input:ie(k(),me()),_meta:ie(k(),me()).optional()}),Bt=Z({type:J("resource"),resource:ce([p,z]),annotations:U.optional(),_meta:ie(k(),me()).optional()}),io=G.extend({type:J("resource_link")}),_t=ce([ar,cr,ur,io,Bt]),kr=Z({role:I,content:_t}),xr=m.extend({description:k().optional(),messages:Q(kr)}),dr=d.extend({method:J("notifications/prompts/list_changed"),params:l.optional()}),ao=Z({title:k().optional(),readOnlyHint:fe().optional(),destructiveHint:fe().optional(),idempotentHint:fe().optional(),openWorldHint:fe().optional()}),Er=Z({taskSupport:$e(["required","optional","forbidden"]).optional()}),pr=Z({...w.shape,...P.shape,description:k().optional(),inputSchema:Z({type:J("object"),properties:ie(k(),e).optional(),required:Q(k()).optional()}).catchall(me()),outputSchema:Z({type:J("object"),properties:ie(k(),e).optional(),required:Q(k()).optional()}).catchall(me()).optional(),annotations:ao.optional(),execution:Er.optional(),_meta:ie(k(),me()).optional()}),Tr=N.extend({method:J("tools/list")}),Or=M.extend({tools:Q(pr)}),Cr=m.extend({content:Q(_t),structuredContent:ie(k(),me()).optional(),isError:fe().optional()}),Ge=c.extend({name:k(),arguments:ie(k(),me()).optional()}),co=u.extend({method:J("tools/call"),params:Ge}),kn=d.extend({method:J("notifications/tools/list_changed"),params:l.optional()}),Ir=$e(["debug","info","notice","warning","error","critical","alert","emergency"]),uo=a.extend({level:Ir}),lo=u.extend({method:J("logging/setLevel"),params:uo}),po=l.extend({level:Ir,logger:k().optional(),data:me()}),mo=d.extend({method:J("notifications/message"),params:po}),fo=Z({name:k().optional()}),ho=Z({hints:Q(fo).optional(),costPriority:te().min(0).max(1).optional(),speedPriority:te().min(0).max(1).optional(),intelligencePriority:te().min(0).max(1).optional()}),go=Z({mode:$e(["auto","required","none"]).optional()}),xn=Z({type:J("tool_result"),toolUseId:k().describe("The unique identifier for the corresponding tool call."),content:Q(_t),structuredContent:Z({}).loose().optional(),isError:fe().optional(),_meta:ie(k(),me()).optional()}),_o=hu("type",[ar,cr,ur]),Jt=hu("type",[ar,cr,ur,so,xn]),yo=Z({role:I,content:ce([Jt,Q(Jt)]),_meta:ie(k(),me()).optional()}),vo=c.extend({messages:Q(yo),modelPreferences:ho.optional(),systemPrompt:k().optional(),includeContext:$e(["none","thisServer","allServers"]).optional(),temperature:te().optional(),maxTokens:te().int(),stopSequences:Q(k()).optional(),metadata:t.optional(),tools:Q(pr).optional(),toolChoice:go.optional()}),So=u.extend({method:J("sampling/createMessage"),params:vo}),bo=m.extend({model:k(),stopReason:ge($e(["endTurn","stopSequence","maxTokens"]).or(k())),role:I,content:_o}),zo=m.extend({model:k(),stopReason:ge($e(["endTurn","stopSequence","maxTokens","toolUse"]).or(k())),role:I,content:ce([Jt,Q(Jt)])}),$o=Z({type:J("boolean"),title:k().optional(),description:k().optional(),default:fe().optional()}),Ro=Z({type:J("string"),title:k().optional(),description:k().optional(),minLength:te().optional(),maxLength:te().optional(),format:$e(["email","uri","date","date-time"]).optional(),default:k().optional()}),wo=Z({type:$e(["number","integer"]),title:k().optional(),description:k().optional(),minimum:te().optional(),maximum:te().optional(),default:te().optional()}),Po=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),default:k().optional()}),ko=Z({type:J("string"),title:k().optional(),description:k().optional(),oneOf:Q(Z({const:k(),title:k()})),default:k().optional()}),xo=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),enumNames:Q(k()).optional(),default:k().optional()}),Eo=ce([Po,ko]),mr=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({type:J("string"),enum:Q(k())}),default:Q(k()).optional()}),fr=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({anyOf:Q(Z({const:k(),title:k()}))}),default:Q(k()).optional()}),En=ce([mr,fr]),Tn=ce([xo,Eo,En]),at=ce([Tn,$o,Ro,wo]),ct=c.extend({mode:J("form").optional(),message:k(),requestedSchema:Z({type:J("object"),properties:ie(k(),at),required:Q(k()).optional()}).catchall(me())}),To=c.extend({mode:J("url"),message:k(),elicitationId:k(),url:k().url()}),$t=ce([ct,To]),On=u.extend({method:J("elicitation/create"),params:$t}),Cn=l.extend({elicitationId:k()}),In=d.extend({method:J("notifications/elicitation/complete"),params:Cn}),Nn=m.extend({action:$e(["accept","decline","cancel"]),content:di((Ye)=>Ye===null?void 0:Ye,ie(k(),ce([k(),te(),fe(),Q(k())])).optional())}),An=Z({type:J("ref/resource"),uri:k()}),jn=Z({type:J("ref/prompt"),name:k()}),Mn=a.extend({ref:ce([jn,An]),argument:Z({name:k(),value:k()}),context:Z({arguments:ie(k(),k()).optional()}).optional()}),Oo=u.extend({method:J("completion/complete"),params:Mn}),Zn=m.extend({completion:ze({values:Q(k()).max(100),total:ge(te().int()),hasMore:ge(fe())})}),qn=Z({uri:k().startsWith("file://"),name:k().optional(),_meta:ie(k(),me()).optional()}),Nr=u.extend({method:J("roots/list"),params:a.optional()}),Co=m.extend({roots:Q(qn)}),Ln=d.extend({method:J("notifications/roots/list_changed"),params:l.optional()}),Dn=ze({ttl:te().optional(),pollInterval:te().optional()}),Io=$e(["working","input_required","completed","failed","cancelled"]),Kt=Z({taskId:k(),status:Io,ttl:ce([te(),li()]),createdAt:k(),lastUpdatedAt:k(),pollInterval:ge(te()),statusMessage:ge(k())}),tt=m.extend({task:Kt}),Un=l.merge(Kt),hr=d.extend({method:J("notifications/tasks/status"),params:Un}),jr=u.extend({method:J("tasks/get"),params:a.extend({taskId:k()})}),Mr=m.merge(Kt),Zr=u.extend({method:J("tasks/result"),params:a.extend({taskId:k()})}),Ii=m.loose(),Xe=N.extend({method:J("tasks/list")}),Fe=M.extend({tasks:Q(Kt)}),gr=u.extend({method:J("tasks/cancel"),params:a.extend({taskId:k()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,TaskMetadataSchema:n,RelatedTaskMetadataSchema:s,RequestMetaSchema:i,BaseRequestParamsSchema:a,TaskAugmentedRequestParamsSchema:c,RequestSchema:u,NotificationsParamsSchema:l,NotificationSchema:d,ResultSchema:m,RequestIdSchema:h,EmptyResultSchema:f,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:y,IconSchema:g,IconsSchema:P,BaseMetadataSchema:w,ImplementationSchema:E,ClientTasksCapabilitySchema:S,ServerTasksCapabilitySchema:T,ClientCapabilitiesSchema:A,InitializeRequestParamsSchema:H,InitializeRequestSchema:j,ServerCapabilitiesSchema:V,InitializeResultSchema:W,InitializedNotificationSchema:Y,PingRequestSchema:ae,ProgressSchema:we,ProgressNotificationParamsSchema:Re,ProgressNotificationSchema:Ce,PaginatedRequestParamsSchema:pe,PaginatedRequestSchema:N,PaginatedResultSchema:M,ResourceContentsSchema:b,TextResourceContentsSchema:p,BlobResourceContentsSchema:z,RoleSchema:I,AnnotationsSchema:U,ResourceSchema:G,ResourceTemplateSchema:K,ListResourcesRequestSchema:le,ListResourcesResultSchema:Pe,ListResourceTemplatesRequestSchema:O,ListResourceTemplatesResultSchema:q,ResourceRequestParamsSchema:F,ReadResourceRequestParamsSchema:ee,ReadResourceRequestSchema:re,ReadResourceResultSchema:se,ResourceListChangedNotificationSchema:_e,SubscribeRequestParamsSchema:Ze,SubscribeRequestSchema:ke,UnsubscribeRequestParamsSchema:De,UnsubscribeRequestSchema:Ie,ResourceUpdatedNotificationParamsSchema:gt,ResourceUpdatedNotificationSchema:Ve,PromptArgumentSchema:jt,PromptSchema:zt,ListPromptsRequestSchema:Mt,ListPromptsResultSchema:Vt,GetPromptRequestParamsSchema:Ht,GetPromptRequestSchema:ir,TextContentSchema:ar,ImageContentSchema:cr,AudioContentSchema:ur,ToolUseContentSchema:so,EmbeddedResourceSchema:Bt,ResourceLinkSchema:io,ContentBlockSchema:_t,PromptMessageSchema:kr,GetPromptResultSchema:xr,PromptListChangedNotificationSchema:dr,ToolAnnotationsSchema:ao,ToolExecutionSchema:Er,ToolSchema:pr,ListToolsRequestSchema:Tr,ListToolsResultSchema:Or,CallToolResultSchema:Cr,CallToolRequestParamsSchema:Ge,CallToolRequestSchema:co,ToolListChangedNotificationSchema:kn,LoggingLevelSchema:Ir,SetLevelRequestParamsSchema:uo,SetLevelRequestSchema:lo,LoggingMessageNotificationParamsSchema:po,LoggingMessageNotificationSchema:mo,ModelHintSchema:fo,ModelPreferencesSchema:ho,ToolChoiceSchema:go,ToolResultContentSchema:xn,SamplingContentSchema:_o,SamplingMessageContentBlockSchema:Jt,SamplingMessageSchema:yo,CreateMessageRequestParamsSchema:vo,CreateMessageRequestSchema:So,CreateMessageResultSchema:bo,CreateMessageResultWithToolsSchema:zo,BooleanSchemaSchema:$o,StringSchemaSchema:Ro,NumberSchemaSchema:wo,UntitledSingleSelectEnumSchemaSchema:Po,TitledSingleSelectEnumSchemaSchema:ko,LegacyTitledEnumSchemaSchema:xo,SingleSelectEnumSchemaSchema:Eo,UntitledMultiSelectEnumSchemaSchema:mr,TitledMultiSelectEnumSchemaSchema:fr,MultiSelectEnumSchemaSchema:En,EnumSchemaSchema:Tn,PrimitiveSchemaDefinitionSchema:at,ElicitRequestFormParamsSchema:ct,ElicitRequestURLParamsSchema:To,ElicitRequestParamsSchema:$t,ElicitRequestSchema:On,ElicitationCompleteNotificationParamsSchema:Cn,ElicitationCompleteNotificationSchema:In,ElicitResultSchema:Nn,ResourceTemplateReferenceSchema:An,PromptReferenceSchema:jn,CompleteRequestParamsSchema:Mn,CompleteRequestSchema:Oo,CompleteResultSchema:Zn,RootSchema:qn,ListRootsRequestSchema:Nr,ListRootsResultSchema:Co,RootsListChangedNotificationSchema:Ln,TaskCreationParamsSchema:Dn,TaskStatusSchema:Io,TaskSchema:Kt,CreateTaskResultSchema:tt,TaskStatusNotificationParamsSchema:Un,TaskStatusNotificationSchema:hr,GetTaskRequestSchema:jr,GetTaskResultSchema:Mr,GetTaskPayloadRequestSchema:Zr,GetTaskPayloadResultSchema:Ii,ListTasksRequestSchema:Xe,ListTasksResultSchema:Fe,CancelTaskRequestSchema:gr,CancelTaskResultSchema:m.merge(Kt),ClientRequestSchema:ce([ae,j,Oo,lo,ir,Mt,le,O,re,ke,Ie,co,Tr,jr,Zr,Xe,gr]),ClientNotificationSchema:ce([y,Ce,Y,Ln,hr]),ClientResultSchema:ce([f,bo,zo,Nn,Co,Mr,Fe,tt]),ServerRequestSchema:ce([ae,So,On,Nr,jr,Zr,Xe,gr]),ServerNotificationSchema:ce([y,Ce,mo,Ve,_e,kn,dr,hr,In]),ServerResultSchema:ce([f,W,Zn,xr,Vt,Pe,q,se,Cr,Or,Mr,Fe,tt]),CallToolResultWireSchema:me().superRefine((Ye,Fz)=>{if(typeof Ye!=="object"||Ye===null||Array.isArray(Ye)||Ye.content!==void 0)return;for(let Wu of Eb)if(Wu in Ye){Fz.addIssue({code:"custom",message:`content is required when the body carries '${Wu}' \u2014 another result family cannot default into an empty tools/call success`});return}}).transform(ku).pipe(Cr)}}var AP;function Tb(){return AP??=NP()}function Ob(e){return e.type!=="object"}var jP=new Set(["const","enum","default","examples"]),MP=new Set(["properties","patternProperties","$defs","definitions","dependentSchemas","dependencies"]);function ub(e){return e!==void 0&&!(typeof e==="string"&&e.startsWith("#"))}function ZP(e){let t=typeof e.$schema==="string"?e.$schema:void 0;if(ub(e.$id))return{...t!==void 0&&{$schema:t},type:"object",properties:{result:e},required:["result"]};let r=Qu(e.$schema)&&e.$recursiveAnchor!==!0,o=(n,s)=>{if(Array.isArray(n))return n.map((c)=>o(c,!1));if(n===null||typeof n!=="object")return n;if(!s&&ub(n.$id))return n;let i={},a=!1;for(let[c,u]of Object.entries(n))if(s)i[c]=o(u,!1);else if((c==="$ref"||c==="$dynamicRef")&&typeof u==="string")i[c]=u==="#"?"#/properties/result":u.startsWith("#/")?`#/properties/result${u.slice(1)}`:u;else if(c==="$recursiveRef"&&u==="#"&&r)a=!0;else if(jP.has(c))i[c]=u;else if(MP.has(c))i[c]=o(u,!0);else i[c]=o(u,!1);if(a)if("$ref"in i)i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:"#/properties/result"}];else i.$ref="#/properties/result";return i};return{...t!==void 0&&{$schema:t},type:"object",properties:{result:o(e,!1)},required:["result"]}}var Cb={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ib={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},qP={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},pi;function xu(){if(pi)return pi;let e=Tb();return pi={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},pi}function Nb(e){return Object.prototype.hasOwnProperty.call(Cb,e)}function Ab(e){return Object.prototype.hasOwnProperty.call(Ib,e)}function LP(e){return Object.prototype.hasOwnProperty.call(qP,e)}function DP(e){return LP(e)?xu().resultSchemas[e]:void 0}function UP(e){return Nb(e)?xu().requestSchemas[e]:void 0}function FP(e){return Ab(e)?xu().notificationSchemas[e]:void 0}var vj=Object.keys(Cb),Sj=Object.keys(Ib);function Ru(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function fi(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var lb={ok:!1,reason:"not-in-era"};function db(e){return Ru(e)&&Ru(e.outputSchema)&&Ob(e.outputSchema)}function pb(e){return e}var Eu={era:"2025-11-25",hasRequestMethod:Nb,hasNotificationMethod:Ab,validateRequest:(e,t)=>fi(UP(e),t),validateResult:(e,t)=>fi(DP(e),t),validateNotification:(e,t)=>fi(FP(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>lb,validateInputResponse:()=>lb,samplingResultVariant:(e,t)=>{let r=Tb();return fi(e?r.CreateMessageResultWithToolsSchema:r.CreateMessageResultSchema,t)},outboundEnvelope:(e)=>{return},validateEnvelopeMeta:(e)=>[],projectCallToolResult(e,t){let r=xb(e),o=r.structuredContent;if(o===void 0)return r;let n=typeof o!=="object"||o===null||Array.isArray(o),s=t!==void 0&&Ob(t);if(!n&&!s)return r;return{...r,structuredContent:{result:o}}},decodeResult(e,t){if(Ru(t)&&"resultType"in t){let r={...t};return delete r.resultType,{kind:"complete",result:pb(r)}}return{kind:"complete",result:pb(t)}},encodeResult(e,t){if(e!=="tools/list")return t;let r=t.tools;if(!Array.isArray(r)||!r.some((o)=>db(o)))return t;return{...t,tools:r.map((o)=>db(o)?{...o,outputSchema:ZP(o.outputSchema)}:o)}},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope:(e)=>{return}};function VP(){let e=gu(()=>ce([k(),te(),fe(),li(),ie(k(),e),Q(e)])),t=ie(k(),e),r=ce([k(),te().int()]),o=k(),n=ce([k(),te().int()]),s=$e(["user","assistant"]),i=$e(["debug","info","notice","warning","error","critical","alert","emergency"]),a=k().refine((Fe)=>{try{return atob(Fe),!0}catch{return!1}},{message:"Invalid Base64 string"}),c=Z({ttl:te().optional()}),u=Z({taskId:k()}),l=ze({progressToken:r.optional(),"io.modelcontextprotocol/related-task":u.optional()}),d=Z({_meta:l.optional()}),m=d.extend({task:c.optional()}),h=Z({_meta:l.optional()}),f=Z({method:k(),params:h.loose().optional()}),v=Z({src:k(),mimeType:k().optional(),sizes:Q(k()).optional(),theme:$e(["light","dark"]).optional()}),y=Z({icons:Q(v).optional()}),g=Z({name:k(),title:k().optional()}),P=g.extend({...g.shape,...y.shape,version:k(),websiteUrl:k().optional(),description:k().optional()}),w=Yr(Z({applyDefaults:fe().optional()}),t),E=di((Fe)=>{if(Fe&&typeof Fe==="object"&&!Array.isArray(Fe)&&Object.keys(Fe).length===0)return{form:{}};return Fe},Yr(Z({form:w.optional(),url:t.optional()}),t.optional())),C=ze({list:t.optional(),cancel:t.optional(),requests:ze({sampling:ze({createMessage:t.optional()}).optional(),elicitation:ze({create:t.optional()}).optional()}).optional()}),R=ze({list:t.optional(),cancel:t.optional(),requests:ze({tools:ze({call:t.optional()}).optional()}).optional()}),S=Z({experimental:ie(k(),t).optional(),sampling:Z({context:t.optional(),tools:t.optional()}).optional(),elicitation:E.optional(),roots:Z({listChanged:fe().optional()}).optional(),tasks:C.optional(),extensions:ie(k(),t).optional()}),T=Z({experimental:ie(k(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:Z({listChanged:fe().optional()}).optional(),resources:Z({subscribe:fe().optional(),listChanged:fe().optional()}).optional(),tools:Z({listChanged:fe().optional()}).optional(),tasks:R.optional(),extensions:ie(k(),t).optional()}),A=Z({progress:te(),total:ge(te()),message:ge(k())}),H=Z({...h.shape,...A.shape,progressToken:r}),j=f.extend({method:J("notifications/progress"),params:H}),V=h.extend({level:i,logger:k().optional(),data:me()}),W=f.extend({method:J("notifications/message"),params:V}),Y=Z({uri:k(),mimeType:ge(k()),_meta:ie(k(),me()).optional()}),ae=Y.extend({text:k()}),we=Y.extend({blob:a}),Re=Z({audience:Q(s).optional(),priority:te().min(0).max(1).optional(),lastModified:_u({offset:!0}).optional()}),Ce=Z({...g.shape,...y.shape,uri:k(),description:ge(k()),mimeType:ge(k()),size:ge(te()),annotations:Re.optional(),_meta:ge(ze({}))}),pe=Z({...g.shape,...y.shape,uriTemplate:k(),description:ge(k()),mimeType:ge(k()),annotations:Re.optional(),_meta:ge(ze({}))}),N=f.extend({method:J("notifications/resources/list_changed"),params:h.optional()}),M=h.extend({uri:k()}),b=f.extend({method:J("notifications/resources/updated"),params:M}),p=Z({name:k(),description:ge(k()),required:ge(fe())}),_=Z({...g.shape,...y.shape,description:ge(k()),arguments:ge(Q(p)),_meta:ge(ze({}))}),z=f.extend({method:J("notifications/prompts/list_changed"),params:h.optional()}),I=Z({type:J("text"),text:k(),annotations:Re.optional(),_meta:ie(k(),me()).optional()}),U=Z({type:J("image"),data:a,mimeType:k(),annotations:Re.optional(),_meta:ie(k(),me()).optional()}),G=Z({type:J("audio"),data:a,mimeType:k(),annotations:Re.optional(),_meta:ie(k(),me()).optional()}),K=Z({type:J("tool_use"),name:k(),id:k(),input:ie(k(),me()),_meta:ie(k(),me()).optional()}),le=Z({type:J("resource"),resource:ce([ae,we]),annotations:Re.optional(),_meta:ie(k(),me()).optional()}),Pe=Ce.extend({type:J("resource_link")}),O=ce([I,U,G,Pe,le]),q=Z({role:s,content:O}),F=Z({title:k().optional(),readOnlyHint:fe().optional(),destructiveHint:fe().optional(),idempotentHint:fe().optional(),openWorldHint:fe().optional()}),ee=f.extend({method:J("notifications/tools/list_changed"),params:h.optional()}),re=Z({name:k().optional()}),se=Z({hints:Q(re).optional(),costPriority:te().min(0).max(1).optional(),speedPriority:te().min(0).max(1).optional(),intelligencePriority:te().min(0).max(1).optional()}),_e=Z({mode:$e(["auto","required","none"]).optional()}),Ze=Z({type:J("boolean"),title:k().optional(),description:k().optional(),default:fe().optional()}),ke=Z({type:J("string"),title:k().optional(),description:k().optional(),minLength:te().optional(),maxLength:te().optional(),format:$e(["email","uri","date","date-time"]).optional(),default:k().optional()}),De=Z({type:$e(["number","integer"]),title:k().optional(),description:k().optional(),minimum:te().optional(),maximum:te().optional(),default:te().optional()}),Ie=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),default:k().optional()}),gt=Z({type:J("string"),title:k().optional(),description:k().optional(),oneOf:Q(Z({const:k(),title:k()})),default:k().optional()}),Ve=Z({type:J("string"),title:k().optional(),description:k().optional(),enum:Q(k()),enumNames:Q(k()).optional(),default:k().optional()}),jt=ce([Ie,gt]),zt=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({type:J("string"),enum:Q(k())}),default:Q(k()).optional()}),Mt=Z({type:J("array"),title:k().optional(),description:k().optional(),minItems:te().optional(),maxItems:te().optional(),items:Z({anyOf:Q(Z({const:k(),title:k()}))}),default:Q(k()).optional()}),Vt=ce([zt,Mt]),Ht=ce([Ve,jt,Vt]),ir=ce([Ht,Ze,ke,De]),ar=m.extend({mode:J("form").optional(),message:k(),requestedSchema:Z({type:J("object"),properties:ie(k(),ir),required:Q(k()).optional()}).catchall(me())}),cr=Z({type:J("ref/resource"),uri:k()}),ur=Z({type:J("ref/prompt"),name:k()}),so=Z({uri:k().startsWith("file://"),name:k().optional(),_meta:ie(k(),me()).optional()}),Bt=S.shape,io=Z({experimental:Bt.experimental,sampling:Bt.sampling,elicitation:Bt.elicitation,roots:Bt.roots,extensions:Bt.extensions}),_t=T.shape,kr=Z({experimental:_t.experimental,logging:_t.logging,completions:_t.completions,prompts:_t.prompts,resources:_t.resources,tools:_t.tools,extensions:_t.extensions}),xr=ze({progressToken:r.optional(),[Zo]:k(),[jl]:P.optional(),[Ar]:io,[Mu]:i.optional()}),dr=Z({...g.shape,...y.shape,description:k().optional(),inputSchema:ze({$schema:k().optional(),type:J("object")}),outputSchema:ze({$schema:k().optional()}).optional(),annotations:F.optional(),_meta:ie(k(),me()).optional()}),ao=Z({type:J("tool_result"),toolUseId:k(),content:Q(O),structuredContent:me().optional(),isError:fe().optional(),_meta:ie(k(),me()).optional()}),Er=ce([I,U,G,K,ao]),pr=Z({role:s,content:ce([Er,Q(Er)]),_meta:ie(k(),me()).optional()}),Tr=k(),Or=ze({[va]:P.optional().catch(void 0)}),Cr=Or.optional();function Ge(Fe){return ze({_meta:Cr,resultType:Tr.default("complete"),...Fe})}let co=Ge({}),kn=Ge({nextCursor:o.optional()}),Ir=Ge({content:Q(O),structuredContent:me().optional(),isError:fe().optional()}),uo=Ge({ttlMs:te().int().min(0),cacheScope:$e(["public","private"]),tools:Q(dr),nextCursor:o.optional()}),lo=Ge({ttlMs:te().int().min(0),cacheScope:$e(["public","private"]),prompts:Q(_),nextCursor:o.optional()}),po=Ge({description:k().optional(),messages:Q(q)}),mo=Ge({ttlMs:te().int().min(0),cacheScope:$e(["public","private"]),resources:Q(Ce),nextCursor:o.optional()}),fo=Ge({ttlMs:te().int().min(0),cacheScope:$e(["public","private"]),resourceTemplates:Q(pe),nextCursor:o.optional()}),ho=Ge({ttlMs:te().int().min(0),cacheScope:$e(["public","private"]),contents:Q(ce([ae,we]))}),go=Ge({completion:Z({values:Q(k()).max(100),total:te().int().optional(),hasMore:fe().optional()}).loose()}),xn=Ge({ttlMs:te().int().min(0),cacheScope:$e(["public","private"])}),_o=Ge({ttlMs:te().int().min(0).catch(0),cacheScope:$e(["public","private"]).catch("private"),supportedVersions:Q(k()),capabilities:kr,instructions:k().optional()}),Jt=Z({messages:Q(pr),modelPreferences:se.optional(),systemPrompt:k().optional(),includeContext:$e(["none","thisServer","allServers"]).optional(),temperature:te().optional(),maxTokens:te().int(),stopSequences:Q(k()).optional(),metadata:t.optional(),tools:Q(dr).optional(),toolChoice:_e.optional()}),yo=Z({method:J("sampling/createMessage"),params:Jt}),vo=Z({method:J("roots/list"),params:Z({_meta:ie(k(),me()).optional()}).optional()}),So=Z({...pr.shape,model:k(),stopReason:k().optional()}),bo=Z({roots:Q(so)}),zo=Z({action:$e(["accept","decline","cancel"]),content:ie(k(),ce([k(),te(),fe(),Q(k())])).optional()}),$o=Z({mode:J("url"),message:k(),url:k().url()}),Ro=ce([ar,$o]),wo=Z({method:J("elicitation/create"),params:Ro}),Po=ce([yo,vo,wo]),ko=ce([So,bo,zo]),xo=ie(k(),Po),Eo=ie(k(),ko),mr=Ge({inputRequests:xo.optional(),requestState:k().optional()}),fr={inputResponses:Eo.optional(),requestState:k().optional()},En=Z({_meta:xr,...fr}),Tn=ze({progressToken:r.optional()});function at(Fe,gr){return Z({method:J(Fe),params:Z({_meta:xr,...gr})})}function ct(Fe,gr){return Z({method:J(Fe),params:Z({_meta:Tn.optional(),...gr}).optional()})}let To={name:k(),arguments:ie(k(),me()).optional(),...fr},$t={cursor:o.optional()},On=at("tools/call",To),Cn=at("tools/list",$t),In=at("prompts/list",$t),Nn=at("prompts/get",{name:k(),arguments:ie(k(),k()).optional(),...fr}),An=at("resources/list",$t),jn=at("resources/templates/list",$t),Mn=at("resources/read",{uri:k(),...fr}),Oo={ref:ce([ur,cr]),argument:Z({name:k(),value:k()}),context:Z({arguments:ie(k(),k()).optional()}).optional()},Zn=at("completion/complete",Oo),qn=at("server/discover",{}),Nr=Z({toolsListChanged:fe().optional(),promptsListChanged:fe().optional(),resourcesListChanged:fe().optional(),resourceSubscriptions:Q(k()).optional()}),Co={notifications:Nr},Ln=at("subscriptions/listen",Co),Dn=Or.extend({"io.modelcontextprotocol/subscriptionId":n}),Io=ze({_meta:Dn,resultType:Tr.default("complete")}),Kt={"tools/call":ct("tools/call",To),"tools/list":ct("tools/list",$t),"prompts/get":ct("prompts/get",{name:k(),arguments:ie(k(),k()).optional()}),"prompts/list":ct("prompts/list",$t),"resources/list":ct("resources/list",$t),"resources/templates/list":ct("resources/templates/list",$t),"resources/read":ct("resources/read",{uri:k()}),"completion/complete":ct("completion/complete",Oo),"server/discover":ct("server/discover",{}),"subscriptions/listen":ct("subscriptions/listen",Co)};function tt(Fe){return ze({_meta:Cr,...Fe})}let Un={"tools/call":tt({content:Q(O),structuredContent:me().optional(),isError:fe().optional()}),"tools/list":tt({ttlMs:te().int().min(0),cacheScope:$e(["public","private"]),tools:Q(dr),nextCursor:o.optional()}),"prompts/get":tt({description:k().optional(),messages:Q(q)}),"prompts/list":tt({ttlMs:te().int().min(0),cacheScope:$e(["public","private"]),prompts:Q(_),nextCursor:o.optional()}),"resources/list":tt({ttlMs:te().int().min(0),cacheScope:$e(["public","private"]),resources:Q(Ce),nextCursor:o.optional()}),"resources/templates/list":tt({ttlMs:te().int().min(0),cacheScope:$e(["public","private"]),resourceTemplates:Q(pe),nextCursor:o.optional()}),"resources/read":tt({ttlMs:te().int().min(0),cacheScope:$e(["public","private"]),contents:Q(ce([ae,we]))}),"completion/complete":tt({completion:Z({values:Q(k()).max(100),total:te().int().optional(),hasMore:fe().optional()}).loose()}),"server/discover":tt({ttlMs:te().int().min(0).catch(0),cacheScope:$e(["public","private"]).catch("private"),supportedVersions:Q(k()),capabilities:kr,instructions:k().optional()}),"subscriptions/listen":tt({})},hr=ze({"io.modelcontextprotocol/subscriptionId":n.optional()}),jr=Z({method:J("notifications/subscriptions/acknowledged"),params:Z({_meta:hr.optional(),notifications:Nr})}),Mr=Z({_meta:hr.optional(),requestId:n,reason:k().optional()}),Zr=Z({method:J("notifications/cancelled"),params:Mr}),Ii={"notifications/cancelled":Zr,"notifications/progress":j,"notifications/message":W,"notifications/resources/updated":b,"notifications/resources/list_changed":N,"notifications/tools/list_changed":ee,"notifications/prompts/list_changed":z,"notifications/subscriptions/acknowledged":jr},Xe=(Fe)=>Z({jsonrpc:J("2.0"),id:ce([k(),te().int()]),result:Fe}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:r,CursorSchema:o,RequestIdSchema:n,RoleSchema:s,LoggingLevelSchema:i,TaskMetadataSchema:c,RelatedTaskMetadataSchema:u,RequestMetaSchema:l,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:m,NotificationsParamsSchema:h,NotificationSchema:f,IconSchema:v,IconsSchema:y,BaseMetadataSchema:g,ImplementationSchema:P,ClientTasksCapabilitySchema:C,ServerTasksCapabilitySchema:R,ClientCapabilitiesSchema:S,ServerCapabilitiesSchema:T,ProgressSchema:A,ProgressNotificationParamsSchema:H,ProgressNotificationSchema:j,LoggingMessageNotificationParamsSchema:V,LoggingMessageNotificationSchema:W,ResourceContentsSchema:Y,TextResourceContentsSchema:ae,BlobResourceContentsSchema:we,AnnotationsSchema:Re,ResourceSchema:Ce,ResourceTemplateSchema:pe,ResourceListChangedNotificationSchema:N,ResourceUpdatedNotificationParamsSchema:M,ResourceUpdatedNotificationSchema:b,PromptArgumentSchema:p,PromptSchema:_,PromptListChangedNotificationSchema:z,TextContentSchema:I,ImageContentSchema:U,AudioContentSchema:G,ToolUseContentSchema:K,EmbeddedResourceSchema:le,ResourceLinkSchema:Pe,ContentBlockSchema:O,PromptMessageSchema:q,ToolAnnotationsSchema:F,ToolListChangedNotificationSchema:ee,ModelHintSchema:re,ModelPreferencesSchema:se,ToolChoiceSchema:_e,BooleanSchemaSchema:Ze,StringSchemaSchema:ke,NumberSchemaSchema:De,UntitledSingleSelectEnumSchemaSchema:Ie,TitledSingleSelectEnumSchemaSchema:gt,LegacyTitledEnumSchemaSchema:Ve,SingleSelectEnumSchemaSchema:jt,UntitledMultiSelectEnumSchemaSchema:zt,TitledMultiSelectEnumSchemaSchema:Mt,MultiSelectEnumSchemaSchema:Vt,EnumSchemaSchema:Ht,PrimitiveSchemaDefinitionSchema:ir,ElicitRequestFormParamsSchema:ar,ResourceTemplateReferenceSchema:cr,PromptReferenceSchema:ur,RootSchema:so,ClientCapabilities2026Schema:io,ServerCapabilities2026Schema:kr,RequestMetaEnvelopeSchema:xr,ToolSchema:dr,ToolResultContentSchema:ao,SamplingMessageContentBlockSchema:Er,SamplingMessageSchema:pr,ResultTypeSchema:Tr,ResultMetaSchema:Or,ResultSchema:co,PaginatedResultSchema:kn,CallToolResultSchema:Ir,ListToolsResultSchema:uo,ListPromptsResultSchema:lo,GetPromptResultSchema:po,ListResourcesResultSchema:mo,ListResourceTemplatesResultSchema:fo,ReadResourceResultSchema:ho,CompleteResultSchema:go,CacheableResultSchema:xn,DiscoverResultSchema:_o,CreateMessageRequestParamsSchema:Jt,CreateMessageRequestSchema:yo,ListRootsRequestSchema:vo,CreateMessageResultSchema:So,ListRootsResultSchema:bo,ElicitResultSchema:zo,ElicitRequestURLParamsSchema:$o,ElicitRequestParamsSchema:Ro,ElicitRequestSchema:wo,InputRequestSchema:Po,InputResponseSchema:ko,InputRequestsSchema:xo,InputResponsesSchema:Eo,InputRequiredResultSchema:mr,InputResponseRequestParamsSchema:En,CallToolRequestSchema:On,ListToolsRequestSchema:Cn,ListPromptsRequestSchema:In,GetPromptRequestSchema:Nn,ListResourcesRequestSchema:An,ListResourceTemplatesRequestSchema:jn,ReadResourceRequestSchema:Mn,CompleteRequestSchema:Zn,DiscoverRequestSchema:qn,SubscriptionFilterSchema:Nr,SubscriptionsListenRequestSchema:Ln,SubscriptionsListenResultMetaSchema:Dn,SubscriptionsListenResultSchema:Io,dispatchRequestSchemas:Kt,dispatchResultSchemas:Un,NotificationMetaSchema:hr,SubscriptionsAcknowledgedNotificationSchema:jr,CancelledNotificationParamsSchema:Mr,CancelledNotificationSchema:Zr,notificationSchemas2026:Ii,JSONRPCResultResponseSchema:Xe(co),CallToolResultResponseSchema:Xe(ce([Ir,mr])),ListToolsResultResponseSchema:Xe(uo),ListPromptsResultResponseSchema:Xe(lo),GetPromptResultResponseSchema:Xe(ce([po,mr])),ListResourcesResultResponseSchema:Xe(mo),ListResourceTemplatesResultResponseSchema:Xe(fo),ReadResourceResultResponseSchema:Xe(ce([ho,mr])),CompleteResultResponseSchema:Xe(go),DiscoverResultResponseSchema:Xe(_o),SubscriptionsListenResultResponseSchema:Xe(Io)}}var HP;function nr(){return HP??=VP()}var BP=["tools/list","prompts/list","resources/list","resources/templates/list","resources/read","server/discover"];function JP(e){return BP.includes(e)}var Qr=Symbol("modelcontextprotocol.resultCacheHintFallback");function bi(e,t){if(t===void 0)return e;let r=e[Qr];if(r===void 0)return{...e,[Qr]:t};let o={},n=r.ttlMs??t.ttlMs;if(n!==void 0)o.ttlMs=n;let s=r.cacheScope??t.cacheScope;if(s!==void 0)o.cacheScope=s;return{...e,[Qr]:o}}function KP(e){return e[Qr]}function Tu(e){return typeof e==="number"&&Number.isSafeInteger(e)&&e>=0}function Ou(e){return e==="public"||e==="private"}function W0(e,t){if(e.ttlMs!==void 0&&!Tu(e.ttlMs))throw RangeError(`Invalid cache hint for ${t}: ttlMs must be a non-negative safe integer (got ${String(e.ttlMs)})`);if(e.cacheScope!==void 0&&!Ou(e.cacheScope))throw RangeError(`Invalid cache hint for ${t}: cacheScope must be 'public' or 'private' (got ${String(e.cacheScope)})`)}var ue=function(e){return e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.ResourceNotFound=-32002]="ResourceNotFound",e[e.MissingRequiredClientCapability=-32021]="MissingRequiredClientCapability",e[e.UnsupportedProtocolVersion=-32022]="UnsupportedProtocolVersion",e[e.UrlElicitationRequired=-32042]="UrlElicitationRequired",e}({}),he=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ProtocolError"})}static[Symbol.hasInstance](t){return Vy(this,t)}static isInstance(t){if(typeof this!=="function")throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return Vy(this,t)}constructor(t,r,o){super(r);this.code=t,this.data=o,this.name="ProtocolError",q0(this,new.target)}static fromError(t,r,o){if(t===ue.UrlElicitationRequired&&o){let n=o;if(n.elicitations)return new GP(n.elicitations,r)}if(t===ue.UnsupportedProtocolVersion&&o){let n=o;if(Array.isArray(n.supported)&&typeof n.requested==="string")return new wq({supported:n.supported,requested:n.requested},r)}if(t===ue.InvalidParams||t===ue.ResourceNotFound){let n=o;if(typeof n?.uri==="string"&&(t===ue.ResourceNotFound||Object.keys(n).length===1))return new Qp(n.uri,r)}if(t===ue.MissingRequiredClientCapability&&o){let n=o;if(n.requiredCapabilities!==null&&typeof n.requiredCapabilities==="object"&&!Array.isArray(n.requiredCapabilities))return new z0({requiredCapabilities:n.requiredCapabilities},r)}return new e(t,r,o)}},Qp=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.ResourceNotFoundError"})}constructor(e,t=`Resource not found: ${e}`){super(ue.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},GP=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UrlElicitationRequiredError"})}constructor(e,t=`URL elicitation${e.length>1?"s":""} required`){super(ue.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},wq=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.UnsupportedProtocolVersionError"})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(ue.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},z0=class extends he{static{Object.defineProperty(this,"mcpBrand",{value:"mcp.MissingRequiredClientCapabilityError"})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(", ")}`){super(ue.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},WP=0,YP="private",XP=["tools/call","prompts/get","resources/read"];function QP(e,t){let r=t.resultType;if(r===void 0)return{...t,resultType:"complete"};if(r==="complete")return t;if(XP.includes(e))return t;throw new he(ue.InternalError,`Handler for ${e} returned resultType '${String(r)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function ek(e,t){let r=KP(t);if(t.resultType!=="complete"||!JP(e))return r===void 0?t:sk(t);let o=t,n=Tu(o.ttlMs)?o.ttlMs:ok(r),s=Ou(o.cacheScope)?o.cacheScope:nk(r),i={...o,ttlMs:n,cacheScope:s};return delete i[Qr],i}function tk(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function rk(e,t){if(t===void 0)return e;let r=e._meta;if(r===void 0)return{...e,_meta:{[va]:t}};if(!tk(r))return e;if(r[va]!==void 0)return e;return{...e,_meta:{...r,[va]:t}}}function ok(e){return e!==void 0&&Tu(e.ttlMs)?e.ttlMs:WP}function nk(e){return e!==void 0&&Ou(e.cacheScope)?e.cacheScope:YP}function sk(e){let t={...e};return delete t[Qr],t}var ik=["elicitation/create","sampling/createMessage","roots/list"],hi;function jb(){if(hi)return hi;let e=nr();return hi={request:{"elicitation/create":Z({method:J("elicitation/create"),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":Z({method:J("sampling/createMessage"),params:e.CreateMessageRequestParamsSchema}),"roots/list":Z({method:J("roots/list"),params:ze({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},hi}function Mb(e){return ik.includes(e)}function yu(e){return Mb(e)?jb().request[e]:void 0}function ak(e){return Mb(e)?jb().response[e]:void 0}var Cu={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},Zb={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function qb(e){return Object.prototype.hasOwnProperty.call(Cu,e)}function Lb(e){return Object.prototype.hasOwnProperty.call(Zb,e)}function ck(e){return Object.prototype.hasOwnProperty.call(Cu,e)}function uk(e){return qb(e)?nr().dispatchRequestSchemas[e]:void 0}function lk(e){return ck(e)?nr().dispatchResultSchemas[e]:void 0}function dk(e){return Lb(e)?nr().notificationSchemas2026[e]:void 0}var bj=Object.keys(Cu),zj=Object.keys(Zb);function vn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function _n(e,t){if(e===void 0)return{ok:!1,reason:"not-in-era"};let r=e.safeParse(t);return r.success?{ok:!0,value:r.data}:{ok:!1,reason:"invalid",message:String(r.error)}}var pk={ok:!1,reason:"not-in-era"},mk=[Zo,Ar];function fk(e,t){let r=t,o=!1,n=()=>{if(!o)r={...r},o=!0;return r},s=t.tools;if(e==="tools/list"&&Array.isArray(s)&&s.some((a)=>vn(a)&&("execution"in a)))n().tools=s.map((a)=>{if(!vn(a)||!("execution"in a))return a;let c={...a};return delete c.execution,c});let i=t.capabilities;if(vn(i)&&"tasks"in i){let a={...i};delete a.tasks,n().capabilities=a}return r}var Iu={era:"2026-07-28",hasRequestMethod:qb,hasNotificationMethod:Lb,hasInputRequestMethod:(e)=>yu(e)!==void 0,validateRequest:(e,t)=>_n(uk(e),t),validateResult:(e,t)=>_n(lk(e),t),validateNotification:(e,t)=>_n(dk(e),t),validateInputRequest:(e,t)=>_n(yu(e),t),validateInputResponse:(e,t)=>_n(ak(e),t),samplingResultVariant:()=>pk,outboundEnvelope(e){return{[Zo]:e.protocolVersion,[jl]:e.clientInfo,[Ar]:e.clientCapabilities,...e.logLevel!==void 0&&{[Mu]:e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let o of mk)if(!(o in e))t.push({key:o,problem:"missing"});let r=nr().RequestMetaEnvelopeSchema.safeParse(e);if(!r.success)for(let o of r.error.issues){let n=o.path.map(String),s=n.length>0?n.join("."):"_meta";if(n.length===1&&t.some((i)=>i.key===s&&i.problem==="missing"))continue;t.push({key:s,problem:o.message})}return t},projectCallToolResult:(e)=>xb(e),inputRequestSchema:yu,decodeResult(e,t){if(!vn(t))return{kind:"invalid",error:new it(lt.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let r=t.resultType;if(r===void 0)return{kind:"invalid",error:new it(lt.InvalidResult,`Invalid result for ${e}: missing required resultType \u2014 servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:"missing-resultType"})};if(typeof r!=="string")return{kind:"invalid",error:new it(lt.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:r})};if(r==="input_required"){let i=t.inputRequests,a=vn(i)?i:{},c=t.requestState,u=t._meta===void 0?void 0:nr().ResultMetaSchema.safeParse(t._meta),l=u?.success?u.data:void 0;if(Object.keys(a).length===0&&typeof c!=="string")return{kind:"invalid",error:new it(lt.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:"input-required-missing-both"})};return{kind:"input_required",inputRequests:a,...typeof c==="string"&&{requestState:c},...l!==void 0&&{_meta:l}}}if(r!=="complete")return{kind:"invalid",error:new it(lt.UnsupportedResultType,`Unsupported result type '${r}' for ${e}`,{resultType:r,method:e})};let o=hk(),n=Object.hasOwn(o,e)?o[e]:void 0;if(n!==void 0){let i=n.safeParse(t);if(!i.success)return{kind:"invalid",error:new it(lt.InvalidResult,`Invalid result for ${e}: ${i.error}`,{method:e})}}let s={...t};return delete s.resultType,{kind:"complete",result:s}},encodeResult(e,t,r){return rk(ek(e,QP(e,fk(e,t))),r)},encodeErrorCode:(e)=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return"Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";let t=nr().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map((r)=>r.message).join("; ")}`}},gi;function hk(){if(gi)return gi;let e=nr();return gi={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},gi}var $n="2026-07-28";function Ft(e){return e!==void 0&&Zp(e)?Iu:Eu}function mb(e){if(e.revision!==void 0)return Ft(e.revision).era;return e.era==="modern"?Iu.era:Eu.era}function vu(e){return Db.some((t)=>t.hasRequestMethod(e))}function Su(e){return Db.some((t)=>t.hasNotificationMethod(e))}function fb(e){return e==="tasks/get"||e==="tasks/cancel"}var Db=[Eu,Iu];function hb(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function FS(e){if(!hb(e))return;let t=e._meta;return hb(t)?t:void 0}function zi(e){let t=FS(e);return t!==void 0&&Zo in t}function Au(e){let t=FS(e)?.[Zo];return typeof t==="string"?t:void 0}function yi(e){return Ft($n).validateEnvelopeMeta(e)}var gk=Yu({AnnotationsSchema:()=>Xp,AudioContentSchema:()=>ES,BaseMetadataSchema:()=>Yp,BaseRequestParamsSchema:()=>Ki,BlobResourceContentsSchema:()=>EA,BooleanSchemaSchema:()=>_S,CallToolRequestParamsSchema:()=>J_,CallToolRequestSchema:()=>X_,CallToolResultSchema:()=>xA,CancelTaskRequestSchema:()=>D0,CancelTaskResultSchema:()=>O0,CancelledNotificationParamsSchema:()=>r_,CancelledNotificationSchema:()=>SA,ClientCapabilitiesSchema:()=>s_,ClientNotificationSchema:()=>N0,ClientRequestSchema:()=>M0,ClientResultSchema:()=>F0,ClientTasksCapabilitySchema:()=>i_,CompatibilityCallToolResultSchema:()=>R0,CompleteRequestParamsSchema:()=>Ax,CompleteRequestSchema:()=>Tx,CompleteResultSchema:()=>kx,ContentBlockSchema:()=>IS,CreateMessageRequestParamsSchema:()=>dx,CreateMessageRequestSchema:()=>lx,CreateMessageResultSchema:()=>ux,CreateMessageResultWithToolsSchema:()=>px,CreateTaskResultSchema:()=>A0,CursorSchema:()=>gA,DiscoverRequestSchema:()=>l_,DiscoverResultSchema:()=>Hy,ElicitRequestFormParamsSchema:()=>dh,ElicitRequestParamsSchema:()=>yx,ElicitRequestSchema:()=>vx,ElicitRequestURLParamsSchema:()=>gx,ElicitResultSchema:()=>wx,ElicitationCompleteNotificationParamsSchema:()=>bx,ElicitationCompleteNotificationSchema:()=>Sx,EmbeddedResourceSchema:()=>H_,EmptyResultSchema:()=>bA,EnumSchemaSchema:()=>hx,GetPromptRequestParamsSchema:()=>B_,GetPromptRequestSchema:()=>$_,GetPromptResultSchema:()=>W_,GetTaskPayloadRequestSchema:()=>I0,GetTaskPayloadResultSchema:()=>_0,GetTaskRequestSchema:()=>k0,GetTaskResultSchema:()=>E0,IconSchema:()=>n_,IconsSchema:()=>rh,ImageContentSchema:()=>kS,ImplementationSchema:()=>PS,InitializeRequestParamsSchema:()=>a_,InitializeRequestSchema:()=>wA,InitializeResultSchema:()=>c_,InitializedNotificationSchema:()=>d_,JSONArraySchema:()=>S0,JSONObjectSchema:()=>Oi,JSONRPCErrorResponseSchema:()=>Uy,JSONRPCMessageSchema:()=>Nu,JSONRPCNotificationSchema:()=>RS,JSONRPCRequestSchema:()=>wS,JSONRPCResponseSchema:()=>w0,JSONRPCResultResponseSchema:()=>$y,JSONValueSchema:()=>eh,LegacyTitledEnumSchemaSchema:()=>DS,ListChangedOptionsBaseSchema:()=>CA,ListPromptsRequestSchema:()=>F_,ListPromptsResultSchema:()=>L_,ListResourceTemplatesRequestSchema:()=>g_,ListResourceTemplatesResultSchema:()=>y_,ListResourcesRequestSchema:()=>f_,ListResourcesResultSchema:()=>h_,ListRootsRequestSchema:()=>Ix,ListRootsResultSchema:()=>_x,ListTasksRequestSchema:()=>x0,ListTasksResultSchema:()=>C0,ListToolsRequestSchema:()=>G_,ListToolsResultSchema:()=>Y_,LoggingLevelSchema:()=>sh,LoggingMessageNotificationParamsSchema:()=>tx,LoggingMessageNotificationSchema:()=>rx,ModelHintSchema:()=>nx,ModelPreferencesSchema:()=>ix,MultiSelectEnumSchemaSchema:()=>fx,NotificationSchema:()=>Ks,NotificationsParamsSchema:()=>js,NumberSchemaSchema:()=>ch,PaginatedRequestParamsSchema:()=>Jp,PaginatedRequestSchema:()=>nh,PaginatedResultSchema:()=>qd,PingRequestSchema:()=>PA,PrimitiveSchemaDefinitionSchema:()=>NS,ProgressNotificationParamsSchema:()=>p_,ProgressNotificationSchema:()=>AA,ProgressSchema:()=>u_,ProgressTokenSchema:()=>hA,PromptArgumentSchema:()=>M_,PromptListChangedNotificationSchema:()=>z_,PromptMessageSchema:()=>V_,PromptReferenceSchema:()=>Px,PromptSchema:()=>N_,ReadResourceRequestParamsSchema:()=>v_,ReadResourceRequestSchema:()=>b_,ReadResourceResultSchema:()=>S_,RelatedTaskMetadataSchema:()=>t_,RequestIdSchema:()=>th,RequestMetaSchema:()=>yA,RequestSchema:()=>Mi,ResourceContentsSchema:()=>TA,ResourceLinkSchema:()=>q_,ResourceListChangedNotificationSchema:()=>w_,ResourceRequestParamsSchema:()=>AS,ResourceSchema:()=>oh,ResourceTemplateReferenceSchema:()=>Rx,ResourceTemplateSchema:()=>m_,ResourceUpdatedNotificationParamsSchema:()=>D_,ResourceUpdatedNotificationSchema:()=>O_,ResultMetaObjectSchema:()=>vA,ResultSchema:()=>Jn,RoleSchema:()=>ih,RootSchema:()=>Ex,RootsListChangedNotificationSchema:()=>xx,SamplingContentSchema:()=>ax,SamplingMessageContentBlockSchema:()=>qy,SamplingMessageSchema:()=>cx,ServerCapabilitiesSchema:()=>RA,ServerNotificationSchema:()=>B0,ServerRequestSchema:()=>L0,ServerResultSchema:()=>$0,ServerTasksCapabilitySchema:()=>o_,SetLevelRequestParamsSchema:()=>Q_,SetLevelRequestSchema:()=>ex,SingleSelectEnumSchemaSchema:()=>mx,StringSchemaSchema:()=>ah,SubscribeRequestParamsSchema:()=>R_,SubscribeRequestSchema:()=>P_,SubscriptionFilterSchema:()=>IA,SubscriptionsAcknowledgedNotificationParamsSchema:()=>I_,SubscriptionsAcknowledgedNotificationSchema:()=>__,SubscriptionsListenRequestParamsSchema:()=>k_,SubscriptionsListenRequestSchema:()=>E_,SubscriptionsListenResultMetaSchema:()=>x_,SubscriptionsListenResultSchema:()=>C_,TaskAugmentedRequestParamsSchema:()=>By,TaskCreationParamsSchema:()=>P0,TaskMetadataSchema:()=>e_,TaskSchema:()=>lh,TaskStatusNotificationParamsSchema:()=>Dx,TaskStatusNotificationSchema:()=>T0,TaskStatusSchema:()=>Cx,TextContentSchema:()=>TS,TextResourceContentsSchema:()=>kA,TitledMultiSelectEnumSchemaSchema:()=>MS,TitledSingleSelectEnumSchemaSchema:()=>CS,ToolAnnotationsSchema:()=>j_,ToolChoiceSchema:()=>ox,ToolExecutionSchema:()=>K_,ToolListChangedNotificationSchema:()=>Z_,ToolResultContentSchema:()=>sx,ToolSchema:()=>_A,ToolUseContentSchema:()=>U_,UnsubscribeRequestParamsSchema:()=>A_,UnsubscribeRequestSchema:()=>T_,UntitledMultiSelectEnumSchemaSchema:()=>OS,UntitledSingleSelectEnumSchemaSchema:()=>xS});function I7(e){return Nu.parse(e)}var em=(e)=>wS.safeParse(e).success,ju=(e)=>RS.safeParse(e).success,uh=(e)=>$y.safeParse(e).success,ph=(e)=>Uy.safeParse(e).success;var sr=(e)=>typeof e==="object"&&e!==null&&!Array.isArray(e)&&e.resultType==="input_required";var Q6=(e)=>wA.safeParse(e).success;function Ub(e){if(e.params.ref.type!=="ref/prompt")throw TypeError(`Expected CompleteRequestPrompt, but got ${e.params.ref.type}`)}function Fb(e){if(e.params.ref.type!=="ref/resource")throw TypeError(`Expected CompleteRequestResourceTemplate, but got ${e.params.ref.type}`)}var _k="Mcp-Param-",gb="x-mcp-header",yk=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,vk=new Set(["string","integer","boolean"]);function Rq(e){let t=[],r=new Map,o,n=(i,a,c)=>{if(i===null||typeof i!=="object")return;let u=i;if(gb in u){if(!c||a.length===0)return`${Xr(a)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let d=u[gb];if(typeof d!=="string"||d.length===0)return`${Xr(a)}: x-mcp-header MUST be a non-empty string`;if(!yk.test(d))return`${Xr(a)}: x-mcp-header '${d}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let m=typeof u.type==="string"?u.type:void 0;if(m===void 0||!vk.has(m)){let v=`${Xr(a)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${m??"<none>"}`;if(m!=="number")return v;o??=v}let h=d.toLowerCase(),f=r.get(h);if(f!==void 0)return`x-mcp-header '${d}' is not case-insensitively unique (also declared as '${f}')`;r.set(h,d),t.push({path:a,headerName:d,type:m})}let l=u.properties;if(l!==null&&typeof l==="object")for(let[d,m]of Object.entries(l)){let h=n(m,[...a,d],c);if(h!==void 0)return h}for(let d of Sk){let m=u[d];if(m===void 0)continue;let h=Array.isArray(m)?m:m!==null&&typeof m==="object"&&bk.has(d)?Object.values(m):[m];for(let f of h){let v=n(f,[...a,`<${d}>`],!1);if(v!==void 0)return v}}},s=n(e,[],!0);if(s!==void 0)return{valid:!1,reason:o??s};return o===void 0?{valid:!0,declarations:t}:{valid:!1,reason:o,declarations:t}}var Sk=["items","prefixItems","contains","additionalProperties","unevaluatedProperties","unevaluatedItems","propertyNames","patternProperties","dependentSchemas","oneOf","anyOf","allOf","not","if","then","else","$defs","definitions"],bk=new Set(["patternProperties","dependentSchemas","$defs","definitions"]);function Xr(e){return e.length===0?"<root>":e.join(".")}var zk="=?base64?",$k="?=",Rk=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,wk=/^-?\d+(\.\d+)?$/;function Pk(e){if(typeof e==="string")return e;if(typeof e==="boolean")return e?"true":"false";if(typeof e==="number"){if(!Number.isFinite(e))return;if(Number.isInteger(e)&&!Number.isSafeInteger(e))return;return String(e)}}function kk(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.codePointAt(o);return new TextDecoder("utf-8",{fatal:!0}).decode(r)}function Vb(e){if(!(e.startsWith(zk)&&e.endsWith($k)))return e;let t=e.slice(9,e.length-2);if(!Rk.test(t))return;try{return kk(t)}catch{return}}function xk(e,t){let r=e;for(let o of t){if(r===null||typeof r!=="object")return;r=r[o]}return r}function _7(e,t,r){for(let o of e){let n=`${_k}${o.headerName}`,s=r.get(n),i=xk(t,o.path);if(i===void 0||i===null)continue;let a=Pk(i);if(a===void 0)continue;if(s===null)return bu("param-header-missing",n,`the body carries ${Xr(o.path)}=${JSON.stringify(i)} but the ${n} header is absent`);let c=Vb(s);if(c===void 0)return bu("param-header-invalid-encoding",n,`the ${n} header carries an invalid Base64 sentinel value`);if(!((o.type==="integer"||o.type==="number")&&wk.test(c)&&typeof i==="number"?Number(c)===i:c===a))return bu("param-header-mismatch",n,`the ${n} header decodes to ${JSON.stringify(c)} but the body carries ${Xr(o.path)}=${JSON.stringify(i)}`)}}function bu(e,t,r){return{kind:"reject",rung:"param-header-validation",cell:e,httpStatus:400,code:eo,message:`Bad Request: the request headers and body disagree: ${r}`,data:{mismatch:{header:t,body:r}},settled:!0}}var eo=-32020,$j=[{rung:"http-method",order:1,evaluatedAt:"edge",codes:[-32000],conformance:[],rationale:"The modern era is POST-only; GET/DELETE are body-less 2025-era session operations and are method-routed to legacy serving (405 when legacy serving is not configured), before any body is read."},{rung:"jsonrpc-shape",order:2,evaluatedAt:"edge",codes:[ue.InvalidRequest],conformance:["server-stateless"],rationale:"The body must be a JSON-RPC request or notification: posted responses and batch arrays containing a modern or invalid element are rejected before classification (element-wise batch rule); all-legacy arrays stay legacy traffic."},{rung:"era-classification",order:3,evaluatedAt:"edge",codes:[eo,ue.UnsupportedProtocolVersion],conformance:["server-stateless","http-header-validation","http-custom-header-server-validation"],rationale:"Body-primary era classification with the protocol-version header as a cross-check; a header/body disagreement is rejected with -32020 (HeaderMismatch), and an envelope-less request on a modern-only endpoint is answered with the unsupported-protocol-version error naming the supported revisions."},{rung:"envelope",order:4,evaluatedAt:"edge",codes:[ue.InvalidParams],conformance:["server-stateless"],rationale:"A present envelope claim with a malformed envelope \u2014 and a missing envelope on a request whose protocol-version header names a modern revision \u2014 is an invalid-params rejection naming the offending or missing key(s); never a silent fall back to legacy handling. This is the only place an invalid-params rejection maps to HTTP 400."},{rung:"method-registry",order:5,evaluatedAt:"dispatch",codes:[ue.MethodNotFound],conformance:["server-stateless"],rationale:"Method existence outranks parameter validity: a method absent from the negotiated revision\u2019s registry (or with no handler installed) answers method-not-found before params or capabilities are looked at."},{rung:"request-params",order:6,evaluatedAt:"dispatch",codes:[ue.InvalidParams],conformance:[],rationale:"Per-method params validation; emitted in-band by the dispatch layer (HTTP 200), never via the ladder status table."},{rung:"standard-header-validation",order:7,evaluatedAt:"pre-dispatch",codes:[eo],conformance:["http-header-validation"],rationale:"SEP-2243 standard `MCP-Protocol-Version` / `Mcp-Method` / `Mcp-Name` headers \u2014 presence, sentinel decoding, and `Mcp-Name` \u2194 body cross-check \u2014 are validated by the HTTP entry on a modern-classified request after the supported-revision gate and before dispatch. The spec requires `MCP-Protocol-Version` and `Mcp-Method` on every modern *request* POST (`Mcp-Name` only for the methods that mirror `params.name` / `params.uri` / `params.taskId`, see `MCP_NAME_HEADER_SOURCE`) and names them in that order, so a request missing several is answered by the earliest. Notification POSTs are exempt: the presence half runs on requests only, so a modern-enveloped notification is dispatched even with no standard headers at all. The classifier\u2019s own header-mismatch cells (protocol-version, `Mcp-Method` mismatch) stay on the edge `era-classification` rung; this rung carries the entry-layer presence/`Mcp-Name` half \u2014 including the missing `MCP-Protocol-Version` cell, which cannot live on the edge rung without breaking body-primary classification. Evaluated before the capability gate, the factory call, and the `Mcp-Param-*` rung so a request that fails several rungs is answered by the standard-header rung first. The documented order (after method-registry 5 and request-params 6) is NOT the observed precedence: serveModern evaluates this rung immediately after the supported-revision gate, so a request that also fails a dispatch rung is answered here before the dispatch rungs (5\u20136) are consulted."},{rung:"client-capabilities",order:8,evaluatedAt:"pre-dispatch",codes:[ue.MissingRequiredClientCapability],conformance:["server-stateless"],rationale:"The capability requirement is checked by the HTTP entry, pre-dispatch, against the validated envelope the classifier produced \u2014 pinning the spec-mandated HTTP 400 independently of how dispatch- and handler-produced errors are mapped. The documented order (after method resolution and params validation) is preserved observably only while the requirement table is empty: once a served method gains a requirement entry, a request that is missing the capability and would also fail a dispatch rung is answered by this gate first, so the entry must consult the method registry before the gate if the documented precedence is to stay observable."},{rung:"param-header-validation",order:9,evaluatedAt:"pre-dispatch",codes:[eo],conformance:["http-custom-header-server-validation"],rationale:"SEP-2243 `Mcp-Param-*` headers are validated against the named tool\u2019s `x-mcp-header` declarations and the body `arguments` after the tool registry is known and before dispatch reaches the handler; a missing/disagreeing/malformed header is rejected 400 / -32020 with the same shape as the standard-header cross-checks. The documented order (after method resolution and params validation) is preserved observably only when the body `arguments` would otherwise validate: the check runs pre-dispatch, so a `tools/call` that fails BOTH this rung and a dispatch-time rung (e.g. order-6 `request-params`, -32602) is answered by this gate first with 400 / -32020, not by the earlier-ordered rung."}],Zu={[ue.ParseError]:400,[ue.InvalidRequest]:400,[ue.MethodNotFound]:404,[ue.UnsupportedProtocolVersion]:400,[ue.MissingRequiredClientCapability]:400,[eo]:400};function x7(e,t){if(t==="in-band")return e===ue.MissingRequiredClientCapability?400:200;return Zu[e]??400}function bt(e,t,r,o,n){return{kind:"reject",rung:e,cell:t,httpStatus:r,code:o.code,message:o.message,...o.data!==void 0&&{data:o.data},settled:n}}function Pt(e,t,r,o="era-classification"){return bt(o,e,400,new he(eo,`Bad Request: the request headers and body disagree: ${r}`,{mismatch:{header:t,body:r}}),!0)}var _b={"tools/call":"name","prompts/get":"name","resources/read":"uri","tasks/get":"taskId","tasks/update":"taskId","tasks/cancel":"taskId"};function Ek(e,t){let r=Object.hasOwn(_b,e)?_b[e]:void 0;if(r===void 0)return;let o=bn(t)?t[r]:void 0;return{field:r,value:typeof o==="string"?o:void 0}}function _i(e){let t=0;while(t<e.length){let o=e.codePointAt(t);if(o!==9&&o!==32)break;t+=1}let r=e.length;while(r>t){let o=e.codePointAt(r-1);if(o!==9&&o!==32)break;r-=1}return t===0&&r===e.length?e:e.slice(t,r)}function C7(e,t){if(t.messageKind!=="request")return;let r=t.message.method;if(e.protocolVersionHeader===void 0){let c=t.classification.revision;return Pt("version-header-missing","(missing)",c===void 0?"the body carries a modern per-request envelope but the required MCP-Protocol-Version header is absent":`the body envelope names protocol version ${c} but the required MCP-Protocol-Version header is absent`,"standard-header-validation")}if(e.mcpMethodHeader===void 0)return Pt("method-header-missing","(missing)",`the body names method ${r} but the required Mcp-Method header is absent`,"standard-header-validation");let o=Ek(r,t.message.params);if(o===void 0)return;let{field:n,value:s}=o;if(e.mcpNameHeader===void 0){if(s===void 0)return;return Pt("name-header-missing","(missing)",`the body carries params.${n}="${s}" but the required Mcp-Name header is absent`,"standard-header-validation")}let i=_i(e.mcpNameHeader),a=Vb(i);if(a===void 0)return Pt("name-header-invalid-encoding",i,"the Mcp-Name header carries an invalid Base64 sentinel value","standard-header-validation");if(s!==void 0&&a!==s)return Pt("name-header-mismatch",i,`the body carries params.${n}="${s}" but the Mcp-Name header names "${a}"`,"standard-header-validation")}function bn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function Hb(e){if(e===void 0)return{era:"modern"};return{era:Zp(e)?"modern":"legacy",revision:e}}function Tk(e){if(!zi(e))return!1;let t=Au(e);if(t===void 0||!Zp(t))return!1;let r=FS(e);return r!==void 0&&yi(r).length===0}function Ok(e){if(e.length===0)return bt("jsonrpc-shape","empty-batch",400,new he(ue.InvalidRequest,"Bad Request: empty JSON-RPC batch"),!0);for(let t of e){if(zi(bn(t)?t.params:void 0))return bt("jsonrpc-shape","batch-with-modern-element",400,new he(ue.InvalidRequest,"Bad Request: JSON-RPC batches may not contain requests for protocol revision 2026-07-28 or later"),!0);if(!(em(t)||ju(t)||uh(t)||ph(t)))return bt("jsonrpc-shape","batch-with-invalid-element",400,new he(ue.InvalidRequest,"Bad Request: JSON-RPC batch contains an invalid message"),!0)}return{kind:"legacy",reason:"batch"}}function Ck(e,t){let{params:r,method:o}=t,n=e.protocolVersionHeader,s=n!==void 0&&Zp(n);if(o==="initialize"&&!Tk(r)){if(s)return Pt("initialize-with-modern-header",n,"an initialize request (legacy handshake) was sent with a modern MCP-Protocol-Version header");let i=bn(r)&&typeof r.protocolVersion==="string"?r.protocolVersion:void 0;return{kind:"legacy",reason:"initialize",...i!==void 0&&{requestedVersion:i}}}if(zi(r)){let i=FS(r),a=(i===void 0?[]:yi(i))[0];if(a!==void 0)return bt("envelope","envelope-invalid",400,new he(ue.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${a.key}: ${a.problem}`,{envelope:a}),!0);let c=Au(r);if(n!==void 0&&c!==void 0&&n!==c)return Pt("header-body-version-mismatch",n,`the body envelope names protocol version ${c} but the MCP-Protocol-Version header names ${n}`);if(e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Pt("method-header-mismatch",e.mcpMethodHeader,`the body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"request",message:t,classification:Hb(c)}}if(s){let i=FS(r),a=yi(i??{}).filter((u)=>u.problem==="missing").map((u)=>u.key),c=i===void 0?["_meta"]:a.length>0?a:[Zo];return bt("envelope","modern-header-without-claim",400,new he(ue.InvalidParams,`Invalid params: the MCP-Protocol-Version header names protocol revision ${n}, but the request is missing the required per-request envelope key(s): ${c.join(", ")}`,{envelope:{missing:c}}),!0)}return{kind:"legacy",reason:"no-claim",...n!==void 0&&{requestedVersion:n}}}function Ik(e,t){let{params:r,method:o}=t,n=e.protocolVersionHeader,s=n!==void 0&&Zp(n);if(zi(r)){let i=Au(r);if(i===void 0){let c=FS(r),u=(c===void 0?[]:yi(c)).find((l)=>l.key===Zo)??{key:Zo,problem:"expected a protocol version string"};return bt("envelope","notification-envelope-invalid",400,new he(ue.InvalidParams,`Invalid _meta envelope for protocol revision 2026-07-28: ${u.key}: ${u.problem}`,{envelope:u}),!0)}if(n!==void 0&&n!==i)return Pt("notification-header-body-version-mismatch",n,`the notification envelope names protocol version ${i} but the MCP-Protocol-Version header names ${n}`);let a=Hb(i);if(a.era==="modern"&&e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Pt("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"notification",message:t,classification:a}}if(s){if(e.mcpMethodHeader!==void 0&&e.mcpMethodHeader!==o)return Pt("notification-method-header-mismatch",e.mcpMethodHeader,`the notification body names method ${o} but the Mcp-Method header names ${e.mcpMethodHeader}`);return{kind:"modern",messageKind:"notification",message:t,classification:{era:"modern",revision:n}}}return{kind:"legacy",reason:"notification",...n!==void 0&&{requestedVersion:n}}}function j0(e){if(e={...e,...e.protocolVersionHeader!==void 0&&{protocolVersionHeader:_i(e.protocolVersionHeader)},...e.mcpMethodHeader!==void 0&&{mcpMethodHeader:_i(e.mcpMethodHeader)},...e.mcpNameHeader!==void 0&&{mcpNameHeader:_i(e.mcpNameHeader)}},e.httpMethod.toUpperCase()!=="POST")return{kind:"legacy",reason:"http-method"};let t=e.body;if(Array.isArray(t))return Ok(t);if(uh(t)||ph(t))return{kind:"legacy",reason:"response"};if(bn(t)&&em(t))return Ck(e,t);if(bn(t)&&ju(t))return Ik(e,t);return bt("jsonrpc-shape","invalid-json-rpc-body",400,new he(ue.InvalidRequest,"Bad Request: the request body is not a valid JSON-RPC message"),!0)}function D7(e,t){switch(e.reason){case"http-method":return bt("http-method","modern-only-method-not-allowed",405,new he(-32000,"Method not allowed."),!0);case"batch":return bt("jsonrpc-shape","modern-only-batch-not-supported",400,new he(ue.InvalidRequest,"Bad Request: JSON-RPC batches are not supported by this endpoint"),!0);case"response":return bt("jsonrpc-shape","modern-only-response-post",400,new he(ue.InvalidRequest,"Bad Request: JSON-RPC responses cannot be posted to this endpoint"),!0);case"notification":return;case"initialize":case"no-claim":{let r=e.requestedVersion;return bt("era-classification","modern-only-missing-envelope",400,r===void 0?new he(ue.UnsupportedProtocolVersion,"Unsupported protocol version: the request did not name a protocol version",{supported:[...t]}):new wq({supported:[...t],requested:r}),!0)}}}function $i(e,t){return ai(e,t)}function yn(e){return new Set(e.flatMap((t)=>Object.keys(t.shape)))}function to(e){if(e==null)return!1;let t=typeof e;if(t!=="object"&&t!=="function")return!1;if(!("~standard"in e))return!1;return typeof e["~standard"]?.validate==="function"}var yb=!1,wu="draft-2020-12";function wr(e,t="input"){let r=e["~standard"],o;if(r.jsonSchema)o=r.jsonSchema[t]({target:wu});else if(r.vendor==="zod"){if(!("_zod"in e))throw Error("Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().");if(!yb)yb=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.");o=si(e,{target:wu,io:t})}else throw Error(`Schema library "${r.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t==="output"){if(o.type!==void 0)return o;return Bb(o)?{type:"object",...o}:o}if(o.type!==void 0&&o.type!=="object")throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(o.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:"object",...o}}var Nk=/^#\/(\$defs|definitions)\/([^/~%]+)$/;function Bb(e,t=e){if("properties"in e||"patternProperties"in e||"additionalProperties"in e||"required"in e)return!0;let r=typeof e.$ref==="string"&&Nk.exec(e.$ref);if(r&&t[r[1]]?.[r[2]]?.type==="object")return!0;for(let o of["oneOf","anyOf","allOf"]){let n=e[o];if(Array.isArray(n)&&n.length>0)return n.every((s)=>s!==null&&typeof s==="object"&&(s.type==="object"||Bb(s,"$id"in s?{}:t)))}return!1}function Ak(e){if(!e.path?.length)return e.message;return`${e.path.map((t)=>String(typeof t==="object"?t.key:t)).join(".")}: ${e.message}`}async function Rr(e,t){let r=await e["~standard"].validate(t);if(r.issues&&r.issues.length>0)return{success:!1,error:r.issues.map((o)=>Ak(o)).join(", ")};return{success:!0,data:r.value}}function jk(e){let t=si(e,{target:wu,io:"input"});return typeof t.pattern==="string"?t.pattern:void 0}var Mk=/\\\.\\d\{(\d+)\}/;function Zk(e){let t=Mk.exec(e),r=[void 0,-1,0];if(t)r.push(Number(t[1]));return[!1,!0].flatMap((o)=>[!1,!0].flatMap((n)=>r.map((s)=>_u({local:o,offset:n,precision:s}))))}function qk(e,t){let r;switch(e){case"email":r=[GS()];break;case"uri":r=[YS()];break;case"date":r=[CP()];break;case"date-time":r=Zk(t);break}return new Set(r.map((o)=>jk(o)).filter((o)=>o!==void 0))}function Lk(e,t,r){if(r!=="zod")return!0;return qk(e,t).has(t)}function Jb(e){let t=wr(e,"input"),r=t.properties||{},o=t.required||[];return Object.entries(r).map(([n,s])=>({name:n,description:s?.description,required:o.includes(n)}))}function zn(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Dk(e){try{return wr(e,"input")}catch(t){let r=t instanceof Error?t.message:String(t);throw new he(ue.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${r}`)}}var Uk=new Set(["$comment","deprecated","description","examples","readOnly","title","writeOnly"]);function qu(e){return Uk.has(e)||e.startsWith("x-")}var Fk=new Set(["$schema",...Object.keys(dh.shape.requestedSchema.shape)]),vb={string:yn([ah,xS,CS,DS]),number:yn([ch]),integer:yn([ch]),boolean:yn([_S]),array:yn([OS,MS])},Vk=new Set(ah.shape.format.unwrap().options);function Hk(e,t,r,o){if(!zn(e))return e;let n=typeof e.type==="string"&&Object.hasOwn(vb,e.type)?vb[e.type]:void 0;if(n===void 0)return e;let s={};for(let[i,a]of Object.entries(e))if(n.has(i)||qu(i))s[i]=a;else if(i==="pattern"&&e.type==="string"&&typeof e.format==="string"){if(!Vk.has(e.format))s[i]=a;else if(typeof a!=="string"||!Lk(e.format,a,r))o.push(`${t}.${i}`)}else o.push(`${t}.${i}`);return s}function Bk(e,t){let r={},o=[];for(let[n,s]of Object.entries(e))if(n==="properties"&&zn(s))r[n]=Object.fromEntries(Object.entries(s).map(([i,a])=>[i,Hk(a,`properties.${i}`,t,o)]));else if(Fk.has(n))r[n]=s;else if(!qu(n))o.push(n);if(o.length>0)throw new he(ue.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${o.join(", ")}`);return r}function Jk(e,t){if(!zn(e.properties))return t;let r=Object.entries(e.properties).filter(([,o])=>!$i(NS,o).success).map(([o])=>`properties.${o}`);return r.length>0?r.join(", "):t}function Pu(e,t,r=""){if(Array.isArray(e)&&Array.isArray(t))return e.flatMap((o,n)=>Pu(o,t[n],`${r}[${n}]`));if(!zn(e)||!zn(t))return[];return Object.entries(e).flatMap(([o,n])=>{let s=r?`${r}.${o}`:o;if(!Object.prototype.hasOwnProperty.call(t,o))return qu(o)?[]:[s];return Pu(n,t[o],s)})}function Kk(e){if(!to(e.requestedSchema))return{...e,mode:"form",requestedSchema:e.requestedSchema};let t=e.requestedSchema["~standard"].vendor,r=Bk(Dk(e.requestedSchema),t),o=$i(dh.shape.requestedSchema,r);if(!o.success)throw new he(ue.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Jk(r,o.error.message)}`);let n=Pu(r,o.data);if(n.length>0)throw new he(ue.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${n.join(", ")}`);let s=(o.data.required??[]).filter((i)=>!Object.prototype.hasOwnProperty.call(o.data.properties,i));if(s.length>0)throw new he(ue.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${s.join(", ")}`);return{...e,mode:"form",requestedSchema:o.data}}function Gk(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,r=typeof e.requestState==="string";if(!t&&!r)throw TypeError("inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)");return{resultType:"input_required",...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}var Pq=Object.assign(Gk,{elicit(e){try{return{method:"elicitation/create",params:Kk(e)}}catch(t){throw t instanceof he?TypeError(t.message,{cause:t}):t}},elicitUrl(e){return{method:"elicitation/create",params:{...e,mode:"url"}}},createMessage(e){return{method:"sampling/createMessage",params:e}},listRoots(){return{method:"roots/list"}}});function O7(e,t,r){let o=Wk(e,t);if(o.kind!=="elicit"||o.action!=="accept"||o.content===void 0)return;if(r===void 0)return o.content;let n=r["~standard"].validate(o.content);if(n instanceof Promise)throw TypeError("acceptedContent(responses, key, schema) requires a synchronously-validating schema");return n.issues===void 0?n.value:void 0}function Wk(e,t){if(e===void 0||typeof e!=="object"||e===null)return{kind:"missing"};let r=e[t];if(r===null||typeof r!=="object"||Array.isArray(r))return{kind:"missing"};let o=r;if(o.action==="accept"||o.action==="decline"||o.action==="cancel"){let n=o.content;return{kind:"elicit",action:o.action,...n!==null&&typeof n==="object"&&!Array.isArray(n)&&{content:n}}}if(Array.isArray(o.roots))return{kind:"roots",roots:o.roots};if(typeof o.role==="string"&&o.content!==void 0)return{kind:"sampling",result:o};return{kind:"missing"}}var Kb=250;function Gb(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Wb(e,t){return new Promise((r,o)=>{if(t?.aborted){o(t.reason instanceof it?t.reason:new it(lt.RequestTimeout,String(t.reason)));return}let n=setTimeout(()=>{t?.removeEventListener("abort",s),r()},e),s=()=>{clearTimeout(n),o(t?.reason instanceof it?t.reason:new it(lt.RequestTimeout,String(t?.reason)))};t?.addEventListener("abort",s,{once:!0})})}function Yb(e){let t=new AbortController,r=()=>t.abort(e?.reason);if(e?.addEventListener("abort",r,{once:!0}),e?.aborted)t.abort(e.reason);return{signal:t.signal,abort:(o)=>t.abort(o),dispose:()=>e?.removeEventListener("abort",r)}}var Yk=["AnnotationsSchema","AudioContentSchema","BaseMetadataSchema","BlobResourceContentsSchema","BooleanSchemaSchema","CallToolRequestSchema","CallToolRequestParamsSchema","CallToolResultSchema","CancelledNotificationSchema","CancelledNotificationParamsSchema","CancelTaskRequestSchema","CancelTaskResultSchema","ClientCapabilitiesSchema","ClientNotificationSchema","ClientRequestSchema","ClientResultSchema","CompatibilityCallToolResultSchema","CompleteRequestSchema","CompleteRequestParamsSchema","CompleteResultSchema","ContentBlockSchema","CreateMessageRequestSchema","CreateMessageRequestParamsSchema","CreateMessageResultSchema","CreateMessageResultWithToolsSchema","CreateTaskResultSchema","CursorSchema","DiscoverRequestSchema","DiscoverResultSchema","ElicitationCompleteNotificationSchema","ElicitationCompleteNotificationParamsSchema","ElicitRequestSchema","ElicitRequestFormParamsSchema","ElicitRequestParamsSchema","ElicitRequestURLParamsSchema","ElicitResultSchema","EmbeddedResourceSchema","EmptyResultSchema","EnumSchemaSchema","GetPromptRequestSchema","GetPromptRequestParamsSchema","GetPromptResultSchema","GetTaskPayloadRequestSchema","GetTaskPayloadResultSchema","GetTaskRequestSchema","GetTaskResultSchema","IconSchema","IconsSchema","ImageContentSchema","ImplementationSchema","InitializedNotificationSchema","InitializeRequestSchema","InitializeRequestParamsSchema","InitializeResultSchema","JSONArraySchema","JSONObjectSchema","JSONRPCErrorResponseSchema","JSONRPCMessageSchema","JSONRPCNotificationSchema","JSONRPCRequestSchema","JSONRPCResponseSchema","JSONRPCResultResponseSchema","JSONValueSchema","LegacyTitledEnumSchemaSchema","ListPromptsRequestSchema","ListPromptsResultSchema","ListResourcesRequestSchema","ListResourcesResultSchema","ListResourceTemplatesRequestSchema","ListResourceTemplatesResultSchema","ListRootsRequestSchema","ListRootsResultSchema","ListTasksRequestSchema","ListTasksResultSchema","ListToolsRequestSchema","ListToolsResultSchema","LoggingLevelSchema","LoggingMessageNotificationSchema","LoggingMessageNotificationParamsSchema","ModelHintSchema","ModelPreferencesSchema","MultiSelectEnumSchemaSchema","NotificationSchema","NumberSchemaSchema","PaginatedRequestSchema","PaginatedRequestParamsSchema","PaginatedResultSchema","PingRequestSchema","PrimitiveSchemaDefinitionSchema","ProgressSchema","ProgressNotificationSchema","ProgressNotificationParamsSchema","ProgressTokenSchema","PromptSchema","PromptArgumentSchema","PromptListChangedNotificationSchema","PromptMessageSchema","PromptReferenceSchema","ReadResourceRequestSchema","ReadResourceRequestParamsSchema","ReadResourceResultSchema","RelatedTaskMetadataSchema","RequestSchema","RequestIdSchema","RequestMetaSchema","ResourceSchema","ResourceContentsSchema","ResourceLinkSchema","ResourceListChangedNotificationSchema","ResourceRequestParamsSchema","ResourceTemplateSchema","ResourceTemplateReferenceSchema","ResourceUpdatedNotificationSchema","ResourceUpdatedNotificationParamsSchema","ResultMetaObjectSchema","ResultSchema","RoleSchema","RootSchema","RootsListChangedNotificationSchema","SamplingContentSchema","SamplingMessageSchema","SamplingMessageContentBlockSchema","ServerCapabilitiesSchema","ServerNotificationSchema","ServerRequestSchema","ServerResultSchema","SetLevelRequestSchema","SetLevelRequestParamsSchema","SingleSelectEnumSchemaSchema","StringSchemaSchema","SubscribeRequestSchema","SubscribeRequestParamsSchema","SubscriptionFilterSchema","SubscriptionsAcknowledgedNotificationSchema","SubscriptionsAcknowledgedNotificationParamsSchema","SubscriptionsListenRequestSchema","SubscriptionsListenRequestParamsSchema","SubscriptionsListenResultSchema","SubscriptionsListenResultMetaSchema","TaskAugmentedRequestParamsSchema","TaskCreationParamsSchema","TaskMetadataSchema","TaskSchema","TaskStatusSchema","TaskStatusNotificationSchema","TaskStatusNotificationParamsSchema","TextContentSchema","TextResourceContentsSchema","TitledMultiSelectEnumSchemaSchema","TitledSingleSelectEnumSchemaSchema","ToolSchema","ToolAnnotationsSchema","ToolChoiceSchema","ToolExecutionSchema","ToolListChangedNotificationSchema","ToolResultContentSchema","ToolUseContentSchema","UnsubscribeRequestSchema","UnsubscribeRequestParamsSchema","UntitledMultiSelectEnumSchemaSchema","UntitledSingleSelectEnumSchemaSchema"],Xk={IdJagTokenExchangeResponseSchema:Fx,OAuthClientInformationFullSchema:$x,OAuthClientInformationSchema:Bx,OAuthClientMetadataSchema:Lx,OAuthClientRegistrationErrorSchema:U0,OAuthErrorResponseSchema:MA,OAuthMetadataSchema:DA,OAuthProtectedResourceMetadataSchema:Ox,OAuthTokenRevocationRequestSchema:H0,OAuthTokensSchema:OA,OpenIdProviderDiscoveryMetadataSchema:Nx,OpenIdProviderMetadataSchema:Mx},Xb={},Qb={};function ez(e,t){let r=e.slice(0,-6);Xb[r]=t,Qb[r]=(o)=>t.safeParse(o).success}for(let e of Yk)ez(e,gk[e]);for(let[e,t]of Object.entries(Xk))ez(e,t);var Rj=Object.freeze(Xb),wj=Object.freeze(Qb);function Qk(e){switch(e){case"initialize":case"notifications/initialized":return Ft(void 0);case"server/discover":return Ft($n);default:return}}var zx=60000,jx=[Zo,jl,Ar,Mu],Zx=["inputResponses","requestState"];function Sb(e,t){let r=e.params;if(!Sn(r))return{message:e,lifted:{}};let o=r._meta,n=Sn(o)?jx.filter((c)=>(c in o)):[],s=t==="request"?Zx.filter((c)=>(c in r)):[];if(n.length===0&&s.length===0)return{message:e,lifted:{}};let i={},a={...r};if(n.length>0&&Sn(o)){let c={},u={...o};for(let l of n)c[l]=o[l],delete u[l];if(i.envelope=c,Object.keys(u).length>0)a._meta=u;else delete a._meta}for(let c of s){if(c==="inputResponses")i.inputResponses=a[c];if(c==="requestState")i.requestState=a[c];delete a[c]}return{message:{...e,params:a},lifted:i}}function bb(e,t){let r=e.validateResult(t,void 0);if(!r.ok&&r.reason==="not-in-era")return;return{"~standard":{version:1,vendor:"mcp-wire-codec",validate(o){let n=e.validateResult(t,o);if(n.ok)return{value:n.value};return{issues:[{message:n.reason==="invalid"?n.message:`not-in-era: ${t}`}]}}}}}function Rn(e){return()=>e}var qx=Rn(void 0);function Lu(e,t){return{...e,mcpReq:{...e.mcpReq,requestState:Rn(t)}}}var tz;function M7(e,t){tz(e,t)}var rz=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;static{tz=(e,t)=>{e._negotiatedProtocolVersion=t}}_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Ly,this.setNotificationHandler("notifications/cancelled",(t)=>{this._oncancel(t)}),this.setNotificationHandler("notifications/progress",(t)=>{this._onprogress(t)}),this.setRequestHandler("ping",(t)=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let r=e.params??{};return{...e,params:{...r,_meta:{...t,...r._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new it(lt.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){if(e.params.requestId===void 0)return;this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,r,o,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(o,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:o})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new it(lt.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);if(t)clearTimeout(t.timeoutId),this._timeoutInfo.delete(e)}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let r=this.transport?.onerror;this._transport.onerror=(n)=>{r?.(n),this._onerror(n)};let o=this._transport?.onmessage;this._transport.onmessage=(n,s)=>{if(o?.(n,s),uh(n)||ph(n))this._onresponse(n);else if(em(n))this._onrequest(n,s);else if(ju(n))this._onnotification(n,s);else this._onerror(Error(`Unknown message type: ${JSON.stringify(n)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let o of this._timeoutInfo.values())clearTimeout(o.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let r=new it(lt.ConnectionClosed,"Connection closed");this._transport=void 0;try{this.onclose?.()}finally{for(let o of e.values())o(r);for(let o of t.values())o.abort(r)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:r}=Sb(e,"notification"),o=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop")return;if(t?.classification!==void 0){let i=mb(t.classification);if(i!==o.era){this._onerror(Error(`Era mismatch on inbound notification '${r.method}': classified as ${i} but this instance serves ${o.era}`));return}}if(Su(r.method)&&!o.hasNotificationMethod(r.method))return;let n=this._notificationHandlers.get(r.method),s=this.fallbackNotificationHandler;if(n===void 0&&s===void 0)return;Promise.resolve().then(()=>n===void 0?s(r):n(r,o)).catch((i)=>this._onerror(Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,t){let{message:r,lifted:o}=Sb(e,"request"),n=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)==="drop"){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let s=this._transport,i=(v,y,g)=>{let P={jsonrpc:"2.0",id:r.id,error:{code:v,message:y,...g!==void 0&&{data:g}}};s?.send(P).catch((w)=>this._onerror(Error(`Failed to send an error response: ${w}`)))};if(t?.classification!==void 0){let v=mb(t.classification);if(v!==n.era){this._onerror(Error(`Era mismatch on inbound request '${r.method}': classified as ${v} but this instance serves ${n.era}`));let y=t.classification.revision??v;i(ue.UnsupportedProtocolVersion,`Unsupported protocol version: ${y}`,{supported:this._supportedProtocolVersions,requested:y});return}}if(vu(r.method)&&!n.hasRequestMethod(r.method)&&!(fb(r.method)&&this._customSchemaRequestMethods.has(r.method))){i(ue.MethodNotFound,"Method not found");return}let a=this._requestHandlers.get(r.method)??this.fallbackRequestHandler;if(a===void 0){i(ue.MethodNotFound,"Method not found");return}let c=n.checkInboundEnvelope(o);if(c!==void 0){i(ue.InvalidParams,c);return}let u=(v,y)=>this._notificationViaCodec(this._resolveOutboundCodec(v.method),v,{...y,relatedRequestId:r.id}),l=(v,y,g)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(v.method),v,y,{...g,relatedRequestId:r.id}),d=new AbortController;this._requestHandlerAbortControllers.set(r.id,d);let m=o.inputResponses===void 0?void 0:Vx(o.inputResponses),h={sessionId:s?.sessionId,mcpReq:{id:r.id,method:r.method,_meta:r.params?._meta,...o.envelope!==void 0&&{envelope:o.envelope},...m!==void 0&&{inputResponses:m.accepted},...m!==void 0&&m.droppedKeys.length>0&&{droppedInputResponseKeys:m.droppedKeys},requestState:o.requestState===void 0?qx:Rn(o.requestState),signal:d.signal,send:(v,y,g)=>{let P=this._resolveOutboundCodec(v.method);if(this._assertOutboundRequestInEra(P,v.method),to(y))return l(v,y,g);let w=bb(P,v.method);if(w===void 0)throw TypeError(`'${v.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return l(v,w,y)},notify:u},http:t?.authInfo?{authInfo:t.authInfo}:void 0},f=this.buildContext(h,t);Promise.resolve().then(()=>a(r,f)).then(async(v)=>{if(d.signal.aborted)return;let y;try{y=n.encodeResult(r.method,v,this._outboundServerInfo())}catch(P){this._onerror(Error(`Failed to encode result for ${r.method}: ${P}`)),i(ue.InternalError,"Internal error");return}let g={result:y,jsonrpc:"2.0",id:r.id};await s?.send(g)},async(v)=>{if(d.signal.aborted)return;let y=Number.isSafeInteger(v.code)?v.code:ue.InternalError,g={jsonrpc:"2.0",id:r.id,error:{code:n.encodeErrorCode(y),message:v.message??"Internal error",...v.data!==void 0&&{data:v.data}}};await s?.send(g)}).catch((v)=>this._onerror(Error(`Failed to send response: ${v}`))).finally(()=>{if(this._requestHandlerAbortControllers.get(r.id)===d)this._requestHandlerAbortControllers.delete(r.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,o=Number(t),n=this._progressHandlers.get(o);if(!n){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(o),i=this._timeoutInfo.get(o);if(i&&s&&i.resetTimeoutOnProgress)try{this._resetTimeout(o)}catch(a){this._responseHandlers.delete(o),this._progressHandlers.delete(o),this._cleanupTimeout(o),s(a);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),uh(e))r(e);else r(he.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,r){let o=this._resolveOutboundCodec(e.method);if(to(t)){if(!fb(e.method))this._assertOutboundRequestInEra(o,e.method);return this._requestWithSchemaViaCodec(o,e,t,r)}this._assertOutboundRequestInEra(o,e.method);let n=bb(o,e.method);if(n===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(o,e,n,t)}_negotiatedWireCodec(){return Ft(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=Qk(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(vu(t)&&!e.hasRequestMethod(t))throw new it(lt.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,r){let o=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(o,e.method),this._requestWithSchemaViaCodec(o,e,t,r)}_requestWithSchemaViaCodec(e,t,r,o){let{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:a}=o??{},c=Date.now(),u,l;return new Promise((d,m)=>{let h=(R)=>{m(R)};if(!this._transport){h(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(R){h(R);return}if(o?.signal?.aborted){let R=o.signal.reason;throw R instanceof it?R:new it(lt.RequestTimeout,String(R))}let f=e.era===$n&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,v=this._requestMessageId++;l=v;let y={...t,jsonrpc:"2.0",id:v};if(o?.onprogress)this._progressHandlers.set(v,o.onprogress),y.params={...t.params,_meta:{...t.params?._meta,progressToken:v}};let g=this._envelopeOutbound(y),P=!1,w=(R)=>{if(P)return;if(this._progressHandlers.delete(v),f===void 0){if(t.method!=="initialize")this._transport?.send(this._envelopeOutbound({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:v,reason:String(R)}}),{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i}).catch((S)=>this._onerror(Error(`Failed to send cancellation: ${S}`)))}else f.abort();m(R instanceof it?R:new it(lt.RequestTimeout,String(R)))};this._responseHandlers.set(v,(R)=>{if(o?.signal?.aborted)return;if(P=!0,R instanceof Error)return m(R);let S;try{S=e.decodeResult(t.method,R.result)}catch(A){return m(A instanceof Error?A:Error(String(A)))}if(S.kind==="invalid")return m(S.error);if(S.kind==="input_required"){if(o?.allowInputRequired===!0)return d(Hx(S));let A={codec:e,request:t,resultSchema:r,options:o,flowStartedAt:c,retry:(H,j)=>this._requestWithSchemaViaCodec(e,H===void 0?{method:t.method}:{method:t.method,params:H},r,j)};return d(this._resolveNonCompleteResult(S,A))}let T=S.result;Rr(r,T).then((A)=>{if(A.success)d(A.data);else m(new it(lt.InvalidResult,`Invalid result for ${t.method}: ${A.error}`))},m)}),u=()=>w(o?.signal?.reason),o?.signal?.addEventListener("abort",u,{once:!0});let E=o?.timeout??zx,C=()=>w(new it(lt.RequestTimeout,"Request timed out",{timeout:E}));this._setupTimeout(v,E,o?.maxTotalTimeout,C,o?.resetTimeoutOnProgress??!1),this._transport.send(g,{relatedRequestId:n,resumptionToken:s,onresumptiontoken:i,headers:a,requestSignal:f?.signal}).catch((R)=>{this._progressHandlers.delete(v),m(R)})}).finally(()=>{if(u)o?.signal?.removeEventListener("abort",u);if(l!==void 0)this._responseHandlers.delete(l),this._cleanupTimeout(l)})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,r){if(!this._transport)throw new it(lt.NotConnected,"Not connected");if(Su(t.method)&&!e.hasNotificationMethod(t.method))throw new it(lt.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let o=this._envelopeOutbound({jsonrpc:"2.0",...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&r?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(t.method),!this._transport)return;this._transport?.send(o,r).catch((n)=>this._onerror(n))});return}await this._transport.send(o,r)}setRequestHandler(e,t,r){this.assertRequestHandlerCapability(e);let o;if(typeof t==="function"){if(!vu(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);o=(n,s)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason==="not-in-era")a=i.validateInputRequest(e,n);if(!a.ok){if(a.reason==="not-in-era")throw new he(ue.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(a.message)}return Promise.resolve(t(a.value,s))}}else if(r)o=async(n,s)=>{let i=await Rr(t.params,{...n.params});if(!i.success)throw new he(ue.InvalidParams,`Invalid params for ${e}: ${i.error}`);return r(i.data,s)};else throw TypeError("setRequestHandler: handler is required");if(typeof t==="function")this._customSchemaRequestMethods.delete(e);else this._customSchemaRequestMethods.add(e);this._requestHandlers.set(e,this._wrapHandler(e,o))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,r){if(typeof t==="function"){if(!Su(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(o,n)=>{let s=n.validateNotification(e,o);if(!s.ok){if(s.reason==="not-in-era")throw new he(ue.InternalError,`No wire schema for ${e} in the resolved era`);throw Error(s.message)}return Promise.resolve(t(s.value))});return}if(!r)throw TypeError("setNotificationHandler: handler is required");this._notificationHandlers.set(e,async(o)=>{let n=await Rr(t.params,{...o.params});if(!n.success)throw new he(ue.InvalidParams,`Invalid params for notification ${e}: ${n.error}`);await r(n.data,o)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function Sn(e){return e!==null&&typeof e==="object"&&!Array.isArray(e)}function oz(e,t){let r={...e};for(let o in t){let n=o,s=t[n];if(s===void 0)continue;let i=r[n];r[n]=Sn(i)&&Sn(s)?{...i,...s}:s}return r}function zb(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function Vx(e){let t={},r=[];if(!zb(e))return{accepted:t,droppedKeys:r};for(let[o,n]of Object.entries(e)){if(!zb(n)||"method"in n||"result"in n){r.push(o);continue}t[o]=n}return{accepted:t,droppedKeys:r}}function Hx(e){return{resultType:"input_required",inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}/*!
|
|
115
|
-
* content-type
|
|
116
|
-
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
117
|
-
* MIT Licensed
|
|
118
|
-
*/var Jx=B((e)=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/\\([\u000b\u0020-\u00ff])/g,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=n;function n(a){if(!a)throw TypeError("argument string is required");var c=typeof a==="object"?s(a):a;if(typeof c!=="string")throw TypeError("argument string is required to be a string");var u=c.indexOf(";"),l=u!==-1?c.slice(0,u).trim():c.trim();if(!o.test(l))throw TypeError("invalid media type");var d=new i(l.toLowerCase());if(u!==-1){var m,h,f;t.lastIndex=u;while(h=t.exec(c)){if(h.index!==u)throw TypeError("invalid parameter format");if(u+=h[0].length,m=h[1].toLowerCase(),f=h[2],f.charCodeAt(0)===34){if(f=f.slice(1,-1),f.indexOf("\\")!==-1)f=f.replace(r,"$1")}d.parameters[m]=f}if(u!==c.length)throw TypeError("invalid parameter format")}return d}function s(a){var c;if(typeof a.getHeader==="function")c=a.getHeader("content-type");else if(typeof a.headers==="object")c=a.headers&&a.headers["content-type"];if(typeof c!=="string")throw TypeError("content-type header is missing from object");return c}function i(a){this.parameters=Object.create(null),this.type=a}}),Kx=Hn(Jx(),1);function e4(e){if(!e)return;try{return Kx.parse(e).type}catch{let t=(e.split(";",1)[0]??"").trim().toLowerCase();if(t===""||e.slice(t.length).includes(","))return;return t}}function t4(e){if(e==="application/json")return!0;return e4(e)==="application/json"}var Gx=10485760,N7=class{_buffer;_maxBufferSize;constructor(e){this._maxBufferSize=e?.maxBufferSize??Gx}append(e){if((this._buffer?.length??0)+e.length>this._maxBufferSize)throw this.clear(),Error(`ReadBuffer exceeded maximum size of ${this._maxBufferSize} bytes`);this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){while(this._buffer){let e=this._buffer.indexOf(`
|
|
119
|
-
`);if(e===-1)return null;let t=this._buffer.toString("utf8",0,e).replace(/\r$/,"");this._buffer=this._buffer.subarray(e+1);try{return Wx(t)}catch(r){if(r instanceof SyntaxError)continue;throw r}}return null}clear(){this._buffer=void 0}};function Wx(e){return Nu.parse(JSON.parse(e))}function F7(e){return JSON.stringify(e)+`
|
|
120
|
-
`}var Yx=/^[A-Za-z0-9._-]{1,128}$/;function Xx(e){let t=[];if(e.length===0)return{isValid:!1,warnings:["Tool name cannot be empty"]};if(e.length>128)return{isValid:!1,warnings:[`Tool name exceeds maximum length of 128 characters (current: ${e.length})`]};if(e.includes(" "))t.push("Tool name contains spaces, which may cause parsing issues");if(e.includes(","))t.push("Tool name contains commas, which may cause parsing issues");if(e.startsWith("-")||e.endsWith("-"))t.push("Tool name starts or ends with a dash, which may cause parsing issues in some contexts");if(e.startsWith(".")||e.endsWith("."))t.push("Tool name starts or ends with a dot, which may cause parsing issues in some contexts");if(!Yx.test(e)){let r=[...e].filter((o)=>!/[A-Za-z0-9._-]/.test(o)).filter((o,n,s)=>s.indexOf(o)===n);return t.push(`Tool name contains invalid characters: ${r.map((o)=>`"${o}"`).join(", ")}`,"Allowed characters are: A-Z, a-z, 0-9, underscore (_), dash (-), and dot (.)"),{isValid:!1,warnings:t}}return{isValid:!0,warnings:t}}function Qx(e,t){if(t.length>0){console.warn(`Tool name validation warning for "${e}":`);for(let r of t)console.warn(` - ${r}`);console.warn("Tool registration will proceed, but this may cause compatibility issues."),console.warn("Consider updating the tool name to conform to the MCP tool naming standard."),console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.")}}function Du(e){let t=Xx(e);return Qx(e,t.warnings),t.isValid}var $b=1e6,zu=1e6,Rb=1e4,eE=1e6,nz=class e{static isTemplate(t){return/\{[^}\s]+\}/.test(t)}static validateLength(t,r,o){if(t.length>r)throw Error(`${o} exceeds maximum length of ${r} characters (got ${t.length})`)}template;parts;get variableNames(){return this.parts.flatMap((t)=>typeof t==="string"?[]:t.names)}constructor(t){e.validateLength(t,$b,"Template"),this.template=t,this.parts=this.parse(t)}toString(){return this.template}parse(t){let r=[],o="",n=0,s=0;while(n<t.length)if(t[n]==="{"){if(o)r.push(o),o="";let i=t.indexOf("}",n);if(i===-1)throw Error("Unclosed template expression");if(s++,s>Rb)throw Error(`Template contains too many expressions (max ${Rb})`);let a=t.slice(n+1,i),c=this.getOperator(a),u=a.includes("*"),l=this.getNames(a),d=l[0];for(let m of l)e.validateLength(m,zu,"Variable name");r.push({name:d,operator:c,names:l,exploded:u}),n=i+1}else o+=t[n],n++;if(o)r.push(o);return r}getOperator(t){return["+","#",".","/","?","&"].find((r)=>t.startsWith(r))||""}getNames(t){let r=this.getOperator(t);return t.slice(r.length).split(",").map((o)=>o.replace("*","").trim()).filter((o)=>o.length>0)}encodeValue(t,r){if(e.validateLength(t,zu,"Variable value"),r==="+"||r==="#")return encodeURI(t);return encodeURIComponent(t)}expandPart(t,r){if(t.operator==="?"||t.operator==="&"){let s=t.names.map((i)=>{let a=r[i];if(a===void 0)return"";return`${i}=${Array.isArray(a)?a.map((c)=>this.encodeValue(c,t.operator)).join(","):this.encodeValue(a.toString(),t.operator)}`}).filter((i)=>i.length>0);if(s.length===0)return"";return(t.operator==="?"?"?":"&")+s.join("&")}if(t.names.length>1){let s=t.names.map((i)=>r[i]).filter((i)=>i!==void 0);if(s.length===0)return"";return s.map((i)=>Array.isArray(i)?i[0]:i).join(",")}let o=r[t.name];if(o===void 0)return"";let n=(Array.isArray(o)?o:[o]).map((s)=>this.encodeValue(s,t.operator));switch(t.operator){case"":return n.join(",");case"+":return n.join(",");case"#":return"#"+n.join(",");case".":return"."+n.join(".");case"/":return"/"+n.join("/");default:return n.join(",")}}expand(t){let r="",o=!1;for(let n of this.parts){if(typeof n==="string"){r+=n;continue}let s=this.expandPart(n,t);if(!s)continue;if(r+=(n.operator==="?"||n.operator==="&")&&o?s.replace("?","&"):s,n.operator==="?"||n.operator==="&")o=!0}return r}escapeRegExp(t){return t.replaceAll(/[.*+?^${}()|[\]\\]/g,String.raw`\$&`)}partToRegExp(t){let r=[];for(let s of t.names)e.validateLength(s,zu,"Variable name");if(t.operator==="?"||t.operator==="&"){for(let s=0;s<t.names.length;s++){let i=t.names[s],a=s===0?"\\"+t.operator:"&";r.push({pattern:a+this.escapeRegExp(i)+"=([^&]+)",name:i})}return r}let o,n=t.name;switch(t.operator){case"":o=t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)";break;case"+":case"#":o="(.+)";break;case".":o=String.raw`\.([^/,]+)`;break;case"/":o="/"+(t.exploded?"([^/,]+(?:,[^/,]+)*)":"([^/,]+)");break;default:o="([^/]+)"}return r.push({pattern:o,name:n}),r}match(t){e.validateLength(t,$b,"URI");let r="^",o=[];for(let a of this.parts)if(typeof a==="string")r+=this.escapeRegExp(a);else{let c=this.partToRegExp(a);for(let{pattern:u,name:l}of c)r+=u,o.push({name:l,exploded:a.exploded})}r+="$",e.validateLength(r,eE,"Generated regex pattern");let n=new RegExp(r),s=t.match(n);if(!s)return null;let i={};for(let[a,c]of o.entries()){let{name:u,exploded:l}=c,d=s[a+1],m=u.replace("*","");i[m]=l&&d.includes(",")?d.split(","):d}return i}},L7=class e{_otherTransport;_messageQueue=[];_closed=!1;onclose;onerror;onmessage;sessionId;static createLinkedPair(){let t=new e,r=new e;return t._otherTransport=r,r._otherTransport=t,[t,r]}async start(){while(this._messageQueue.length>0){let t=this._messageQueue.shift();this.onmessage?.(t.message,t.extra)}}async close(){if(this._closed)return;this._closed=!0;let t=this._otherTransport;this._otherTransport=void 0;try{await t?.close()}finally{this.onclose?.()}}async send(t,r){if(!this._otherTransport)throw new it(lt.NotConnected,"Not connected");if(this._otherTransport.onmessage)this._otherTransport.onmessage(t,{authInfo:r?.authInfo});else this._otherTransport._messageQueue.push({message:t,extra:{authInfo:r?.authInfo}})}};function tE(e){return typeof e==="object"&&e!==null&&"_zod"in e}function rE(e){return typeof e==="object"&&e!==null&&!("_zod"in e)&&"_def"in e&&typeof e._def?.typeName==="string"}function oE(e){if(typeof e!=="object"||e===null)return!1;if(to(e))return!1;let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return!1;return Object.values(e).every((r)=>tE(r))}function Ri(e){if(e===void 0)return;if(oE(e))return Z(e);if(typeof e==="object"&&e!==null&&!to(e)&&Object.values(e).some((t)=>rE(t)))throw TypeError("Raw-shape inputSchema/outputSchema/argsSchema fields must be Zod v4 schemas. Got a Zod v3 field schema. Import from `zod/v4` (or upgrade your zod import), or wrap with `z.object({...})` yourself.");if(!to(e))throw TypeError("inputSchema/outputSchema/argsSchema must be a Standard Schema (e.g. z.object({...})) or a raw Zod shape ({ field: z.string() }).");return e}var wi=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var r=class extends t{constructor(g){super();if(!e.IDENTIFIER.test(g))throw Error("CodeGen: name must be a valid identifier");this.str=g}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=r;var o=class extends t{constructor(g){super();this._items=typeof g==="string"?[g]:g}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let g=this._items[0];return g===""||g==='""'}get str(){var g;return(g=this._str)!==null&&g!==void 0?g:this._str=this._items.reduce((P,w)=>`${P}${w}`,"")}get names(){var g;return(g=this._names)!==null&&g!==void 0?g:this._names=this._items.reduce((P,w)=>{if(w instanceof r)P[w.str]=(P[w.str]||0)+1;return P},{})}};e._Code=o,e.nil=new o("");function n(g,...P){let w=[g[0]],E=0;while(E<P.length)a(w,P[E]),w.push(g[++E]);return new o(w)}e._=n;let s=new o("+");function i(g,...P){let w=[h(g[0])],E=0;while(E<P.length)w.push(s),a(w,P[E]),w.push(s,h(g[++E]));return c(w),new o(w)}e.str=i;function a(g,P){if(P instanceof o)g.push(...P._items);else if(P instanceof r)g.push(P);else g.push(d(P))}e.addCodeArg=a;function c(g){let P=1;while(P<g.length-1){if(g[P]===s){let w=u(g[P-1],g[P+1]);if(w!==void 0){g.splice(P-1,3,w);continue}g[P++]="+"}P++}}function u(g,P){if(P==='""')return g;if(g==='""')return P;if(typeof g=="string"){if(P instanceof r||g[g.length-1]!=='"')return;if(typeof P!="string")return`${g.slice(0,-1)}${P}"`;if(P[0]==='"')return g.slice(0,-1)+P.slice(1);return}if(typeof P=="string"&&P[0]==='"'&&!(g instanceof r))return`"${g}${P.slice(1)}`}function l(g,P){return P.emptyStr()?g:g.emptyStr()?P:i`${g}${P}`}e.strConcat=l;function d(g){return typeof g=="number"||typeof g=="boolean"||g===null?g:h(Array.isArray(g)?g.join(","):g)}function m(g){return new o(h(g))}e.stringify=m;function h(g){return JSON.stringify(g).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}e.safeStringify=h;function f(g){return typeof g=="string"&&e.IDENTIFIER.test(g)?new o(`.${g}`):n`[${g}]`}e.getProperty=f;function v(g){if(typeof g=="string"&&e.IDENTIFIER.test(g))return new o(`${g}`);throw Error(`CodeGen: invalid export name: ${g}, use explicit $id name mapping`)}e.getEsmExportName=v;function y(g){return new o(g.toString())}e.regexpCode=y}),sz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;let t=wi();var r=class extends Error{constructor(c){super(`CodeGen: "code" for ${c} not defined`);this.value=c.value}},o;(function(c){c[c.Started=0]="Started",c[c.Completed=1]="Completed"})(o||(e.UsedValueState=o={})),e.varKinds={const:new t.Name("const"),let:new t.Name("let"),var:new t.Name("var")};var n=class{constructor({prefixes:c,parent:u}={}){this._names={},this._prefixes=c,this._parent=u}toName(c){return c instanceof t.Name?c:this.name(c)}name(c){return new t.Name(this._newName(c))}_newName(c){let u=this._names[c]||this._nameGroup(c);return`${c}${u.index++}`}_nameGroup(c){var u,l;if(((l=(u=this._parent)===null||u===void 0?void 0:u._prefixes)===null||l===void 0?void 0:l.has(c))||this._prefixes&&!this._prefixes.has(c))throw Error(`CodeGen: prefix "${c}" is not allowed in this scope`);return this._names[c]={prefix:c,index:0}}};e.Scope=n;var s=class extends t.Name{constructor(c,u){super(u);this.prefix=c}setValue(c,{property:u,itemIndex:l}){this.value=c,this.scopePath=t._`.${new t.Name(u)}[${l}]`}};e.ValueScopeName=s;let i=t._`\n`;var a=class extends n{constructor(c){super(c);this._values={},this._scope=c.scope,this.opts={...c,_n:c.lines?i:t.nil}}get(){return this._scope}name(c){return new s(c,this._newName(c))}value(c,u){var l;if(u.ref===void 0)throw Error("CodeGen: ref must be passed in value");let d=this.toName(c),{prefix:m}=d,h=(l=u.key)!==null&&l!==void 0?l:u.ref,f=this._values[m];if(f){let g=f.get(h);if(g)return g}else f=this._values[m]=new Map;f.set(h,d);let v=this._scope[m]||(this._scope[m]=[]),y=v.length;return v[y]=u.ref,d.setValue(u,{property:m,itemIndex:y}),d}getValue(c,u){let l=this._values[c];if(!l)return;return l.get(u)}scopeRefs(c,u=this._values){return this._reduceValues(u,(l)=>{if(l.scopePath===void 0)throw Error(`CodeGen: name "${l}" has no value`);return t._`${c}${l.scopePath}`})}scopeCode(c=this._values,u,l){return this._reduceValues(c,(d)=>{if(d.value===void 0)throw Error(`CodeGen: name "${d}" has no value`);return d.value.code},u,l)}_reduceValues(c,u,l={},d){let m=t.nil;for(let h in c){let f=c[h];if(!f)continue;let v=l[h]=l[h]||new Map;f.forEach((y)=>{if(v.has(y))return;v.set(y,o.Started);let g=u(y);if(g){let P=this.opts.es5?e.varKinds.var:e.varKinds.const;m=t._`${m}${P} ${y} = ${g};${this.opts._n}`}else if(g=d===null||d===void 0?void 0:d(y))m=t._`${m}${g}${this.opts._n}`;else throw new r(y);v.set(y,o.Completed)})}return m}};e.ValueScope=a}),de=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;let t=wi(),r=sz();var o=wi();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return o.Name}});var n=sz();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return n.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return n.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return n.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return n.varKinds}}),e.operators={GT:new t._Code(">"),GTE:new t._Code(">="),LT:new t._Code("<"),LTE:new t._Code("<="),EQ:new t._Code("==="),NEQ:new t._Code("!=="),NOT:new t._Code("!"),OR:new t._Code("||"),AND:new t._Code("&&"),ADD:new t._Code("+")};var s=class{optimizeNodes(){return this}optimizeNames(p,_){return this}},i=class extends s{constructor(p,_,z){super();this.varKind=p,this.name=_,this.rhs=z}render({es5:p,_n:_}){let z=p?r.varKinds.var:this.varKind,I=this.rhs===void 0?"":` = ${this.rhs}`;return`${z} ${this.name}${I};`+_}optimizeNames(p,_){if(!p[this.name.str])return;if(this.rhs)this.rhs=Y(this.rhs,p,_);return this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},a=class extends s{constructor(p,_,z){super();this.lhs=p,this.rhs=_,this.sideEffects=z}render({_n:p}){return`${this.lhs} = ${this.rhs};`+p}optimizeNames(p,_){if(this.lhs instanceof t.Name&&!p[this.lhs.str]&&!this.sideEffects)return;return this.rhs=Y(this.rhs,p,_),this}get names(){return W(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends a{constructor(p,_,z,I){super(p,z,I);this.op=_}render({_n:p}){return`${this.lhs} ${this.op}= ${this.rhs};`+p}},u=class extends s{constructor(p){super();this.label=p,this.names={}}render({_n:p}){return`${this.label}:`+p}},l=class extends s{constructor(p){super();this.label=p,this.names={}}render({_n:p}){return`break${this.label?` ${this.label}`:""};`+p}},d=class extends s{constructor(p){super();this.error=p}render({_n:p}){return`throw ${this.error};`+p}get names(){return this.error.names}},m=class extends s{constructor(p){super();this.code=p}render({_n:p}){return`${this.code};`+p}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(p,_){return this.code=Y(this.code,p,_),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},h=class extends s{constructor(p=[]){super();this.nodes=p}render(p){return this.nodes.reduce((_,z)=>_+z.render(p),"")}optimizeNodes(){let{nodes:p}=this,_=p.length;while(_--){let z=p[_].optimizeNodes();if(Array.isArray(z))p.splice(_,1,...z);else if(z)p[_]=z;else p.splice(_,1)}return p.length>0?this:void 0}optimizeNames(p,_){let{nodes:z}=this,I=z.length;while(I--){let U=z[I];if(U.optimizeNames(p,_))continue;ae(p,U.names),z.splice(I,1)}return z.length>0?this:void 0}get names(){return this.nodes.reduce((p,_)=>V(p,_.names),{})}},f=class extends h{render(p){return"{"+p._n+super.render(p)+"}"+p._n}},v=class extends h{},y=class extends f{};y.kind="else";var g=class p extends f{constructor(_,z){super(z);this.condition=_}render(_){let z=`if(${this.condition})`+super.render(_);if(this.else)z+="else "+this.else.render(_);return z}optimizeNodes(){super.optimizeNodes();let _=this.condition;if(_===!0)return this.nodes;let z=this.else;if(z){let I=z.optimizeNodes();z=this.else=Array.isArray(I)?new y(I):I}if(z){if(_===!1)return z instanceof p?z:z.nodes;if(this.nodes.length)return this;return new p(we(_),z instanceof p?[z]:z.nodes)}if(_===!1||!this.nodes.length)return;return this}optimizeNames(_,z){var I;if(this.else=(I=this.else)===null||I===void 0?void 0:I.optimizeNames(_,z),!(super.optimizeNames(_,z)||this.else))return;return this.condition=Y(this.condition,_,z),this}get names(){let _=super.names;if(W(_,this.condition),this.else)V(_,this.else.names);return _}};g.kind="if";var P=class extends f{};P.kind="for";var w=class extends P{constructor(p){super();this.iteration=p}render(p){return`for(${this.iteration})`+super.render(p)}optimizeNames(p,_){if(!super.optimizeNames(p,_))return;return this.iteration=Y(this.iteration,p,_),this}get names(){return V(super.names,this.iteration.names)}},E=class extends P{constructor(p,_,z,I){super();this.varKind=p,this.name=_,this.from=z,this.to=I}render(p){let _=p.es5?r.varKinds.var:this.varKind,{name:z,from:I,to:U}=this;return`for(${_} ${z}=${I}; ${z}<${U}; ${z}++)`+super.render(p)}get names(){return W(W(super.names,this.from),this.to)}},C=class extends P{constructor(p,_,z,I){super();this.loop=p,this.varKind=_,this.name=z,this.iterable=I}render(p){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(p)}optimizeNames(p,_){if(!super.optimizeNames(p,_))return;return this.iterable=Y(this.iterable,p,_),this}get names(){return V(super.names,this.iterable.names)}},R=class extends f{constructor(p,_,z){super();this.name=p,this.args=_,this.async=z}render(p){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(p)}};R.kind="func";var S=class extends h{render(p){return"return "+super.render(p)}};S.kind="return";var T=class extends f{render(p){let _="try"+super.render(p);if(this.catch)_+=this.catch.render(p);if(this.finally)_+=this.finally.render(p);return _}optimizeNodes(){var p,_;return super.optimizeNodes(),(p=this.catch)===null||p===void 0||p.optimizeNodes(),(_=this.finally)===null||_===void 0||_.optimizeNodes(),this}optimizeNames(p,_){var z,I;return super.optimizeNames(p,_),(z=this.catch)===null||z===void 0||z.optimizeNames(p,_),(I=this.finally)===null||I===void 0||I.optimizeNames(p,_),this}get names(){let p=super.names;if(this.catch)V(p,this.catch.names);if(this.finally)V(p,this.finally.names);return p}},A=class extends f{constructor(p){super();this.error=p}render(p){return`catch(${this.error})`+super.render(p)}};A.kind="catch";var H=class extends f{render(p){return"finally"+super.render(p)}};H.kind="finally";var j=class{constructor(p,_={}){this._values={},this._blockStarts=[],this._constants={},this.opts={..._,_n:_.lines?`
|
|
121
|
-
`:""},this._extScope=p,this._scope=new r.Scope({parent:p}),this._nodes=[new v]}toString(){return this._root.render(this.opts)}name(p){return this._scope.name(p)}scopeName(p){return this._extScope.name(p)}scopeValue(p,_){let z=this._extScope.value(p,_);return(this._values[z.prefix]||(this._values[z.prefix]=new Set)).add(z),z}getScopeValue(p,_){return this._extScope.getValue(p,_)}scopeRefs(p){return this._extScope.scopeRefs(p,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(p,_,z,I){let U=this._scope.toName(_);if(z!==void 0&&I)this._constants[U.str]=z;return this._leafNode(new i(p,U,z)),U}const(p,_,z){return this._def(r.varKinds.const,p,_,z)}let(p,_,z){return this._def(r.varKinds.let,p,_,z)}var(p,_,z){return this._def(r.varKinds.var,p,_,z)}assign(p,_,z){return this._leafNode(new a(p,_,z))}add(p,_){return this._leafNode(new c(p,e.operators.ADD,_))}code(p){if(typeof p=="function")p();else if(p!==t.nil)this._leafNode(new m(p));return this}object(...p){let _=["{"];for(let[z,I]of p){if(_.length>1)_.push(",");if(_.push(z),z!==I||this.opts.es5)_.push(":"),(0,t.addCodeArg)(_,I)}return _.push("}"),new t._Code(_)}if(p,_,z){if(this._blockNode(new g(p)),_&&z)this.code(_).else().code(z).endIf();else if(_)this.code(_).endIf();else if(z)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(p){return this._elseNode(new g(p))}else(){return this._elseNode(new y)}endIf(){return this._endBlockNode(g,y)}_for(p,_){if(this._blockNode(p),_)this.code(_).endFor();return this}for(p,_){return this._for(new w(p),_)}forRange(p,_,z,I,U=this.opts.es5?r.varKinds.var:r.varKinds.let){let G=this._scope.toName(p);return this._for(new E(U,G,_,z),()=>I(G))}forOf(p,_,z,I=r.varKinds.const){let U=this._scope.toName(p);if(this.opts.es5){let G=_ instanceof t.Name?_:this.var("_arr",_);return this.forRange("_i",0,t._`${G}.length`,(K)=>{this.var(U,t._`${G}[${K}]`),z(U)})}return this._for(new C("of",I,U,_),()=>z(U))}forIn(p,_,z,I=this.opts.es5?r.varKinds.var:r.varKinds.const){if(this.opts.ownProperties)return this.forOf(p,t._`Object.keys(${_})`,z);let U=this._scope.toName(p);return this._for(new C("in",I,U,_),()=>z(U))}endFor(){return this._endBlockNode(P)}label(p){return this._leafNode(new u(p))}break(p){return this._leafNode(new l(p))}return(p){let _=new S;if(this._blockNode(_),this.code(p),_.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(S)}try(p,_,z){if(!_&&!z)throw Error('CodeGen: "try" without "catch" and "finally"');let I=new T;if(this._blockNode(I),this.code(p),_){let U=this.name("e");this._currNode=I.catch=new A(U),_(U)}if(z)this._currNode=I.finally=new H,this.code(z);return this._endBlockNode(A,H)}throw(p){return this._leafNode(new d(p))}block(p,_){if(this._blockStarts.push(this._nodes.length),p)this.code(p).endBlock(_);return this}endBlock(p){let _=this._blockStarts.pop();if(_===void 0)throw Error("CodeGen: not in self-balancing block");let z=this._nodes.length-_;if(z<0||p!==void 0&&z!==p)throw Error(`CodeGen: wrong number of nodes: ${z} vs ${p} expected`);return this._nodes.length=_,this}func(p,_=t.nil,z,I){if(this._blockNode(new R(p,_,z)),I)this.code(I).endFunc();return this}endFunc(){return this._endBlockNode(R)}optimize(p=1){while(p-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(p){return this._currNode.nodes.push(p),this}_blockNode(p){this._currNode.nodes.push(p),this._nodes.push(p)}_endBlockNode(p,_){let z=this._currNode;if(z instanceof p||_&&z instanceof _)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${_?`${p.kind}/${_.kind}`:p.kind}"`)}_elseNode(p){let _=this._currNode;if(!(_ instanceof g))throw Error('CodeGen: "else" without "if"');return this._currNode=_.else=p,this}get _root(){return this._nodes[0]}get _currNode(){let p=this._nodes;return p[p.length-1]}set _currNode(p){let _=this._nodes;_[_.length-1]=p}};e.CodeGen=j;function V(p,_){for(let z in _)p[z]=(p[z]||0)+(_[z]||0);return p}function W(p,_){return _ instanceof t._CodeOrName?V(p,_.names):p}function Y(p,_,z){if(p instanceof t.Name)return I(p);if(!U(p))return p;return new t._Code(p._items.reduce((G,K)=>{if(K instanceof t.Name)K=I(K);if(K instanceof t._Code)G.push(...K._items);else G.push(K);return G},[]));function I(G){let K=z[G.str];if(K===void 0||_[G.str]!==1)return G;return delete _[G.str],K}function U(G){return G instanceof t._Code&&G._items.some((K)=>K instanceof t.Name&&_[K.str]===1&&z[K.str]!==void 0)}}function ae(p,_){for(let z in _)p[z]=(p[z]||0)-(_[z]||0)}function we(p){return typeof p=="boolean"||typeof p=="number"||p===null?!p:t._`!${b(p)}`}e.not=we;let Re=M(e.operators.AND);function Ce(...p){return p.reduce(Re)}e.and=Ce;let pe=M(e.operators.OR);function N(...p){return p.reduce(pe)}e.or=N;function M(p){return(_,z)=>_===t.nil?z:z===t.nil?_:t._`${b(_)} ${p} ${b(z)}`}function b(p){return p instanceof t.Name?p:t._`(${p})`}}),ye=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;let t=de(),r=wi();function o(R){let S={};for(let T of R)S[T]=!0;return S}e.toHash=o;function n(R,S){if(typeof S=="boolean")return S;if(Object.keys(S).length===0)return!0;return s(R,S),!i(S,R.self.RULES.all)}e.alwaysValidSchema=n;function s(R,S=R.schema){let{opts:T,self:A}=R;if(!T.strictSchema)return;if(typeof S==="boolean")return;let H=A.RULES.keywords;for(let j in S)if(!H[j])C(R,`unknown keyword: "${j}"`)}e.checkUnknownRules=s;function i(R,S){if(typeof R=="boolean")return!R;for(let T in R)if(S[T])return!0;return!1}e.schemaHasRules=i;function a(R,S){if(typeof R=="boolean")return!R;for(let T in R)if(T!=="$ref"&&S.all[T])return!0;return!1}e.schemaHasRulesButRef=a;function c({topSchemaRef:R,schemaPath:S},T,A,H){if(!H){if(typeof T=="number"||typeof T=="boolean")return T;if(typeof T=="string")return t._`${T}`}return t._`${R}${S}${(0,t.getProperty)(A)}`}e.schemaRefOrVal=c;function u(R){return m(decodeURIComponent(R))}e.unescapeFragment=u;function l(R){return encodeURIComponent(d(R))}e.escapeFragment=l;function d(R){if(typeof R=="number")return`${R}`;return R.replace(/~/g,"~0").replace(/\//g,"~1")}e.escapeJsonPointer=d;function m(R){return R.replace(/~1/g,"/").replace(/~0/g,"~")}e.unescapeJsonPointer=m;function h(R,S){if(Array.isArray(R))for(let T of R)S(T);else S(R)}e.eachItem=h;function f({mergeNames:R,mergeToName:S,mergeValues:T,resultToName:A}){return(H,j,V,W)=>{let Y=V===void 0?j:V instanceof t.Name?(j instanceof t.Name?R(H,j,V):S(H,j,V),V):j instanceof t.Name?(S(H,V,j),j):T(j,V);return W===t.Name&&!(Y instanceof t.Name)?A(H,Y):Y}}e.mergeEvaluated={props:f({mergeNames:(R,S,T)=>R.if(t._`${T} !== true && ${S} !== undefined`,()=>{R.if(t._`${S} === true`,()=>R.assign(T,!0),()=>R.assign(T,t._`${T} || {}`).code(t._`Object.assign(${T}, ${S})`))}),mergeToName:(R,S,T)=>R.if(t._`${T} !== true`,()=>{if(S===!0)R.assign(T,!0);else R.assign(T,t._`${T} || {}`),y(R,T,S)}),mergeValues:(R,S)=>R===!0?!0:{...R,...S},resultToName:v}),items:f({mergeNames:(R,S,T)=>R.if(t._`${T} !== true && ${S} !== undefined`,()=>R.assign(T,t._`${S} === true ? true : ${T} > ${S} ? ${T} : ${S}`)),mergeToName:(R,S,T)=>R.if(t._`${T} !== true`,()=>R.assign(T,S===!0?!0:t._`${T} > ${S} ? ${T} : ${S}`)),mergeValues:(R,S)=>R===!0?!0:Math.max(R,S),resultToName:(R,S)=>R.var("items",S)})};function v(R,S){if(S===!0)return R.var("props",!0);let T=R.var("props",t._`{}`);if(S!==void 0)y(R,T,S);return T}e.evaluatedPropsToName=v;function y(R,S,T){Object.keys(T).forEach((A)=>R.assign(t._`${S}${(0,t.getProperty)(A)}`,!0))}e.setEvaluated=y;let g={};function P(R,S){return R.scopeValue("func",{ref:S,code:g[S.code]||(g[S.code]=new r._Code(S.code))})}e.useFunc=P;var w;(function(R){R[R.Num=0]="Num",R[R.Str=1]="Str"})(w||(e.Type=w={}));function E(R,S,T){if(R instanceof t.Name){let A=S===w.Num;return T?A?t._`"[" + ${R} + "]"`:t._`"['" + ${R} + "']"`:A?t._`"/" + ${R}`:t._`"/" + ${R}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return T?(0,t.getProperty)(R).toString():"/"+d(R)}e.getErrorPath=E;function C(R,S,T=R.opts.strictSchema){if(!T)return;if(S=`strict mode: ${S}`,T===!0)throw Error(S);R.self.logger.warn(S)}e.checkStrictMode=C}),kt=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={data:new t.Name("data"),valCxt:new t.Name("valCxt"),instancePath:new t.Name("instancePath"),parentData:new t.Name("parentData"),parentDataProperty:new t.Name("parentDataProperty"),rootData:new t.Name("rootData"),dynamicAnchors:new t.Name("dynamicAnchors"),vErrors:new t.Name("vErrors"),errors:new t.Name("errors"),this:new t.Name("this"),self:new t.Name("self"),scope:new t.Name("scope"),json:new t.Name("json"),jsonPos:new t.Name("jsonPos"),jsonLen:new t.Name("jsonLen"),jsonPart:new t.Name("jsonPart")};e.default=r}),xi=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;let t=de(),r=ye(),o=kt();e.keywordError={message:({keyword:y})=>t.str`must pass "${y}" keyword validation`},e.keyword$DataError={message:({keyword:y,schemaType:g})=>g?t.str`"${y}" keyword must be ${g} ($data)`:t.str`"${y}" keyword is invalid ($data)`};function n(y,g=e.keywordError,P,w){let{it:E}=y,{gen:C,compositeRule:R,allErrors:S}=E,T=d(y,g,P);if(w!==null&&w!==void 0?w:R||S)c(C,T);else u(E,t._`[${T}]`)}e.reportError=n;function s(y,g=e.keywordError,P){let{it:w}=y,{gen:E,compositeRule:C,allErrors:R}=w;if(c(E,d(y,g,P)),!(C||R))u(w,o.default.vErrors)}e.reportExtraError=s;function i(y,g){y.assign(o.default.errors,g),y.if(t._`${o.default.vErrors} !== null`,()=>y.if(g,()=>y.assign(t._`${o.default.vErrors}.length`,g),()=>y.assign(o.default.vErrors,null)))}e.resetErrorsCount=i;function a({gen:y,keyword:g,schemaValue:P,data:w,errsCount:E,it:C}){if(E===void 0)throw Error("ajv implementation error");let R=y.name("err");y.forRange("i",E,o.default.errors,(S)=>{if(y.const(R,t._`${o.default.vErrors}[${S}]`),y.if(t._`${R}.instancePath === undefined`,()=>y.assign(t._`${R}.instancePath`,(0,t.strConcat)(o.default.instancePath,C.errorPath))),y.assign(t._`${R}.schemaPath`,t.str`${C.errSchemaPath}/${g}`),C.opts.verbose)y.assign(t._`${R}.schema`,P),y.assign(t._`${R}.data`,w)})}e.extendErrors=a;function c(y,g){let P=y.const("err",g);y.if(t._`${o.default.vErrors} === null`,()=>y.assign(o.default.vErrors,t._`[${P}]`),t._`${o.default.vErrors}.push(${P})`),y.code(t._`${o.default.errors}++`)}function u(y,g){let{gen:P,validateName:w,schemaEnv:E}=y;if(E.$async)P.throw(t._`new ${y.ValidationError}(${g})`);else P.assign(t._`${w}.errors`,g),P.return(!1)}let l={keyword:new t.Name("keyword"),schemaPath:new t.Name("schemaPath"),params:new t.Name("params"),propertyName:new t.Name("propertyName"),message:new t.Name("message"),schema:new t.Name("schema"),parentSchema:new t.Name("parentSchema")};function d(y,g,P){let{createErrors:w}=y.it;if(w===!1)return t._`{}`;return m(y,g,P)}function m(y,g,P={}){let{gen:w,it:E}=y,C=[h(E,P),f(y,P)];return v(y,g,C),w.object(...C)}function h({errorPath:y},{instancePath:g}){let P=g?t.str`${y}${(0,r.getErrorPath)(g,r.Type.Str)}`:y;return[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,P)]}function f({keyword:y,it:{errSchemaPath:g}},{schemaPath:P,parentSchema:w}){let E=w?g:t.str`${g}/${y}`;if(P)E=t.str`${E}${(0,r.getErrorPath)(P,r.Type.Str)}`;return[l.schemaPath,E]}function v(y,{params:g,message:P},w){let{keyword:E,data:C,schemaValue:R,it:S}=y,{opts:T,propertyName:A,topSchemaRef:H,schemaPath:j}=S;if(w.push([l.keyword,E],[l.params,typeof g=="function"?g(y):g||t._`{}`]),T.messages)w.push([l.message,typeof P=="function"?P(y):P]);if(T.verbose)w.push([l.schema,R],[l.parentSchema,t._`${H}${j}`],[o.default.data,C]);if(A)w.push([l.propertyName,A])}}),nE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;let t=xi(),r=de(),o=kt(),n={message:"boolean schema is false"};function s(c){let{gen:u,schema:l,validateName:d}=c;if(l===!1)a(c,!1);else if(typeof l=="object"&&l.$async===!0)u.return(o.default.data);else u.assign(r._`${d}.errors`,null),u.return(!0)}e.topBoolOrEmptySchema=s;function i(c,u){let{gen:l,schema:d}=c;if(d===!1)l.var(u,!1),a(c);else l.var(u,!0)}e.boolOrEmptySchema=i;function a(c,u){let{gen:l,data:d}=c,m={gen:l,keyword:"false schema",data:d,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:c};(0,t.reportError)(m,n,void 0,u)}}),iz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;let t=new Set(["string","number","integer","boolean","null","object","array"]);function r(n){return typeof n=="string"&&t.has(n)}e.isJSONType=r;function o(){let n={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...n,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},n.number,n.string,n.array,n.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=o}),az=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:n,self:s},i){let a=s.RULES.types[i];return a&&a!==!0&&r(n,a)}e.schemaHasRulesForType=t;function r(n,s){return s.rules.some((i)=>o(n,i))}e.shouldUseGroup=r;function o(n,s){var i;return n[s.keyword]!==void 0||((i=s.definition.implements)===null||i===void 0?void 0:i.some((a)=>n[a]!==void 0))}e.shouldUseRule=o}),ki=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;let t=iz(),r=az(),o=xi(),n=de(),s=ye();var i;(function(w){w[w.Correct=0]="Correct",w[w.Wrong=1]="Wrong"})(i||(e.DataType=i={}));function a(w){let E=c(w.type);if(E.includes("null")){if(w.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!E.length&&w.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(w.nullable===!0)E.push("null")}return E}e.getSchemaTypes=a;function c(w){let E=Array.isArray(w)?w:w?[w]:[];if(E.every(t.isJSONType))return E;throw Error("type must be JSONType or JSONType[]: "+E.join(","))}e.getJSONTypes=c;function u(w,E){let{gen:C,data:R,opts:S}=w,T=d(E,S.coerceTypes),A=E.length>0&&!(T.length===0&&E.length===1&&(0,r.schemaHasRulesForType)(w,E[0]));if(A){let H=v(E,R,S.strictNumbers,i.Wrong);C.if(H,()=>{if(T.length)m(w,E,T);else g(w)})}return A}e.coerceAndCheckDataType=u;let l=new Set(["string","number","integer","boolean","null"]);function d(w,E){return E?w.filter((C)=>l.has(C)||E==="array"&&C==="array"):[]}function m(w,E,C){let{gen:R,data:S,opts:T}=w,A=R.let("dataType",n._`typeof ${S}`),H=R.let("coerced",n._`undefined`);if(T.coerceTypes==="array")R.if(n._`${A} == 'object' && Array.isArray(${S}) && ${S}.length == 1`,()=>R.assign(S,n._`${S}[0]`).assign(A,n._`typeof ${S}`).if(v(E,S,T.strictNumbers),()=>R.assign(H,S)));R.if(n._`${H} !== undefined`);for(let V of C)if(l.has(V)||V==="array"&&T.coerceTypes==="array")j(V);R.else(),g(w),R.endIf(),R.if(n._`${H} !== undefined`,()=>{R.assign(S,H),h(w,H)});function j(V){switch(V){case"string":R.elseIf(n._`${A} == "number" || ${A} == "boolean"`).assign(H,n._`"" + ${S}`).elseIf(n._`${S} === null`).assign(H,n._`""`);return;case"number":R.elseIf(n._`${A} == "boolean" || ${S} === null
|
|
122
|
-
|| (${A} == "string" && ${S} && ${S} == +${S})`).assign(H,n._`+${S}`);return;case"integer":R.elseIf(n._`${A} === "boolean" || ${S} === null
|
|
123
|
-
|| (${A} === "string" && ${S} && ${S} == +${S} && !(${S} % 1))`).assign(H,n._`+${S}`);return;case"boolean":R.elseIf(n._`${S} === "false" || ${S} === 0 || ${S} === null`).assign(H,!1).elseIf(n._`${S} === "true" || ${S} === 1`).assign(H,!0);return;case"null":R.elseIf(n._`${S} === "" || ${S} === 0 || ${S} === false`),R.assign(H,null);return;case"array":R.elseIf(n._`${A} === "string" || ${A} === "number"
|
|
124
|
-
|| ${A} === "boolean" || ${S} === null`).assign(H,n._`[${S}]`)}}}function h({gen:w,parentData:E,parentDataProperty:C},R){w.if(n._`${E} !== undefined`,()=>w.assign(n._`${E}[${C}]`,R))}function f(w,E,C,R=i.Correct){let S=R===i.Correct?n.operators.EQ:n.operators.NEQ,T;switch(w){case"null":return n._`${E} ${S} null`;case"array":T=n._`Array.isArray(${E})`;break;case"object":T=n._`${E} && typeof ${E} == "object" && !Array.isArray(${E})`;break;case"integer":T=A(n._`!(${E} % 1) && !isNaN(${E})`);break;case"number":T=A();break;default:return n._`typeof ${E} ${S} ${w}`}return R===i.Correct?T:(0,n.not)(T);function A(H=n.nil){return(0,n.and)(n._`typeof ${E} == "number"`,H,C?n._`isFinite(${E})`:n.nil)}}e.checkDataType=f;function v(w,E,C,R){if(w.length===1)return f(w[0],E,C,R);let S,T=(0,s.toHash)(w);if(T.array&&T.object){let A=n._`typeof ${E} != "object"`;S=T.null?A:n._`!${E} || ${A}`,delete T.null,delete T.array,delete T.object}else S=n.nil;if(T.number)delete T.integer;for(let A in T)S=(0,n.and)(S,f(A,E,C,R));return S}e.checkDataTypes=v;let y={message:({schema:w})=>`must be ${w}`,params:({schema:w,schemaValue:E})=>typeof w=="string"?n._`{type: ${w}}`:n._`{type: ${E}}`};function g(w){let E=P(w);(0,o.reportError)(E,y)}e.reportTypeError=g;function P(w){let{gen:E,data:C,schema:R}=w,S=(0,s.schemaRefOrVal)(w,R,"type");return{gen:E,keyword:"type",data:C,schema:R.type,schemaCode:S,schemaValue:S,parentSchema:R,params:{},it:w}}}),sE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;let t=de(),r=ye();function o(s,i){let{properties:a,items:c}=s.schema;if(i==="object"&&a)for(let u in a)n(s,u,a[u].default);else if(i==="array"&&Array.isArray(c))c.forEach((u,l)=>n(s,l,u.default))}e.assignDefaults=o;function n(s,i,a){let{gen:c,compositeRule:u,data:l,opts:d}=s;if(a===void 0)return;let m=t._`${l}${(0,t.getProperty)(i)}`;if(u){(0,r.checkStrictMode)(s,`default is ignored for: ${m}`);return}let h=t._`${m} === undefined`;if(d.useDefaults==="empty")h=t._`${h} || ${m} === null || ${m} === ""`;c.if(h,t._`${m} = ${(0,t.stringify)(a)}`)}}),xt=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;let t=de(),r=ye(),o=kt(),n=ye();function s(w,E){let{gen:C,data:R,it:S}=w;C.if(d(C,R,E,S.opts.ownProperties),()=>{w.setParams({missingProperty:t._`${E}`},!0),w.error()})}e.checkReportMissingProp=s;function i({gen:w,data:E,it:{opts:C}},R,S){return(0,t.or)(...R.map((T)=>(0,t.and)(d(w,E,T,C.ownProperties),t._`${S} = ${T}`)))}e.checkMissingProp=i;function a(w,E){w.setParams({missingProperty:E},!0),w.error()}e.reportMissingProp=a;function c(w){return w.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:t._`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function u(w,E,C){return t._`${c(w)}.call(${E}, ${C})`}e.isOwnProperty=u;function l(w,E,C,R){let S=t._`${E}${(0,t.getProperty)(C)} !== undefined`;return R?t._`${S} && ${u(w,E,C)}`:S}e.propertyInData=l;function d(w,E,C,R){let S=t._`${E}${(0,t.getProperty)(C)} === undefined`;return R?(0,t.or)(S,(0,t.not)(u(w,E,C))):S}e.noPropertyInData=d;function m(w){return w?Object.keys(w).filter((E)=>E!=="__proto__"):[]}e.allSchemaProperties=m;function h(w,E){return m(E).filter((C)=>!(0,r.alwaysValidSchema)(w,E[C]))}e.schemaProperties=h;function f({schemaCode:w,data:E,it:{gen:C,topSchemaRef:R,schemaPath:S,errorPath:T},it:A},H,j,V){let W=V?t._`${w}, ${E}, ${R}${S}`:E,Y=[[o.default.instancePath,(0,t.strConcat)(o.default.instancePath,T)],[o.default.parentData,A.parentData],[o.default.parentDataProperty,A.parentDataProperty],[o.default.rootData,o.default.rootData]];if(A.opts.dynamicRef)Y.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let ae=t._`${W}, ${C.object(...Y)}`;return j!==t.nil?t._`${H}.call(${j}, ${ae})`:t._`${H}(${ae})`}e.callValidateCode=f;let v=t._`new RegExp`;function y({gen:w,it:{opts:E}},C){let R=E.unicodeRegExp?"u":"",{regExp:S}=E.code,T=S(C,R);return w.scopeValue("pattern",{key:T.toString(),ref:T,code:t._`${S.code==="new RegExp"?v:(0,n.useFunc)(w,S)}(${C}, ${R})`})}e.usePattern=y;function g(w){let{gen:E,data:C,keyword:R,it:S}=w,T=E.name("valid");if(S.allErrors){let H=E.let("valid",!0);return A(()=>E.assign(H,!1)),H}return E.var(T,!0),A(()=>E.break()),T;function A(H){let j=E.const("len",t._`${C}.length`);E.forRange("i",0,j,(V)=>{w.subschema({keyword:R,dataProp:V,dataPropType:r.Type.Num},T),E.if((0,t.not)(T),H)})}}e.validateArray=g;function P(w){let{gen:E,schema:C,keyword:R,it:S}=w;if(!Array.isArray(C))throw Error("ajv implementation error");if(C.some((H)=>(0,r.alwaysValidSchema)(S,H))&&!S.opts.unevaluated)return;let T=E.let("valid",!1),A=E.name("_valid");E.block(()=>C.forEach((H,j)=>{let V=w.subschema({keyword:R,schemaProp:j,compositeRule:!0},A);if(E.assign(T,t._`${T} || ${A}`),!w.mergeValidEvaluated(V,A))E.if((0,t.not)(T))})),w.result(T,()=>w.reset(),()=>w.error(!0))}e.validateUnion=P}),iE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;let t=de(),r=kt(),o=xt(),n=xi();function s(h,f){let{gen:v,keyword:y,schema:g,parentSchema:P,it:w}=h,E=f.macro.call(w.self,g,P,w),C=l(v,y,E);if(w.opts.validateSchema!==!1)w.self.validateSchema(E,!0);let R=v.name("valid");h.subschema({schema:E,schemaPath:t.nil,errSchemaPath:`${w.errSchemaPath}/${y}`,topSchemaRef:C,compositeRule:!0},R),h.pass(R,()=>h.error(!0))}e.macroKeywordCode=s;function i(h,f){var v;let{gen:y,keyword:g,schema:P,parentSchema:w,$data:E,it:C}=h;u(C,f);let R=l(y,g,!E&&f.compile?f.compile.call(C.self,P,w,C):f.validate),S=y.let("valid");h.block$data(S,T),h.ok((v=f.valid)!==null&&v!==void 0?v:S);function T(){if(f.errors===!1){if(j(),f.modifying)a(h);V(()=>h.error())}else{let W=f.async?A():H();if(f.modifying)a(h);V(()=>c(h,W))}}function A(){let W=y.let("ruleErrs",null);return y.try(()=>j(t._`await `),(Y)=>y.assign(S,!1).if(t._`${Y} instanceof ${C.ValidationError}`,()=>y.assign(W,t._`${Y}.errors`),()=>y.throw(Y))),W}function H(){let W=t._`${R}.errors`;return y.assign(W,null),j(t.nil),W}function j(W=f.async?t._`await `:t.nil){let Y=C.opts.passContext?r.default.this:r.default.self,ae=!(("compile"in f)&&!E||f.schema===!1);y.assign(S,t._`${W}${(0,o.callValidateCode)(h,R,Y,ae)}`,f.modifying)}function V(W){var Y;y.if((0,t.not)((Y=f.valid)!==null&&Y!==void 0?Y:S),W)}}e.funcKeywordCode=i;function a(h){let{gen:f,data:v,it:y}=h;f.if(y.parentData,()=>f.assign(v,t._`${y.parentData}[${y.parentDataProperty}]`))}function c(h,f){let{gen:v}=h;v.if(t._`Array.isArray(${f})`,()=>{v.assign(r.default.vErrors,t._`${r.default.vErrors} === null ? ${f} : ${r.default.vErrors}.concat(${f})`).assign(r.default.errors,t._`${r.default.vErrors}.length`),(0,n.extendErrors)(h)},()=>h.error())}function u({schemaEnv:h},f){if(f.async&&!h.$async)throw Error("async keyword in sync schema")}function l(h,f,v){if(v===void 0)throw Error(`keyword "${f}" failed to compile`);return h.scopeValue("keyword",typeof v=="function"?{ref:v}:{ref:v,code:(0,t.stringify)(v)})}function d(h,f,v=!1){return!f.length||f.some((y)=>y==="array"?Array.isArray(h):y==="object"?h&&typeof h=="object"&&!Array.isArray(h):typeof h==y||v&&typeof h>"u")}e.validSchemaType=d;function m({schema:h,opts:f,self:v,errSchemaPath:y},g,P){if(Array.isArray(g.keyword)?!g.keyword.includes(P):g.keyword!==P)throw Error("ajv implementation error");let w=g.dependencies;if(w===null||w===void 0?void 0:w.some((E)=>!Object.prototype.hasOwnProperty.call(h,E)))throw Error(`parent schema must have dependencies of ${P}: ${w.join(",")}`);if(g.validateSchema){if(!g.validateSchema(h[P])){let E=`keyword "${P}" value is invalid at path "${y}": `+v.errorsText(g.validateSchema.errors);if(f.validateSchema==="log")v.logger.error(E);else throw Error(E)}}}e.validateKeywordUsage=m}),aE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;let t=de(),r=ye();function o(i,{keyword:a,schemaProp:c,schema:u,schemaPath:l,errSchemaPath:d,topSchemaRef:m}){if(a!==void 0&&u!==void 0)throw Error('both "keyword" and "schema" passed, only one allowed');if(a!==void 0){let h=i.schema[a];return c===void 0?{schema:h,schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(a)}`,errSchemaPath:`${i.errSchemaPath}/${a}`}:{schema:h[c],schemaPath:t._`${i.schemaPath}${(0,t.getProperty)(a)}${(0,t.getProperty)(c)}`,errSchemaPath:`${i.errSchemaPath}/${a}/${(0,r.escapeFragment)(c)}`}}if(u!==void 0){if(l===void 0||d===void 0||m===void 0)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:u,schemaPath:l,topSchemaRef:m,errSchemaPath:d}}throw Error('either "keyword" or "schema" must be passed')}e.getSubschema=o;function n(i,a,{dataProp:c,dataPropType:u,data:l,dataTypes:d,propertyName:m}){if(l!==void 0&&c!==void 0)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:h}=a;if(c!==void 0){let{errorPath:v,dataPathArr:y,opts:g}=a;f(h.let("data",t._`${a.data}${(0,t.getProperty)(c)}`,!0)),i.errorPath=t.str`${v}${(0,r.getErrorPath)(c,u,g.jsPropertySyntax)}`,i.parentDataProperty=t._`${c}`,i.dataPathArr=[...y,i.parentDataProperty]}if(l!==void 0){if(f(l instanceof t.Name?l:h.let("data",l,!0)),m!==void 0)i.propertyName=m}if(d)i.dataTypes=d;function f(v){i.data=v,i.dataLevel=a.dataLevel+1,i.dataTypes=[],a.definedProperties=new Set,i.parentData=a.data,i.dataNames=[...a.dataNames,v]}}e.extendSubschemaData=n;function s(i,{jtdDiscriminator:a,jtdMetadata:c,compositeRule:u,createErrors:l,allErrors:d}){if(u!==void 0)i.compositeRule=u;if(l!==void 0)i.createErrors=l;if(d!==void 0)i.allErrors=d;i.jtdDiscriminator=a,i.jtdMetadata=c}e.extendSubschemaMode=s}),cz=B((e,t)=>{t.exports=function r(o,n){if(o===n)return!0;if(o&&n&&typeof o=="object"&&typeof n=="object"){if(o.constructor!==n.constructor)return!1;var s,i,a;if(Array.isArray(o)){if(s=o.length,s!=n.length)return!1;for(i=s;i--!==0;)if(!r(o[i],n[i]))return!1;return!0}if(o.constructor===RegExp)return o.source===n.source&&o.flags===n.flags;if(o.valueOf!==Object.prototype.valueOf)return o.valueOf()===n.valueOf();if(o.toString!==Object.prototype.toString)return o.toString()===n.toString();if(a=Object.keys(o),s=a.length,s!==Object.keys(n).length)return!1;for(i=s;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=s;i--!==0;){var c=a[i];if(!r(o[c],n[c]))return!1}return!0}return o!==o&&n!==n}}),cE=B((e,t)=>{var r=t.exports=function(s,i,a){if(typeof i=="function")a=i,i={};a=i.cb||a;var c=typeof a=="function"?a:a.pre||function(){},u=a.post||function(){};o(i,c,u,s,"",s)};r.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},r.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},r.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},r.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function o(s,i,a,c,u,l,d,m,h,f){if(c&&typeof c=="object"&&!Array.isArray(c)){i(c,u,l,d,m,h,f);for(var v in c){var y=c[v];if(Array.isArray(y)){if(v in r.arrayKeywords)for(var g=0;g<y.length;g++)o(s,i,a,y[g],u+"/"+v+"/"+g,l,u,v,c,g)}else if(v in r.propsKeywords){if(y&&typeof y=="object")for(var P in y)o(s,i,a,y[P],u+"/"+v+"/"+n(P),l,u,v,c,P)}else if(v in r.keywords||s.allKeys&&!(v in r.skipKeywords))o(s,i,a,y,u+"/"+v,l,u,v,c)}a(c,u,l,d,m,h,f)}}function n(s){return s.replace(/~/g,"~0").replace(/\//g,"~1")}}),Ei=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;let t=ye(),r=cz(),o=cE(),n=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function s(y,g=!0){if(typeof y=="boolean")return!0;if(g===!0)return!a(y);if(!g)return!1;return c(y)<=g}e.inlineRef=s;let i=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function a(y){for(let g in y){if(i.has(g))return!0;let P=y[g];if(Array.isArray(P)&&P.some(a))return!0;if(typeof P=="object"&&a(P))return!0}return!1}function c(y){let g=0;for(let P in y){if(P==="$ref")return 1/0;if(g++,n.has(P))continue;if(typeof y[P]=="object")(0,t.eachItem)(y[P],(w)=>g+=c(w));if(g===1/0)return 1/0}return g}function u(y,g="",P){if(P!==!1)g=m(g);return l(y,y.parse(g))}e.getFullPath=u;function l(y,g){return y.serialize(g).split("#")[0]+"#"}e._getFullPath=l;let d=/#\/?$/;function m(y){return y?y.replace(d,""):""}e.normalizeId=m;function h(y,g,P){return P=m(P),y.resolve(g,P)}e.resolveUrl=h;let f=/^[a-z_][-a-z0-9._]*$/i;function v(y,g){if(typeof y=="boolean")return{};let{schemaId:P,uriResolver:w}=this.opts,E=m(y[P]||g),C={"":E},R=u(w,E,!1),S={},T=new Set;return o(y,{allKeys:!0},(j,V,W,Y)=>{if(Y===void 0)return;let ae=R+V,we=C[Y];if(typeof j[P]=="string")we=Re.call(this,j[P]);Ce.call(this,j.$anchor),Ce.call(this,j.$dynamicAnchor),C[V]=we;function Re(pe){let N=this.opts.uriResolver.resolve;if(pe=m(we?N(we,pe):pe),T.has(pe))throw H(pe);T.add(pe);let M=this.refs[pe];if(typeof M=="string")M=this.refs[M];if(typeof M=="object")A(j,M.schema,pe);else if(pe!==m(ae))if(pe[0]==="#")A(j,S[pe],pe),S[pe]=j;else this.refs[pe]=ae;return pe}function Ce(pe){if(typeof pe=="string"){if(!f.test(pe))throw Error(`invalid anchor "${pe}"`);Re.call(this,`#${pe}`)}}}),S;function A(j,V,W){if(V!==void 0&&!r(j,V))throw H(W)}function H(j){return Error(`reference "${j}" resolves to more than one schema`)}}e.getSchemaRefs=v}),oo=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;let t=nE(),r=ki(),o=az(),n=ki(),s=sE(),i=iE(),a=aE(),c=de(),u=kt(),l=Ei(),d=ye(),m=xi();function h(O){if(R(O)){if(T(O),C(O)){g(O);return}}f(O,()=>(0,t.topBoolOrEmptySchema)(O))}e.validateFunctionCode=h;function f({gen:O,validateName:q,schema:F,schemaEnv:ee,opts:re},se){if(re.code.es5)O.func(q,c._`${u.default.data}, ${u.default.valCxt}`,ee.$async,()=>{O.code(c._`"use strict"; ${w(F,re)}`),y(O,re),O.code(se)});else O.func(q,c._`${u.default.data}, ${v(re)}`,ee.$async,()=>O.code(w(F,re)).code(se))}function v(O){return c._`{${u.default.instancePath}="", ${u.default.parentData}, ${u.default.parentDataProperty}, ${u.default.rootData}=${u.default.data}${O.dynamicRef?c._`, ${u.default.dynamicAnchors}={}`:c.nil}}={}`}function y(O,q){O.if(u.default.valCxt,()=>{if(O.var(u.default.instancePath,c._`${u.default.valCxt}.${u.default.instancePath}`),O.var(u.default.parentData,c._`${u.default.valCxt}.${u.default.parentData}`),O.var(u.default.parentDataProperty,c._`${u.default.valCxt}.${u.default.parentDataProperty}`),O.var(u.default.rootData,c._`${u.default.valCxt}.${u.default.rootData}`),q.dynamicRef)O.var(u.default.dynamicAnchors,c._`${u.default.valCxt}.${u.default.dynamicAnchors}`)},()=>{if(O.var(u.default.instancePath,c._`""`),O.var(u.default.parentData,c._`undefined`),O.var(u.default.parentDataProperty,c._`undefined`),O.var(u.default.rootData,u.default.data),q.dynamicRef)O.var(u.default.dynamicAnchors,c._`{}`)})}function g(O){let{schema:q,opts:F,gen:ee}=O;f(O,()=>{if(F.$comment&&q.$comment)Y(O);if(j(O),ee.let(u.default.vErrors,null),ee.let(u.default.errors,0),F.unevaluated)P(O);A(O),ae(O)})}function P(O){let{gen:q,validateName:F}=O;O.evaluated=q.const("evaluated",c._`${F}.evaluated`),q.if(c._`${O.evaluated}.dynamicProps`,()=>q.assign(c._`${O.evaluated}.props`,c._`undefined`)),q.if(c._`${O.evaluated}.dynamicItems`,()=>q.assign(c._`${O.evaluated}.items`,c._`undefined`))}function w(O,q){let F=typeof O=="object"&&O[q.schemaId];return F&&(q.code.source||q.code.process)?c._`/*# sourceURL=${F} */`:c.nil}function E(O,q){if(R(O)){if(T(O),C(O)){S(O,q);return}}(0,t.boolOrEmptySchema)(O,q)}function C({schema:O,self:q}){if(typeof O=="boolean")return!O;for(let F in O)if(q.RULES.all[F])return!0;return!1}function R(O){return typeof O.schema!="boolean"}function S(O,q){let{schema:F,gen:ee,opts:re}=O;if(re.$comment&&F.$comment)Y(O);V(O),W(O);let se=ee.const("_errs",u.default.errors);A(O,se),ee.var(q,c._`${se} === ${u.default.errors}`)}function T(O){(0,d.checkUnknownRules)(O),H(O)}function A(O,q){if(O.opts.jtd)return Re(O,[],!1,q);let F=(0,r.getSchemaTypes)(O.schema);Re(O,F,!(0,r.coerceAndCheckDataType)(O,F),q)}function H(O){let{schema:q,errSchemaPath:F,opts:ee,self:re}=O;if(q.$ref&&ee.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(q,re.RULES))re.logger.warn(`$ref: keywords ignored in schema at path "${F}"`)}function j(O){let{schema:q,opts:F}=O;if(q.default!==void 0&&F.useDefaults&&F.strictSchema)(0,d.checkStrictMode)(O,"default is ignored in the schema root")}function V(O){let q=O.schema[O.opts.schemaId];if(q)O.baseId=(0,l.resolveUrl)(O.opts.uriResolver,O.baseId,q)}function W(O){if(O.schema.$async&&!O.schemaEnv.$async)throw Error("async schema in sync schema")}function Y({gen:O,schemaEnv:q,schema:F,errSchemaPath:ee,opts:re}){let se=F.$comment;if(re.$comment===!0)O.code(c._`${u.default.self}.logger.log(${se})`);else if(typeof re.$comment=="function"){let _e=c.str`${ee}/$comment`,Ze=O.scopeValue("root",{ref:q.root});O.code(c._`${u.default.self}.opts.$comment(${se}, ${_e}, ${Ze}.schema)`)}}function ae(O){let{gen:q,schemaEnv:F,validateName:ee,ValidationError:re,opts:se}=O;if(F.$async)q.if(c._`${u.default.errors} === 0`,()=>q.return(u.default.data),()=>q.throw(c._`new ${re}(${u.default.vErrors})`));else{if(q.assign(c._`${ee}.errors`,u.default.vErrors),se.unevaluated)we(O);q.return(c._`${u.default.errors} === 0`)}}function we({gen:O,evaluated:q,props:F,items:ee}){if(F instanceof c.Name)O.assign(c._`${q}.props`,F);if(ee instanceof c.Name)O.assign(c._`${q}.items`,ee)}function Re(O,q,F,ee){let{gen:re,schema:se,data:_e,allErrors:Ze,opts:ke,self:De}=O,{RULES:Ie}=De;if(se.$ref&&(ke.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(se,Ie))){re.block(()=>G(O,"$ref",Ie.all.$ref.definition));return}if(!ke.jtd)pe(O,q);re.block(()=>{for(let Ve of Ie.rules)gt(Ve);gt(Ie.post)});function gt(Ve){if(!(0,o.shouldUseGroup)(se,Ve))return;if(Ve.type){if(re.if((0,n.checkDataType)(Ve.type,_e,ke.strictNumbers)),Ce(O,Ve),q.length===1&&q[0]===Ve.type&&F)re.else(),(0,n.reportTypeError)(O);re.endIf()}else Ce(O,Ve);if(!Ze)re.if(c._`${u.default.errors} === ${ee||0}`)}}function Ce(O,q){let{gen:F,schema:ee,opts:{useDefaults:re}}=O;if(re)(0,s.assignDefaults)(O,q.type);F.block(()=>{for(let se of q.rules)if((0,o.shouldUseRule)(ee,se))G(O,se.keyword,se.definition,q.type)})}function pe(O,q){if(O.schemaEnv.meta||!O.opts.strictTypes)return;if(N(O,q),!O.opts.allowUnionTypes)M(O,q);b(O,O.dataTypes)}function N(O,q){if(!q.length)return;if(!O.dataTypes.length){O.dataTypes=q;return}q.forEach((F)=>{if(!_(O.dataTypes,F))I(O,`type "${F}" not allowed by context "${O.dataTypes.join(",")}"`)}),z(O,q)}function M(O,q){if(q.length>1&&!(q.length===2&&q.includes("null")))I(O,"use allowUnionTypes to allow union type keyword")}function b(O,q){let F=O.self.RULES.all;for(let ee in F){let re=F[ee];if(typeof re=="object"&&(0,o.shouldUseRule)(O.schema,re)){let{type:se}=re.definition;if(se.length&&!se.some((_e)=>p(q,_e)))I(O,`missing type "${se.join(",")}" for keyword "${ee}"`)}}}function p(O,q){return O.includes(q)||q==="number"&&O.includes("integer")}function _(O,q){return O.includes(q)||q==="integer"&&O.includes("number")}function z(O,q){let F=[];for(let ee of O.dataTypes)if(_(q,ee))F.push(ee);else if(q.includes("integer")&&ee==="number")F.push("integer");O.dataTypes=F}function I(O,q){let F=O.schemaEnv.baseId+O.errSchemaPath;q+=` at "${F}" (strictTypes)`,(0,d.checkStrictMode)(O,q,O.opts.strictTypes)}var U=class{constructor(O,q,F){if((0,i.validateKeywordUsage)(O,q,F),this.gen=O.gen,this.allErrors=O.allErrors,this.keyword=F,this.data=O.data,this.schema=O.schema[F],this.$data=q.$data&&O.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(O,this.schema,F,this.$data),this.schemaType=q.schemaType,this.parentSchema=O.schema,this.params={},this.it=O,this.def=q,this.$data)this.schemaCode=O.gen.const("vSchema",Pe(this.$data,O));else if(this.schemaCode=this.schemaValue,!(0,i.validSchemaType)(this.schema,q.schemaType,q.allowUndefined))throw Error(`${F} value must be ${JSON.stringify(q.schemaType)}`);if("code"in q?q.trackErrors:q.errors!==!1)this.errsCount=O.gen.const("_errs",u.default.errors)}result(O,q,F){this.failResult((0,c.not)(O),q,F)}failResult(O,q,F){if(this.gen.if(O),F)F();else this.error();if(q){if(this.gen.else(),q(),this.allErrors)this.gen.endIf()}else if(this.allErrors)this.gen.endIf();else this.gen.else()}pass(O,q){this.failResult((0,c.not)(O),void 0,q)}fail(O){if(O===void 0){if(this.error(),!this.allErrors)this.gen.if(!1);return}if(this.gen.if(O),this.error(),this.allErrors)this.gen.endIf();else this.gen.else()}fail$data(O){if(!this.$data)return this.fail(O);let{schemaCode:q}=this;this.fail(c._`${q} !== undefined && (${(0,c.or)(this.invalid$data(),O)})`)}error(O,q,F){if(q){this.setParams(q),this._error(O,F),this.setParams({});return}this._error(O,F)}_error(O,q){(O?m.reportExtraError:m.reportError)(this,this.def.error,q)}$dataError(){(0,m.reportError)(this,this.def.$dataError||m.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error('add "trackErrors" to keyword definition');(0,m.resetErrorsCount)(this.gen,this.errsCount)}ok(O){if(!this.allErrors)this.gen.if(O)}setParams(O,q){if(q)Object.assign(this.params,O);else this.params=O}block$data(O,q,F=c.nil){this.gen.block(()=>{this.check$data(O,F),q()})}check$data(O=c.nil,q=c.nil){if(!this.$data)return;let{gen:F,schemaCode:ee,schemaType:re,def:se}=this;if(F.if((0,c.or)(c._`${ee} === undefined`,q)),O!==c.nil)F.assign(O,!0);if(re.length||se.validateSchema){if(F.elseIf(this.invalid$data()),this.$dataError(),O!==c.nil)F.assign(O,!1)}F.else()}invalid$data(){let{gen:O,schemaCode:q,schemaType:F,def:ee,it:re}=this;return(0,c.or)(se(),_e());function se(){if(F.length){if(!(q instanceof c.Name))throw Error("ajv implementation error");let Ze=Array.isArray(F)?F:[F];return c._`${(0,n.checkDataTypes)(Ze,q,re.opts.strictNumbers,n.DataType.Wrong)}`}return c.nil}function _e(){if(ee.validateSchema){let Ze=O.scopeValue("validate$data",{ref:ee.validateSchema});return c._`!${Ze}(${q})`}return c.nil}}subschema(O,q){let F=(0,a.getSubschema)(this.it,O);(0,a.extendSubschemaData)(F,this.it,O),(0,a.extendSubschemaMode)(F,O);let ee={...this.it,...F,items:void 0,props:void 0};return E(ee,q),ee}mergeEvaluated(O,q){let{it:F,gen:ee}=this;if(!F.opts.unevaluated)return;if(F.props!==!0&&O.props!==void 0)F.props=d.mergeEvaluated.props(ee,O.props,F.props,q);if(F.items!==!0&&O.items!==void 0)F.items=d.mergeEvaluated.items(ee,O.items,F.items,q)}mergeValidEvaluated(O,q){let{it:F,gen:ee}=this;if(F.opts.unevaluated&&(F.props!==!0||F.items!==!0))return ee.if(q,()=>this.mergeEvaluated(O,c.Name)),!0}};e.KeywordCxt=U;function G(O,q,F,ee){let re=new U(O,F,q);if("code"in F)F.code(re,ee);else if(re.$data&&F.validate)(0,i.funcKeywordCode)(re,F);else if("macro"in F)(0,i.macroKeywordCode)(re,F);else if(F.compile||F.validate)(0,i.funcKeywordCode)(re,F)}let K=/^\/(?:[^~]|~0|~1)*$/,le=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function Pe(O,{dataLevel:q,dataNames:F,dataPathArr:ee}){let re,se;if(O==="")return u.default.rootData;if(O[0]==="/"){if(!K.test(O))throw Error(`Invalid JSON-pointer: ${O}`);re=O,se=u.default.rootData}else{let De=le.exec(O);if(!De)throw Error(`Invalid JSON-pointer: ${O}`);let Ie=+De[1];if(re=De[2],re==="#"){if(Ie>=q)throw Error(ke("property/index",Ie));return ee[q-Ie]}if(Ie>q)throw Error(ke("data",Ie));if(se=F[q-Ie],!re)return se}let _e=se,Ze=re.split("/");for(let De of Ze)if(De)se=c._`${se}${(0,c.getProperty)((0,d.unescapeJsonPointer)(De))}`,_e=c._`${_e} && ${se}`;return _e;function ke(De,Ie){return`Cannot access ${De} ${Ie} levels up, current level is ${q}`}}e.getData=Pe}),wn=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{constructor(r){super("validation failed");this.errors=r,this.ajv=this.validation=!0}};e.default=t}),no=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Ei();var r=class extends Error{constructor(o,n,s,i){super(i||`can't resolve reference ${s} from id ${n}`);this.missingRef=(0,t.resolveUrl)(o,n,s),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(o,this.missingRef))}};e.default=r}),Ti=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;let t=de(),r=wn(),o=kt(),n=Ei(),s=ye(),i=oo();var a=class{constructor(g){var P;this.refs={},this.dynamicAnchors={};let w;if(typeof g.schema=="object")w=g.schema;this.schema=g.schema,this.schemaId=g.schemaId,this.root=g.root||this,this.baseId=(P=g.baseId)!==null&&P!==void 0?P:(0,n.normalizeId)(w===null||w===void 0?void 0:w[g.schemaId||"$id"]),this.schemaPath=g.schemaPath,this.localRefs=g.localRefs,this.meta=g.meta,this.$async=w===null||w===void 0?void 0:w.$async,this.refs={}}};e.SchemaEnv=a;function c(g){let P=d.call(this,g);if(P)return P;let w=(0,n.getFullPath)(this.opts.uriResolver,g.root.baseId),{es5:E,lines:C}=this.opts.code,{ownProperties:R}=this.opts,S=new t.CodeGen(this.scope,{es5:E,lines:C,ownProperties:R}),T;if(g.$async)T=S.scopeValue("Error",{ref:r.default,code:t._`require("ajv/dist/runtime/validation_error").default`});let A=S.scopeName("validate");g.validateName=A;let H={gen:S,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:S.scopeValue("schema",this.opts.code.source===!0?{ref:g.schema,code:(0,t.stringify)(g.schema)}:{ref:g.schema}),validateName:A,ValidationError:T,schema:g.schema,schemaEnv:g,rootId:w,baseId:g.baseId||w,schemaPath:t.nil,errSchemaPath:g.schemaPath||(this.opts.jtd?"":"#"),errorPath:t._`""`,opts:this.opts,self:this},j;try{this._compilations.add(g),(0,i.validateFunctionCode)(H),S.optimize(this.opts.code.optimize);let V=S.toString();if(j=`${S.scopeRefs(o.default.scope)}return ${V}`,this.opts.code.process)j=this.opts.code.process(j,g);let W=Function(`${o.default.self}`,`${o.default.scope}`,j)(this,this.scope.get());if(this.scope.value(A,{ref:W}),W.errors=null,W.schema=g.schema,W.schemaEnv=g,g.$async)W.$async=!0;if(this.opts.code.source===!0)W.source={validateName:A,validateCode:V,scopeValues:S._values};if(this.opts.unevaluated){let{props:Y,items:ae}=H;if(W.evaluated={props:Y instanceof t.Name?void 0:Y,items:ae instanceof t.Name?void 0:ae,dynamicProps:Y instanceof t.Name,dynamicItems:ae instanceof t.Name},W.source)W.source.evaluated=(0,t.stringify)(W.evaluated)}return g.validate=W,g}catch(V){if(delete g.validate,delete g.validateName,j)this.logger.error("Error compiling schema, function code:",j);throw V}finally{this._compilations.delete(g)}}e.compileSchema=c;function u(g,P,w){var E;w=(0,n.resolveUrl)(this.opts.uriResolver,P,w);let C=g.refs[w];if(C)return C;let R=h.call(this,g,w);if(R===void 0){let S=(E=g.localRefs)===null||E===void 0?void 0:E[w],{schemaId:T}=this.opts;if(S)R=new a({schema:S,schemaId:T,root:g,baseId:P})}if(R===void 0)return;return g.refs[w]=l.call(this,R)}e.resolveRef=u;function l(g){if((0,n.inlineRef)(g.schema,this.opts.inlineRefs))return g.schema;return g.validate?g:c.call(this,g)}function d(g){for(let P of this._compilations)if(m(P,g))return P}e.getCompilingSchema=d;function m(g,P){return g.schema===P.schema&&g.root===P.root&&g.baseId===P.baseId}function h(g,P){let w;while(typeof(w=this.refs[P])=="string")P=w;return w||this.schemas[P]||f.call(this,g,P)}function f(g,P){let w=this.opts.uriResolver.parse(P),E=(0,n._getFullPath)(this.opts.uriResolver,w),C=(0,n.getFullPath)(this.opts.uriResolver,g.baseId,void 0);if(Object.keys(g.schema).length>0&&E===C)return y.call(this,w,g);let R=(0,n.normalizeId)(E),S=this.refs[R]||this.schemas[R];if(typeof S=="string"){let T=f.call(this,g,S);if(typeof(T===null||T===void 0?void 0:T.schema)!=="object")return;return y.call(this,w,T)}if(typeof(S===null||S===void 0?void 0:S.schema)!=="object")return;if(!S.validate)c.call(this,S);if(R===(0,n.normalizeId)(P)){let{schema:T}=S,{schemaId:A}=this.opts,H=T[A];if(H)C=(0,n.resolveUrl)(this.opts.uriResolver,C,H);return new a({schema:T,schemaId:A,root:g,baseId:C})}return y.call(this,w,S)}e.resolveSchema=f;let v=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(g,{baseId:P,schema:w,root:E}){var C;if(((C=g.fragment)===null||C===void 0?void 0:C[0])!=="/")return;for(let T of g.fragment.slice(1).split("/")){if(typeof w==="boolean")return;let A=w[(0,s.unescapeFragment)(T)];if(A===void 0)return;w=A;let H=typeof w==="object"&&w[this.opts.schemaId];if(!v.has(T)&&H)P=(0,n.resolveUrl)(this.opts.uriResolver,P,H)}let R;if(typeof w!="boolean"&&w.$ref&&!(0,s.schemaHasRulesButRef)(w,this.RULES)){let T=(0,n.resolveUrl)(this.opts.uriResolver,P,w.$ref);R=f.call(this,E,T)}let{schemaId:S}=this.opts;if(R=R||new a({schema:w,schemaId:S,root:E,baseId:P}),R.schema!==R.root.schema)return R}}),uE=B((e,t)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),uz=B((e,t)=>{let r=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),o=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),n=RegExp.prototype.test.bind(/^\d*$/u),s=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),i=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),a=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),c=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),u=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),l=Array(256);for(let p=0;p<256;p++)l[p]="%"+"0123456789ABCDEF"[p>>4]+"0123456789ABCDEF"[p&15];function d(b){if(b<2048)return l[192|b>>6]+l[128|b&63];if(b<65536)return l[224|b>>12]+l[128|b>>6&63]+l[128|b&63];return l[240|b>>18]+l[128|b>>12&63]+l[128|b>>6&63]+l[128|b&63]}function m(b){let p="",_=0,z=0;for(z=0;z<b.length;z++){if(_=b[z].charCodeAt(0),_===48)continue;if(!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";p+=b[z];break}for(z+=1;z<b.length;z++){if(_=b[z].charCodeAt(0),!(_>=48&&_<=57||_>=65&&_<=70||_>=97&&_<=102))return"";p+=b[z]}return p}let h=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),f=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),v=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),y=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function g(b){if(b.length===0)return!1;for(let p=0;p<b.length;p++){if(v(b[p]))continue;if(b[p]==="%"&&p+2<b.length&&s(b.slice(p+1,p+3))){p+=2;continue}return!1}return!0}function P(b){let p=-1,_=0,z=-1,I=0;for(let K=0;K<b.length;K++)if(b[K]==="0"){if(z===-1)z=K;if(I++,I>_)_=I,p=z}else z=-1,I=0;if(_<2)return b.join(":");let U=b.slice(0,p).join(":"),G=b.slice(p+_).join(":");return U+"::"+G}function w(b){let p=b.indexOf("::");if(p!==-1&&b.indexOf("::",p+1)!==-1)return;let _=p===-1?b.split(":"):b.slice(0,p).split(":"),z=p===-1?[]:b.slice(p+2).split(":");if(p!==-1){if(_.length===1&&_[0]==="")_.length=0;if(z.length===1&&z[0]==="")z.length=0}let I=_.concat(z),U=0;for(let K=0;K<I.length;K++){let le=I[K];if(le==="")return;if(le.indexOf(".")!==-1){if(K!==I.length-1||p!==-1&&z.length===0||!o(le))return;U+=2;continue}if(!h(le))return;I[K]=parseInt(le,16).toString(16),U++}if(p===-1){if(U!==8)return;return P(I)}if(U>=8)return;let G=I.slice(0,_.length);for(let K=U;K<8;K++)G.push("0");for(let K=_.length;K<I.length;K++)G.push(I[K]);return P(G)}function E(b){let p=b[0]==="["&&b[b.length-1]==="]";if((b[0]==="["||b[b.length-1]==="]")&&!p)return{host:b,isIPV6:!1,error:!0};let _=p?b.slice(1,-1):b;if(p&&f(_))return _=_.toLowerCase(),{host:`[${_}]`,escapedHost:_,isIPV6:!1,isIPVFuture:!0};if(C(_,":")<2)return{host:b,isIPV6:!1,error:p};let z="",I=_.indexOf("%");if(I!==-1){let G=_.slice(I,I+3).toLowerCase()==="%25"?3:1;if(z=_.slice(I+G),!g(z))return{host:b,isIPV6:!1,error:!0};_=_.slice(0,I)}let U=w(_);if(U===void 0)return{host:b,isIPV6:!1,error:!0};return{host:U+(z?"%"+z:""),escapedHost:U+(z?"%25"+z:""),isIPV6:!0}}function C(b,p){let _=0;for(let z=0;z<b.length;z++)if(b[z]===p)_++;return _}function R(b){let p=b,_=[],z=-1,I=0;while(I=p.length){if(I===1)if(p===".")break;else if(p==="/"){_.push("/");break}else{_.push(p);break}else if(I===2){if(p[0]==="."){if(p[1]===".")break;else if(p[1]==="/"){p=p.slice(2);continue}}else if(p[0]==="/"){if(p[1]==="."||p[1]==="/"){_.push("/");break}}}else if(I===3){if(p==="/.."){if(_.length!==0)_.pop();_.push("/");break}}if(p[0]==="."){if(p[1]==="."){if(p[2]==="/"){p=p.slice(3);continue}}else if(p[1]==="/"){p=p.slice(2);continue}}else if(p[0]==="/"){if(p[1]==="."){if(p[2]==="/"){p=p.slice(2);continue}else if(p[2]==="."){if(p[3]==="/"){if(p=p.slice(3),_.length!==0)_.pop();continue}}}}if((z=p.indexOf("/",1))===-1){_.push(p);break}else _.push(p.slice(0,z)),p=p.slice(z)}return _.join("")}let S={"@":"%40","/":"%2F","?":"%3F","#":"%23",":":"%3A"},T=/[@/?#:]/g,A=/[@/?#]/g;function H(b,p){let _=p?A:T;return _.lastIndex=0,b.replace(_,(z)=>S[z])}function j(b,p=!1){if(b.indexOf("%")===-1)return b;let _="";for(let z=0;z<b.length;z++){if(b[z]==="%"&&z+2<b.length){let I=b.slice(z+1,z+3);if(s(I)){let U=I.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(p&&i(G))_+=G;else _+="%"+U;z+=2;continue}}_+=b[z]}return _}function V(b){let p="";for(let _=0;_<b.length;_++){let z=b[_];if(z==="%"&&_+2<b.length){let I=b.slice(_+1,_+3);if(s(I)){let U=I.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(G!=="."&&i(G))p+=G;else p+="%"+U;_+=2;continue}}if(a(z))p+=z;else{let I=b.charCodeAt(_);if(I<128)p+=Ce(I)?z:l[I];else if(I<55296||I>57343)p+=d(I);else if(I<=56319&&_+1<b.length){let U=b.charCodeAt(_+1);if(U>=56320&&U<=57343)p+=d(65536+(I-55296<<10)+(U-56320)),_++;else p+=d(65533)}else p+=d(65533)}}return p}function W(b,p=!1){let _="",z=p&&b[0]!=="/";for(let I=0;I<b.length;I++){let U=b[I];if(U==="%"&&I+2<b.length){let G=b.slice(I+1,I+3);if(s(G)){_+="%"+G.toUpperCase(),I+=2;continue}}if(U==="/")z=!1;if(a(U)&&(U!==":"||!z))_+=U;else{let G=b.charCodeAt(I);if(G<128)_+=l[G];else if(G<55296||G>57343)_+=d(G);else if(G<=56319&&I+1<b.length){let K=b.charCodeAt(I+1);if(K>=56320&&K<=57343)_+=d(65536+(G-55296<<10)+(K-56320)),I++;else _+=d(65533)}else _+=d(65533)}}return _}function Y(b,p){let _="";for(let z=0;z<b.length;z++){let I=b[z];if(I==="%"&&z+2<b.length){let U=b.slice(z+1,z+3);if(s(U)){_+="%"+U.toUpperCase(),z+=2;continue}}if(p(I))_+=I;else{let U=b.charCodeAt(z);if(U<128)_+=l[U];else if(U<55296||U>57343)_+=d(U);else if(U<=56319&&z+1<b.length){let G=b.charCodeAt(z+1);if(G>=56320&&G<=57343)_+=d(65536+(U-55296<<10)+(G-56320)),z++;else _+=d(65533)}else _+=d(65533)}}return _}function ae(b){return Y(b,u)}function we(b){return Y(b,c)}function Re(b){return Y(b,c)}function Ce(b){return b>=48&&b<=57||b>=65&&b<=90||b>=97&&b<=122||b===42||b===43||b===45||b===46||b===47||b===64||b===95}function pe(b){let p="";for(let _=0;_<b.length;_++){let z=b[_];if(z==="%"&&_+2<b.length){let I=b.slice(_+1,_+3);if(s(I)){let U=I.toUpperCase(),G=String.fromCharCode(parseInt(U,16));if(i(G))p+=G;else p+="%"+U;_+=2;continue}}if(c(z))p+=z;else{let I=b.charCodeAt(_);if(I<128)p+=Ce(I)?z:l[I];else if(I<55296||I>57343)p+=d(I);else if(I<=56319&&_+1<b.length){let U=b.charCodeAt(_+1);if(U>=56320&&U<=57343)p+=d(65536+(I-55296<<10)+(U-56320)),_++;else p+=d(65533)}else p+=d(65533)}}return p}function N(b){let p="";for(let _=0;_<b.length;_++){if(b[_]==="%"&&_+2<b.length){let z=b.slice(_+1,_+3);if(s(z)){p+="%"+z.toUpperCase(),_+=2;continue}}p+=escape(b[_])}return p}function M(b){let p=[];if(b.userinfo!==void 0)p.push(ae(b.userinfo)),p.push("@");if(b.host!==void 0){let _=b.host;if(!o(_)){let z=E(_);if(z.isIPV6!==!0&&z.isIPVFuture!==!0)_=j(_,!0),z=E(_);if(z.isIPV6===!0||z.isIPVFuture===!0)_=`[${z.escapedHost}]`;else _=H(_,!1)}p.push(_)}if(typeof b.port==="number"||typeof b.port==="string"){let _=String(b.port);if(!n(_))throw TypeError("URI port is malformed.");p.push(":"),p.push(_)}return p.length?p.join(""):void 0}t.exports={nonSimpleDomain:y,recomposeAuthority:M,reescapeHostDelimiters:H,normalizePercentEncoding:j,normalizePathEncoding:V,serializePathEncoding:W,normalizeQueryFragmentEncoding:pe,encodeUserinfo:ae,encodeQuery:we,encodeFragment:Re,escapePreservingEscapes:N,removeDotSegments:R,isIPv4:o,isUUID:r,normalizeIPv6:E,stringArrayToHexStripped:m}}),lE=B((e,t)=>{let{isUUID:r}=uz(),o=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,n=["http","https","ws","wss","urn","urn:uuid"];function s(S){return n.indexOf(S)!==-1}function i(S){if(S.secure===!0)return!0;else if(S.secure===!1)return!1;else if(S.scheme)return S.scheme.length===3&&(S.scheme[0]==="w"||S.scheme[0]==="W")&&(S.scheme[1]==="s"||S.scheme[1]==="S")&&(S.scheme[2]==="s"||S.scheme[2]==="S");else return!1}function a(S){if(!S.host)S.error=S.error||"HTTP URIs must have a host.";return S}function c(S){let T=String(S.scheme).toLowerCase()==="https";if(S.port===(T?443:80)||S.port==="")S.port=void 0;if(!S.path)S.path="/";return S}function u(S){return S.secure=i(S),S.resourceName=(S.path||"/")+(S.query?"?"+S.query:""),S.path=void 0,S.query=void 0,S}function l(S){if(S.port===(i(S)?443:80)||S.port==="")S.port=void 0;if(typeof S.secure==="boolean")S.scheme=S.secure?"wss":"ws",S.secure=void 0;if(S.resourceName){let T=S.resourceName.indexOf("?"),A=T===-1?S.resourceName:S.resourceName.slice(0,T);S.path=A&&A!=="/"?A:void 0,S.query=T===-1?void 0:S.resourceName.slice(T+1),S.resourceName=void 0}return S.fragment=void 0,S}function d(S,T){if(!S.path)return S.error="URN can not be parsed",S;let A=S.path.match(o);if(A&&A[0]===S.path){let H=T.scheme||S.scheme||"urn";S.nid=A[1].toLowerCase(),S.nss=A[2];let j=R(`${H}:${T.nid||S.nid}`);if(S.path=void 0,j)S=j.parse(S,T)}else S.error=S.error||"URN can not be parsed.";return S}function m(S,T){if(S.nid===void 0)throw Error("URN without nid cannot be serialized");let A=T.scheme||S.scheme||"urn",H=S.nid.toLowerCase(),j=R(`${A}:${T.nid||H}`);if(j)S=j.serialize(S,T);let V=S,W=S.nss;return V.path=`${H||T.nid}:${W}`,T.skipEscape=!0,V}function h(S,T){let A=S;if(A.uuid=A.nss,A.nss=void 0,!T.tolerant&&(!A.uuid||!r(A.uuid)))A.error=A.error||"UUID is not valid.";return A}function f(S){let T=S;return T.nss=(S.uuid||"").toLowerCase(),T}let v={scheme:"http",domainHost:!0,parse:a,serialize:c},y={scheme:"https",domainHost:v.domainHost,parse:a,serialize:c},g={scheme:"ws",domainHost:!0,parse:u,serialize:l},P={scheme:"wss",domainHost:g.domainHost,parse:g.parse,serialize:g.serialize},C={http:v,https:y,ws:g,wss:P,urn:{scheme:"urn",parse:d,serialize:m,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:h,serialize:f,skipNormalize:!0}};Object.setPrototypeOf(C,null);function R(S){return S&&(C[S]||C[S.toLowerCase()])||void 0}t.exports={wsIsSecure:i,SCHEMES:C,isValidSchemeName:s,getSchemeHandler:R}}),dE=B((e,t)=>{let{normalizeIPv6:r,removeDotSegments:o,recomposeAuthority:n,normalizePercentEncoding:s,normalizePathEncoding:i,serializePathEncoding:a,normalizeQueryFragmentEncoding:c,encodeQuery:u,encodeFragment:l,reescapeHostDelimiters:d,isIPv4:m,nonSimpleDomain:h}=uz(),{SCHEMES:f,getSchemeHandler:v}=lE(),y=/^[A-Za-z][A-Za-z0-9+.-]*$/u,g="URI scheme is malformed.";function P(b){let p=unescape(String(b));if(!y.test(p))throw TypeError("URI scheme is malformed.");return p}function w(b,p){if(typeof b==="string")b=Ce(b,p);else if(typeof b==="object")b=Re(S(b,p),p);return b}function E(b,p,_){let z=_?Object.assign({scheme:"null"},_):{scheme:"null"},{parsed:I,malformedAuthorityOrPort:U,malformedPercentEncoding:G,malformedSchemeSpecific:K,malformedHost:le,malformedScheme:Pe}=we(b,z),{parsed:O,malformedAuthorityOrPort:q,malformedPercentEncoding:F,malformedSchemeSpecific:ee,malformedHost:re,malformedScheme:se}=we(p,z);if(U||q||G||F||K||ee||le||re||Pe||se)throw Error(I.error||O.error||"URI is malformed.");let _e=C(I,O,z,!0),Ze=v(_&&_.scheme||_e.scheme),ke=_e.host,De=ke!==void 0&&ke!==""&&(m(ke)||r(ke).isIPV6);ae(_e,_||{},Ze,De);let Ie=ke&&ke.indexOf("%")!==-1&&!/\P{ASCII}/u.test(ke);if(_e.error&&!Ie)throw Error(_e.error);return z.skipEscape=!0,S(_e,z)}function C(b,p,_,z){let I={};if(!z)b=Re(S(b,_),_),p=Re(S(p,_),_);if(_=_||{},!_.tolerant&&p.scheme)I.scheme=p.scheme,I.userinfo=p.userinfo,I.host=p.host,I.port=p.port,I.path=o(p.path||""),I.query=p.query;else{if(p.userinfo!==void 0||p.host!==void 0||p.port!==void 0)I.userinfo=p.userinfo,I.host=p.host,I.port=p.port,I.path=o(p.path||""),I.query=p.query;else{if(!p.path)if(I.path=b.path,p.query!==void 0)I.query=p.query;else I.query=b.query;else{if(p.path[0]==="/")I.path=o(p.path);else{if((b.userinfo!==void 0||b.host!==void 0||b.port!==void 0)&&!b.path)I.path="/"+p.path;else if(!b.path)I.path=p.path;else I.path=b.path.slice(0,b.path.lastIndexOf("/")+1)+p.path;I.path=o(I.path)}I.query=p.query}I.userinfo=b.userinfo,I.host=b.host,I.port=b.port}I.scheme=b.scheme}return I.fragment=p.fragment,I}function R(b,p,_){let z=N(b,_),I=N(p,_);return z!==void 0&&I!==void 0&&z===I}function S(b,p){let _={host:b.host,scheme:b.scheme,userinfo:b.userinfo,port:b.port,path:b.path,query:b.query,nid:b.nid,nss:b.nss,uuid:b.uuid,fragment:b.fragment,reference:b.reference,resourceName:b.resourceName,secure:b.secure,error:""},z=Object.assign({},p),I=[];if(_.scheme)_.scheme=P(_.scheme);let U=v(z.scheme||_.scheme);if(U&&U.serialize)U.serialize(_,z);let G=_.userinfo!==void 0||_.host!==void 0||_.port!==void 0,K=!z.skipEscape&&_.scheme===void 0&&!G;if(_.path!==void 0)if(!z.skipEscape)_.path=a(_.path,K);else _.path=s(_.path);if(z.reference!=="suffix"&&_.scheme)_.scheme=P(_.scheme),I.push(_.scheme,":");let le=n(_);if(le!==void 0){if(z.reference!=="suffix")I.push("//");if(I.push(le),_.path&&_.path[0]!=="/")I.push("/")}if(_.path!==void 0){let Pe=_.path;if(!z.absolutePath&&(!U||!U.absolutePath))Pe=o(Pe);if(K)Pe=a(Pe,!0);if(le===void 0&&Pe[0]==="/"&&Pe[1]==="/")Pe="/%2F"+Pe.slice(2);I.push(Pe)}if(_.query!==void 0)I.push("?",u(_.query));if(_.fragment!==void 0)I.push("#",l(_.fragment));return I.join("")}let T=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,A=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,H=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function j(b,p){if(p[2]!==void 0&&b.path&&b.path[0]!=="/")return'URI path must start with "/" when authority is present.';if(typeof b.port==="number"&&(b.port<0||b.port>65535))return"URI port is malformed."}function V(b){if(b===void 0)return!1;let p=b.indexOf("%");while(p!==-1){if(p+2>=b.length||!/^[\da-f]{2}$/iu.test(b.slice(p+1,p+3)))return!0;p=b.indexOf("%",p+3)}return!1}function W(b){return b[0]==="["&&b[b.length-1]==="]"}function Y(b){let p=b[4];return V(b[3])||p!==void 0&&!W(p)&&V(p)||V(b[6])||V(b[7])||V(b[8])}function ae(b,p,_,z){if(!p.unicodeSupport&&(!_||!_.unicodeSupport)&&b.host&&!W(b.host)&&(p.domainHost||_&&_.domainHost)&&z===!1&&h(b.host))try{b.host=new URL("http://"+b.host).hostname}catch(I){return b.error=b.error||"Host's domain name can not be converted to ASCII: "+I,!0}return!1}function we(b,p){let _=Object.assign({},p),z={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},I=!1,U=!1,G=!1,K=!1,le=!1,Pe=!1,O=!1;if(_.reference==="suffix")if(_.scheme)b=_.scheme+":"+b;else b="//"+b;let q=b.match(A);if(q!==null&&q[1].indexOf("\\")!==-1)z.error="URI authority must not contain a literal backslash.",I=!0;let F=b.match(H);if(F!==null){let re=F[1],se=re.replace(/[\t\n\r]/g,"");if(se.length>=2){if(se.slice(0,2)!=="//")z.error=z.error||"URI authority must not contain a literal backslash.",I=!0;else if(re.length!==se.length)z.error=z.error||"URI authority introducer must not contain whitespace.",I=!0}}let ee=b.match(T);if(ee){if(z.scheme=ee[1],z.userinfo=ee[3],z.host=ee[4],z.port=parseInt(ee[5],10),z.path=ee[6]||"",z.query=ee[7],z.fragment=ee[8],z.scheme!==void 0){let _e=unescape(z.scheme);if(y.test(_e))z.scheme=_e.toLowerCase();else z.error=z.error||"URI scheme is malformed.",Pe=!0}if(U=Y(ee),U)z.error=z.error||"URI contains malformed percent-encoding.";if(isNaN(z.port))z.port=ee[5];let re=j(z,ee);if(re!==void 0)z.error=z.error||re,I=!0;if(z.host)if(m(z.host)===!1){let _e=W(z.host),Ze=z.host.indexOf("[")!==-1||z.host.indexOf("]")!==-1,ke=r(z.host);if(O=ke.isIPV6||ke.isIPVFuture===!0,le=Ze&&(!_e||ke.error===!0),z.host=O?ke.host:ke.host.toLowerCase(),le)z.error=z.error||"URI host is malformed.",I=!0}else O=!0;if(z.scheme===void 0&&z.userinfo===void 0&&z.host===void 0&&z.port===void 0&&z.query===void 0&&!z.path)z.reference="same-document";else if(z.scheme===void 0)z.reference="relative";else if(z.fragment===void 0)z.reference="absolute";else z.reference="uri";if(_.reference&&_.reference!=="suffix"&&_.reference!==z.reference)z.error=z.error||"URI is not a "+_.reference+" reference.";let se=v(_.scheme||z.scheme);if(!le)K=ae(z,_,se,O);if(b.indexOf("%")!==-1&&z.host!==void 0&&!le){let _e=O?z.host:s(z.host,!0);if(!O)_e=s(_e.toLowerCase());z.host=d(_e,O)}if(!se||se&&!se.skipNormalize){if(z.path)z.path=i(z.path);if(z.query)z.query=c(z.query);if(z.fragment)z.fragment=c(z.fragment)}if(se&&se.parse){if(se.parse(z,_),se===f.urn&&z.nid===void 0)G=!0}}else z.error=z.error||"URI can not be parsed.";return{parsed:z,malformedAuthorityOrPort:I,malformedPercentEncoding:U,malformedSchemeSpecific:G,malformedHost:K,malformedScheme:Pe}}function Re(b,p){return we(b,p).parsed}function Ce(b,p){return pe(b,p).normalized}function pe(b,p){let{parsed:_,malformedAuthorityOrPort:z,malformedPercentEncoding:I,malformedSchemeSpecific:U,malformedHost:G,malformedScheme:K}=we(b,p);return{normalized:z||I||U||G||K?b:S(_,p),malformedAuthorityOrPort:z,malformedPercentEncoding:I,malformedSchemeSpecific:U,malformedHost:G,malformedScheme:K}}function N(b,p){if(typeof b!=="string"&&typeof b!=="object")return;let _;try{_=typeof b==="string"?b:S(b,p)}catch{return}let{normalized:z,malformedAuthorityOrPort:I,malformedPercentEncoding:U,malformedSchemeSpecific:G,malformedHost:K,malformedScheme:le}=pe(_,p);return I||U||G||K||le?void 0:z}let M={SCHEMES:f,normalize:w,resolve:E,resolveComponent:C,equal:R,serialize:S,parse:Re};t.exports=M,t.exports.default=M,t.exports.fastUri=M});var pE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=dE();t.code='require("ajv/dist/runtime/uri").default',e.default=t}),Fu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=oo();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var r=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return r.CodeGen}});let o=wn(),n=no(),s=iz(),i=Ti(),a=de(),c=Ei(),u=ki(),l=ye(),d=uE(),m=pE(),h=(N,M)=>new RegExp(N,M);h.code="new RegExp";let f=["removeAdditional","useDefaults","coerceTypes"],v=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),y={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},g={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},P=200;function w(N){var M,b,p,_,z,I,U,G,K,le,Pe,O,q,F,ee,re,se,_e,Ze,ke,De,Ie,gt,Ve,jt;let zt=N.strict,Mt=(M=N.code)===null||M===void 0?void 0:M.optimize,Vt=Mt===!0||Mt===void 0?1:Mt||0,Ht=(p=(b=N.code)===null||b===void 0?void 0:b.regExp)!==null&&p!==void 0?p:h,ir=(_=N.uriResolver)!==null&&_!==void 0?_:m.default;return{strictSchema:(I=(z=N.strictSchema)!==null&&z!==void 0?z:zt)!==null&&I!==void 0?I:!0,strictNumbers:(G=(U=N.strictNumbers)!==null&&U!==void 0?U:zt)!==null&&G!==void 0?G:!0,strictTypes:(le=(K=N.strictTypes)!==null&&K!==void 0?K:zt)!==null&&le!==void 0?le:"log",strictTuples:(O=(Pe=N.strictTuples)!==null&&Pe!==void 0?Pe:zt)!==null&&O!==void 0?O:"log",strictRequired:(F=(q=N.strictRequired)!==null&&q!==void 0?q:zt)!==null&&F!==void 0?F:!1,code:N.code?{...N.code,optimize:Vt,regExp:Ht}:{optimize:Vt,regExp:Ht},loopRequired:(ee=N.loopRequired)!==null&&ee!==void 0?ee:P,loopEnum:(re=N.loopEnum)!==null&&re!==void 0?re:P,meta:(se=N.meta)!==null&&se!==void 0?se:!0,messages:(_e=N.messages)!==null&&_e!==void 0?_e:!0,inlineRefs:(Ze=N.inlineRefs)!==null&&Ze!==void 0?Ze:!0,schemaId:(ke=N.schemaId)!==null&&ke!==void 0?ke:"$id",addUsedSchema:(De=N.addUsedSchema)!==null&&De!==void 0?De:!0,validateSchema:(Ie=N.validateSchema)!==null&&Ie!==void 0?Ie:!0,validateFormats:(gt=N.validateFormats)!==null&>!==void 0?gt:!0,unicodeRegExp:(Ve=N.unicodeRegExp)!==null&&Ve!==void 0?Ve:!0,int32range:(jt=N.int32range)!==null&&jt!==void 0?jt:!0,uriResolver:ir}}var E=class{constructor(N={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,N=this.opts={...N,...w(N)};let{es5:M,lines:b}=this.opts.code;this.scope=new a.ValueScope({scope:{},prefixes:v,es5:M,lines:b}),this.logger=V(N.logger);let p=N.validateFormats;if(N.validateFormats=!1,this.RULES=(0,s.getRules)(),C.call(this,y,N,"NOT SUPPORTED"),C.call(this,g,N,"DEPRECATED","warn"),this._metaOpts=H.call(this),N.formats)T.call(this);if(this._addVocabularies(),this._addDefaultMetaSchema(),N.keywords)A.call(this,N.keywords);if(typeof N.meta=="object")this.addMetaSchema(N.meta);S.call(this),N.validateFormats=p}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:N,meta:M,schemaId:b}=this.opts,p=d;if(b==="id")p={...d},p.id=p.$id,delete p.$id;if(M&&N)this.addMetaSchema(p,p[b],!1)}defaultMeta(){let{meta:N,schemaId:M}=this.opts;return this.opts.defaultMeta=typeof N=="object"?N[M]||N:void 0}validate(N,M){let b;if(typeof N=="string"){if(b=this.getSchema(N),!b)throw Error(`no schema with key or ref "${N}"`)}else b=this.compile(N);let p=b(M);if(!("$async"in b))this.errors=b.errors;return p}compile(N,M){let b=this._addSchema(N,M);return b.validate||this._compileSchemaEnv(b)}compileAsync(N,M){if(typeof this.opts.loadSchema!="function")throw Error("options.loadSchema should be a function");let{loadSchema:b}=this.opts;return p.call(this,N,M);async function p(K,le){await _.call(this,K.$schema);let Pe=this._addSchema(K,le);return Pe.validate||z.call(this,Pe)}async function _(K){if(K&&!this.getSchema(K))await p.call(this,{$ref:K},!0)}async function z(K){try{return this._compileSchemaEnv(K)}catch(le){if(!(le instanceof n.default))throw le;return I.call(this,le),await U.call(this,le.missingSchema),z.call(this,K)}}function I({missingSchema:K,missingRef:le}){if(this.refs[K])throw Error(`AnySchema ${K} is loaded but ${le} cannot be resolved`)}async function U(K){let le=await G.call(this,K);if(!this.refs[K])await _.call(this,le.$schema);if(!this.refs[K])this.addSchema(le,K,M)}async function G(K){let le=this._loading[K];if(le)return le;try{return await(this._loading[K]=b(K))}finally{delete this._loading[K]}}}addSchema(N,M,b,p=this.opts.validateSchema){if(Array.isArray(N)){for(let z of N)this.addSchema(z,void 0,b,p);return this}let _;if(typeof N==="object"){let{schemaId:z}=this.opts;if(_=N[z],_!==void 0&&typeof _!="string")throw Error(`schema ${z} must be string`)}return M=(0,c.normalizeId)(M||_),this._checkUnique(M),this.schemas[M]=this._addSchema(N,b,M,p,!0),this}addMetaSchema(N,M,b=this.opts.validateSchema){return this.addSchema(N,M,!0,b),this}validateSchema(N,M){if(typeof N=="boolean")return!0;let b;if(b=N.$schema,b!==void 0&&typeof b!="string")throw Error("$schema must be a string");if(b=b||this.opts.defaultMeta||this.defaultMeta(),!b)return this.logger.warn("meta-schema not available"),this.errors=null,!0;let p=this.validate(b,N);if(!p&&M){let _="schema is invalid: "+this.errorsText();if(this.opts.validateSchema==="log")this.logger.error(_);else throw Error(_)}return p}getSchema(N){let M;while(typeof(M=R.call(this,N))=="string")N=M;if(M===void 0){let{schemaId:b}=this.opts,p=new i.SchemaEnv({schema:{},schemaId:b});if(M=i.resolveSchema.call(this,p,N),!M)return;this.refs[N]=M}return M.validate||this._compileSchemaEnv(M)}removeSchema(N){if(N instanceof RegExp)return this._removeAllSchemas(this.schemas,N),this._removeAllSchemas(this.refs,N),this;switch(typeof N){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let M=R.call(this,N);if(typeof M=="object")this._cache.delete(M.schema);return delete this.schemas[N],delete this.refs[N],this}case"object":{let M=N;this._cache.delete(M);let b=N[this.opts.schemaId];if(b)b=(0,c.normalizeId)(b),delete this.schemas[b],delete this.refs[b];return this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(N){for(let M of N)this.addKeyword(M);return this}addKeyword(N,M){let b;if(typeof N=="string"){if(b=N,typeof M=="object")this.logger.warn("these parameters are deprecated, see docs for addKeyword"),M.keyword=b}else if(typeof N=="object"&&M===void 0){if(M=N,b=M.keyword,Array.isArray(b)&&!b.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(Y.call(this,b,M),!M)return(0,l.eachItem)(b,(_)=>ae.call(this,_)),this;Re.call(this,M);let p={...M,type:(0,u.getJSONTypes)(M.type),schemaType:(0,u.getJSONTypes)(M.schemaType)};return(0,l.eachItem)(b,p.type.length===0?(_)=>ae.call(this,_,p):(_)=>p.type.forEach((z)=>ae.call(this,_,p,z))),this}getKeyword(N){let M=this.RULES.all[N];return typeof M=="object"?M.definition:!!M}removeKeyword(N){let{RULES:M}=this;delete M.keywords[N],delete M.all[N];for(let b of M.rules){let p=b.rules.findIndex((_)=>_.keyword===N);if(p>=0)b.rules.splice(p,1)}return this}addFormat(N,M){if(typeof M=="string")M=new RegExp(M);return this.formats[N]=M,this}errorsText(N=this.errors,{separator:M=", ",dataVar:b="data"}={}){if(!N||N.length===0)return"No errors";return N.map((p)=>`${b}${p.instancePath} ${p.message}`).reduce((p,_)=>p+M+_)}$dataMetaSchema(N,M){let b=this.RULES.all;N=JSON.parse(JSON.stringify(N));for(let p of M){let _=p.split("/").slice(1),z=N;for(let I of _)z=z[I];for(let I in b){let U=b[I];if(typeof U!="object")continue;let{$data:G}=U.definition,K=z[I];if(G&&K)z[I]=pe(K)}}return N}_removeAllSchemas(N,M){for(let b in N){let p=N[b];if(!M||M.test(b)){if(typeof p=="string")delete N[b];else if(p&&!p.meta)this._cache.delete(p.schema),delete N[b]}}}_addSchema(N,M,b,p=this.opts.validateSchema,_=this.opts.addUsedSchema){let z,{schemaId:I}=this.opts;if(typeof N=="object")z=N[I];else if(this.opts.jtd)throw Error("schema must be object");else if(typeof N!="boolean")throw Error("schema must be object or boolean");let U=this._cache.get(N);if(U!==void 0)return U;b=(0,c.normalizeId)(z||b);let G=c.getSchemaRefs.call(this,N,b);if(U=new i.SchemaEnv({schema:N,schemaId:I,meta:M,baseId:b,localRefs:G}),this._cache.set(U.schema,U),_&&!b.startsWith("#")){if(b)this._checkUnique(b);this.refs[b]=U}if(p)this.validateSchema(N,!0);return U}_checkUnique(N){if(this.schemas[N]||this.refs[N])throw Error(`schema with key or id "${N}" already exists`)}_compileSchemaEnv(N){if(N.meta)this._compileMetaSchema(N);else i.compileSchema.call(this,N);if(!N.validate)throw Error("ajv implementation error");return N.validate}_compileMetaSchema(N){let M=this.opts;this.opts=this._metaOpts;try{i.compileSchema.call(this,N)}finally{this.opts=M}}};E.ValidationError=o.default,E.MissingRefError=n.default,e.default=E;function C(N,M,b,p="error"){for(let _ in N){let z=_;if(z in M)this.logger[p](`${b}: option ${_}. ${N[z]}`)}}function R(N){return N=(0,c.normalizeId)(N),this.schemas[N]||this.refs[N]}function S(){let N=this.opts.schemas;if(!N)return;if(Array.isArray(N))this.addSchema(N);else for(let M in N)this.addSchema(N[M],M)}function T(){for(let N in this.opts.formats){let M=this.opts.formats[N];if(M)this.addFormat(N,M)}}function A(N){if(Array.isArray(N)){this.addVocabulary(N);return}this.logger.warn("keywords option as map is deprecated, pass array");for(let M in N){let b=N[M];if(!b.keyword)b.keyword=M;this.addKeyword(b)}}function H(){let N={...this.opts};for(let M of f)delete N[M];return N}let j={log(){},warn(){},error(){}};function V(N){if(N===!1)return j;if(N===void 0)return console;if(N.log&&N.warn&&N.error)return N;throw Error("logger must implement log, warn and error methods")}let W=/^[a-z_$][a-z0-9_$:-]*$/i;function Y(N,M){let{RULES:b}=this;if((0,l.eachItem)(N,(p)=>{if(b.keywords[p])throw Error(`Keyword ${p} is already defined`);if(!W.test(p))throw Error(`Keyword ${p} has invalid name`)}),!M)return;if(M.$data&&!(("code"in M)||("validate"in M)))throw Error('$data keyword must have "code" or "validate" function')}function ae(N,M,b){var p;let _=M===null||M===void 0?void 0:M.post;if(b&&_)throw Error('keyword with "post" flag cannot have "type"');let{RULES:z}=this,I=_?z.post:z.rules.find(({type:G})=>G===b);if(!I)I={type:b,rules:[]},z.rules.push(I);if(z.keywords[N]=!0,!M)return;let U={keyword:N,definition:{...M,type:(0,u.getJSONTypes)(M.type),schemaType:(0,u.getJSONTypes)(M.schemaType)}};if(M.before)we.call(this,I,U,M.before);else I.rules.push(U);z.all[N]=U,(p=M.implements)===null||p===void 0||p.forEach((G)=>this.addKeyword(G))}function we(N,M,b){let p=N.rules.findIndex((_)=>_.keyword===b);if(p>=0)N.rules.splice(p,0,M);else N.rules.push(M),this.logger.warn(`rule ${b} is not defined`)}function Re(N){let{metaSchema:M}=N;if(M===void 0)return;if(N.$data&&this.opts.$data)M=pe(M);N.validateSchema=this.compile(M,!0)}let Ce={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function pe(N){return{anyOf:[N,Ce]}}}),mE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};e.default=t}),Vu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;let t=no(),r=xt(),o=de(),n=kt(),s=Ti(),i=ye(),a={keyword:"$ref",schemaType:"string",code(l){let{gen:d,schema:m,it:h}=l,{baseId:f,schemaEnv:v,validateName:y,opts:g,self:P}=h,{root:w}=v;if((m==="#"||m==="#/")&&f===w.baseId)return C();let E=s.resolveRef.call(P,w,f,m);if(E===void 0)throw new t.default(h.opts.uriResolver,f,m);if(E instanceof s.SchemaEnv)return R(E);return S(E);function C(){if(v===w)return u(l,y,v,v.$async);let T=d.scopeValue("root",{ref:w});return u(l,o._`${T}.validate`,w,w.$async)}function R(T){u(l,c(l,T),T,T.$async)}function S(T){let A=d.scopeValue("schema",g.code.source===!0?{ref:T,code:(0,o.stringify)(T)}:{ref:T}),H=d.name("valid"),j=l.subschema({schema:T,dataTypes:[],schemaPath:o.nil,topSchemaRef:A,errSchemaPath:m},H);l.mergeEvaluated(j),l.ok(H)}}};function c(l,d){let{gen:m}=l;return d.validate?m.scopeValue("validate",{ref:d.validate}):o._`${m.scopeValue("wrapper",{ref:d})}.validate`}e.getValidate=c;function u(l,d,m,h){let{gen:f,it:v}=l,{allErrors:y,schemaEnv:g,opts:P}=v,w=P.passContext?n.default.this:o.nil;if(h)E();else C();function E(){if(!g.$async)throw Error("async schema referenced by sync schema");let T=f.let("valid");f.try(()=>{if(f.code(o._`await ${(0,r.callValidateCode)(l,d,w)}`),S(d),!y)f.assign(T,!0)},(A)=>{if(f.if(o._`!(${A} instanceof ${v.ValidationError})`,()=>f.throw(A)),R(A),!y)f.assign(T,!1)}),l.ok(T)}function C(){l.result((0,r.callValidateCode)(l,d,w),()=>S(d),()=>R(d))}function R(T){let A=o._`${T}.errors`;f.assign(n.default.vErrors,o._`${n.default.vErrors} === null ? ${A} : ${n.default.vErrors}.concat(${A})`),f.assign(n.default.errors,o._`${n.default.vErrors}.length`)}function S(T){var A;if(!v.opts.unevaluated)return;let H=(A=m===null||m===void 0?void 0:m.validate)===null||A===void 0?void 0:A.evaluated;if(v.props!==!0)if(H&&!H.dynamicProps){if(H.props!==void 0)v.props=i.mergeEvaluated.props(f,H.props,v.props)}else{let j=f.var("props",o._`${T}.evaluated.props`);v.props=i.mergeEvaluated.props(f,j,v.props,o.Name)}if(v.items!==!0)if(H&&!H.dynamicItems){if(H.items!==void 0)v.items=i.mergeEvaluated.items(f,H.items,v.items)}else{let j=f.var("items",o._`${T}.evaluated.items`);v.items=i.mergeEvaluated.items(f,j,v.items,o.Name)}}}e.callRef=u,e.default=a}),lz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mE(),r=Vu(),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",t.default,r.default];e.default=o}),fE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=t.operators,o={maximum:{okStr:"<=",ok:r.LTE,fail:r.GT},minimum:{okStr:">=",ok:r.GTE,fail:r.LT},exclusiveMaximum:{okStr:"<",ok:r.LT,fail:r.GTE},exclusiveMinimum:{okStr:">",ok:r.GT,fail:r.LTE}},n={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:s,schemaCode:i})=>t.str`must be ${o[s].okStr} ${i}`,params:({keyword:s,schemaCode:i})=>t._`{comparison: ${o[s].okStr}, limit: ${i}}`},code(s){let{keyword:i,data:a,schemaCode:c}=s;s.fail$data(t._`${a} ${o[i].fail} ${c} || isNaN(${a})`)}};e.default=n}),hE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:o})=>t.str`must be multiple of ${o}`,params:({schemaCode:o})=>t._`{multipleOf: ${o}}`},code(o){let{gen:n,data:s,schemaCode:i,it:a}=o,c=a.opts.multipleOfPrecision,u=n.let("res"),l=c?t._`Math.abs(Math.round(${u}) - ${u}) > 1e-${c}`:t._`${u} !== parseInt(${u})`;o.fail$data(t._`(${i} === 0 || (${u} = ${s}/${i}, ${l}))`)}};e.default=r}),gE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});function t(r){let o=r.length,n=0,s=0,i;while(s<o)if(n++,i=r.charCodeAt(s++),i>=55296&&i<=56319&&s<o){if(i=r.charCodeAt(s),(i&64512)===56320)s++}return n}e.default=t,t.code='require("ajv/dist/runtime/ucs2length").default'}),_E=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=ye(),o=gE(),n={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:s,schemaCode:i}){let a=s==="maxLength"?"more":"fewer";return t.str`must NOT have ${a} than ${i} characters`},params:({schemaCode:s})=>t._`{limit: ${s}}`},code(s){let{keyword:i,data:a,schemaCode:c,it:u}=s,l=i==="maxLength"?t.operators.GT:t.operators.LT,d=u.opts.unicode===!1?t._`${a}.length`:t._`${(0,r.useFunc)(s.gen,o.default)}(${a})`;s.fail$data(t._`${d} ${l} ${c}`)}};e.default=n}),yE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=ye(),o=de(),n={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:s})=>o.str`must match pattern "${s}"`,params:({schemaCode:s})=>o._`{pattern: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s,m=d.opts.unicodeRegExp?"u":"";if(c){let{regExp:h}=d.opts.code,f=h.code==="new RegExp"?o._`new RegExp`:(0,r.useFunc)(i,h),v=i.let("valid");i.try(()=>i.assign(v,o._`${f}(${l}, ${m}).test(${a})`),()=>i.assign(v,!1)),s.fail$data(o._`!${v}`)}else{let h=(0,t.usePattern)(s,u);s.fail$data(o._`!${h}.test(${a})`)}}};e.default=n}),vE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxProperties"?"more":"fewer";return t.str`must NOT have ${s} than ${n} properties`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxProperties"?t.operators.GT:t.operators.LT;o.fail$data(t._`Object.keys(${s}).length ${a} ${i}`)}};e.default=r}),SE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=de(),o=ye(),n={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:s}})=>r.str`must have required property '${s}'`,params:({params:{missingProperty:s}})=>r._`{missingProperty: ${s}}`},code(s){let{gen:i,schema:a,schemaCode:c,data:u,$data:l,it:d}=s,{opts:m}=d;if(!l&&a.length===0)return;let h=a.length>=m.loopRequired;if(d.allErrors)f();else v();if(m.strictRequired){let P=s.parentSchema.properties,{definedProperties:w}=s.it;for(let E of a)if((P===null||P===void 0?void 0:P[E])===void 0&&!w.has(E)){let C=`required property "${E}" is not defined at "${d.schemaEnv.baseId+d.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(d,C,d.opts.strictRequired)}}function f(){if(h||l)s.block$data(r.nil,y);else for(let P of a)(0,t.checkReportMissingProp)(s,P)}function v(){let P=i.let("missing");if(h||l){let w=i.let("valid",!0);s.block$data(w,()=>g(P,w)),s.ok(w)}else i.if((0,t.checkMissingProp)(s,a,P)),(0,t.reportMissingProp)(s,P),i.else()}function y(){i.forOf("prop",c,(P)=>{s.setParams({missingProperty:P}),i.if((0,t.noPropertyInData)(i,u,P,m.ownProperties),()=>s.error())})}function g(P,w){s.setParams({missingProperty:P}),i.forOf(P,c,()=>{i.assign(w,(0,t.propertyInData)(i,u,P,m.ownProperties)),i.if((0,r.not)(w),()=>{s.error(),i.break()})},r.nil)}}};e.default=n}),bE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:o,schemaCode:n}){let s=o==="maxItems"?"more":"fewer";return t.str`must NOT have ${s} than ${n} items`},params:({schemaCode:o})=>t._`{limit: ${o}}`},code(o){let{keyword:n,data:s,schemaCode:i}=o,a=n==="maxItems"?t.operators.GT:t.operators.LT;o.fail$data(t._`${s}.length ${a} ${i}`)}};e.default=r}),Hu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=cz();t.code='require("ajv/dist/runtime/equal").default',e.default=t}),zE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ki(),r=de(),o=ye(),n=Hu(),s={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i,j:a}})=>r.str`must NOT have duplicate items (items ## ${a} and ${i} are identical)`,params:({params:{i,j:a}})=>r._`{i: ${i}, j: ${a}}`},code(i){let{gen:a,data:c,$data:u,schema:l,parentSchema:d,schemaCode:m,it:h}=i;if(!u&&!l)return;let f=a.let("valid"),v=d.items?(0,t.getSchemaTypes)(d.items):[];i.block$data(f,y,r._`${m} === false`),i.ok(f);function y(){let E=a.let("i",r._`${c}.length`),C=a.let("j");i.setParams({i:E,j:C}),a.assign(f,!0),a.if(r._`${E} > 1`,()=>(g()?P:w)(E,C))}function g(){return v.length>0&&!v.some((E)=>E==="object"||E==="array")}function P(E,C){let R=a.name("item"),S=(0,t.checkDataTypes)(v,R,h.opts.strictNumbers,t.DataType.Wrong),T=a.const("indices",r._`{}`);a.for(r._`;${E}--;`,()=>{if(a.let(R,r._`${c}[${E}]`),a.if(S,r._`continue`),v.length>1)a.if(r._`typeof ${R} == "string"`,r._`${R} += "_"`);a.if(r._`typeof ${T}[${R}] == "number"`,()=>{a.assign(C,r._`${T}[${R}]`),i.error(),a.assign(f,!1).break()}).code(r._`${T}[${R}] = ${E}`)})}function w(E,C){let R=(0,o.useFunc)(a,n.default),S=a.name("outer");a.label(S).for(r._`;${E}--;`,()=>a.for(r._`${C} = ${E}; ${C}--;`,()=>a.if(r._`${R}(${c}[${E}], ${c}[${C}])`,()=>{i.error(),a.assign(f,!1).break(S)})))}}};e.default=s}),$E=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=ye(),o=Hu(),n={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:s})=>t._`{allowedValue: ${s}}`},code(s){let{gen:i,data:a,$data:c,schemaCode:u,schema:l}=s;if(c||l&&typeof l=="object")s.fail$data(t._`!${(0,r.useFunc)(i,o.default)}(${a}, ${u})`);else s.fail(t._`${l} !== ${a}`)}};e.default=n}),RE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=ye(),o=Hu(),n={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:s})=>t._`{allowedValues: ${s}}`},code(s){let{gen:i,data:a,$data:c,schema:u,schemaCode:l,it:d}=s;if(!c&&u.length===0)throw Error("enum must have non-empty array");let m=u.length>=d.opts.loopEnum,h,f=()=>h!==null&&h!==void 0?h:h=(0,r.useFunc)(i,o.default),v;if(m||c)v=i.let("valid"),s.block$data(v,y);else{if(!Array.isArray(u))throw Error("ajv implementation error");let P=i.const("vSchema",l);v=(0,t.or)(...u.map((w,E)=>g(P,E)))}s.pass(v);function y(){i.assign(v,!1),i.forOf("v",l,(P)=>i.if(t._`${f()}(${a}, ${P})`,()=>i.assign(v,!0).break()))}function g(P,w){let E=u[w];return typeof E==="object"&&E!==null?t._`${f()}(${a}, ${P}[${w}])`:t._`${a} === ${E}`}}};e.default=n}),dz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=fE(),r=hE(),o=_E(),n=yE(),s=vE(),i=SE(),a=bE(),c=zE(),u=$E(),l=RE(),d=[t.default,r.default,o.default,n.default,s.default,i.default,a.default,c.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},u.default,l.default];e.default=d}),pz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;let t=de(),r=ye(),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:s}})=>t.str`must NOT have more than ${s} items`,params:({params:{len:s}})=>t._`{limit: ${s}}`},code(s){let{parentSchema:i,it:a}=s,{items:c}=i;if(!Array.isArray(c)){(0,r.checkStrictMode)(a,'"additionalItems" is ignored when "items" is not an array of schemas');return}n(s,c)}};function n(s,i){let{gen:a,schema:c,data:u,keyword:l,it:d}=s;d.items=!0;let m=a.const("len",t._`${u}.length`);if(c===!1)s.setParams({len:i.length}),s.pass(t._`${m} <= ${i.length}`);else if(typeof c=="object"&&!(0,r.alwaysValidSchema)(d,c)){let f=a.var("valid",t._`${m} <= ${i.length}`);a.if((0,t.not)(f),()=>h(f)),s.ok(f)}function h(f){a.forRange("i",i.length,m,(v)=>{if(s.subschema({keyword:l,dataProp:v,dataPropType:r.Type.Num},f),!d.allErrors)a.if((0,t.not)(f),()=>a.break())})}}e.validateAdditionalItems=n,e.default=o}),mz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;let t=de(),r=ye(),o=xt(),n={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(i){let{schema:a,it:c}=i;if(Array.isArray(a))return s(i,"additionalItems",a);if(c.items=!0,(0,r.alwaysValidSchema)(c,a))return;i.ok((0,o.validateArray)(i))}};function s(i,a,c=i.schema){let{gen:u,parentSchema:l,data:d,keyword:m,it:h}=i;if(y(l),h.opts.unevaluated&&c.length&&h.items!==!0)h.items=r.mergeEvaluated.items(u,c.length,h.items);let f=u.name("valid"),v=u.const("len",t._`${d}.length`);c.forEach((g,P)=>{if((0,r.alwaysValidSchema)(h,g))return;u.if(t._`${v} > ${P}`,()=>i.subschema({keyword:m,schemaProp:P,dataProp:P},f)),i.ok(f)});function y(g){let{opts:P,errSchemaPath:w}=h,E=c.length,C=E===g.minItems&&(E===g.maxItems||g[a]===!1);if(P.strictTuples&&!C){let R=`"${m}" is ${E}-tuple, but minItems or maxItems/${a} are not specified or different at path "${w}"`;(0,r.checkStrictMode)(h,R,P.strictTuples)}}}e.validateTuple=s,e.default=n}),wE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=mz(),r={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:(o)=>(0,t.validateTuple)(o,"items")};e.default=r}),PE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=ye(),o=xt(),n=pz(),s={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:i}})=>t.str`must NOT have more than ${i} items`,params:({params:{len:i}})=>t._`{limit: ${i}}`},code(i){let{schema:a,parentSchema:c,it:u}=i,{prefixItems:l}=c;if(u.items=!0,(0,r.alwaysValidSchema)(u,a))return;if(l)(0,n.validateAdditionalItems)(i,l);else i.ok((0,o.validateArray)(i))}};e.default=s}),kE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=ye(),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:n,max:s}})=>s===void 0?t.str`must contain at least ${n} valid item(s)`:t.str`must contain at least ${n} and no more than ${s} valid item(s)`,params:({params:{min:n,max:s}})=>s===void 0?t._`{minContains: ${n}}`:t._`{minContains: ${n}, maxContains: ${s}}`},code(n){let{gen:s,schema:i,parentSchema:a,data:c,it:u}=n,l,d,{minContains:m,maxContains:h}=a;if(u.opts.next)l=m===void 0?1:m,d=h;else l=1;let f=s.const("len",t._`${c}.length`);if(n.setParams({min:l,max:d}),d===void 0&&l===0){(0,r.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(d!==void 0&&l>d){(0,r.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),n.fail();return}if((0,r.alwaysValidSchema)(u,i)){let w=t._`${f} >= ${l}`;if(d!==void 0)w=t._`${w} && ${f} <= ${d}`;n.pass(w);return}u.items=!0;let v=s.name("valid");if(d===void 0&&l===1)g(v,()=>s.if(v,()=>s.break()));else if(l===0){if(s.let(v,!0),d!==void 0)s.if(t._`${c}.length > 0`,y)}else s.let(v,!1),y();n.result(v,()=>n.reset());function y(){let w=s.name("_valid"),E=s.let("count",0);g(w,()=>s.if(w,()=>P(E)))}function g(w,E){s.forRange("i",0,f,(C)=>{n.subschema({keyword:"contains",dataProp:C,dataPropType:r.Type.Num,compositeRule:!0},w),E()})}function P(w){if(s.code(t._`${w}++`),d===void 0)s.if(t._`${w} >= ${l}`,()=>s.assign(v,!0).break());else if(s.if(t._`${w} > ${d}`,()=>s.assign(v,!1).break()),l===1)s.assign(v,!0);else s.if(t._`${w} >= ${l}`,()=>s.assign(v,!0))}}};e.default=o}),Bu=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;let t=de(),r=ye(),o=xt();e.error={message:({params:{property:c,depsCount:u,deps:l}})=>{let d=u===1?"property":"properties";return t.str`must have ${d} ${l} when property ${c} is present`},params:({params:{property:c,depsCount:u,deps:l,missingProperty:d}})=>t._`{property: ${c},
|
|
125
|
-
missingProperty: ${d},
|
|
126
|
-
depsCount: ${u},
|
|
127
|
-
deps: ${l}}`};let n={keyword:"dependencies",type:"object",schemaType:"object",error:e.error,code(c){let[u,l]=s(c);i(c,u),a(c,l)}};function s({schema:c}){let u={},l={};for(let d in c){if(d==="__proto__")continue;let m=Array.isArray(c[d])?u:l;m[d]=c[d]}return[u,l]}function i(c,u=c.schema){let{gen:l,data:d,it:m}=c;if(Object.keys(u).length===0)return;let h=l.let("missing");for(let f in u){let v=u[f];if(v.length===0)continue;let y=(0,o.propertyInData)(l,d,f,m.opts.ownProperties);if(c.setParams({property:f,depsCount:v.length,deps:v.join(", ")}),m.allErrors)l.if(y,()=>{for(let g of v)(0,o.checkReportMissingProp)(c,g)});else l.if(t._`${y} && (${(0,o.checkMissingProp)(c,v,h)})`),(0,o.reportMissingProp)(c,h),l.else()}}e.validatePropertyDeps=i;function a(c,u=c.schema){let{gen:l,data:d,keyword:m,it:h}=c,f=l.name("valid");for(let v in u){if((0,r.alwaysValidSchema)(h,u[v]))continue;l.if((0,o.propertyInData)(l,d,v,h.opts.ownProperties),()=>{let y=c.subschema({keyword:m,schemaProp:v},f);c.mergeValidEvaluated(y,f)},()=>l.var(f,!0)),c.ok(f)}}e.validateSchemaDeps=a,e.default=n}),xE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=ye(),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:n})=>t._`{propertyName: ${n.propertyName}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n;if((0,r.alwaysValidSchema)(c,i))return;let u=s.name("valid");s.forIn("key",a,(l)=>{n.setParams({propertyName:l}),n.subschema({keyword:"propertyNames",data:l,dataTypes:["string"],propertyName:l,compositeRule:!0},u),s.if((0,t.not)(u),()=>{if(n.error(!0),!c.allErrors)s.break()})}),n.ok(u)}};e.default=o}),fz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=de(),o=kt(),n=ye(),s={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:i})=>r._`{additionalProperty: ${i.additionalProperty}}`},code(i){let{gen:a,schema:c,parentSchema:u,data:l,errsCount:d,it:m}=i;if(!d)throw Error("ajv implementation error");let{allErrors:h,opts:f}=m;if(m.props=!0,f.removeAdditional!=="all"&&(0,n.alwaysValidSchema)(m,c))return;let v=(0,t.allSchemaProperties)(u.properties),y=(0,t.allSchemaProperties)(u.patternProperties);g(),i.ok(r._`${d} === ${o.default.errors}`);function g(){a.forIn("key",l,(R)=>{if(!v.length&&!y.length)E(R);else a.if(P(R),()=>E(R))})}function P(R){let S;if(v.length>8){let T=(0,n.schemaRefOrVal)(m,u.properties,"properties");S=(0,t.isOwnProperty)(a,T,R)}else if(v.length)S=(0,r.or)(...v.map((T)=>r._`${R} === ${T}`));else S=r.nil;if(y.length)S=(0,r.or)(S,...y.map((T)=>r._`${(0,t.usePattern)(i,T)}.test(${R})`));return(0,r.not)(S)}function w(R){a.code(r._`delete ${l}[${R}]`)}function E(R){if(f.removeAdditional==="all"||f.removeAdditional&&c===!1){w(R);return}if(c===!1){if(i.setParams({additionalProperty:R}),i.error(),!h)a.break();return}if(typeof c=="object"&&!(0,n.alwaysValidSchema)(m,c)){let S=a.name("valid");if(f.removeAdditional==="failing")C(R,S,!1),a.if((0,r.not)(S),()=>{i.reset(),w(R)});else if(C(R,S),!h)a.if((0,r.not)(S),()=>a.break())}}function C(R,S,T){let A={keyword:"additionalProperties",dataProp:R,dataPropType:n.Type.Str};if(T===!1)Object.assign(A,{compositeRule:!0,createErrors:!1,allErrors:!1});i.subschema(A,S)}}};e.default=s}),EE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=oo(),r=xt(),o=ye(),n=fz(),s={keyword:"properties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,parentSchema:u,data:l,it:d}=i;if(d.opts.removeAdditional==="all"&&u.additionalProperties===void 0)n.default.code(new t.KeywordCxt(d,n.default,"additionalProperties"));let m=(0,r.allSchemaProperties)(c);for(let g of m)d.definedProperties.add(g);if(d.opts.unevaluated&&m.length&&d.props!==!0)d.props=o.mergeEvaluated.props(a,(0,o.toHash)(m),d.props);let h=m.filter((g)=>!(0,o.alwaysValidSchema)(d,c[g]));if(h.length===0)return;let f=a.name("valid");for(let g of h){if(v(g))y(g);else{if(a.if((0,r.propertyInData)(a,l,g,d.opts.ownProperties)),y(g),!d.allErrors)a.else().var(f,!0);a.endIf()}i.it.definedProperties.add(g),i.ok(f)}function v(g){return d.opts.useDefaults&&!d.compositeRule&&c[g].default!==void 0}function y(g){i.subschema({keyword:"properties",schemaProp:g,dataProp:g},f)}}};e.default=s}),TE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=xt(),r=de(),o=ye(),n=ye(),s={keyword:"patternProperties",type:"object",schemaType:"object",code(i){let{gen:a,schema:c,data:u,parentSchema:l,it:d}=i,{opts:m}=d,h=(0,t.allSchemaProperties)(c),f=h.filter((C)=>(0,o.alwaysValidSchema)(d,c[C]));if(h.length===0||f.length===h.length&&(!d.opts.unevaluated||d.props===!0))return;let v=m.strictSchema&&!m.allowMatchingProperties&&l.properties,y=a.name("valid");if(d.props!==!0&&!(d.props instanceof r.Name))d.props=(0,n.evaluatedPropsToName)(a,d.props);let{props:g}=d;P();function P(){for(let C of h){if(v)w(C);if(d.allErrors)E(C);else a.var(y,!0),E(C),a.if(y)}}function w(C){for(let R in v)if(new RegExp(C).test(R))(0,o.checkStrictMode)(d,`property ${R} matches pattern ${C} (use allowMatchingProperties)`)}function E(C){a.forIn("key",u,(R)=>{a.if(r._`${(0,t.usePattern)(i,C)}.test(${R})`,()=>{let S=f.includes(C);if(!S)i.subschema({keyword:"patternProperties",schemaProp:C,dataProp:R,dataPropType:n.Type.Str},y);if(d.opts.unevaluated&&g!==!0)a.assign(r._`${g}[${R}]`,!0);else if(!S&&!d.allErrors)a.if((0,r.not)(y),()=>a.break())})})}}};e.default=s}),OE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ye(),r={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(o){let{gen:n,schema:s,it:i}=o;if((0,t.alwaysValidSchema)(i,s)){o.fail();return}let a=n.name("valid");o.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},a),o.failResult(a,()=>o.reset(),()=>o.error())},error:{message:"must NOT be valid"}};e.default=r}),CE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:xt().validateUnion,error:{message:"must match a schema in anyOf"}};e.default=t}),IE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=ye(),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:n})=>t._`{passingSchemas: ${n.passing}}`},code(n){let{gen:s,schema:i,parentSchema:a,it:c}=n;if(!Array.isArray(i))throw Error("ajv implementation error");if(c.opts.discriminator&&a.discriminator)return;let u=i,l=s.let("valid",!1),d=s.let("passing",null),m=s.name("_valid");n.setParams({passing:d}),s.block(h),n.result(l,()=>n.reset(),()=>n.error(!0));function h(){u.forEach((f,v)=>{let y;if((0,r.alwaysValidSchema)(c,f))s.var(m,!0);else y=n.subschema({keyword:"oneOf",schemaProp:v,compositeRule:!0},m);if(v>0)s.if(t._`${m} && ${l}`).assign(l,!1).assign(d,t._`[${d}, ${v}]`).else();s.if(m,()=>{if(s.assign(l,!0),s.assign(d,v),y)n.mergeEvaluated(y,t.Name)})})}}};e.default=o}),NE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ye(),r={keyword:"allOf",schemaType:"array",code(o){let{gen:n,schema:s,it:i}=o;if(!Array.isArray(s))throw Error("ajv implementation error");let a=n.name("valid");s.forEach((c,u)=>{if((0,t.alwaysValidSchema)(i,c))return;let l=o.subschema({keyword:"allOf",schemaProp:u},a);o.ok(a),o.mergeEvaluated(l)})}};e.default=r}),AE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=ye(),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:s})=>t.str`must match "${s.ifClause}" schema`,params:({params:s})=>t._`{failingKeyword: ${s.ifClause}}`},code(s){let{gen:i,parentSchema:a,it:c}=s;if(a.then===void 0&&a.else===void 0)(0,r.checkStrictMode)(c,'"if" without "then" and "else" is ignored');let u=n(c,"then"),l=n(c,"else");if(!u&&!l)return;let d=i.let("valid",!0),m=i.name("_valid");if(h(),s.reset(),u&&l){let v=i.let("ifClause");s.setParams({ifClause:v}),i.if(m,f("then",v),f("else",v))}else if(u)i.if(m,f("then"));else i.if((0,t.not)(m),f("else"));s.pass(d,()=>s.error(!0));function h(){let v=s.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},m);s.mergeEvaluated(v)}function f(v,y){return()=>{let g=s.subschema({keyword:v},m);if(i.assign(d,m),s.mergeValidEvaluated(g,d),y)i.assign(y,t._`${v}`);else s.setParams({ifClause:v})}}}};function n(s,i){let a=s.schema[i];return a!==void 0&&!(0,r.alwaysValidSchema)(s,a)}e.default=o}),jE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ye(),r={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:o,parentSchema:n,it:s}){if(n.if===void 0)(0,t.checkStrictMode)(s,`"${o}" without "if" is ignored`)}};e.default=r}),hz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=pz(),r=wE(),o=mz(),n=PE(),s=kE(),i=Bu(),a=xE(),c=fz(),u=EE(),l=TE(),d=OE(),m=CE(),h=IE(),f=NE(),v=AE(),y=jE();function g(P=!1){let w=[d.default,m.default,h.default,f.default,v.default,y.default,a.default,c.default,i.default,u.default,l.default];if(P)w.push(r.default,n.default);else w.push(t.default,o.default);return w.push(s.default),w}e.default=g}),ME=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:o})=>t.str`must match format "${o}"`,params:({schemaCode:o})=>t._`{format: ${o}}`},code(o,n){let{gen:s,data:i,$data:a,schema:c,schemaCode:u,it:l}=o,{opts:d,errSchemaPath:m,schemaEnv:h,self:f}=l;if(!d.validateFormats)return;if(a)v();else y();function v(){let g=s.scopeValue("formats",{ref:f.formats,code:d.code.formats}),P=s.const("fDef",t._`${g}[${u}]`),w=s.let("fType"),E=s.let("format");s.if(t._`typeof ${P} == "object" && !(${P} instanceof RegExp)`,()=>s.assign(w,t._`${P}.type || "string"`).assign(E,t._`${P}.validate`),()=>s.assign(w,t._`"string"`).assign(E,P)),o.fail$data((0,t.or)(C(),R()));function C(){if(d.strictSchema===!1)return t.nil;return t._`${u} && !${E}`}function R(){let S=h.$async?t._`(${P}.async ? await ${E}(${i}) : ${E}(${i}))`:t._`${E}(${i})`,T=t._`(typeof ${E} == "function" ? ${S} : ${E}.test(${i}))`;return t._`${E} && ${E} !== true && ${w} === ${n} && !${T}`}}function y(){let g=f.formats[c];if(!g){C();return}if(g===!0)return;let[P,w,E]=R(g);if(P===n)o.pass(S());function C(){if(d.strictSchema===!1){f.logger.warn(T());return}throw Error(T());function T(){return`unknown format "${c}" ignored in schema at path "${m}"`}}function R(T){let A=T instanceof RegExp?(0,t.regexpCode)(T):d.code.formats?t._`${d.code.formats}${(0,t.getProperty)(c)}`:void 0,H=s.scopeValue("formats",{key:c,ref:T,code:A});if(typeof T=="object"&&!(T instanceof RegExp))return[T.type||"string",T.validate,t._`${H}.validate`];return["string",T,H]}function S(){if(typeof g=="object"&&!(g instanceof RegExp)&&g.async){if(!h.$async)throw Error("async format in sync schema");return t._`await ${E}(${i})`}return typeof w=="function"?t._`${E}(${i})`:t._`${E}.test(${i})`}}}};e.default=r}),gz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=[ME().default];e.default=t}),_z=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],e.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}),yz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lz(),r=dz(),o=hz(),n=gz(),s=_z(),i=[t.default,r.default,(0,o.default)(),n.default,s.metadataVocabulary,s.contentVocabulary];e.default=i}),ZE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(r){r.Tag="tag",r.Mapping="mapping"})(t||(e.DiscrError=t={}))}),Ju=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=ZE(),o=Ti(),n=no(),s=ye(),i={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:a,tagName:c}})=>a===r.DiscrError.Tag?`tag "${c}" must be string`:`value of tag "${c}" must be in oneOf`,params:({params:{discrError:a,tag:c,tagName:u}})=>t._`{error: ${a}, tag: ${u}, tagValue: ${c}}`},code(a){let{gen:c,data:u,schema:l,parentSchema:d,it:m}=a,{oneOf:h}=d;if(!m.opts.discriminator)throw Error("discriminator: requires discriminator option");let f=l.propertyName;if(typeof f!="string")throw Error("discriminator: requires propertyName");if(l.mapping)throw Error("discriminator: mapping is not supported");if(!h)throw Error("discriminator: requires oneOf keyword");let v=c.let("valid",!1),y=c.const("tag",t._`${u}${(0,t.getProperty)(f)}`);c.if(t._`typeof ${y} == "string"`,()=>g(),()=>a.error(!1,{discrError:r.DiscrError.Tag,tag:y,tagName:f})),a.ok(v);function g(){let E=w();c.if(!1);for(let C in E)c.elseIf(t._`${y} === ${C}`),c.assign(v,P(E[C]));c.else(),a.error(!1,{discrError:r.DiscrError.Mapping,tag:y,tagName:f}),c.endIf()}function P(E){let C=c.name("valid"),R=a.subschema({keyword:"oneOf",schemaProp:E},C);return a.mergeEvaluated(R,t.Name),C}function w(){var E;let C={},R=T(d),S=!0;for(let j=0;j<h.length;j++){let V=h[j];if((V===null||V===void 0?void 0:V.$ref)&&!(0,s.schemaHasRulesButRef)(V,m.self.RULES)){let Y=V.$ref;if(V=o.resolveRef.call(m.self,m.schemaEnv.root,m.baseId,Y),V instanceof o.SchemaEnv)V=V.schema;if(V===void 0)throw new n.default(m.opts.uriResolver,m.baseId,Y)}let W=(E=V===null||V===void 0?void 0:V.properties)===null||E===void 0?void 0:E[f];if(typeof W!="object")throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);S=S&&(R||T(V)),A(W,j)}if(!S)throw Error(`discriminator: "${f}" must be required`);return C;function T({required:j}){return Array.isArray(j)&&j.includes(f)}function A(j,V){if(j.const)H(j.const,V);else if(j.enum)for(let W of j.enum)H(W,V);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function H(j,V){if(typeof j!="string"||j in C)throw Error(`discriminator: "${f}" values must be unique strings`);C[j]=V}}}};e.default=i}),qE=B((e,t)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),vz=B((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;let r=Fu(),o=yz(),n=Ju(),s=qE(),i=["/properties"],a="http://json-schema.org/draft-07/schema";var c=class extends r.default{_addVocabularies(){if(super._addVocabularies(),o.default.forEach((h)=>this.addVocabulary(h)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let h=this.opts.$data?this.$dataMetaSchema(s,i):s;this.addMetaSchema(h,a,!1),this.refs["http://json-schema.org/schema"]=a}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(a)?a:void 0)}};e.Ajv=c,t.exports=e=c,t.exports.Ajv=c,Object.defineProperty(e,"__esModule",{value:!0}),e.default=c;var u=oo();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var l=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return l.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return l.CodeGen}});var d=wn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return d.default}});var m=no();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return m.default}})}),Sz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicAnchor=void 0;let t=de(),r=kt(),o=Ti(),n=Vu(),s={keyword:"$dynamicAnchor",schemaType:"string",code:(c)=>i(c,c.schema)};function i(c,u){let{gen:l,it:d}=c;d.schemaEnv.root.dynamicAnchors[u]=!0;let m=t._`${r.default.dynamicAnchors}${(0,t.getProperty)(u)}`,h=d.errSchemaPath==="#"?d.validateName:a(c);l.if(t._`!${m}`,()=>l.assign(m,h))}e.dynamicAnchor=i;function a(c){let{schemaEnv:u,schema:l,self:d}=c.it,{root:m,baseId:h,localRefs:f,meta:v}=u.root,{schemaId:y}=d.opts,g=new o.SchemaEnv({schema:l,schemaId:y,root:m,baseId:h,localRefs:f,meta:v});return o.compileSchema.call(d,g),(0,n.getValidate)(c,g)}e.default=s}),bz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.dynamicRef=void 0;let t=de(),r=kt(),o=Vu(),n={keyword:"$dynamicRef",schemaType:"string",code:(i)=>s(i,i.schema)};function s(i,a){let{gen:c,keyword:u,it:l}=i;if(a[0]!=="#")throw Error(`"${u}" only supports hash fragment reference`);let d=a.slice(1);if(l.allErrors)m();else{let f=c.let("valid",!1);m(f),i.ok(f)}function m(f){if(l.schemaEnv.root.dynamicAnchors[d]){let v=c.let("_v",t._`${r.default.dynamicAnchors}${(0,t.getProperty)(d)}`);c.if(v,h(v,f),h(l.validateName,f))}else h(l.validateName,f)()}function h(f,v){return v?()=>c.block(()=>{(0,o.callRef)(i,f),c.let(v,!0)}):()=>(0,o.callRef)(i,f)}}e.dynamicRef=s,e.default=n}),LE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Sz(),r=ye(),o={keyword:"$recursiveAnchor",schemaType:"boolean",code(n){if(n.schema)(0,t.dynamicAnchor)(n,"");else(0,r.checkStrictMode)(n.it,"$recursiveAnchor: false is ignored")}};e.default=o}),DE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=bz(),r={keyword:"$recursiveRef",schemaType:"string",code:(o)=>(0,t.dynamicRef)(o,o.schema)};e.default=r}),zz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Sz(),r=bz(),o=LE(),n=DE(),s=[t.default,r.default,o.default,n.default];e.default=s}),UE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Bu(),r={keyword:"dependentRequired",type:"object",schemaType:"object",error:t.error,code:(o)=>(0,t.validatePropertyDeps)(o)};e.default=r}),FE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=Bu(),r={keyword:"dependentSchemas",type:"object",schemaType:"object",code:(o)=>(0,t.validateSchemaDeps)(o)};e.default=r}),VE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=ye(),r={keyword:["maxContains","minContains"],type:"array",schemaType:"number",code({keyword:o,parentSchema:n,it:s}){if(n.contains===void 0)(0,t.checkStrictMode)(s,`"${o}" without "contains" is ignored`)}};e.default=r}),$z=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=UE(),r=FE(),o=VE(),n=[t.default,r.default,o.default];e.default=n}),HE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=ye(),o=kt(),n={keyword:"unevaluatedProperties",type:"object",schemaType:["boolean","object"],trackErrors:!0,error:{message:"must NOT have unevaluated properties",params:({params:s})=>t._`{unevaluatedProperty: ${s.unevaluatedProperty}}`},code(s){let{gen:i,schema:a,data:c,errsCount:u,it:l}=s;if(!u)throw Error("ajv implementation error");let{allErrors:d,props:m}=l;if(m instanceof t.Name)i.if(t._`${m} !== true`,()=>i.forIn("key",c,(y)=>i.if(f(m,y),()=>h(y))));else if(m!==!0)i.forIn("key",c,(y)=>m===void 0?h(y):i.if(v(m,y),()=>h(y)));l.props=!0,s.ok(t._`${u} === ${o.default.errors}`);function h(y){if(a===!1){if(s.setParams({unevaluatedProperty:y}),s.error(),!d)i.break();return}if(!(0,r.alwaysValidSchema)(l,a)){let g=i.name("valid");if(s.subschema({keyword:"unevaluatedProperties",dataProp:y,dataPropType:r.Type.Str},g),!d)i.if((0,t.not)(g),()=>i.break())}}function f(y,g){return t._`!${y} || !${y}[${g}]`}function v(y,g){let P=[];for(let w in y)if(y[w]===!0)P.push(t._`${g} !== ${w}`);return(0,t.and)(...P)}}};e.default=n}),BE=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=de(),r=ye(),o={keyword:"unevaluatedItems",type:"array",schemaType:["boolean","object"],error:{message:({params:{len:n}})=>t.str`must NOT have more than ${n} items`,params:({params:{len:n}})=>t._`{limit: ${n}}`},code(n){let{gen:s,schema:i,data:a,it:c}=n,u=c.items||0;if(u===!0)return;let l=s.const("len",t._`${a}.length`);if(i===!1)n.setParams({len:u}),n.fail(t._`${l} > ${u}`);else if(typeof i=="object"&&!(0,r.alwaysValidSchema)(c,i)){let m=s.var("valid",t._`${l} <= ${u}`);s.if((0,t.not)(m),()=>d(m,u)),n.ok(m)}c.items=!0;function d(m,h){s.forRange("i",h,l,(f)=>{if(n.subschema({keyword:"unevaluatedItems",dataProp:f,dataPropType:r.Type.Num},m),!c.allErrors)s.if((0,t.not)(m),()=>s.break())})}}};e.default=o}),Rz=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=HE(),r=BE(),o=[t.default,r.default];e.default=o}),JE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/schema",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0,"https://json-schema.org/draft/2019-09/vocab/applicator":!0,"https://json-schema.org/draft/2019-09/vocab/validation":!0,"https://json-schema.org/draft/2019-09/vocab/meta-data":!0,"https://json-schema.org/draft/2019-09/vocab/format":!1,"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format"},{$ref:"meta/content"}],type:["object","boolean"],properties:{definitions:{$comment:"While no longer an official keyword as it is replaced by $defs, this keyword is retained in the meta-schema to prevent incompatible extensions as it remains in common use.",type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},dependencies:{$comment:'"dependencies" is no longer a keyword, but schema authors should avoid redefining it to facilitate a smooth transition to "dependentSchemas" and "dependentRequired"',type:"object",additionalProperties:{anyOf:[{$recursiveRef:"#"},{$ref:"meta/validation#/$defs/stringArray"}]}}}}}),KE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/applicator":!0},$recursiveAnchor:!0,title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{additionalItems:{$recursiveRef:"#"},unevaluatedItems:{$recursiveRef:"#"},items:{anyOf:[{$recursiveRef:"#"},{$ref:"#/$defs/schemaArray"}]},contains:{$recursiveRef:"#"},additionalProperties:{$recursiveRef:"#"},unevaluatedProperties:{$recursiveRef:"#"},properties:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$recursiveRef:"#"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$recursiveRef:"#"}},propertyNames:{$recursiveRef:"#"},if:{$recursiveRef:"#"},then:{$recursiveRef:"#"},else:{$recursiveRef:"#"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$recursiveRef:"#"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$recursiveRef:"#"}}}}}),GE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/content",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/content":!0},$recursiveAnchor:!0,title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentMediaType:{type:"string"},contentEncoding:{type:"string"},contentSchema:{$recursiveRef:"#"}}}}),WE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/core",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/core":!0},$recursiveAnchor:!0,title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{type:"string",format:"uri"},$anchor:{type:"string",pattern:"^[A-Za-z][-A-Za-z0-9.:_]*$"},$ref:{type:"string",format:"uri-reference"},$recursiveRef:{type:"string",format:"uri-reference"},$recursiveAnchor:{type:"boolean",default:!1},$vocabulary:{type:"object",propertyNames:{type:"string",format:"uri"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$recursiveRef:"#"},default:{}}}}}),YE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/format",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/format":!0},$recursiveAnchor:!0,title:"Format vocabulary meta-schema",type:["object","boolean"],properties:{format:{type:"string"}}}}),XE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/meta-data":!0},$recursiveAnchor:!0,title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),QE=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://json-schema.org/draft/2019-09/meta/validation",$vocabulary:{"https://json-schema.org/draft/2019-09/vocab/validation":!0},$recursiveAnchor:!0,title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}},const:!0,enum:{type:"array",items:!0},type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),eT=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=JE(),r=KE(),o=GE(),n=WE(),s=YE(),i=XE(),a=QE(),c=["/properties"];function u(l){return[t,r,o,n,d(this,s),i,d(this,a)].forEach((m)=>this.addMetaSchema(m,void 0,!1)),this;function d(m,h){return l?m.$dataMetaSchema(h,c):h}}e.default=u}),tT=B((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2019=void 0;let r=Fu(),o=yz(),n=zz(),s=$z(),i=Rz(),a=Ju(),c=eT(),u="https://json-schema.org/draft/2019-09/schema";var l=class extends r.default{constructor(v={}){super({...v,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),this.addVocabulary(n.default),o.default.forEach((v)=>this.addVocabulary(v)),this.addVocabulary(s.default),this.addVocabulary(i.default),this.opts.discriminator)this.addKeyword(a.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:v,meta:y}=this.opts;if(!y)return;c.default.call(this,v),this.refs["http://json-schema.org/schema"]=u}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(u)?u:void 0)}};e.Ajv2019=l,t.exports=e=l,t.exports.Ajv2019=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var d=oo();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return d.KeywordCxt}});var m=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return m._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return m.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return m.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return m.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return m.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return m.CodeGen}});var h=wn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return h.default}});var f=no();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return f.default}})}),rT=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=lz(),r=dz(),o=hz(),n=zz(),s=$z(),i=Rz(),a=gz(),c=_z(),u=[n.default,t.default,r.default,(0,o.default)(!0),a.default,c.metadataVocabulary,c.contentVocabulary,s.default,i.default];e.default=u}),oT=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/schema",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0,"https://json-schema.org/draft/2020-12/vocab/applicator":!0,"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0,"https://json-schema.org/draft/2020-12/vocab/validation":!0,"https://json-schema.org/draft/2020-12/vocab/meta-data":!0,"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0,"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Core and Validation specifications meta-schema",allOf:[{$ref:"meta/core"},{$ref:"meta/applicator"},{$ref:"meta/unevaluated"},{$ref:"meta/validation"},{$ref:"meta/meta-data"},{$ref:"meta/format-annotation"},{$ref:"meta/content"}],type:["object","boolean"],$comment:"This meta-schema also defines keywords that have appeared in previous drafts in order to prevent incompatible extensions as they remain in common use.",properties:{definitions:{$comment:'"definitions" has been replaced by "$defs".',type:"object",additionalProperties:{$dynamicRef:"#meta"},deprecated:!0,default:{}},dependencies:{$comment:'"dependencies" has been split and replaced by "dependentSchemas" and "dependentRequired" in order to serve their differing semantics.',type:"object",additionalProperties:{anyOf:[{$dynamicRef:"#meta"},{$ref:"meta/validation#/$defs/stringArray"}]},deprecated:!0,default:{}},$recursiveAnchor:{$comment:'"$recursiveAnchor" has been replaced by "$dynamicAnchor".',$ref:"meta/core#/$defs/anchorString",deprecated:!0},$recursiveRef:{$comment:'"$recursiveRef" has been replaced by "$dynamicRef".',$ref:"meta/core#/$defs/uriReferenceString",deprecated:!0}}}}),nT=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/applicator",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/applicator":!0},$dynamicAnchor:"meta",title:"Applicator vocabulary meta-schema",type:["object","boolean"],properties:{prefixItems:{$ref:"#/$defs/schemaArray"},items:{$dynamicRef:"#meta"},contains:{$dynamicRef:"#meta"},additionalProperties:{$dynamicRef:"#meta"},properties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},patternProperties:{type:"object",additionalProperties:{$dynamicRef:"#meta"},propertyNames:{format:"regex"},default:{}},dependentSchemas:{type:"object",additionalProperties:{$dynamicRef:"#meta"},default:{}},propertyNames:{$dynamicRef:"#meta"},if:{$dynamicRef:"#meta"},then:{$dynamicRef:"#meta"},else:{$dynamicRef:"#meta"},allOf:{$ref:"#/$defs/schemaArray"},anyOf:{$ref:"#/$defs/schemaArray"},oneOf:{$ref:"#/$defs/schemaArray"},not:{$dynamicRef:"#meta"}},$defs:{schemaArray:{type:"array",minItems:1,items:{$dynamicRef:"#meta"}}}}}),sT=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/unevaluated",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/unevaluated":!0},$dynamicAnchor:"meta",title:"Unevaluated applicator vocabulary meta-schema",type:["object","boolean"],properties:{unevaluatedItems:{$dynamicRef:"#meta"},unevaluatedProperties:{$dynamicRef:"#meta"}}}}),iT=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/content",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/content":!0},$dynamicAnchor:"meta",title:"Content vocabulary meta-schema",type:["object","boolean"],properties:{contentEncoding:{type:"string"},contentMediaType:{type:"string"},contentSchema:{$dynamicRef:"#meta"}}}}),aT=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/core",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/core":!0},$dynamicAnchor:"meta",title:"Core vocabulary meta-schema",type:["object","boolean"],properties:{$id:{$ref:"#/$defs/uriReferenceString",$comment:"Non-empty fragments not allowed.",pattern:"^[^#]*#?$"},$schema:{$ref:"#/$defs/uriString"},$ref:{$ref:"#/$defs/uriReferenceString"},$anchor:{$ref:"#/$defs/anchorString"},$dynamicRef:{$ref:"#/$defs/uriReferenceString"},$dynamicAnchor:{$ref:"#/$defs/anchorString"},$vocabulary:{type:"object",propertyNames:{$ref:"#/$defs/uriString"},additionalProperties:{type:"boolean"}},$comment:{type:"string"},$defs:{type:"object",additionalProperties:{$dynamicRef:"#meta"}}},$defs:{anchorString:{type:"string",pattern:"^[A-Za-z_][-A-Za-z0-9._]*$"},uriString:{type:"string",format:"uri"},uriReferenceString:{type:"string",format:"uri-reference"}}}}),cT=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/format-annotation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/format-annotation":!0},$dynamicAnchor:"meta",title:"Format vocabulary meta-schema for annotation results",type:["object","boolean"],properties:{format:{type:"string"}}}}),uT=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/meta-data",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/meta-data":!0},$dynamicAnchor:"meta",title:"Meta-data vocabulary meta-schema",type:["object","boolean"],properties:{title:{type:"string"},description:{type:"string"},default:!0,deprecated:{type:"boolean",default:!1},readOnly:{type:"boolean",default:!1},writeOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0}}}}),lT=B((e,t)=>{t.exports={$schema:"https://json-schema.org/draft/2020-12/schema",$id:"https://json-schema.org/draft/2020-12/meta/validation",$vocabulary:{"https://json-schema.org/draft/2020-12/vocab/validation":!0},$dynamicAnchor:"meta",title:"Validation vocabulary meta-schema",type:["object","boolean"],properties:{type:{anyOf:[{$ref:"#/$defs/simpleTypes"},{type:"array",items:{$ref:"#/$defs/simpleTypes"},minItems:1,uniqueItems:!0}]},const:!0,enum:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/$defs/nonNegativeInteger"},minLength:{$ref:"#/$defs/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},maxItems:{$ref:"#/$defs/nonNegativeInteger"},minItems:{$ref:"#/$defs/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},maxContains:{$ref:"#/$defs/nonNegativeInteger"},minContains:{$ref:"#/$defs/nonNegativeInteger",default:1},maxProperties:{$ref:"#/$defs/nonNegativeInteger"},minProperties:{$ref:"#/$defs/nonNegativeIntegerDefault0"},required:{$ref:"#/$defs/stringArray"},dependentRequired:{type:"object",additionalProperties:{$ref:"#/$defs/stringArray"}}},$defs:{nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{$ref:"#/$defs/nonNegativeInteger",default:0},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}}}}),dT=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0});let t=oT(),r=nT(),o=sT(),n=iT(),s=aT(),i=cT(),a=uT(),c=lT(),u=["/properties"];function l(d){return[t,r,o,n,s,m(this,i),a,m(this,c)].forEach((h)=>this.addMetaSchema(h,void 0,!1)),this;function m(h,f){return d?h.$dataMetaSchema(f,u):f}}e.default=l}),pT=B((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv2020=void 0;let r=Fu(),o=rT(),n=Ju(),s=dT(),i="https://json-schema.org/draft/2020-12/schema";var a=class extends r.default{constructor(m={}){super({...m,dynamicRef:!0,next:!0,unevaluated:!0})}_addVocabularies(){if(super._addVocabularies(),o.default.forEach((m)=>this.addVocabulary(m)),this.opts.discriminator)this.addKeyword(n.default)}_addDefaultMetaSchema(){super._addDefaultMetaSchema();let{$data:m,meta:h}=this.opts;if(!h)return;s.default.call(this,m),this.refs["http://json-schema.org/schema"]=i}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(i)?i:void 0)}};e.Ajv2020=a,t.exports=e=a,t.exports.Ajv2020=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var c=oo();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return c.KeywordCxt}});var u=de();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return u._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return u.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return u.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return u.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return u.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return u.CodeGen}});var l=wn();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return l.default}});var d=no();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return d.default}})}),mT=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(j,V){return{validate:j,compare:V}}e.fullFormats={date:t(s,i),time:t(c(!0),u),"date-time":t(m(!0),h),"iso-time":t(c(),l),"iso-date-time":t(m(),f),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:g,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:H,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:w,int32:{type:"number",validate:R},int64:{type:"number",validate:S},float:{type:"number",validate:T},double:{type:"number",validate:T},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,i),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,u),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,f),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function r(j){return j%4===0&&(j%100!==0||j%400===0)}let o=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(j){let V=o.exec(j);if(!V)return!1;let W=+V[1],Y=+V[2],ae=+V[3];return Y>=1&&Y<=12&&ae>=1&&ae<=(Y===2&&r(W)?29:n[Y])}function i(j,V){if(!(j&&V))return;if(j>V)return 1;if(j<V)return-1;return 0}let a=/^(\d\d):(\d\d):(\d\d(?:\.\d+)?)(z|([+-])(\d\d)(?::?(\d\d))?)?$/i;function c(j){return function(W){let Y=a.exec(W);if(!Y)return!1;let ae=+Y[1],we=+Y[2],Re=+Y[3],Ce=Y[4],pe=Y[5]==="-"?-1:1,N=+(Y[6]||0),M=+(Y[7]||0);if(N>23||M>59||j&&!Ce)return!1;if(ae<=23&&we<=59&&Re<60)return!0;let b=we-M*pe,p=ae-N*pe-(b<0?1:0);return(p===23||p===-1)&&(b===59||b===-1)&&Re<61}}function u(j,V){if(!(j&&V))return;let W=new Date("2020-01-01T"+j).valueOf(),Y=new Date("2020-01-01T"+V).valueOf();if(!(W&&Y))return;return W-Y}function l(j,V){if(!(j&&V))return;let W=a.exec(j),Y=a.exec(V);if(!(W&&Y))return;if(j=W[1]+W[2]+W[3],V=Y[1]+Y[2]+Y[3],j>V)return 1;if(j<V)return-1;return 0}let d=/t|\s/i;function m(j){let V=c(j);return function(Y){let ae=Y.split(d);return ae.length===2&&s(ae[0])&&V(ae[1])}}function h(j,V){if(!(j&&V))return;let W=new Date(j).valueOf(),Y=new Date(V).valueOf();if(!(W&&Y))return;return W-Y}function f(j,V){if(!(j&&V))return;let[W,Y]=j.split(d),[ae,we]=V.split(d),Re=i(W,ae);if(Re===void 0)return;return Re||u(Y,we)}let v=/\/|:/,y=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function g(j){return v.test(j)&&y.test(j)}let P=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function w(j){return P.lastIndex=0,P.test(j)}let E=-2147483648,C=2147483647;function R(j){return Number.isInteger(j)&&j<=C&&j>=E}function S(j){return Number.isInteger(j)}function T(){return!0}let A=/[^\\]\\Z/;function H(j){if(A.test(j))return!1;try{return new RegExp(j),!0}catch(V){return!1}}});var fT=B((e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;let t=vz(),r=de(),o=r.operators,n={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:a,schemaCode:c})=>r.str`should be ${n[a].okStr} ${c}`,params:({keyword:a,schemaCode:c})=>r._`{comparison: ${n[a].okStr}, limit: ${c}}`};e.formatLimitDefinition={keyword:Object.keys(n),type:"string",schemaType:"string",$data:!0,error:s,code(a){let{gen:c,data:u,schemaCode:l,keyword:d,it:m}=a,{opts:h,self:f}=m;if(!h.validateFormats)return;let v=new t.KeywordCxt(m,f.RULES.all.format.definition,"format");if(v.$data)y();else g();function y(){let w=c.scopeValue("formats",{ref:f.formats,code:h.code.formats}),E=c.const("fmt",r._`${w}[${v.schemaCode}]`);a.fail$data((0,r.or)(r._`typeof ${E} != "object"`,r._`${E} instanceof RegExp`,r._`typeof ${E}.compare != "function"`,P(E)))}function g(){let w=v.schema,E=f.formats[w];if(!E||E===!0)return;if(typeof E!="object"||E instanceof RegExp||typeof E.compare!="function")throw Error(`"${d}": format "${w}" does not define "compare" function`);let C=c.scopeValue("formats",{key:w,ref:E,code:h.code.formats?r._`${h.code.formats}${(0,r.getProperty)(w)}`:void 0});a.fail$data(P(C))}function P(w){return r._`${w}.compare(${u}, ${l}) ${n[d].fail} 0`}},dependencies:["format"]};let i=(a)=>(a.addKeyword(e.formatLimitDefinition),a);e.default=i}),hT=B((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});let r=mT(),o=fT(),n=de(),s=new n.Name("fullFormats"),i=new n.Name("fastFormats"),a=(u,l={keywords:!0})=>{if(Array.isArray(l))return c(u,l,r.fullFormats,s),u;let[d,m]=l.mode==="fast"?[r.fastFormats,i]:[r.fullFormats,s];if(c(u,l.formats||r.formatNames,d,m),l.keywords)(0,o.default)(u);return u};a.get=(u,l="full")=>{let d=(l==="fast"?r.fastFormats:r.fullFormats)[u];if(!d)throw Error(`Unknown format "${u}"`);return d};function c(u,l,d,m){var h,f;(h=(f=u.opts.code).formats)!==null&&h!==void 0||(f.formats=n._`require("ajv-formats/dist/formats").${m}`);for(let v of l)u.addFormat(v,d[v])}t.exports=e=a,Object.defineProperty(e,"__esModule",{value:!0}),e.default=a}),wz=vz(),gT=tT(),_T=pT(),yT=Hn(hT(),1),vT=yT.default;function Uu(e){let t=new e({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return vT(t),t}var Ku=class{_ajv;_ajvDraft7;_ajv2019;_userAjv;constructor(e){this._userAjv=e!==void 0,this._ajv=e}get ajv(){return this._ajv??=Uu(_T.Ajv2020)}_engineFor(e){if(this._userAjv)return this.ajv;let t=el(e,"pass a pre-configured Ajv instance to AjvJsonSchemaValidator(ajv) to validate other dialects.");if(t==="2020-12")return this.ajv;if(t==="2019-09")return this._ajv2019??=Uu(gT.Ajv2019);return this._ajvDraft7??=Uu(wz.Ajv)}getValidator(e){let t=this._engineFor(e),r="$id"in e&&typeof e.$id==="string"?t.getSchema(e.$id)??t.compile(e):t.compile(e);return(o)=>r(o)?{valid:!0,data:o,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:t.errorsText(r.errors)}}},Mj=wz.Ajv;import r4 from"process";var Az=Symbol.for("mcp.completable");function Pz(e){return!!e&&typeof e==="object"&&Az in e}function ST(e){return e[Az]?.complete}var Ux=15000,bT=2147483647;function K0(e,t){if(!Number.isFinite(e)||e<1)return;let r=setInterval(t,Math.min(e,bT));return r.unref?.(),r}var jz,n4=class{static{jz=(e)=>e._classification}onclose;onerror;onmessage;_classification;_responseMode;_started=!1;_used=!1;_closed=!1;_terminalDelivered=!1;_dispatchWindowOpen=!1;_requestId;_deferredResponse;_sse;_abortCleanup;_keepAliveMs;constructor(e){this._classification=e.classification,this._responseMode=e.responseMode??"auto",this._keepAliveMs=e.keepAliveMs??Ux}async start(){if(this._started)throw Error("PerRequestHTTPServerTransport is already started");this._started=!0}async handleMessage(e,t){if(this._used)throw Error("PerRequestHTTPServerTransport serves exactly one exchange; construct a new transport per request");if(!this._started||this.onmessage===void 0)throw Error("PerRequestHTTPServerTransport is not connected: connect a server to this transport before handling a message");if(this._closed)throw Error("PerRequestHTTPServerTransport is closed");this._used=!0;let r=t?.request?.signal;if(r?.aborted)throw await this.close(),new it(lt.ConnectionClosed,"The request was aborted before it could be handled");let o={classification:this._classification,...t?.request!==void 0&&{request:t.request},...t?.authInfo!==void 0&&{authInfo:t.authInfo}};if(em(e)){this._requestId=e.id;let n,s,i=new Promise((a,c)=>{n=a,s=c});if(this._deferredResponse={promise:i,resolve:n,reject:s,settled:!1},r!==void 0){let a=()=>void this.close();r.addEventListener("abort",a,{once:!0}),this._abortCleanup=()=>r.removeEventListener("abort",a)}this._dispatchWindowOpen=!0;try{this.onmessage(e,o)}finally{this._dispatchWindowOpen=!1}if(this._responseMode==="sse"&&!this._closed&&!this._deferredResponse.settled)this.upgradeToSse();return i}return this.onmessage(e,o),new Response(null,{status:202})}async send(e,t){if(this._closed)return;let r=uh(e)||ph(e),o=r?e.id:t?.relatedRequestId;if(this._requestId===void 0||o===void 0||o!==this._requestId){if(r)this.onerror?.(Error(`Received a response for an unknown request id: ${String(e.id)}`));return}if(r){if(this._terminalDelivered)return;this._terminalDelivered=!0;let n=ph(e)?e.error.code:void 0,s=n!==void 0&&(this._dispatchWindowOpen||n===ue.MissingRequiredClientCapability)?Zu[n]:void 0;if(s!==void 0&&this._sse===void 0){this.settleResponse(Response.json(e,{status:s,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._sse!==void 0||this._responseMode==="sse"){if(this._sse===void 0)this.upgradeToSse();this.writeMessageFrame(e),this.finalizeStream();return}this.settleResponse(Response.json(e,{status:200,headers:{"Content-Type":"application/json"}})),queueMicrotask(()=>void this.close());return}if(this._responseMode==="json")return;if(this._sse===void 0)this.upgradeToSse();this.writeMessageFrame(e)}writeCommentFrame(e){if(this._closed||this._sse===void 0||this._sse.closed)return;let t=e.split(`
|
|
128
|
-
`).map((r)=>`: ${r}`).join(`
|
|
129
|
-
`);this.writeFrame(`${t}
|
|
130
|
-
|
|
131
|
-
`)}async close(){if(this._closed)return;if(this._closed=!0,this._abortCleanup?.(),this._abortCleanup=void 0,this._sse?.keepAliveTimer!==void 0)clearInterval(this._sse.keepAliveTimer);if(this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}if(this._deferredResponse!==void 0&&!this._deferredResponse.settled)this._deferredResponse.settled=!0,this._deferredResponse.reject(new it(lt.ConnectionClosed,"Connection closed before a response was produced"));this.onclose?.()}settleResponse(e){if(this._deferredResponse===void 0||this._deferredResponse.settled)return;this._deferredResponse.settled=!0,this._deferredResponse.resolve(e)}upgradeToSse(){let e,t=new ReadableStream({start:(r)=>{e=r},cancel:()=>{this.close()}});this._sse={controller:e,encoder:new TextEncoder,closed:!1},this._sse.keepAliveTimer=K0(this._keepAliveMs,()=>this.writeCommentFrame("keepalive")),this.settleResponse(new Response(t,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}}))}finalizeStream(){if(this._sse?.keepAliveTimer!==void 0)clearInterval(this._sse.keepAliveTimer);if(this._sse!==void 0&&!this._sse.closed){this._sse.closed=!0;try{this._sse.controller.close()}catch{}}queueMicrotask(()=>void this.close())}writeMessageFrame(e){this.writeFrame(`event: message
|
|
132
|
-
data: ${JSON.stringify(e)}
|
|
133
|
-
|
|
134
|
-
`)}writeFrame(e){if(this._sse===void 0||this._sse.closed)return;try{this._sse.controller.enqueue(this._sse.encoder.encode(e))}catch(t){this.onerror?.(Error(`Failed to write to the response stream: ${t}`))}}};function zT(e){return e instanceof n4?jz(e):void 0}function Ci(e){return e.replaceAll(/[\\"]/g,String.raw`\$&`).replaceAll(/[^\u0020-\u007E]/g," ")}function kz(e,t,r,o){let n=`Bearer error="${Ci(e)}", error_description="${Ci(t)}"`;if(r.length>0)n+=`, scope="${Ci(r.join(" "))}"`;if(o)n+=`, resource_metadata="${Ci(o)}"`;return n}function $T(e,t){let{requiredScopes:r=[],resourceMetadataUrl:o}=t??{};if(!(e instanceof vi)){let n=new vi(ro.ServerError,"Internal Server Error");return Response.json(n.toResponseObject(),{status:500})}switch(e.code){case ro.InvalidToken:{let n=kz(e.code,e.message,r,o);return Response.json(e.toResponseObject(),{status:401,headers:{"WWW-Authenticate":n}})}case ro.InsufficientScope:{let n=kz(e.code,e.message,r,o);return Response.json(e.toResponseObject(),{status:403,headers:{"WWW-Authenticate":n}})}case ro.ServerError:return Response.json(e.toResponseObject(),{status:500});default:return Response.json(e.toResponseObject(),{status:400})}}function RT(e){let t=new URL(e);return t.pathname=wT(e),t.hash="",t.href}function wT(e){let t=PT(e.pathname);return`/.well-known/oauth-protected-resource${t==="/"?"":t}`}function PT(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function kT(e){return typeof e==="object"&&e!==null&&"setScopeChallengeResolver"in e&&typeof e.setScopeChallengeResolver==="function"}function xT(e,t){if(typeof e!=="string"||!/^[\u0021\u0023-\u005B\u005D-\u007E]+$/.test(e))throw TypeError(`${t} must satisfy the OAuth scope-token grammar`)}function ET(e){if(e===null||typeof e!=="object"||!Array.isArray(e.scopes)||e.scopes.length===0)throw TypeError("scope challenge must contain at least one scope");for(let[t,r]of e.scopes.entries())xT(r,`scope challenge scopes[${t}]`);if(e.errorDescription!==void 0&&typeof e.errorDescription!=="string")throw TypeError("scope challenge errorDescription must be a string");if(e.errorDescription!==void 0&&!/^[\u0020-\u0021\u0023-\u005B\u005D-\u007E]+$/.test(e.errorDescription))throw TypeError("scope challenge errorDescription must satisfy the RFC 6750 error-description grammar");return e}async function i4(e,t,r){for(let o of e){let n=await r({request:o,...t!==void 0&&{authInfo:t}});if(n!==void 0)return ET(n)}}function o4(e){if(e?.resourceMetadataUrl!==void 0)return e.resourceMetadataUrl;if(e?.resource?.protocol==="https:"||e?.resource?.protocol==="http:")return RT(e.resource)}function s4(e,t){return $T(new vi(ro.InsufficientScope,e.errorDescription??"Insufficient scope"),{requiredScopes:[...e.scopes],resourceMetadataUrl:t})}var TT=8,OT=600000;function CT(e){if(e?.maxRounds!==void 0&&(!Number.isInteger(e.maxRounds)||e.maxRounds<1))throw RangeError(`inputRequired.maxRounds must be a positive integer (got ${e.maxRounds})`);if(e?.roundTimeoutMs!==void 0&&(!Number.isFinite(e.roundTimeoutMs)||e.roundTimeoutMs<=0))throw RangeError(`inputRequired.roundTimeoutMs must be a positive number (got ${e.roundTimeoutMs})`);return{maxRounds:e?.maxRounds??TT,roundTimeoutMs:e?.roundTimeoutMs??OT,legacyShim:e?.legacyShim??!0}}function Mz(e,t,r){if(r===null||typeof r!=="object"||typeof r.method!=="string")throw new he(ue.InternalError,`Handler for ${e} returned an invalid input request '${t}': each inputRequests entry must be an embedded elicitation/create, sampling/createMessage, or roots/list request`);let o=r,n=wb(o);if(n===void 0)throw new he(ue.InternalError,`Handler for ${e} returned an input request '${t}' of kind '${o.method}', which is not an embedded request the 2026-07-28 revision defines`);return{embedded:o,required:n}}function IT(){let e=globalThis.crypto;if(e?.randomUUID!==void 0)return e.randomUUID();let t=new Uint8Array(16);e.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let r=[...t].map((o)=>o.toString(16).padStart(2,"0")).join("");return`${r.slice(0,8)}-${r.slice(8,12)}-${r.slice(12,16)}-${r.slice(16,20)}-${r.slice(20)}`}function Gu(e,t){if(e==="tools/call")return{content:[{type:"text",text:t}],isError:!0};throw new he(ue.InternalError,t)}var NT=class{constructor(e){this._host=e}async fulfill(e,t,r,o,n){let{maxRounds:s,roundTimeoutMs:i}=this._host,a=o.mcpReq.signal,c=n,u=0;while(!0){if(u+=1,u>s)return Gu(e,Gb(e,s));let l=c.inputRequests,d=l!=null&&Object.keys(l).length>0,m=typeof c.requestState==="string"?c.requestState:void 0;if(!d&&m===void 0)throw new he(ue.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);let h;if(d){let y=this._host.resolvedClientCapabilities(o),g=[];for(let[w,E]of Object.entries(l)){let{embedded:C,required:R}=Mz(e,w,E);if(C.method!=="roots/list"&&C.params===void 0)throw new he(ue.InternalError,`Handler for ${e} returned an input request '${w}' of kind '${C.method}' without params`);if(V0(R,y)!==void 0)return Gu(e,`Cannot request input '${w}' (${C.method}): the client on this 2025-era connection did not declare the required capability${y===void 0?" (no client capabilities are available on this connection \u2014 per-request legacy serving cannot receive server-to-client requests)":""}`);g.push([w,C])}let P=Yb(a);try{let w={relatedRequestId:o.mcpReq.id,timeout:i,resetTimeoutOnProgress:!0,onprogress:()=>{},signal:P.signal},E=await Promise.all(g.map(async([C,R])=>{try{return[C,await this._dispatchLeg(R,w)]}catch(S){throw P.abort(S),S}}));h=Object.fromEntries(E)}catch(w){if(a.aborted)throw w;return Gu(e,`Fulfilling input required by '${e}' failed: ${w instanceof Error?w.message:String(w)}`)}finally{P.dispose()}}else await Wb(Kb,a);let f={...o,mcpReq:{...o.mcpReq,inputResponses:h,droppedInputResponseKeys:void 0,requestState:Rn(m)}};if(m!==void 0){let y=await this._host.verifyRequestState(m,f,e);if(y!==void 0)f=Lu(f,y)}let v=await t(r,f);if(!sr(v))return v;c=v}}async _dispatchLeg(e,t){switch(e.method){case"elicitation/create":{let r=e.params;if(r.mode==="url"&&r.elicitationId===void 0)r={...r,elicitationId:IT()};return await this._host.sendElicitation(r,t)}case"sampling/createMessage":return await this._host.sendSampling(e.params,t);case"roots/list":return await this._host.listRoots(e.params,t)}}},AT=new Set(["tools/call","prompts/get","resources/read"]),Zz,qz,Lz;function B7(e,t){Zz(e,t)}function $7(e,t){qz(e,t)}function U7(e){return Lz(e)}var jT=class extends rz{_clientCapabilities;_clientVersion;static{Zz=(e,t)=>{if(t.clientCapabilities!==void 0)e._clientCapabilities=t.clientCapabilities;if(t.clientInfo!==void 0)e._clientVersion=t.clientInfo},qz=(e,t)=>{let r=t.filter((o)=>!e._supportedProtocolVersions.includes(o));if(r.length>0)e._supportedProtocolVersions=[...e._supportedProtocolVersions,...r];e.setRequestHandler("server/discover",()=>e._ondiscover())},Lz=(e)=>e._serverInfo}_capabilities;_instructions;_jsonSchemaValidator;_cacheHints;_requestStateVerify;_inputRequiredServing;_legacyShim;_boundFromTransport=!1;_legacyInputRequiredShim(){return this._legacyShim??=new NT({maxRounds:this._inputRequiredServing.maxRounds,roundTimeoutMs:this._inputRequiredServing.roundTimeoutMs,resolvedClientCapabilities:(e)=>this._inputRequestCapabilityView(e),verifyRequestState:(e,t,r)=>this._verifyRequestState(e,t,r),sendElicitation:(e,t)=>this._sendElicitationLeg(e,t,{validateAcceptedContent:!1}),sendSampling:(e,t)=>this.createMessage(e,t),listRoots:(e,t)=>this.listRoots(e,t)})}oninitialized;constructor(e,t){super(t);if(this._serverInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._instructions=t?.instructions,this._jsonSchemaValidator=t?.jsonSchemaValidator??new Ku,this._requestStateVerify=t?.requestState?.verify,this._inputRequiredServing=CT(t?.inputRequired),t?.cacheHints!==void 0){for(let[r,o]of Object.entries(t.cacheHints))if(o!==void 0)W0(o,`cacheHints['${r}']`);this._cacheHints=t.cacheHints}if(this.setRequestHandler("initialize",(r)=>this._oninitialize(r)),this.setNotificationHandler("notifications/initialized",()=>this.oninitialized?.()),Si(this._supportedProtocolVersions).length>0)this.setRequestHandler("server/discover",()=>this._ondiscover());if(this._capabilities.logging)this._registerLoggingHandler()}async connect(e){if(this.transport!==void 0)throw new it(lt.AlreadyConnected,"Use a separate Server instance per connection: this instance is already connected to a transport. To connect it to a new transport, call close() first.");if(this._boundFromTransport)this._boundFromTransport=!1,this._negotiatedProtocolVersion=void 0;let t=zT(e)?.revision;if(t!==void 0&&!this._servedModernEra()&&NA.includes(t)&&Si(this._supportedProtocolVersions).includes(t))this._negotiatedProtocolVersion=t,this._boundFromTransport=!0;await super.connect(e)}_registerLoggingHandler(){this.setRequestHandler("logging/setLevel",async(e,t)=>{let r=t.sessionId||t.http?.req?.headers.get("mcp-session-id")||void 0,{level:o}=e.params,n=$i(sh,o);if(n.success)this._loggingLevels.set(r,n.data);return{}})}buildContext(e,t){let r=e.http||t?.request||t?.closeSSEStream||t?.closeStandaloneSSEStream;return{...e,mcpReq:{...e.mcpReq,log:(o,n,s)=>{if(!this._capabilities.logging)return Promise.resolve();let i;if(this._servedModernEra()){if(i=e.mcpReq.envelope?.[Mu],i===void 0)return Promise.resolve()}else i=this._loggingLevels.get(e.sessionId)??this._loggingLevels.get(void 0);if(i!==void 0&&this.LOG_LEVEL_SEVERITY.get(o)<this.LOG_LEVEL_SEVERITY.get(i))return Promise.resolve();return e.mcpReq.notify({method:"notifications/message",params:{level:o,data:n,logger:s}})},elicitInput:(o,n)=>this.elicitInput(o,n),requestSampling:(o,n)=>this.createMessage(o,n)},http:r?{...e.http,req:t?.request,closeSSE:t?.closeSSEStream,closeStandaloneSSE:t?.closeStandaloneSSEStream}:void 0}}_loggingLevels=new Map;LOG_LEVEL_SEVERITY=new Map(sh.options.map((e,t)=>[e,t]));isMessageIgnored=(e,t)=>{let r=this._loggingLevels.get(t);return r?this.LOG_LEVEL_SEVERITY.get(e)<this.LOG_LEVEL_SEVERITY.get(r):!1};registerCapabilities(e){if(this.transport)throw new it(lt.AlreadyConnected,"Cannot register capabilities after connecting to transport");let t=!!this._capabilities.logging;if(this._capabilities=oz(this._capabilities,e),!t&&this._capabilities.logging)this._registerLoggingHandler()}_wrapHandler(e,t){if(e!=="tools/call"){let r=this._cacheHints?.[e],o=AT.has(e);if(r===void 0&&!o)return async(n,s)=>{let i=await t(n,s);if(sr(i))throw new he(ue.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i};return async(n,s)=>{let i=o?await this._invokeInputRequiredCapableHandler(e,t,n,s):await t(n,s);if(sr(i)){if(!o)throw new he(ue.InternalError,`Handler for ${e} returned an input-required result, but only tools/call, prompts/get and resources/read support input_required (protocol revision 2026-07-28)`);return i}return r===void 0?i:bi(i,r)}}return async(r,o)=>{let n=Ft(this._negotiatedProtocolVersion),s=n.validateRequest("tools/call",r);if(!s.ok)throw new he(s.reason==="not-in-era"?ue.InternalError:ue.InvalidParams,s.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call request: ${s.message}`);let i=await this._invokeInputRequiredCapableHandler("tools/call",t,r,o);if(sr(i))return i;let a=ku(i),c=n.validateResult("tools/call",a);if(!c.ok)throw new he(c.reason==="not-in-era"?ue.InternalError:ue.InvalidParams,c.reason==="not-in-era"?"No wire schema for tools/call in the resolved era":`Invalid tools/call result: ${c.message}`);return c.value}}_servedModernEra(){return this._negotiatedProtocolVersion!==void 0&&Zp(this._negotiatedProtocolVersion)}async _invokeInputRequiredCapableHandler(e,t,r,o){let n=this._servedModernEra(),s=o.mcpReq.requestState();if(s!==void 0&&typeof s!=="string")throw new he(ue.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"});let i=o;if(typeof s==="string"){let d=await this._verifyRequestState(s,o,e);if(d!==void 0)i=Lu(o,d)}let a;try{a=await t(r,i)}catch(d){if(d instanceof he&&d.code===ue.UrlElicitationRequired){if(!n)throw d;throw new he(ue.InternalError,`URL elicitation cannot be signalled by throwing UrlElicitationRequiredError on protocol revision ${this._negotiatedProtocolVersion}: return inputRequired({ inputRequests: { \u2026: inputRequired.elicitUrl(...) } }) from the handler instead. The urlElicitationRequired error (-32042) of earlier revisions is not available on this revision.`)}throw d}if(!sr(a))return a;if(!n){if(!this._inputRequiredServing.legacyShim)throw new he(ue.InternalError,`Handler for ${e} returned an input-required result, but this request is served on protocol revision ${this._negotiatedProtocolVersion??Hr}, which has no input_required vocabulary`);return await this._legacyInputRequiredShim().fulfill(e,t,r,i,a)}let c=a.inputRequests,u=c!=null&&Object.keys(c).length>0,l=typeof a.requestState==="string";if(!u&&!l)throw new he(ue.InternalError,`Handler for ${e} returned an input-required result with neither inputRequests nor requestState (every InputRequiredResult must include at least one of the two)`);if(u){let d=this._inputRequestCapabilityView(o);for(let[m,h]of Object.entries(c)){let{embedded:f,required:v}=Mz(e,m,h),y=V0(v,d);if(y!==void 0)throw new z0({requiredCapabilities:y},`Cannot request input '${m}' (${f.method}): the request's client capabilities do not declare the required capability`)}}return a}async _verifyRequestState(e,t,r){if(this._requestStateVerify===void 0)return;try{return await this._requestStateVerify(e,t)}catch(o){throw this.onerror?.(Error(`requestState verification rejected ${r}: ${o instanceof Error?o.message:String(o)}`)),new he(ue.InvalidParams,"Invalid or expired requestState",{reason:"invalid_request_state"})}}_inputRequestCapabilityView(e){return this._servedModernEra()?e.mcpReq.envelope?.[Ar]:this._clientCapabilities}_assertPushApiInServedEra(e){if(this._servedModernEra())throw new it(lt.MethodNotSupportedByProtocolVersion,`Server-to-client requests are not available on protocol revision ${this._negotiatedProtocolVersion}: '${e}' cannot be sent while serving a request on that revision. Return inputRequired({ ... }) from the handler instead \u2014 the client fulfils the embedded requests and retries the original request (multi round-trip requests).`,{method:e,era:"2026-07-28"})}assertCapabilityForMethod(e){switch(e){case"sampling/createMessage":if(!this._clientCapabilities?.sampling)throw new it(lt.CapabilityNotSupported,`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!this._clientCapabilities?.elicitation)throw new it(lt.CapabilityNotSupported,`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!this._clientCapabilities?.roots)throw new it(lt.CapabilityNotSupported,`Client does not support listing roots (required for ${e})`);break;case"ping":break}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw new it(lt.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw new it(lt.CapabilityNotSupported,`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw new it(lt.CapabilityNotSupported,`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw new it(lt.CapabilityNotSupported,`Server does not support notifying of prompt list changes (required for ${e})`);break;case"notifications/elicitation/complete":if(!this._clientCapabilities?.elicitation?.url)throw new it(lt.CapabilityNotSupported,`Client does not support URL elicitation (required for ${e})`);break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"completion/complete":if(!this._capabilities.completions)throw new it(lt.CapabilityNotSupported,`Server does not support completions (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw new it(lt.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw new it(lt.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw new it(lt.CapabilityNotSupported,`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw new it(lt.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case"ping":case"initialize":break}}async _oninitialize(e){let t=e.params.protocolVersion;this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo;let r=kb(this._supportedProtocolVersions),o=r.includes(t)?t:r[0]??Hr;return this._negotiatedProtocolVersion=o,this.transport?.setProtocolVersion?.(o),{protocolVersion:o,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}_ondiscover(){return{supportedVersions:Si(this._supportedProtocolVersions),capabilities:MT(this.getCapabilities()),...this._instructions&&{instructions:this._instructions}}}_outboundServerInfo(){return this._serverInfo}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}projectCallToolResult(e,t){return this._wireCodec().projectCallToolResult(e,t)}getCapabilities(){return this._capabilities}async ping(){return this._assertPushApiInServedEra("ping"),this.request({method:"ping"})}async createMessage(e,t){if(this._assertPushApiInServedEra("sampling/createMessage"),(e.tools||e.toolChoice)&&!this._clientCapabilities?.sampling?.tools)throw new it(lt.CapabilityNotSupported,"Client does not support sampling tools capability.");if(e.messages.length>0){let s=e.messages.at(-1),i=Array.isArray(s.content)?s.content:[s.content],a=i.some((d)=>d.type==="tool_result"),c=e.messages.length>1?e.messages.at(-2):void 0,u=c?Array.isArray(c.content)?c.content:[c.content]:[],l=u.some((d)=>d.type==="tool_use");if(a){if(i.some((d)=>d.type!=="tool_result"))throw new he(ue.InvalidParams,"The last message must contain only tool_result content if any is present");if(!l)throw new he(ue.InvalidParams,"tool_result blocks are not matching any tool_use from the previous message")}if(l){let d=new Set(u.filter((h)=>h.type==="tool_use").map((h)=>h.id)),m=new Set(i.filter((h)=>h.type==="tool_result").map((h)=>h.toolUseId));if(d.size!==m.size||![...d].every((h)=>m.has(h)))throw new he(ue.InvalidParams,"ids of tool_result blocks and tool_use blocks from previous message do not match")}}let r=Boolean(e.tools||e.toolChoice),o=await this.request({method:"sampling/createMessage",params:e},t),n=this._wireCodec().samplingResultVariant(r,o);if(!n.ok)throw new it(lt.InvalidResult,`Invalid sampling/createMessage result: ${n.reason==="invalid"?n.message:n.reason}`);return n.value}async elicitInput(e,t){switch(this._assertPushApiInServedEra("elicitation/create"),e.mode??"form"){case"url":if(!this._clientCapabilities?.elicitation?.url)throw new it(lt.CapabilityNotSupported,"Client does not support url elicitation.");break;case"form":if(!this._clientCapabilities?.elicitation?.form)throw new it(lt.CapabilityNotSupported,"Client does not support form elicitation.");break}return this._sendElicitationLeg(e,t)}async _sendElicitationLeg(e,t,r){let o=e.mode??"form",n=r?.validateAcceptedContent??!0;switch(o){case"url":{let s=e;return this.request({method:"elicitation/create",params:s},t)}case"form":{let s=e.mode==="form"?e:{...e,mode:"form"},i=await this.request({method:"elicitation/create",params:s},t);if(n&&i.action==="accept"&&i.content&&s.requestedSchema)try{let a=this._jsonSchemaValidator.getValidator(s.requestedSchema)(i.content);if(!a.valid)throw new he(ue.InvalidParams,`Elicitation response content does not match requested schema: ${a.errorMessage}`)}catch(a){if(a instanceof he)throw a;throw new he(ue.InternalError,`Error validating elicitation response: ${a instanceof Error?a.message:String(a)}`)}return i}}}createElicitationCompletionNotifier(e,t){if(!this._clientCapabilities?.elicitation?.url)throw new it(lt.CapabilityNotSupported,"Client does not support URL elicitation (required for notifications/elicitation/complete)");return()=>this.notification({method:"notifications/elicitation/complete",params:{elicitationId:e}},t)}async listRoots(e,t){return this._assertPushApiInServedEra("roots/list"),this.request({method:"roots/list",params:e},t)}async sendLoggingMessage(e,t){if(this._capabilities.logging&&!this.isMessageIgnored(e.level,t))return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}};function MT(e){return{...e}}function ZT(e,t){let r=0,o=[e];while(o.length>0){let n=o.pop();if(n===null||typeof n!=="object")continue;if(Array.isArray(n))for(let s of n){if(++r>t)return r;if(s!==null&&typeof s==="object")o.push(s)}else for(let s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;if(++r>t)return r;let i=n[s];if(i!==null&&typeof i==="object")o.push(i)}}return r}function qT(e){if(e===void 0||e===1/0)return;if(typeof e!=="number"||Number.isNaN(e)||e<1)throw RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(e)}`);return e}var mh=class{server;_maxToolInputElements;_registeredResources={};_registeredResourceTemplates={};_registeredTools={};_registeredPrompts={};_toolInputSchemaJson={};toolInputSchemaJson(e){let t=this._registeredTools[e];if(t===void 0||!t.enabled)return;if(Object.hasOwn(this._toolInputSchemaJson,e))return this._toolInputSchemaJson[e];if(t.inputSchema===void 0)return Ez;try{let r=wr(t.inputSchema,"input");return this._toolInputSchemaJson[e]=r,r}catch{return}}constructor(e,t){if(this.server=new jT(e,t),this._maxToolInputElements=qT(t?.maxToolInputElements),t?.capabilities?.tools)this.setToolRequestHandlers();if(t?.capabilities?.resources)this.setResourceRequestHandlers();if(t?.capabilities?.prompts)this.setPromptRequestHandlers()}async connect(e){if(kT(e))e.setScopeChallengeResolver((t)=>this.resolveScopeChallenge(t));return await this.server.connect(e)}async close(){await this.server.close()}resolveScopeChallenge=(e)=>{switch(e.request.method){case"tools/call":{let t=e.request.params?.name;if(typeof t!=="string")return;let r=this._registeredTools[t];if(r===void 0||!r.enabled)return;return r.scopeChallenge?.(e)}case"resources/read":{let t=e.request.params?.uri;if(typeof t!=="string")return;let r;try{r=new URL(t)}catch{return}let o=this._registeredResources[r.toString()];if(o!==void 0)return o.enabled?o.scopeChallenge?.(e):void 0;for(let n of Object.values(this._registeredResourceTemplates))if(n.resourceTemplate.uriTemplate.match(r.toString()))return n.enabled?n.scopeChallenge?.(e):void 0;return}case"prompts/get":{let t=e.request.params?.name;if(typeof t!=="string")return;let r=this._registeredPrompts[t];if(r===void 0||!r.enabled)return;return r.scopeChallenge?.(e)}default:return}};_toolHandlersInitialized=!1;setToolRequestHandlers(){if(this._toolHandlersInitialized)return;this.server.assertCanSetRequestHandler("tools/list"),this.server.assertCanSetRequestHandler("tools/call"),this.server.registerCapabilities({tools:{listChanged:this.server.getCapabilities().tools?.listChanged??!0}}),this.server.setRequestHandler("tools/list",()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?LT(e,t.inputSchema):Ez,annotations:t.annotations,icons:t.icons,execution:t.execution,_meta:t._meta};if(t.outputSchema)r.outputSchema=wr(t.outputSchema,"output");return r})})),this.server.setRequestHandler("tools/call",async(e,t)=>{let r=this._registeredTools[e.params.name];if(!r)throw new he(ue.InvalidParams,`Tool ${e.params.name} not found`);if(!r.enabled)throw new he(ue.InvalidParams,`Tool ${e.params.name} disabled`);try{let o=await this.validateToolInput(r,e.params.arguments,e.params.name),n=await this.executeToolHandler(r,o,t);if(await this.validateToolOutput(r,n,e.params.name),sr(n))return n;return this.server.projectCallToolResult(n,r.outputSchemaJson)}catch(o){if(o instanceof he&&o.code===ue.UrlElicitationRequired)throw o;return this.createToolError(o instanceof Error?o.message:String(o))}}),this._toolHandlersInitialized=!0}createToolError(e){return{content:[{type:"text",text:e}],isError:!0}}async validateToolInput(e,t,r){if(this._maxToolInputElements!==void 0&&ZT(t,this._maxToolInputElements)>this._maxToolInputElements)throw new he(ue.InvalidParams,`Invalid arguments for tool ${r}: arguments contain more than the maximum of ${this._maxToolInputElements} elements`);if(!e.inputSchema)return;let o=await Rr(e.inputSchema,t??{});if(!o.success)throw new he(ue.InvalidParams,`Input validation error: Invalid arguments for tool ${r}: ${o.error}`);return o.data}async validateToolOutput(e,t,r){if(!e.outputSchema)return;if(sr(t))return;if(t.isError)return;if(t.structuredContent===void 0)throw new he(ue.InvalidParams,`Output validation error: Tool ${r} has an output schema but no structured content was provided`);let o=await Rr(e.outputSchema,t.structuredContent);if(!o.success)throw new he(ue.InvalidParams,`Output validation error: Invalid structured content for tool ${r}: ${o.error}`)}async executeToolHandler(e,t,r){return e.executor(t,r)}_completionHandlerInitialized=!1;setCompletionRequestHandler(){if(this._completionHandlerInitialized)return;this.server.assertCanSetRequestHandler("completion/complete"),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler("completion/complete",async(e)=>{switch(e.params.ref.type){case"ref/prompt":return Ub(e),this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return Fb(e),this.handleResourceCompletion(e,e.params.ref);default:throw new he(ue.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new he(ue.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new he(ue.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return Pn;let o=Nz(Iz(r.argsSchema)?.[e.params.argument.name]);if(!Pz(o))return Pn;let n=ST(o);if(!n)return Pn;return Cz(await n(e.params.argument.value,e.params.context))}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find((n)=>n.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return Pn;throw new he(ue.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let o=r.resourceTemplate.completeCallback(e.params.argument.name);if(!o)return Pn;return Cz(await o(e.params.argument.value,e.params.context))}_resourceHandlersInitialized=!1;setResourceRequestHandlers(){if(this._resourceHandlersInitialized)return;this.server.assertCanSetRequestHandler("resources/list"),this.server.assertCanSetRequestHandler("resources/templates/list"),this.server.assertCanSetRequestHandler("resources/read"),this.server.registerCapabilities({resources:{listChanged:this.server.getCapabilities().resources?.listChanged??!0}}),this.server.setRequestHandler("resources/list",async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([n,s])=>s.enabled).map(([n,s])=>({uri:n,name:s.name,...s.metadata})),o=[];for(let n of Object.values(this._registeredResourceTemplates)){if(!n.resourceTemplate.listCallback)continue;let s=await n.resourceTemplate.listCallback(t);for(let i of s.resources)o.push({...n.metadata,...i})}return{resources:[...r,...o]}}),this.server.setRequestHandler("resources/templates/list",async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler("resources/read",async(e,t)=>{let r;try{r=new URL(e.params.uri)}catch{throw new he(ue.InvalidParams,`Resource URI ${e.params.uri} is invalid`,{uri:e.params.uri,reason:"invalid_uri"})}let o=this._registeredResources[r.toString()];if(o){if(!o.enabled)throw new he(ue.InvalidParams,`Resource ${r} disabled`);return bi(await o.readCallback(r,t),o.cacheHint)}for(let n of Object.values(this._registeredResourceTemplates)){let s=n.resourceTemplate.uriTemplate.match(r.toString());if(s){if(!n.enabled)throw new he(ue.InvalidParams,`Resource template ${n.resourceTemplate.uriTemplate} disabled`);return bi(await n.readCallback(r,s,t),n.cacheHint)}}throw new Qp(e.params.uri)}),this._resourceHandlersInitialized=!0}_promptHandlersInitialized=!1;setPromptRequestHandlers(){if(this._promptHandlersInitialized)return;this.server.assertCanSetRequestHandler("prompts/list"),this.server.assertCanSetRequestHandler("prompts/get"),this.server.registerCapabilities({prompts:{listChanged:this.server.getCapabilities().prompts?.listChanged??!0}}),this.server.setRequestHandler("prompts/list",()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?Jb(t.argsSchema):void 0,icons:t.icons,_meta:t._meta}))})),this.server.setRequestHandler("prompts/get",async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new he(ue.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new he(ue.InvalidParams,`Prompt ${e.params.name} disabled`);return r.handler(e.params.arguments,t)}),this._promptHandlersInitialized=!0}registerResource(e,t,r,o){let{cacheHint:n,scopeChallenge:s,...i}=r,a=i;if(n!==void 0)W0(n,`resource ${e}`);if(typeof t==="string"){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let c=this._createRegisteredResource(e,r.title,t,a,s,o);if(n!==void 0)c.cacheHint=n;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}else{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let c=this._createRegisteredResourceTemplate(e,r.title,t,a,s,o);if(n!==void 0)c.cacheHint=n;return this.setResourceRequestHandlers(),this.sendResourceListChanged(),c}}_createRegisteredResource(e,t,r,o,n,s){let i={name:e,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({uri:null}),update:(a)=>{if(a.uri!==void 0&&a.uri!==r){if(delete this._registeredResources[r],a.uri)this._registeredResources[a.uri]=i}if(a.name!==void 0)i.name=a.name;if(a.metadata!==void 0)i.metadata=a.metadata;if(a.title!==void 0)i.title=a.title,i.metadata={...i.metadata,title:a.title};if(a.callback!==void 0)i.readCallback=a.callback;if(a.scopeChallenge!==void 0)i.scopeChallenge=a.scopeChallenge===null?void 0:a.scopeChallenge;if(a.enabled!==void 0)i.enabled=a.enabled;this.sendResourceListChanged()}};return this._registeredResources[r]=i,i}_createRegisteredResourceTemplate(e,t,r,o,n,s){let i={resourceTemplate:r,title:t,metadata:o,readCallback:s,scopeChallenge:n,enabled:!0,disable:()=>i.update({enabled:!1}),enable:()=>i.update({enabled:!0}),remove:()=>i.update({name:null}),update:(c)=>{if(c.name!==void 0&&c.name!==e){if(delete this._registeredResourceTemplates[e],c.name)this._registeredResourceTemplates[c.name]=i}if(c.template!==void 0)i.resourceTemplate=c.template;if(c.metadata!==void 0)i.metadata=c.metadata;if(c.title!==void 0)i.title=c.title,i.metadata={...i.metadata,title:c.title};if(c.callback!==void 0)i.readCallback=c.callback;if(c.scopeChallenge!==void 0)i.scopeChallenge=c.scopeChallenge===null?void 0:c.scopeChallenge;if(c.enabled!==void 0)i.enabled=c.enabled;this.sendResourceListChanged()}};this._registeredResourceTemplates[e]=i;let a=r.uriTemplate.variableNames;if(Array.isArray(a)&&a.some((c)=>!!r.completeCallback(c)))this.setCompletionRequestHandler();return i}_createRegisteredPrompt(e,t,r,o,n,s,i,a){let c=o,u=n,l={title:t,description:r,argsSchema:o,icons:s,scopeChallenge:i,_meta:a,handler:Oz(e,o,n),enabled:!0,disable:()=>l.update({enabled:!1}),enable:()=>l.update({enabled:!0}),remove:()=>l.update({name:null}),update:(d)=>{if(d.name!==void 0&&d.name!==e){if(delete this._registeredPrompts[e],d.name)this._registeredPrompts[d.name]=l}if(d.title!==void 0)l.title=d.title;if(d.description!==void 0)l.description=d.description;if(d.icons!==void 0)l.icons=d.icons;if(d.scopeChallenge!==void 0)l.scopeChallenge=d.scopeChallenge===null?void 0:d.scopeChallenge;if(d._meta!==void 0)l._meta=d._meta;let m=!1;if(d.argsSchema!==void 0)l.argsSchema=d.argsSchema,c=d.argsSchema,m=!0;if(d.callback!==void 0)u=d.callback,m=!0;if(m)l.handler=Oz(e,c,u);if(d.enabled!==void 0)l.enabled=d.enabled;this.sendPromptListChanged()}};if(this._registeredPrompts[e]=l,o){let d=Iz(o);if(d){if(Object.values(d).some((m)=>Pz(Nz(m))))this.setCompletionRequestHandler()}}return l}_createRegisteredTool(e,t,r,o,n,s,i,a,c,u,l){Du(e);let d=l,m,h={title:t,description:r,inputSchema:o,outputSchema:n,get outputSchemaJson(){return m??=Tz(h.outputSchema)},set outputSchemaJson(f){m=f},annotations:s,icons:i,execution:a,scopeChallenge:c,_meta:u,handler:l,executor:xz(o,l),enabled:!0,disable:()=>h.update({enabled:!1}),enable:()=>h.update({enabled:!0}),remove:()=>h.update({name:null}),update:(f)=>{if(f.name!==void 0&&f.name!==e){if(typeof f.name==="string")Du(f.name);if(delete this._registeredTools[e],delete this._toolInputSchemaJson[e],f.name)delete this._toolInputSchemaJson[f.name],this._registeredTools[f.name]=h,e=f.name}if(f.title!==void 0)h.title=f.title;if(f.description!==void 0)h.description=f.description;let v=!1;if(f.paramsSchema!==void 0)h.inputSchema=f.paramsSchema,delete this._toolInputSchemaJson[e],v=!0;if(f.callback!==void 0)h.handler=f.callback,d=f.callback,v=!0;if(v)h.executor=xz(h.inputSchema,d);if(f.outputSchema!==void 0)h.outputSchema=f.outputSchema,h.outputSchemaJson=Tz(f.outputSchema);if(f.annotations!==void 0)h.annotations=f.annotations;if(f.icons!==void 0)h.icons=f.icons;if(f.scopeChallenge!==void 0)h.scopeChallenge=f.scopeChallenge===null?void 0:f.scopeChallenge;if(f._meta!==void 0)h._meta=f._meta;if(f.enabled!==void 0)h.enabled=f.enabled;this.sendToolListChanged()}};return this._registeredTools[e]=h,this.setToolRequestHandlers(),this.sendToolListChanged(),h}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:o,description:n,inputSchema:s,outputSchema:i,annotations:a,icons:c,scopeChallenge:u,_meta:l}=t;return this._createRegisteredTool(e,o,n,Ri(s),Ri(i),a,c,void 0,u,l,r)}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:o,description:n,argsSchema:s,icons:i,scopeChallenge:a,_meta:c}=t,u=this._createRegisteredPrompt(e,o,n,Ri(s),r,i,a,c);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),u}isConnected(){return this.server.transport!==void 0}async sendLoggingMessage(e,t){return this.server.sendLoggingMessage(e,t)}sendResourceListChanged(){if(this.isConnected())this.server.sendResourceListChanged()}sendToolListChanged(){if(this.isConnected())this.server.sendToolListChanged()}sendPromptListChanged(){if(this.isConnected())this.server.sendPromptListChanged()}},H7=class{_uriTemplate;constructor(e,t){this._callbacks=t,this._uriTemplate=typeof e==="string"?new nz(e):e}get uriTemplate(){return this._uriTemplate}get listCallback(){return this._callbacks.list}completeCallback(e){return this._callbacks.complete?.[e]}};function xz(e,t){if(e){let o=t;return async(n,s)=>o(n,s)}let r=t;return async(o,n)=>r(n)}var Ez={type:"object",properties:{}};function LT(e,t){let r=wr(t,"input"),o=Rq(r);if(!o.valid)console.warn(`[mcp-sdk] tool '${e}' carries an invalid x-mcp-header declaration and will be excluded by conforming Streamable HTTP clients: ${o.reason}`);return r}function Tz(e){if(e===void 0)return;try{return wr(e,"output")}catch{return}}function Oz(e,t,r){if(t){let o=r;return async(n,s)=>{let i=await Rr(t,n??{});if(!i.success)throw new he(ue.InvalidParams,`Invalid arguments for prompt ${e}: ${i.error}`);return o(i.data,s)}}else{let o=r;return async(n,s)=>o(s)}}function Cz(e){return{completion:{values:e.map(String).slice(0,100),total:e.length,hasMore:e.length>100}}}var Pn={completion:{values:[],hasMore:!1}};function Iz(e){let t=e;if(t.shape&&typeof t.shape==="object")return t.shape}function DT(e){return e?.type==="optional"}function Nz(e){if(!DT(e))return e;return e.def?.innerType??e}var G0=class{_listeners=new Set;constructor(e){this.onerror=e}publish(e){for(let t of this._listeners)try{t(e)}catch(r){this.onerror?.(r instanceof Error?r:Error(String(r)))}}subscribe(e){this._listeners.add(e);let t=!0;return()=>{if(!t)return;t=!1,this._listeners.delete(e)}}get listenerCount(){return this._listeners.size}};function q7(e){return{toolsChanged:()=>e.publish({kind:"tools_list_changed"}),promptsChanged:()=>e.publish({kind:"prompts_list_changed"}),resourcesChanged:()=>e.publish({kind:"resources_list_changed"}),resourceUpdated:(t)=>e.publish({kind:"resource_updated",uri:t})}}function UT(e,t){switch(t.kind){case"tools_list_changed":return e.toolsListChanged===!0;case"prompts_list_changed":return e.promptsListChanged===!0;case"resources_list_changed":return e.resourcesListChanged===!0;case"resource_updated":return e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.includes(t.uri)}}function FT(e,t){let r={},o=(n)=>t===void 0||n===!0;if(e.toolsListChanged===!0&&o(t?.tools?.listChanged))r.toolsListChanged=!0;if(e.promptsListChanged===!0&&o(t?.prompts?.listChanged))r.promptsListChanged=!0;if(e.resourcesListChanged===!0&&o(t?.resources?.listChanged))r.resourcesListChanged=!0;if(e.resourceSubscriptions!==void 0&&e.resourceSubscriptions.length>0&&o(t?.resources?.subscribe))r.resourceSubscriptions=[...e.resourceSubscriptions];return r}function VT(e){switch(e.kind){case"tools_list_changed":return{method:"notifications/tools/list_changed",...e.params!==void 0&&{params:e.params}};case"prompts_list_changed":return{method:"notifications/prompts/list_changed",...e.params!==void 0&&{params:e.params}};case"resources_list_changed":return{method:"notifications/resources/list_changed",...e.params!==void 0&&{params:e.params}};case"resource_updated":return{method:"notifications/resources/updated",params:{...e.params,uri:e.uri}}}}var a4=1024;function Dz(e,t,r){return Response.json({jsonrpc:"2.0",error:{code:t,message:r},id:e},{status:200})}function Uz(e,t){return{method:e.method,params:{...e.params,_meta:{...e.params?._meta,[Qf]:t}}}}function HT(e){let t=Ft($n).validateRequest("subscriptions/listen",e);return t.ok?t.value.params?.notifications:void 0}function V7(e){let{bus:t,onerror:r}=e,o=e.maxSubscriptions??a4,n=e.keepAliveMs??Ux,s=new Set;function i(a,c,u,l){if(s.size>=o)return r?.(Error(`subscriptions/listen refused: subscription limit reached (${o})`)),Dz(a.id,-32603,"Subscription limit reached");let d=HT(a);if(d===void 0)return Dz(a.id,-32602,"Invalid params: 'notifications' is required and must be a valid SubscriptionFilter");let m=FT(d,u),h=a.id,f=new TextEncoder,v,y=!1,g,P,w,E=(T)=>{if(y)return;try{v.enqueue(f.encode(T))}catch(A){r?.(A instanceof Error?A:Error(String(A)))}},C=(T,A)=>{E(`event: message
|
|
135
|
-
data: ${JSON.stringify({jsonrpc:"2.0",method:T,params:A})}
|
|
136
|
-
|
|
137
|
-
`)},R=(T)=>{if(y)return;if(T)E(`event: message
|
|
138
|
-
data: ${JSON.stringify({jsonrpc:"2.0",id:h,result:{resultType:"complete",_meta:{[Qf]:h,[va]:l}}})}
|
|
139
|
-
|
|
140
|
-
`);y=!0;try{g?.()}catch(A){r?.(A instanceof Error?A:Error(String(A)))}if(P!==void 0)clearInterval(P);w?.(),s.delete(R);try{v.close()}catch{}},S=new ReadableStream({start(T){v=T;let A=Uz({method:"notifications/subscriptions/acknowledged",params:{notifications:m}},h);if(C(A.method,A.params),Object.keys(m).length===0){R(!0);return}g=t.subscribe((H)=>{if(y||!UT(m,H))return;let j=Uz(VT(H),h);C(j.method,j.params)}),P=K0(n,()=>E(`: keepalive
|
|
141
|
-
|
|
142
|
-
`)),s.add(R)},cancel(){R(!1)}});if(c!==void 0)if(c.aborted)R(!1);else{let T=()=>R(!1);c.addEventListener("abort",T,{once:!0}),w=()=>c.removeEventListener("abort",T)}return new Response(S,{status:200,headers:{"Content-Type":"text/event-stream","Cache-Control":"no-cache, no-transform",Connection:"keep-alive","X-Accel-Buffering":"no"}})}return{serve:i,closeAll(){for(let a of s)a(!0)},get openCount(){return s.size}}}
|
|
143
|
-
export{x,lr,Pr,Pi,ve,un,Fn,mi,ic,We,yq,Ly,Zo,jl,va,Ar,Qf,Mu,vq,bq,Sq,eh,Oi,S0,hA,gA,e_,t_,yA,Ki,By,Mi,js,Ks,vA,Jn,th,wS,RS,$y,Uy,Nu,w0,bA,r_,SA,n_,rh,Yp,PS,i_,o_,s_,a_,wA,RA,c_,d_,l_,Hy,PA,u_,p_,AA,Jp,nh,qd,TA,kA,EA,ih,Xp,oh,m_,f_,h_,g_,y_,AS,v_,b_,S_,w_,R_,P_,A_,T_,IA,k_,E_,I_,__,x_,C_,D_,O_,M_,N_,F_,L_,B_,$_,TS,kS,ES,U_,H_,q_,IS,V_,W_,z_,j_,K_,_A,G_,Y_,xA,R0,J_,X_,Z_,CA,sh,Q_,ex,tx,rx,nx,ix,ox,sx,ax,qy,cx,dx,lx,ux,px,_S,ah,ch,xS,CS,DS,mx,OS,MS,fx,hx,NS,dh,gx,yx,vx,bx,Sx,wx,Rx,Px,Ax,Tx,kx,Ex,Ix,_x,xx,P0,Cx,lh,A0,Dx,T0,k0,E0,I0,_0,x0,C0,D0,O0,M0,N0,F0,L0,B0,$0,Ox,DA,Mx,Nx,OA,Fx,MA,Lx,Bx,$x,U0,H0,q0,Vy,lt,it,E7,V0,NA,Zp,W0,ue,he,Qp,wq,z0,FS,I7,em,uh,ph,Q6,Rq,_7,x7,C7,j0,D7,Pq,O7,M7,e4,t4,N7,F7,L7,r4,Ux,K0,n4,i4,o4,s4,B7,$7,U7,mh,H7,G0,q7,a4,V7};
|
|
144
|
-
|
|
145
|
-
//# debugId=3498B81D42E90E4664756E2164756E21
|